Item receipts

TL;DR

The goods coming back into the warehouse on a return. It reverses cost of goods the way the item fulfillment booked it.

An item receipt is the inbound shipment on a return: the products physically arriving back. It arrives from NetSuite and points back at the return authorization that permitted it, and at the order underneath.

It is the mirror of the item fulfillment. The fulfillment took cost of goods out when the order shipped; the receipt puts it back when the goods return.

Where it comes from

app/jobs/netsuite/itemreceipts.php consumes the ns_itemreceipts batch type, one batch per date. It is not part of the verkoopdump backfill, so pre-2022 receipts are not in CCC.

classify/itemreceipts.php calls getblocked(array('ns_salesorders', 'ns_invoices', 'ns_returnauthorizations')) and ends the run while any of the three is still queued.

Tables

TableHolds
itemreceiptsThe header
itemreceiptlines, itemreceiptlinesnoninvItem and non-inventory lines
itemreceiptclassificationsHeader flags
itemreceiptlineclassificationsLine flags

There are no discount or tax tables, for the same reason the fulfillment has none: a movement of goods prices nothing.

What classification records

The return it belongs to, the order underneath it, the transaction date, the receipt status, the sales channel, and the three line-shape flags multiline, linesinvonly and linesnoshipping.

What it contributes to margin

The reversal of cost of goods, through three rules in the seeded set that target this type. calculate/itemreceipts.php rebuilds a day at a time, deleting that date's receipt impacts from all four contribution groups before recalculating, and re-queues every order it touched into cm_impact_salesorders.

A receipt and a credit memo are independent. Goods can arrive back without a refund having been issued, and a refund can be issued before the goods arrive. An order in between shows one side of the return and not the other, which is the data being current rather than the data being wrong.

Where to look, and where to change

WhatWhere
The receipts themselves/transactions/itemreceipts
One receipt in the context of its order/transactions/salesorderdetail, under related records
The cogs reversal it booked/contributionmargin/impact, filtered on the cogs accounts

The receipt is upstream data and is not editable in CCC.

Evidence

Import and blocking from app/jobs/netsuite/itemreceipts.php and app/jobs/classify/itemreceipts.php. Classification fields from the INSERT in that classify job. Table family from app/jobs/install/install.php. Day rebuild from app/jobs/calculate/itemreceipts.php. Rule counts per type from config/seed/cm_calculationrules/rules.json. Columns from templates/main/transactions/itemreceipts.tpl. Basis: code-checked at 30f5313.

About this document