Skip to main content

Statuses & delivery

A purchase order is Pending, Delivered or Canceled. The supplier moves it forward by marking it delivered, can step a delivery back, and can cancel it.

Who uses it​

Supplier staff with full access to purchase orders, in the buying business.

How it works​

FromToHowAllowed when
PendingDeliveredMark as DeliveredEvery catch-weight line has a weight
DeliveredPending⋮ → Revert to Previous StatusThe order is Delivered
PendingCanceled⋮ → Cancel Purchase OrderThe order is not already canceled
DeliveredCanceled⋮ → Cancel Purchase OrderThe order is not already canceled

Canceled is final. There is no way back from it.

Delivering​

Mark as Delivered stamps the delivery date, sets the due date if it can (Reference numbers & dates) and adds the goods to stock. See Stock & cost effects. A catch-weight line must be weighed first: "Cannot mark delivered: catch-weight item(s) Whole Fish have no weight entered." The order stays Pending when delivery is refused.

Reverting a delivery​

For an order marked delivered by mistake. Revert to Previous Status asks you to confirm, with a list of what changes:

  • Status: returns to Placed (shown as Pending).
  • Stock on Hand: the received units come back out of inventory.
  • Average Cost: this delivery's effect is reversed.
  • Due Date: re-dated from the invoice date, or cleared if there isn't one yet.

"Payments, recorded returns and the invoice stay as they are." Confirm with Revert Order, or press Go Back.

After the revert you can edit the lines, correct a price, and mark the order delivered again. Do it as many times as you need: the effects never pile up. The date the order was placed does not change, and the delivery date is cleared.

Reverting is refused for an order that is already Pending or Canceled, and only the buying business can do it.

Canceling​

Cancel Purchase Order warns: "Canceling this purchase will mark the order and invoice as canceled. The invoice will remain on record and Inventory changes from the purchase order will reverse back to original." Confirm with Cancel Order.

  • A Delivered order's stock and cost effects are reversed, less anything already returned to the vendor.
  • Payments recorded against the order are reversed so the books net to zero, and the payment status becomes Canceled.
  • The invoice stays on record, marked canceled.

Deleting​

A purchase order that has not been delivered can be deleted. A delivered one cannot: "Cannot delete delivered purchase order". Cancel it instead.

Calculations​

The worked effects on stock and cost are on Stock & cost effects. For due dates: a Net 30 Days order with no invoice date, delivered Nov 10, is due Dec 10. Reverted, it has no due date until it is delivered again, say Nov 14, and is then due Dec 14.

Where it shows up​

The status chip in the list and the detail page, the date under the status (placed, delivered or canceled), and the product's stock history.

Permissions​

ActionNeeds
Mark delivered, revert, cancelFull access to purchase orders, buying business
Open an orderRead access; the vendor's business can read too

A member of the vendor's business cannot revert a delivery.

Decisions​

  • Reverting never restarts the aging clock. The placed date is kept, so an overdue order cannot be refreshed by cycling its status.
  • A reversal that cannot finish changes nothing. The order stays Delivered and can be reverted again.
  • Two reversals at once count once. A double click cannot take stock out twice.

Specs​

purchase-order-delivery-reversal.feature
# prefix: PDR
Feature: Purchase Order Delivery Reversal
A supplier who marked a purchase order delivered by mistake can return it to placed,
correct it, and mark it delivered again. Reversing undoes the delivery's effect on
stock on hand and average cost, and may be repeated any number of times without the
effects compounding.

Background:
Given a supplier has placed a purchase order with a vendor

Rule: Only a delivered purchase order can be reversed

Scenario: PDR-001 supplier returns a delivered purchase order to placed
Given the purchase order is delivered
When the supplier reverses the delivery
Then the purchase order is placed
And the supplier can edit its items

Scenario Outline: PDR-002 reversal is rejected when the purchase order is <state>
Given the purchase order is <state>
When the supplier attempts to reverse the delivery
Then the reversal is rejected
And the purchase order is unchanged

Examples:
| state |
| placed |
| canceled |

Scenario: PDR-003 reversal is rejected for a purchase order that no longer exists
Given the purchase order has been removed
When the supplier attempts to reverse the delivery
Then the reversal is rejected

Rule: Reversing a delivery undoes its effect on stock on hand

Scenario: PDR-004 stock on hand returns to its pre-delivery level
Given the supplier held 10 units of a product
And a purchase order for 10 more units was delivered
When the supplier reverses the delivery
Then the supplier holds 10 units of that product

Scenario: PDR-005 inventory history records both the delivery and the reversal
Given a delivered purchase order
When the supplier reverses the delivery
Then the inventory history still shows the original delivery
And the inventory history shows the reversal as a separate movement

Scenario: PDR-006 stock on hand may fall below zero when the goods were already sold on
Given a purchase order for 10 units was delivered
And 12 of those units have since been sold
When the supplier reverses the delivery
Then the reversal is accepted
And the supplier's stock on hand for that product is negative

Scenario: PDR-007 both unit count and total weight are restored for weighed products
Given a delivered purchase order for a product sold by weight
When the supplier reverses the delivery
Then the supplier's unit count returns to its pre-delivery level
And the supplier's total weight on hand returns to its pre-delivery level

Rule: Reversing a delivery undoes its effect on average cost

Scenario: PDR-008 average cost returns to its pre-delivery value
Given the supplier held 10 units at an average cost of $5.00
And a purchase order for 10 units at $8.00 each was delivered
And the average cost became $6.50
When the supplier reverses the delivery
Then the average cost is $5.00

