如何在创建发票时添加组 - IPP数据服务 - QuickBooks桌面版

时间:2013-04-19 13:21:52

标签: quickbooks intuit-partner-platform intuit

我们有一个名为“付款组”的组。在那个小组中 两件物品都有书籍,轮胎修理。我们正在尝试在发票中添加此组。但是我们在创建发票时遇到了问题。

QBInvoiceService iInvoiceSer = QBServiceFactory.getService(platformSessionContext, QBInvoiceService.class);
 QBInvoice myInvoice = QBObjectFactory.getQBObject(platformSessionContext, QBInvoice.class);


  InvoiceHeader invoiceHeader = QBObjectFactory.getQBObject(platformSessionContext, InvoiceHeader.class);
  invoiceHeader.setCustomerName("John");
  invoiceHeader.setPONumber("999");
  invoiceHeader.setSalesTermName("Net 10");
  Calendar dueDate = Calendar.getInstance();
  dueDate.set(2013, 12, 01);
  invoiceHeader.setDueDate(dueDate);

  ArrayList<InvoiceLine> invoiceLineList = new ArrayList<InvoiceLine>();
  InvoiceLine invoiceLine = QBObjectFactory.getQBObject(platformSessionContext, InvoiceLine.class);
  invoiceLine.setItemName("Payment Group");   

  InvoiceLine invoiceLine1 = QBObjectFactory.getQBObject(platformSessionContext, InvoiceLine.class);
  invoiceLine1.setItemName("Books"); 
  invoiceLine1.setDesc("");
  invoiceLine1.setAmount(new BigDecimal(500));
  invoiceLine1.setQty(new BigDecimal(5));

  InvoiceLine invoiceLine2 = QBObjectFactory.getQBObject(platformSessionContext, InvoiceLine.class);
  invoiceLine2.setItemName("Tire Repair");
  invoiceLine2.setDesc("Tire Repair");
  invoiceLine2.setAmount(new BigDecimal(500));
  invoiceLine2.setQty(new BigDecimal(5));

  InvoiceLine invoiceLine3 = QBObjectFactory.getQBObject(platformSessionContext, InvoiceLine.class);
  invoiceLine3.setDesc("group description");
  invoiceLine3.setAmount(new BigDecimal(1000));    

invoiceLineList.add(invoiceLine);
invoiceLineList.add(invoiceLine1);
invoiceLineList.add(invoiceLine2);  

ArrayList<TaxLine> taxLineList = new ArrayList<TaxLine>();
           TaxLine taxLine = QBObjectFactory.getQBObject(platformSessionContext, TaxLine.class);
           taxLine.setTaxName("Net 10");
           taxLineList.add(taxLine);

           myInvoice.setHeader(invoiceHeader);
           myInvoice.setLine(invoiceLineList);
           myInvoice.setTaxLine(taxLineList);

           QBInvoice newInvoice = iInvoiceSer.addInvoice(platformSessionContext, myInvoice);    

发票已成功创建。但不与Desktop QuickBooks软件同步。 有什么想法吗?是否可以在创建时添加组项 发票使用ipp Java devkit 2.0.7? API是否可用?

0 个答案:

没有答案