当我想更新发票中的余额时,下面的代码运行正常,没有任何错误,但余额没有变化,为什么?
var queryService = new QueryService<Intuit.Ipp.Data.Invoice>(context);
IList<Intuit.Ipp.Data.Invoice> list = queryService.Where(p => true).ToList();
foreach (var invoice in list)
{
if (invoice.Id == order.Accounting.QBOID)
{
if (invoice.Balance != order.Accounting.SurveyAmount)
{
Invoice invo = new Invoice();
invo.Id = invoice.Id;
invo = commonService.FindById(invo);
invo.Balance = order.Accounting.SurveyAmount.HasValue ? order.Accounting.SurveyAmount.Value : 0;
invo.sparse = true;
commonService.Update(invo);
}
}
最佳答案
余额是发票中的只读字段。它无法更新。
引用 doc .
添加
谢谢
关于.net - 当我使用适用于 .Net 的 V3 SDK 更新 QuickBooks Online 中的发票时,它不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18780750/