Scenario: PDR-009 average cost reflects a corrected price after re-delivery
Given a purchase order for 10 units at $8.00 each was delivered and then reversed
When the supplier corrects the price to $6.00 and marks it delivered again
Then the average cost reflects $6.00 per unit
And the average cost carries no trace of the original $8.00

Scenario: PDR-010 average cost is cleared when no stock remains on hand
Given the supplier held no stock of a product
And a purchase order for that product was delivered
When the supplier reverses the delivery
Then the supplier holds no stock of that product
And the average cost is zero

Rule: Items already returned to the vendor are not reversed twice

Scenario: PDR-011 only the quantity still held is removed
Given a purchase order for 10 units was delivered
And 3 of those units were returned to the vendor
When the supplier reverses the delivery
Then 7 units are removed from stock on hand
And the purchase order has no remaining effect on stock on hand

Scenario: PDR-012 re-delivering restores only the quantity still held
Given a purchase order for 10 units with 3 returned to the vendor was reversed
When the supplier marks it delivered again
Then 7 units are added to stock on hand

Scenario: PDR-013 a fully returned line moves no stock when reversed
Given a purchase order line was delivered and then returned to the vendor in full
When the supplier reverses the delivery
Then no stock movement is recorded for that line

Scenario: PDR-014 canceling a delivered purchase order also accounts for returned items
Given a purchase order for 10 units was delivered
And 3 of those units were returned to the vendor
When the supplier cancels the purchase order
Then 7 units are removed from stock on hand
And the average cost is adjusted for the removal

Rule: Reversal and re-delivery may repeat without compounding

Scenario: PDR-015 repeated cycles leave the same result as a single delivery
Given a purchase order was delivered
When the supplier reverses and re-delivers it three times
And the purchase order is left delivered
Then stock on hand matches a single delivery of that purchase order
And the average cost matches a single delivery of that purchase order

Scenario: PDR-016 a purchase order left reversed has no net effect
Given a purchase order was delivered
When the supplier reverses and re-delivers it three times
And the purchase order is left placed
Then the purchase order has no net effect on stock on hand
And the purchase order has no net effect on the average cost

Scenario: PDR-017 two simultaneous reversals take effect only once
Given a delivered purchase order
When two reversals of the same delivery are attempted at the same time
Then only one reversal takes effect
And stock on hand is reduced only once

Rule: Order history and payments are preserved

Scenario: PDR-018 the date the order was placed is preserved
Given a delivered purchase order placed on a known date
When the supplier reverses the delivery
Then the date the order was placed is unchanged

Scenario: PDR-019 the delivery date is cleared
Given a delivered purchase order
When the supplier reverses the delivery
Then the purchase order has no delivery date

Scenario: PDR-020 payments already recorded are preserved
Given a delivered purchase order that has been paid in full
When the supplier reverses the delivery
Then the payment remains recorded against the purchase order
And the purchase order is still shown as paid

Rule: A payment due date exists as soon as its anchor date is known

Scenario: PDR-021 a due date is available before delivery when an invoice date is known
Given a placed purchase order with an invoice date and payment terms
Then the purchase order has a payment due date

Scenario: PDR-022 the invoice date takes precedence over the delivery date
Given a delivered purchase order with both an invoice date and a delivery date
Then the payment due date is calculated from the invoice date

Scenario: PDR-023 the due date is unaffected by reversal when an invoice date is known
Given a delivered purchase order with an invoice date
When the supplier reverses the delivery
Then the payment due date is unchanged

Scenario: PDR-024 without an invoice date the due date is recalculated on re-delivery
Given a delivered purchase order with no invoice date
When the supplier reverses the delivery and marks it delivered again later
Then the payment due date is calculated from the later delivery date

Scenario: PDR-025 no due date exists without an invoice date or a delivery
Given a placed purchase order with no invoice date
Then the purchase order has no payment due date

Rule: Only the buying business may reverse a delivery

Scenario: PDR-026 the buying business can reverse a delivery
Given a delivered purchase order
When a member of the buying business reverses the delivery
Then the reversal is accepted

Scenario: PDR-027 the selling business cannot reverse a delivery
Given a delivered purchase order
When a member of the selling business attempts to reverse the delivery
Then the reversal is rejected

Rule: Reporting reflects only genuine sales and purchases

Scenario: PDR-028 average selling price ignores reversed deliveries
Given 10 units of a product were sold at $12.00 each
And a delivered purchase order for 10 units of that product was reversed
Then the average selling price for that product is $12.00

Scenario: PDR-029 average selling price ignores items returned to a vendor
Given units of a product were sold
And other units of that product were returned to a vendor
Then the average selling price reflects only the units sold

Scenario: PDR-030 average cost nets a reversed delivery against its original
Given a purchase order for 10 units at $8.00 was delivered, reversed, corrected to $6.00, and delivered again
Then the reported average cost for that product is $6.00

Scenario: PDR-031 last purchase price falls back to the previous delivered order
Given two purchase orders for the same product were delivered at different prices
When the supplier reverses the more recent delivery
Then the last purchase price for that product is the earlier order's price

Rule: A reversal that cannot complete changes nothing

Scenario: PDR-032 a failed reversal leaves the purchase order delivered
Given a delivered purchase order
When the supplier reverses the delivery and the reversal cannot complete
Then the purchase order is still delivered
And stock on hand is unchanged
And the supplier can attempt the reversal again

Known limitations​

  • Only a Delivered order can be reverted. A Canceled order cannot be reopened.
  • A reversal can leave stock negative when the goods were already sold on.

FAQ​

I reverted an order. Is the payment gone? No. Payments, returns and the invoice stay as they are.

Should I cancel or revert? Cancel ends the order for good. Revert lets you fix it and deliver again.

My stock went negative after a revert. The units were sold after delivery. The reversal is still applied, so the product shows the true position.