Retroactive Freight & Duty Accounting · Exact BigInt 4-Decimal Scale

Calculate True Shopify Landed Cost & Moving Weighted-Average COGS — Even When Freight Bills Arrive Weeks Late

Cost per item is one number per variant in Shopify. If a forwarder invoice or customs duty bill lands 3 weeks after receiving—after you have already sold 40% of the shipment—simply overwriting Shopify's cost inflates remaining inventory and distorts historical gross margin.

Interactive Browser Calculator · Zero Network Calls

Late Freight & MWAC Split Quick Calculator

Test a single SKU receipt and late freight bill below. Need multi-SKU weight/value/quantity splits from a full Stocky PO? Open the Full Multi-SKU MWAC Simulator.

Initial Post-Receipt MWAC $11.0000
Capitalized into Remaining Stock +$24.0000
Realized COGS Adjustment +$16.0000
Batch Full Landed Cost (if 0 prior stock & 0 sold) $11.4000
True Store-Wide New MWAC (LedgerPO Writeback) $11.4000 (Shopify: $11.40)
Naive Overwrite Gap (Batch Landed − True MWAC) +$0.0000 / unit

Transparent Accounting Mechanics

Why Shopify's single Cost per item breaks landed cost

  1. Overwriting historical margins: Shopify keeps one unitCost per InventoryItem. Overwriting it with a single batch's invoice price ignores older units sitting at a different cost across your warehouses.
  2. Delayed ocean freight & customs invoices: Freight forwarder and broker invoices typically arrive 2–6 weeks after warehouse receiving. By then, part of the shipment has already been sold. Pushing 100% of the late fee onto remaining shelves overstates ending inventory valuation; ignoring it overstates gross profit by 8%–25%.

LedgerPO's Store-Wide MWAC & Retroactive Split Formula

1. Initial Store-Wide MWAC on Receipt:
   C_new = (Q_old * C_old + q_rcvd * C_landed) / (Q_old + q_rcvd)
2. Late Freight / Duty Split (4-Decimal Micro-Unit Scale):
   Inventory_Delta = round(Fee_Delta * Remaining_Share)
   COGS_Delta = Fee_Delta - Inventory_Delta
   MWAC_after = round((OnHand_now * MWAC_now + Inventory_Delta) / OnHand_now)

Every late fee allocation uses largest-remainder rounding so the sum of SKU postings matches your freight bill to the exact ten-thousandth (0.0001). Need to correct a duplicate broker bill? LedgerPO posts an immutable reversal entry in cost_ledger and restores the exact prior unitCost without deleting audit history.