根据这里的文件:
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v3/020_key_concepts/0700_other_topics#SalesItemLineDetail
我应该有能力设置单价,这样我的发票显示单价,数量和小计。
我的发票工作得很好,但我缺少这一关键信息,下面是我在发票上生成行的代码:
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;
}
有人用这个吗?我错过了什么?
最佳答案
//Line Sales Item Line Detail - UnitPrice
lineSalesItemLineDetail.AnyIntuitObject = 33m;
lineSalesItemLineDetail.ItemElementName = ItemChoiceType.UnitPrice;
https://gist.github.com/IntuitDeveloperRelations/6500373