Troubleshooting
Problem
Attempts to create a partial return on a Sales Order leads to mismatch in the amount by a penny in IBM Sterling Selling and Fulfillment Suite.
Symptom
Steps to reproduce:
- Create a return order with the following taxes and discounts :
<Order DocumentType="0003" EnterpriseCode="DEFAULT" SellerOrganizationCode="DEFAULT">
<OrderLines>
<OrderLine OrderedQty="3" ShipNode="N1" >
<Item ItemID="Item1" UnitOfMeasure="EACH"/>
<PersonInfoShipTo Country="US" />
<LinePriceInfo UnitPrice="1"/>
<LineTaxes>
<LineTax ChargeCategory="" ChargeName=""
ChargeNameKey="" InvoicedTax="0.00" Reference_1=""
Reference_2="" Reference_3="" RemainingTax="0.20"
Tax="0.20" TaxName="STATE TAX" TaxPercentage="0.065"/>
<LineTax ChargeCategory="" ChargeName=""
ChargeNameKey="" InvoicedTax="0.00" Reference_1=""
Reference_2="" Reference_3="" RemainingTax="0.06"
Tax="0.06" TaxName="CITY TAX" TaxPercentage="0.021"/>
<LineTax ChargeCategory="" ChargeName=""
ChargeNameKey="" InvoicedTax="0.00" Reference_1=""
Reference_2="" Reference_3="" RemainingTax="0.025"
Tax="0.025" TaxName="DISTRICT TAX" TaxPercentage="0.009"/>
</LineTaxes>
<LineCharges>
<LineCharge ChargeAmount="0.285" ChargeCategory="Discount"
ChargeName="Discount"
ChargePerLine="0.285" ChargePerUnit="0.00"
InvoicedChargeAmount="0.00"
InvoicedChargePerLine="0.00"
InvoicedChargePerUnit="0.00" IsBillable="Y"
IsDiscount="Y" IsManual="Y" IsShippingCharge="N"
Reference="" RemainingChargeAmount="0.285"
RemainingChargePerLine="0.285"
RemainingChargePerUnit="0.00"/>
</LineCharges>
</OrderLine>
</OrderLines>
</Order>
- On opening the order in the console or when getOrderDetails is called, there is a difference in the amount at line level and order level.
Cause
As per design , product only considers precision upto 2 decimal points.
Diagnosing The Problem
A mismatch in amount by a penny is seen in the calculation between LineTotal and GrandTotal (Order Level). This in turn affects the total amount to be refunded. This is usually seen when a partial return is created on a Sales Order which has Line level discount applied on the order.
Resolving The Problem
While creating the order, ensure that only 2 decimal values are passed.
When order total was calculated for the first time during order creation, the product expects pricing only upto two 2 decimals and this is rounded off just before it is saved in the database (yfs_order_header.total_amount.
The tax is also saved to the DB after the round off. During getOrderDetails API the sub total of the line is a calculated field and not pulled from the DB. Hence the calculation using the rounded off decimal of taxes gives you a penny less.
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21969012