openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.12k stars 723 forks source link

[Return authorizations] Cancelling and refunding an order marked as 'Shipped'. #6835

Open lbwright22 opened 3 years ago

lbwright22 commented 3 years ago

Description

Hub/Shop dispatches an order to a customer (or the customer collects their produce). Hub/shop manager marks the order as 'shipped'. Customer contacts the hub/shop to say they are not happy with their order and wants a refund.

Expected Behavior

  1. Hub/Shop manager visits Edit Order -> Return Authorisations and adds a new return authorisation.
  2. Order status changes to 'awaiting return'
  3. Product received by the hub. Hub manager edits the 'return authorisation' and marks it as 'received'
  4. Order status changes to 'returned'
  5. Balance of order is updated to remove the returned product from the order total.
  6. Order payment status is now 'credit owing'
  7. Hub manager visits Payments and is able to refund the customer for the item returned.

Actual Behaviour

  1. Hub/Shop manager visits Edit Order -> Return Authorisations and adds a new return authorisation.
  2. Order status changes to 'awaiting return'

Scenario One: Balance due (before creating the RA but after marking the order as shipped, the hub manager voided the payment for the order and so the order displays as 'balance due')

  1. Product received by the hub. Hub manager edits the 'return authorisation' and marks it as 'received'
  2. This returns the slug error page.
  3. Hub manager can not visit the payments page or edit the order in any manner This is issue #6830

Scenario Two: Order is marked as 'paid' prior to creating the RA

  1. Product received by the hub. Hub manager edits the 'return authorisation' and marks it as 'received'
  2. Order status changes to 'returned'
  3. Balance of order is updated to remove the returned product from the order total.
  4. Order payment status is now 'credit owing'
  5. Hub manager can not access the 'payments tab' to issue a refund or update the payment status if they refund the customer outside of the platform.
    This is similar to issue #5018
  6. Under Order Adjustments the RA is listed as a negative adjustment but the translation is missing

missingtrans

Steps to Reproduce

  1. Edit Order after it has been marked as 'Shipped'.
  2. Add a New Return Authorisation
  3. Mark the RA as 'received' . Notice that if the payment for the order was voided prior to adding the RA then the slug page is encounterd.
  4. If the original payment was not made void prior to adding the RA notice that the order can not be edited and the payments tab is inaccessible. Hence the payment status can not be changed and the hub manager can not issue a refund for the returned product.

NOTEs: Return authorisation (RA)/shipped feature works in a very inconsistent manner. An order must be paid in total and this payment captured before it can be marked as 'shipped' -> Is this Ideal? What about deposits and 'buy now, pay later' etc?

Scenario A Order is £10. Add a payment of £1.00 can't mark order as 'shipped' and can't add a RA (hence can't return an item which may have been bought on a 'buy now pay later' Scenario B Order is £10. Add a payment of £10, void the payment, can't mark as 'Shipped' and can't add a RA Scenario C Order is £10. Add a payment of £10. Mark order as 'Shipped'. Void payment. Can add an RA but can't capture the return. Stays as 'awaiting return'.

Animated Gif/Screenshot

Workaround

Issue a refund outside of the platform and make an external note for accounting purposes.

Severity

bug S3

Your Environment

Possible Fix

illusionist301 commented 3 years ago

@lbwright22 Can I work on this issue?

drummer83 commented 1 year ago

Maybe fixing this is as easy as #7014?

Related issues and PRs: