One shipment, two imports: keep delivery totals from doubling

A consignee confirms receipt and a file containing that confirmation is imported twice. If each row is treated as a new delivery, the report can double the accepted quantity even though the physical delivery occurred once.
A consignee confirms receipt and a file containing that confirmation is imported twice. If each row is treated as a new delivery, the report can double the accepted quantity even though the physical delivery occurred once.
Use a separate key for each purpose
Give each trip a stable identifier and each warehouse event an event key, ideally issued by the source system. Give each import batch its own ID and receipt time. A new file may contain events already processed, and a single trip can have several valid partial receipts.
If the source does not issue an event ID, agree a composite key with the data owner. Source system, trip ID, event type and receipt reference are a possible combination. A truck registration or timestamp alone cannot reliably identify an event. Do not merge similar rows until their relationship is established.
Handle three cases
- A new key creates an event after validation.
- The same key and payload records a retry in the import log without increasing the accepted quantity.
- The same key with changed values preserves the previous version and routes the correction through the agreed review.
Record a cancellation as a change with a source, reason and link to the replacement. Keep the warehouse event time separate from the import time. A late confirmation does not represent another delivery.
Worked example
Receipt A-101 confirms 12 pallets. The file is imported twice, so the report still shows 12 and the log shows two arrivals of the same record. The source later changes the quantity to 11. Before review, show the current accepted value and a pending correction. After approval, show 11 and keep the history. A different valid receipt for another partial delivery is recorded separately. All values and identifiers are illustrative.
Reconcile the result
Compare the source row count with new, repeated, corrected and rejected rows. Expose rejection reasons. Reconcile trip and order quantities against the consignee's receipts. Test the original file, an exact copy, a corrected row and a new receipt on the same trip before rollout. The copy should leave totals unchanged, the correction should retain history, and the new receipt should count once.
