简体   繁体   English

当我使用V3 SDK for .Net更新QuickBooks Online中的Invoice时,它无效

[英]It has no effect when I update Invoice in QuickBooks Online with The V3 SDK for .Net

When I want to update the balance in a Invoice, the code below is running normally without any error, but the balance doesn't change, why? 当我想更新发票中的余额时,下面的代码正常运行而没有任何错误,但余额不会改变,为什么?

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);
            }
        }

Balance is a read-only field in Invoice. 余额是发票中的只读字段。 It can't be updated. 它无法更新。

Ref doc . 参考文档

Add

在此输入图像描述 Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM