当我想更新发票中的余额时,下面的代码运行正常,没有任何错误,但是余额没有改变,为什么?
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);
}
}