IBM Support

Recording a refund on Return Order that was issued outside of Sterling

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:

  1. Create Sales Order (SO) with 2 lines, each line 5 Qty and 2 payment tenders CREDIT_CARD, GIFT_VOUCHER.

  2. Move SO to paid status.

  3. 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.
  4. Call requestCollection API - new CHARGE opened with – $10 amount.

  5. After executeCollection: second CHARGE (-$10) CLOSED

  6. After requestCollection second time: second CHARGE CHECKED
    Now there are two charges +$10 and -$10.

  7. Create Invoice for Return Order - A new record in yfs_charge_transaction table with charge type as Return is created

  8. After requestCollection: RETURN CHECKED

  9. 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:

  1. Do not call requestCollection before invoicing the return

  2. Create charge via payment details for negative amount
Example Scenario:
  1. Sales order is created for $100


  2. Order is shipped/invoiced/paid.


  3. $10 is refunded outside of the system


  4. 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

  5. Invoice the return, RETURN type Charge Transaction is created for $100

  6. call processOrderPayments.
    A second charge is created for $-90 for the remaining amount on the return, for a total of -$100

[{"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Distributed Order Management","Platform":[{"code":"PF033","label":"Windows"}],"Version":"All;9.2.1;9.2","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
16 June 2018

UID

swg21962152