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

Dear edy_simon,

This issue has been documented in SAP Note 3439522 which will be released soon.

The issue is supposed to be fixed in Feature Package 2405 of SAP Business One Version 10.0.

Be advised that the time-frame is subject to change without any further notice.

If you do not have any further question, kindly help to close this thread.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support