Skip to Content
avatar image
Former Member

DI Error: (-5002) Tax amount cannot be negative

Dear all,

I am trying to create Sales Order with Document_LinesAdditionalExpenses (RDR2, Freights) based on incoming file using scenario in B1if. File was parsed successfully, but I get DI API error at the end.

The following object was generated in B1if to send to DI API (cut from message log):

<BOM>
<BO>
<AdmInfo>
<Object>17</Object>
<Version>2</Version>
</AdmInfo>
<QueryParams>
<DocEntry/>
</QueryParams>
<Documents>
<row>
<CardCode>C0000032</CardCode>
<DocTotal>290.94</DocTotal>
<DocDate>20161229</DocDate>
<DocDueDate>20170103</DocDueDate>
<NumAtCard>100000010</NumAtCard>
<DocCurrency>EUR</DocCurrency>
</row>
</Documents>
<Document_Lines>
<row>
<ItemCode>15-1022</ItemCode>
<Quantity>1</Quantity>
<Price>240.0000</Price>
<LineTotal>240.0000</LineTotal>
<TaxTotal>50.4900</TaxTotal>
</row>
</Document_Lines>
<Document_LinesAdditionalExpenses>
<row>
<LineNumber>1</LineNumber>
<GroupCode>1</GroupCode>
<ExpenseCode>1</ExpenseCode>
<LineTotal>240.0000</LineTotal>
<VatGroup>21V</VatGroup>
<TaxPercent>21</TaxPercent>
<TaxSum>0.15</TaxSum>
</row>
<row>
<LineNumber>1</LineNumber>
<GroupCode>0</GroupCode>
<ExpenseCode>2</ExpenseCode>
<LineTotal>240.0000</LineTotal>
<VatGroup>21V</VatGroup>
<TaxPercent>21</TaxPercent>
<TaxSum>0.3</TaxSum>
</row>
</Document_LinesAdditionalExpenses>
<AddressExtension>
<row>
<ShipToStreet/>
<ShipToCity>Mons</ShipToCity>
<ShipToZipCode>7000</ShipToZipCode>
<ShipToState/>
<ShipToCountry>BE</ShipToCountry>
</row>
</AddressExtension>
</BO>
</BOM>

But processing finished with error

XCE001 Nested exception: java.lang.RuntimeException: DI Error: (-5002) Tax amount cannot be negative [RDR1.VatSum][line: 1]"

Could you please advice what should be changed to process it correctly?

This functionality works fine in SAP B1 and Order can be uploaded successfully without AdditionalExpenses.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers