Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DFC Orders] Cancelled Order does not reduce DFC Order quantities immediately #12876

Closed
RaggedStaff opened this issue Sep 25, 2024 · 4 comments · Fixed by #12856 or #12945
Closed

[DFC Orders] Cancelled Order does not reduce DFC Order quantities immediately #12876

RaggedStaff opened this issue Sep 25, 2024 · 4 comments · Fixed by #12856 or #12945
Assignees

Comments

@RaggedStaff
Copy link
Collaborator

Description

Testing issue for #12856

When an order is cancelled that contains DFC products, stock is returned but the quantity ordered from the Producer is not adjusted down.

Expected Behaviour

When an order is cancelled (& items restocked), if that variant now has the same or more (>=) stock than the wholesale case, the DFC Order should be reduced by 1 case.

Actual Behaviour

Items were restocked, no adjustment was made to the DFC Order, so too many wholesale cases were ordered.

Steps to Reproduce

  1. Create hub
  2. Link OIDC account (ensure authorised to DFC Shopify Store, including setting up Shopify account to match OIDC User Id/email)
  3. Import products
  4. Create Order Cycle including DFC products
  5. Place an order for DFC Products
  6. Confirm order has created draft order on Shopify
  7. Cancel Order & restock items
  8. Confirm Shopify draft order has not been adjusted.

Animated Gif/Screenshot

Cancelled order:

image

Over-stocked product:

image

Shopify draft Order:

image

Severity

bug-s2: a non-critical feature is broken, no workaround

Your Environment

  • Version used: uk-staging
  • Browser name and version: Firefox 130.0.1 (64 bit)
  • Operating System and version (desktop or mobile): Ubuntu 22.04, desktop

Possible Fix

Need to adjust (update) DFC Order on OFN Order cancellation (where stock >= case quantity).

@mkllnk
Copy link
Member

mkllnk commented Sep 25, 2024

I think that we agreed on restocking at the end of the sale session. Did you wait for that to happen?

Here are my reasons for not doing it at point of cancellation:

  • It's easier to implement at the end, when we update the order anyway.
  • The available stock may be bought again during the order cycle.
  • We minimise the number network requests.

I'm also tempted to say that there's no harm in holding a bit too much stock but that's only true for the shop. The wholesaler would like to have more stock to sell, I'm sure. And that touches a bigger question which also came up in other contexts: What is the cost of holding stock?

The flower farmers in Canada would like stock tracking per order cycle because they want to take advance orders for flowers that will grow at a certain time. And they do allow their customers to adjust ordered quantities later in the order cycle. That would enable people to hog stock though. And they haven't even paid for any of it yet.

@RaggedStaff
Copy link
Collaborator Author

Hmm, I don't recall that conversation, but fair enough, I don't think we can do it this way though:

For 1 pilot this will make little difference - all the stock they're putting into the network will be unlimited.

For the other pilot (small beef producer) it makes all the difference - they will only have 2-3 stock items per variant (meat pack), they want to be able to sell via their own Shopify store, if the stock is locked up in a cancelled OFN order, it will be out of stock on their store, potentially for 1-2 weeks.

I would hope that order cancellations would be rare enough to not increase network traffic that significantly.

I think having up to date stock data accurately reflected across the network is key to our value proposition, so I'd really like that to happen. Do you think you can fit it into the remaining hours?

@mkllnk
Copy link
Member

mkllnk commented Sep 26, 2024

Okay. We can trigger an update after order cancellation. I can work on that next week.

@github-project-automation github-project-automation bot moved this from In Progress ⚙ to Done in OFN Delivery board Oct 1, 2024
@mkllnk mkllnk reopened this Oct 2, 2024
@github-project-automation github-project-automation bot moved this from Done to Dev ready 👋 in OFN Delivery board Oct 2, 2024
@RaggedStaff RaggedStaff changed the title Cancelled Order does not reduce DFC Order quantities [DFC Orders]Cancelled Order does not reduce DFC Order quantities Oct 11, 2024
@sigmundpetersen sigmundpetersen changed the title [DFC Orders]Cancelled Order does not reduce DFC Order quantities [DFC Orders] Cancelled Order does not reduce DFC Order quantities Oct 14, 2024
@mkllnk
Copy link
Member

mkllnk commented Oct 15, 2024

More general solution:

But for now we could work only on the order cancellation bit.

@mkllnk mkllnk changed the title [DFC Orders] Cancelled Order does not reduce DFC Order quantities [DFC Orders] Cancelled Order does not reduce DFC Order quantities immediately Oct 17, 2024
@mkllnk mkllnk moved this from Ready to In progress in DFC Orders Implementation Phase 1 Oct 18, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in DFC Orders Implementation Phase 1 Oct 29, 2024
@github-project-automation github-project-automation bot moved this from In Progress ⚙ to Done in OFN Delivery board Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment