5

根据此处的文档: https ://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v3/020_key_concepts/0700_other_topics#SalesItemLineDetail

我应该能够设置 UnitPrice,以便我的发票显示 UnitPrice、Qty 和 SubTotal。

我的发票工作得很好,但我错过了这条关键信息,这是我在发票上生成一行的代码:

foreach (var i in orderItems)
            {
                Line invLine = new Line();
                invLine.Id = i.ItemID;
                invLine.Amount = i.SubTotal.Value;
                invLine.AmountSpecified = true;
                invLine.Description = i.ItemName;
                invLine.DetailType = LineDetailTypeEnum.SalesItemLineDetail;
                invLine.DetailTypeSpecified = true;

                SalesItemLineDetail silDetails = new SalesItemLineDetail();
                silDetails.Qty = i.Qty;
                silDetails.QtySpecified = true;
                silDetails.ItemRef = new ReferenceType() {  Value = i.ItemID };
                invLine.AnyIntuitObject = silDetails;

                invoice.Line[lineCount] = invLine;
                lineCount += 1;
            }

有人有这个工作吗?我在这里想念什么?

4

1 回答 1

5
//Line Sales Item Line Detail - UnitPrice
lineSalesItemLineDetail.AnyIntuitObject = 33m;
lineSalesItemLineDetail.ItemElementName = ItemChoiceType.UnitPrice;

https://gist.github.com/IntuitDeveloperRelations/6500373

于 2013-09-09T19:34:39.717 回答