Skip to main content

ReceiptLoad

Goods receipts against PO lines. A receipt belongs to the PO line of its source_line_id (same source system), which must exist.

Import​

from lib.objects.receipt import ReceiptLoad

Standard BaseLoad methods​

get_all(), search(), new(), save_all(), patch_all(), delete_keys(), obj.save(), obj.delete(). See BaseLoad. Receipts have no active flag, so obj.deactivate() raises ValueError: delete instead.

Run it from the get_receipts entrypoint. Its job token may read and write receipts, and read purchase orders, PO lines and organizations.

Keys​

A receipt is found by its Nuntiq id or by source_system + source_receipt_line_id.

Receipt fields​

FieldRequiredNotes
source_receipt_line_idyesThe receipt line's id in your system. With the source system, the key
source_line_idyesNames the PO line (its source_line_id); the line must exist
receipt_line_numberyesReceipt line within the same PO line (you can have several partial receipts)
po_number / po_line_number / source_document_idTaken from the PO line when left out
receipt_numberFree-form GR number, e.g. GR-2026-0042
receipt_dateISO date
quantityNumber, the quantity received
unit_priceNumber
unit_of_measure
quantity_alt / unit_price_alt / unit_of_measure_altA second unit of measure
net_amount / tax_amount / gross_amountNumbers
location_codeWhere received
received_by
comments
source_system / source_updated_atAs on the PO
custom_text_1..10Text
custom_number_1..10Numbers
custom_date_1..10ISO dates

Example​

from lib.objects.receipt import ReceiptLoad

def run(context):
load = ReceiptLoad(context)

r = load.new()
r.receipt_line_number = '1'
r.receipt_number = 'GR-2026-0042'
r.receipt_date = '2026-04-26'
r.quantity = 100
r.unit_price = 12.50
r.net_amount = 1250.00
r.location_code = 'WAREHOUSE-AMS'
r.source_line_id = 'ERP-PO-42-L1' # the PO line
r.source_receipt_line_id = 'ERP-RCV-42-1' # this receipt

results = load.save_all()
return {'saved': len(results)}

Partial receipts​

If the PO line is for 100 units and you receive 60 then 40, that's two receipts on the same PO line with different receipt_line_number and source_receipt_line_id.

# First delivery: 60 units
r1 = load.new()
r1.source_line_id = 'ERP-PO-42-L1'
r1.receipt_line_number = '1' # first partial
r1.quantity = 60
r1.source_receipt_line_id = 'ERP-RCV-42-1A'
# ... fill in the rest ...

# Second delivery: 40 units
r2 = load.new()
r2.source_line_id = 'ERP-PO-42-L1'
r2.receipt_line_number = '2' # second partial
r2.quantity = 40
r2.source_receipt_line_id = 'ERP-RCV-42-1B'
# ... fill in the rest ...

load.save_all()

Exact-match filters: receipt_number, po_number, source_document_id, source_line_id, source_system, source_receipt_line_id, plus updated_since and include_deleted.

# All receipts for a PO
for r in load.search(po_number='PO-2026-0042'):
print(r.receipt_number, r.quantity)

Delete​

load.delete_keys([{'source_receipt_line_id': 'ERP-RCV-42-1A'}])

Soft delete. Receipts have no is_active: delete or keep.