to select ↑↓ to navigate
iVend

iVend

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

How to Test: Order Cancel & Refund Reversal

This guide is for QA, support, and demo presenters who need to verify that order cancellation and refund reversal works end-to-end.

What this tests

The storefront automatically reverses coupon, gift-card, and loyalty redemptions when an order is cancelled or fully returned. It does this by creating a Credit Note and a reverse Payment Entry rather than ever cancelling the original documents, so the audit trail stays intact. For the full behavioural reference, see Order Cancel & Return Reversal.

Before you start

IMPORTANT: The Cancel / Return controls render only for the storefront customer who owns the order — not for Administrator. Always test as a storefront customer. Use Desk (as Administrator) only to verify the side-effects, never to trigger the cancel/return itself.

Test site: http://ivend.localhost:8014

Path A — storefront end-to-end

  1. Log in on the storefront as a customer (not Administrator) at /en/login.
  2. Add product(s) to the cart, then apply a serial coupon (for example WELCOME10, serial WELCOME-0001).
  3. Proceed to checkout and place the order.
  4. Go to My Account → Orders (/en/account/orders), open the order, and either Cancel it or request a full return. Partial returns intentionally do not refund.
  5. Verify the side-effects in Desk (log in as Administrator / Frappe@123):
    • Sales Order status = Cancelled and Ecommerce Status = Cancelled.
    • A Credit Note exists — a Sales Invoice with Is Return ticked and Return Against pointing at the original invoice (SINV).
    • A reverse Payment Entry (type Pay) exists only if the order used a gateway payment. COD orders have no reverse Payment Entry.
    • The coupon is freed — its Coupon Ledger redemption transaction is cleared, so the coupon is reusable again.

Path B — verify the logic via the test suite

The fastest proof is the integration test suite, which runs against a real, rolled-back database:

bench --site ivend.localhost run-tests --app ivendnext_ecommerce --module ivendnext_ecommerce.tests.test_order_cancel_reversal

Desk verification checklist

Cancelled Sales Order Sales Order with status Cancelled, Order Type Shopping Cart, and Ecommerce Status Cancelled.

Credit Note Credit Note — a Sales Invoice with Is Return ticked and Return Against set to the original invoice.

Coupon ledger Serial coupon redemption transaction in the Coupon Ledger — cleared on reversal so the coupon is reusable.

My Account Orders The storefront My Account → Orders page where the customer cancels or returns an order.

Known issues to watch

  • Serial coupon reversal is solid — safe to demo.
  • Non-serial coupons are intentionally unhandled — do not expect them to reverse.
  • Loyalty double-clawback bug: points were being reversed twice. This is being fixed to reverse exactly once. When testing, verify the customer's loyalty balance nets back to its pre-redemption value.
  • Gift card over-credit: gift card restore can over-credit when the redeem amount was floored, so the balance can exceed the face value. Known, under review.
  • Full-return only: partial returns get no refund by design.
Last updated 1 month ago
Was this helpful?
Thanks!