1

我正在尝试使用 QuickBooks REST API v2.0 的 .NET SDK 添加销售收据 当我到达添加行项目的阶段时,缺少属性并且我无法添加必需的属性。

这是我当前代码的一部分:

DataServices dataServices = new DataServices(context);
            SalesReceipt salesreceipt = new SalesReceipt();
            salesreceipt.Id.Value = "23423423";
            salesreceipt.Header.DocNumber = "23423423";
            salesreceipt.Header.Note = "test message";
            salesreceipt.Header.CustomerId.Value = "Mohsin Gillani";
            salesreceipt.Header.DepositToAccountName = "PayPal";
            salesreceipt.Line[0].Id.Value = "SKUEXAMPLE6";
            salesreceipt.Line[0].Desc = "Google Nexus screen protector";
            salesreceipt.Line[0].Amount = 2.35M;

在我输入的那一刻salesreceipt.Line[0].ItemId,没有出现智能感知建议的元素,而实际上根据 v2 的文档存在 ItemId。也没有数量,所以我不可能合作。

4

1 回答 1

3

Try something like this:

//Set Line Item
Intuit.Ipp.Data.Qbo.SalesReceiptLine qboSalesReceiptLine = new Intuit.Ipp.Data.Qbo.SalesReceiptLine();
qboSalesReceiptLine.Amount = 123;
qboSalesReceiptLine.AmountSpecified = true;
qboSalesReceiptLine.Items = new object[] { new IdType() { idDomain = idDomainEnum.QBO, Value = "63" }, 123m, 2m };
qboSalesReceiptLine.ItemsElementName = new ItemsChoiceType2[]
                                            {
                                                ItemsChoiceType2.ItemId, ItemsChoiceType2.UnitPrice,
                                                ItemsChoiceType2.Qty
                                            };
qboSalesReceipt.Line = new SalesReceiptLine[] { qboSalesReceiptLine };
于 2013-09-06T12:43:25.130 回答