cancel
Showing results for 
Search instead for 
Did you mean: 

There is a difference between the document total and its components. [ORDR.DocTotal][line: 1]

edy_simon
Active Contributor
0 Kudos

Hi,
In a fresh copy of SBODemoSG,
Under 'Company Details-Accounting Data' enable the 'Allow External Calculation Of Tax on A/R Documents'

Create an SO with External Tax and Rounding on header
SO is created successfully, but Updating any field in SO using DI API returns the above error.
Updating the SO from application does not get the error.

        private static void TestSO(SAPbobsCOM.Company oc)
        {
            //Create a SO
            var so = oc.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders) as SAPbobsCOM.Documents;
            so.CardCode = "C42000";
            so.DocDate = DateTime.Now;
            so.DocDueDate = DateTime.Now;
            so.Rounding = SAPbobsCOM.BoYesNoEnum.tYES;
            so.RoundingDiffAmount = -0.04;
            so.Lines.ItemCode = "A00003";
            so.Lines.Quantity = 1;
            so.Lines.UnitPrice = 21;
            so.Lines.PriceAfterVAT = 22.89;
            so.Lines.ExternalCalcTaxAmount = 1.89;
            so.Lines.ExternalCalcTaxRate = 9;


            if (so.Add() == 0)
            {
                int soKey = int.Parse(oc.GetNewObjectKey());
                so = oc.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders) as SAPbobsCOM.Documents;
                so.GetByKey(soKey);
                so.Comments = "TestUpdate";
                if (so.Update() == 0)
                {
                    System.Diagnostics.Debug.WriteLine("Updated successfully");
                }
                else
                    System.Diagnostics.Debug.WriteLine(oc.GetLastErrorDescription());       //<--- Error here There is a difference between the document total and its components.  [ORDR.DocTotal][line: 1]
            }
            else
                System.Diagnostics.Debug.WriteLine(oc.GetLastErrorDescription());

        }

Error on so.Update() at line 24


Regards
Edy

View Entire Topic
ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi edy_simon,

We received an incident today only which is mentioning exactly the same issue.

I am currently handling it. Will update about it accordingly.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

edy_simon
Active Contributor
0 Kudos
Thanks Ankit, Yes, it was my colleague raising the incident.