Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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);
            }
        }
like image 966
Tangfb Avatar asked Sep 13 '13 07:09

Tangfb


1 Answers

Balance is a read-only field in Invoice. It can't be updated.

Ref doc.

Add

enter image description here Thanks

like image 188
Manas Mukherjee Avatar answered Sep 22 '22 18:09

Manas Mukherjee