Troubleshooting
Problem
Invoicing return order does not tag the already issued refund to any payment tender in IBM Sterling Selling and Fulfillment Suite.
Symptom
Steps to reproduce:
- Create Sales Order (SO) with 2 lines, each line 5 Qty and 2 payment tenders CREDIT_CARD, GIFT_VOUCHER.
- Move SO to paid status.
- Create a Return order (RO) for the above Sales Order to return 1 Qty.
Sample input xml for creating Return Order-
<Order BillToKey="2015032411282920709" CreatedAtNode="N" DocumentType="0003" DraftOrderFlag="N" EnterpriseCode="E" OrderNo="R7030" OrderType="" Override="N"
SellerOrganizationCode="E" ProcessPaymentOnReturnOrder="Y">
<OrderLines>
<OrderLine OrderedQty="1.0" ShipNode="40" ShipToKey="2015041312395351320" >
<DerivedFrom OrderLineKey="2015041712062975681" OrderReleaseKey="2015041712222475951" OrderHeaderKey='2015041712062975680' />
</OrderLine>
</OrderLines>
<PriceInfo Currency="BP" />
<PaymentMethods>
<PaymentMethod PaymentType="CREDIT_CARD" CreditCardNo="7004" >
<PaymentDetails ChargeType="CHARGE" ProcessedAmount="10" />
</PaymentMethod>
</PaymentMethods>
</Order >
A charge will be opened for $10. - Call requestCollection API - new CHARGE opened with – $10 amount.
- After executeCollection: second CHARGE (-$10) CLOSED
- After requestCollection second time: second CHARGE CHECKED
Now there are two charges +$10 and -$10.
- Create Invoice for Return Order - A new record in yfs_charge_transaction table with charge type as Return is created
- After requestCollection: RETURN CHECKED
- Run below Query to pull Invoice key linked to this charge transaction key
select * from YFS_INVOICE_COLLECTION where ORDER_INVOICE_KEY='201504171239355576271' order by creates desc;
As a result, No records found, means invoice did not map to any charge transaction Record.
Cause
Since there is no invoice associated with the return, requestCollection is reversing the charge initially created during createOrder
Diagnosing The Problem
If a refund is already issued before creating a return order, the same info would be passed and Sterling needs to record and process the amount accordingly.
When the issued refund amount and payment method info is passed on the Return Order (During RO creation or immediately after creating Order) there are unnecessary charges being created when payment APIs are run and at later stage when RO is invoiced the refund that is already issued is not being tagged to any payment tender.
Resolving The Problem
Steps to resolve:
- Do not call requestCollection before invoicing the return
- Create charge via payment details for negative amount
- Sales order is created for $100
- Order is shipped/invoiced/paid.
- $10 is refunded outside of the system
- createOrder is called to create the return for the entire order.
-You should pass paymentDetails with type="CHARGE" and processedAmount="-10"
-Charge is created by createOrder for $-10
- Invoice the return, RETURN type Charge Transaction is created for $100
- call processOrderPayments.
A second charge is created for $-90 for the remaining amount on the return, for a total of -$100
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21962152