Saltar a contenido

Warehouse receiving with Claude

Help the warehouse team receive supplier goods and post them in B1 with Claude: complete the A/P invoice drafts the e-invoice import already created, post goods receipt POs for deliveries that arrive before the invoice, and enter serial numbers without typing them.

Last updated: 2026-11-07 (requirements from an interview with Ivan Armoa) Epic: "Warehouse receiving with Claude" in the backlog (hypothesis and outcomes there)

Requirements

Who and why

The warehouse team receives goods from local suppliers and posts them in B1 themselves: goods receipt POs (GRPOs) and A/P invoices for items. They handle more than 30 documents a day, a typical document with serials takes more than 15 minutes, and the volume is growing. Everything is slow today:

  • finding our item for each supplier line;
  • typing serial numbers by hand, one per unit, on many items;
  • typing lines, quantities, prices and tax codes (GRPOs are typed from scratch; there are no purchase orders in production);
  • checking the document against the supplier's invoice.

Success means no wrong items or serials and keeping up with the volume (no deliveries left unprocessed at the end of the day).

What arrives (last 30 goods A/P invoices in COMPU, read 2026-11-07)

  • 30 invoices (DocNum 25327–25417, 2026-10-27 to 11-06), 82 lines, 461 units. Two are not warehouse goods (an outsourced service, fixed assets).
  • Lines per invoice: 1 line ×8, 2 ×9, 3 ×7, 4 ×3, 5 ×1, 7 ×1, 11 ×1. Most invoices are short; a few large ones (Sol Control 25382: 11 lines, 302 units) carry most of the units.
  • Serials: 33 of 82 lines (40%) are serial-managed items, but only 56 of 461 units (12%): serial items come one or a few at a time (notebooks, phones, monitors, UPS, printers, tablets), while the bulk (mice, keyboards, headsets, cables) has no serials. 45 of those 56 units are managed on every transaction, so their serials must be entered on receipt.
  • Flows: 7 invoices copied a GRPO (one partly), 23 were entered directly. Fewer GRPOs than the "half and half" estimate in this sample.
  • Suppliers: Fastrax 6, EMAP 6, Sol Control 4, PROART 4, Betamed 2, and one each from ten others. PROART invoices in guaraníes, the others mostly in USD.
  • Paper invoices: 9 of the 30 (U_CENT_COMPROBANTE 109, no CDC), from 6 suppliers: PROART 4, Infinycore, Juntech, two individuals and a service provider. The other 21 are e-invoices (999), but none has a CDC stored: none came through the e-invoice import, which went live on COMPU on 2026-11-05.
  • New items are common: 13 of the 30 invoices have a line whose item was created in the 10 days before; codes 10490–10539 were all created between 2026-10-31 and 11-06, about 50 a week.
  • 25 of the 76 items have no bar code.
  • Today, entering an invoice header alone takes about 3 minutes with careful checking.

Flows

A and B are about half the volume each. C covers the invoices that are not in B1 as e-invoices: mostly paper invoices, 30% of the sample above.

A. The invoice is already in B1 (invoiced directly). The supplier's e-invoice reached the mailbox and the e-invoice import created an A/P invoice draft before the goods arrived. The paper invoice that comes with the goods only identifies it. The clerk, with Claude:

  1. finds the draft (from a photo of the printed invoice: the supplier's RUC and the number as printed, 001-001-0038415, or the CDC under the QR code);
  2. completes the lines Claude couldn't identify, with our items;
  3. adds the serials of the units received;
  4. posts the A/P invoice after one confirmation. The invoice receives the stock; there is no GRPO. Lines the draft copies from a GRPO were received already: they need no serials, and an invoice with such lines can't take the reserve route.

If the delivery is rejected (wrong or damaged goods), the draft stays unposted with the clerk's reason as a text line, which also keeps it from being posted by mistake.

B. The goods arrive before the invoice (receive first). The invoice comes later, or one invoice covers several deliveries. A delivery note comes with the goods, on paper or as an electronic remisión (SIFEN XML) by email. The clerk, with Claude:

  1. gives Claude the delivery note: a photo of the paper one, or the remisión XML;
  2. checks the lines and items Claude proposes;
  3. adds the serials;
  4. posts the GRPO after one confirmation.

When the supplier's e-invoice arrives later, the e-invoice import already copies open GRPO lines into the A/P invoice draft. Several GRPOs for one invoice are copied together. For suppliers without e-invoices yet (PROART in November 2026), the A/P invoice is copied from the GRPO with b1_copy_document when the paper invoice arrives, or created from a photo of it (flow C).

An electronic remisión (sample: TIGERS DEL ESTE, PL0178, 001-001-0002646, 2026-10-28) is SIFEN document type 7 (iTiDE 7). It has the supplier's item codes (dCodInt), descriptions and quantities, but no prices and no GTINs, and it names the invoice it belongs to (gCamDEAsoc/dCdCDERef, the invoice's CDC). The GRPO keeps both CDCs, so the invoice import can find its GRPO exactly instead of by supplier and item.

C. A paper invoice that is not in B1. The supplier has no e-invoices yet (PROART, Infinycore, Juntech and individuals in November 2026), or an e-invoice never reached the mailbox and only its printed copy (KuDE) arrived. The clerk, with Claude:

  1. photographs the invoice;
  2. Claude reads the header (supplier RUC, timbrado and its expiry, establishment, expedition point, number, date, currency, credit or cash), the lines and the printed totals per VAT rate;
  3. the server checks what was read and creates the same A/P invoice draft the e-invoice import creates, marked as read from a photo;
  4. from there it is flow A: items, serials, post. For a receive-first supplier, the draft copies its open GRPOs as an e-invoice draft does.

For an e-invoice that never reached the mailbox, the XML is still better than a photo: forward the supplier's email to facturacion@, or, later, fetch the XML from SIFEN with the CDC printed on the KuDE (to research). The photo is the fallback.

Must

  1. Read the source, never retype it. Lines, quantities, prices and tax codes come from the e-invoice draft, the remisión XML or a photo of the paper document.
  2. Items: every line ends with our item code, from (in order) the e-invoice import's matches, the supplier's catalog numbers, the GTIN, the part number (U_COD_PART), the supplier's open GRPOs, or a suggestion the clerk confirms (b1_suggest_items, also shown in the receiving preview). Claude never picks an item silently.
  3. New items: when a product doesn't exist in B1, Claude proposes the item from the invoice and similar items (fields in Design, Item fields) and creates it after confirmation. Claude always asks the clerk whether the item is managed by serial numbers: it can't be changed once the item has documents. Some items are (notebooks, monitors), others aren't (cables).
  4. Serials: the clerk scans labels with a barcode scanner into the chat, or sends photos of the labels. Claude assigns serials to lines; serials read from photos are marked as such and shown for confirmation. Labels vary by supplier: some have a GTIN and a serial barcode, others only text. TP-Link boxes have an EAN-13 label and a second label with model, S/N and P/N; the P/N equals our U_COD_PART. Photos must show the label side: the front of the box has no serial.
  5. Differences stop the posting. When what arrived differs from the invoice or delivery note (missing units, damaged, wrong item), Claude doesn't post; it explains the difference and the clerk decides in the chat between:
  6. an A/P reserve invoice for the whole supplier invoice, plus a GRPO for what arrived, copied from the reserve invoice (the rest is received later the same way);
  7. rejecting the invoice and talking with the supplier (the draft stays unposted, with a note: b1_receive_einvoice_draft mode reject).
  8. One confirmation per document, with a compact summary that is quick to approve: supplier, document, each line with item, quantity and number of serials, totals against the source, and any warning on top.
  9. Works on a computer and on a phone (claude.ai web, desktop and mobile), under the clerk's own B1 user.

Not in the first version

  • Imports (foreign suppliers, landed costs, customs): local suppliers only.
  • Bin locations and several warehouses: everything is received into one central warehouse (PED1, "PEDIDOS CENTRAL", on every line of the invoices read).
  • Turning electronic remisiones into GRPO drafts automatically (n8n); the clerk gives the XML to Claude on arrival.
  • Purchase orders: production has none.

Acceptance criteria

  • Flow A: for a pilot Fastrax delivery, the clerk posts the A/P invoice from Claude with all items and serials. The invoice's total equals the e-invoice, and every serial count equals its line's quantity.
  • Flow B: for a pilot receive-first delivery, the clerk posts the GRPO from a photo or remisión XML with items and serials. The later e-invoice draft copies it with no item left to match.
  • A serial that is already in stock, appears twice, or doesn't fit the line's quantity is refused before the confirmation.
  • A difference between received and invoiced quantities never posts without the clerk's decision.
  • Time per document is measured on the pilot suppliers before and after.

Design

Building blocks that already exist

Need Existing piece
A/P invoice drafts from e-invoices, matched by catalog number and GTIN, GRPO lines copied b1_import_einvoice, POST /integrations/einvoice (n8n)
Find a draft by its e-invoice U_SIFEN_CDC on drafts, folio fields, the import's duplicate check
Post a draft as an A/P invoice b1_document_action post (DraftsService_SaveDraftToDocument), refused while REVISAR: or text lines remain (to relax, see New pieces 1)
Copy GRPOs into an invoice b1_copy_document; the e-invoice import copies open GRPO lines
SIFEN XML parsing services/b1-einvoice-parser.ts
Journal entry after posting services/b1-journal-entry-feedback.ts

New pieces

  1. Complete an e-invoice draft (flow A, decision 8):
  2. One PATCH of the draft with the header B1S-ReplaceCollectionsOnPatch: true:
    • DocumentLines: every line, existing ones with their LineNum, new item lines with their SerialNumbers;
    • DocumentSpecialLines: a single text line, exactly Artículos confirmados, replacing the placeholders and notes;
    • Comments: without the REVISAR: prefix.
  3. Then post with DraftsService_SaveDraftToDocument. The posting rule in b1_document_action changes from "no text lines" to "no text line other than Artículos confirmados, and no REVISAR:".
  4. Why one text line stays: no PATCH removes the last text line of a document ([] and null are ignored even with the header).
  5. Tested in ZZ_COMPU_3 on 2026-11-07:
    • drafts 6164 and 6165: serials on draft lines survive posting (A/P invoice 24310, serial records created);
    • a plain PATCH of DocumentLines without LineNum overwrites existing lines by position, so always send LineNum with the header.
  6. Lines copied from a GRPO (BaseType 20) keep their base and need no serials; the import's note "Cantidad no coincide con lo pendiente" is not a line without item but a line to copy in SAP, so receiving stops on it instead of adding an unbased line. Tested in ZZ_COMPU_3 on 2026-11-09: PROART GRPO 2685 (item 01892, serial ZZGRPO-0001) → draft 6172 → A/P invoice 24326 posted with no serials, GRPO closed.
  7. GRPO from a delivery note (flow B): a workflow tool that takes a remisión XML (parsed like e-invoices, document type 7) or the lines Claude read from a photo, matches items with the same steps as the e-invoice import, and posts a PurchaseDeliveryNotes document with serials after confirmation. A remisión has no prices, so they come from the supplier's last purchase of each item and are marked for checking; the invoice later sets the real price. The GRPO stores the remisión's CDC and the invoice CDC it names, and the e-invoice import uses the latter to find it.
  8. Serial assignment: a pure function that takes scanned or read codes and the document's lines and returns serials per line. It separates GTINs and part numbers (which confirm the item) from serials, checks counts against quantities, and flags duplicates and serials already in stock. Item confirmation accepts a GTIN equal to BarCode or a P/N equal to U_COD_PART: item 04634 has BarCode 489709868809 in COMPU while its box says 4897098688809, so a GTIN mismatch is reported as a possible bar code error, not as the wrong item.
  9. Item creation (b1_create_items, decisions 15–17): Claude proposes the name and a similar existing item, the clerk confirms both and says whether the product is managed by serial numbers; the server copies the rest from the similar item (see Item fields) and creates up to 10 items after one confirmation. Before writing it refuses an item that looks like an existing one:
  10. the same bar code (BarCode, the barcode UDFs or BarCodes) on an item with the same name or a shared model code: always, the item exists. On an unrelated item the bar code in B1 is probably wrong (164 bar codes in COMPU sit on unrelated products), so the clerk may override it and should have that item fixed;
  11. the same part number, supplier catalog number, supplier's code, name, or a model code of the name: unless the clerk says it is another product (a color or capacity variant). Names are compared on letters and digits only (case, accents, spaces and any hyphen ignored; + and decimal points kept: PRO/PRO+, 15M/1.5M). B1 compares text case-sensitively and the Service Layer has no tolower, so names are searched by their model codes (runs with a digit, not specs such as 16GB; single-letter units take at most 3 digits, so 7269L is a model) and by all their words at once (a substring AND finds MARIOKART from MARIO KART), then compared in code. Checked on the 2026-11-09 duplicate analysis: all 67 duplicate pairs found, no different product taken for the same name;
  12. a bar code with a wrong check digit, which is how a misread photo shows up.

The manufacturer and group come from the similar item with its mistakes: when the new name names another manufacturer (05023, an FTX stand, carries Kolke in ZZ_COMPU_3), the preview and the confirmation say so.

With the supplier and its product code (the [cód. …] of the receiving line), it adds an AlternateCatNum row, the first thing the e-invoice import looks at, so the supplier's next invoices find the item. Tested in ZZ_COMPU_3 on 2026-11-09: item 06610 (series 79, 10 warehouses, IVA_10, serials, catalog row for PL0148); a second identical request was refused on bar code, part number, supplier's code and name, a name differing only in letter case was found, and an invented model C210 found the existing TAPO C210 (03256). 5. Reserve invoice and partial GRPO (difference in flow A): the same completion PATCH also sets ReserveInvoice: tYES, SaveDraftToDocument posts the A/P reserve invoice for the whole invoice, then a GRPO copied from it (BaseType 18) receives what arrived, with the serials. The reserve invoice keeps the rest open (RemainingOpenInventoryQuantity) for a later GRPO. Tested in ZZ_COMPU_3 on 2026-11-07: draft 6167 → reserve invoice 24314 (USD 633.5) → GRPO 1138 with 2 of 3 monitors and 4 serials, one monitor left open. 6. Invoice from a photo (flow C, b1_import_paper_invoice): Claude passes what it read as structured data (header, lines, printed totals per VAT rate). Before writing anything the server checks: - quantity × price adds up to each line total, and the lines to the printed total; - the VAT per rate matches the printed breakdown (liquidación del IVA); - the timbrado fields are complete and the timbrado is valid on the invoice date; - it isn't a duplicate (supplier RUC, timbrado, establishment, expedition point and number, the same check the e-invoice import makes); - the supplier exists, found by RUC. A supplier is never created from a photo.

Then it reuses the e-invoice import's item matching and draft plan, with the comprobante type of paper invoices (109, as entered today) instead of 999, and remarks saying the draft was read from a photo. The confirmation shows the values read. Misread amounts are the main risk: any failed check stops before writing, with the line or total that doesn't add up. The photo goes on the draft as an attachment once attachments from the chat exist (backlog). 7. Compact receiving summary: a confirmation format for flows A, B and C, built for quick approval at volume: warnings on top, then the completed total against the invoice's (kept in the remarks so a re-run after a failed posting still checks it), then each line with its serials as given/needed, and lines already received on a GRPO marked as such. 8. Skill warehouse-receiving in plugins/sap-b1: the flows, how to scan or photograph labels, what to do with differences. 9. Item suggestions (b1_suggest_items, decision 20): the company's purchasable items are kept in memory 15 minutes per company and compared in code, because B1 compares text case-sensitively and b1_read returns 20 rows. Candidates are strong (bar code, the supplier's catalog number or code, FX-<code> included, the same name, a rare model code) or possible with what differs (a letter suffix such as 12400F, capacity, color, another kind of product, a code shared beside each name's own model). The supplier's invoice and goods receipt lines of the last year raise the rank and flag prices far from the last one. Checked against the 2026-11-09 duplicate pairs (kept as a test fixture: every duplicate's item in the top five, no variant called the same name) and, read-only in COMPU on 2026-11-10, on the three Fastrax lines left without item that day: 00234, 09721 (then its duplicate 09626) and 09302 come first and strong. The receiving preview lists up to five per line; b1_create_items stops on a strong one. Words count by how much of the item's name the description covers, since supplier descriptions add specs the item name leaves out (the 2026-11-10 test offered nothing for the C096E stand until then). The import's notes keep the e-invoice GTIN, which receiving ranks with and passes on to new items. 10. Posted twin: before posting a draft, receiving and b1_document_action look for the same supplier invoice already posted (supplier, number, establishment, point) and stop: on 2026-11-10 clerks typed Fastrax 38473 and 38463 while the import's drafts 9522/9523 waited.

Reads must not use $select when serials matter: like text lines, SerialNumbers come back empty with $select (A/P invoice 25415 in COMPU has 5 serials, all hidden by a $select read).

Item fields

From the 50 latest items in COMPU (codes 10490–10539, created 2026-10-31 to 11-06):

Field Value on new items How Claude fills it
ItemCode Series 79 on all 50 Omitted; the series of the group's newest item (79) lets B1 assign the next code
ItemName Upper case: type, brand, model, key specs (NOTEBOOK MSI PRESTIGE 16 AI EVO B1MG-00…) Proposed from the invoice description, in that style; clerk confirms
ForeignName Equal to ItemName on 41 of 42 Copied from ItemName
ItemsGroupCode 20 different groups From the most similar item; clerk confirms
Manufacturer Set on half (15 values), -1 on the rest From the most similar item of the same brand
ManageSerialNumbers 12 of 50 Always asked; never inferred
SRIAndBatchManageMethod On every transaction 39, on release only 11 On every transaction for serial items, unless the clerk says otherwise
UoM Group 1, UNIDAD on 41 of 50 Default
ApTaxCode / ArTaxCode IVA_10 on 48 of 50 From the similar item, with IndirectTax: tYES: without it B1 drops the codes silently (new items default to tNO)
U_REG_TUR (tourism regime) S on 39, N on 11 From the most similar item; clerk confirms
SWW (tariff code) 36 of 50, e.g. 8471.60.53 From the most similar item
U_COD_PART (part number) 33 of 50 From the label's P/N or the invoice
BarCode 19 of 50 From the scanned or photographed EAN, when there is one
U_DESC_CORTA (short description) 12 of 50 Optional, proposed from specs
SupplierCatalogNo 11 of 50 Only in the supplier's format: Fastrax items have FX- + its code (dCodInt), the web catalog integration's format that the clerks follow. The supplier's raw code goes to AlternateCatNum (empty in COMPU on 2026-11-09)
Prices Item 10542 had a list 1 sales price the day it was created None; whoever sets prices does it in SAP (decision 16)
WarrantyTemplate, Properties1 (Tienda naranja) 7 and 15 of 50 Asked only when the similar item has them
ItemWarehouseInfoCollection All 16 warehouses on item 10539 Copied from the similar item, always: items created through the Service Layer get no warehouse rows, and posting then fails with "Item … not found in Warehouse CEN"

Item matching improves further with the backlog story on learning supplier item codes from posted documents; item suggestions for unmatched lines are New pieces 9.

Decisions

# Decision Status Notes
1 Flow A posts the A/P invoice directly, no GRPO Confirmed (2026-11-07)
2 Flow B posts the GRPO after confirmation, not a draft Confirmed (2026-11-07)
3 Serials by scanner and by photo Confirmed (2026-11-07) Photo-read serials always shown for confirmation
4 Differences: Claude stops, the clerk decides in the chat Confirmed (2026-11-07)
5 Claude creates new items after confirmation Confirmed (2026-11-07)
6 Remisiones read on arrival, not imported by n8n Confirmed (2026-11-07)
7 Fewer units than invoiced in flow A: reserve invoice plus a GRPO for what arrived, or reject and talk with the supplier Confirmed (2026-11-07) See New pieces 5
8 Flow A drafts are completed by PATCH and posted with SaveDraftToDocument, keeping one text line Artículos confirmados Confirmed (2026-11-07) Tested in ZZ_COMPU_3, see New pieces 1. Rejected: posting a new invoice from the draft's data and deleting the draft (works, but two steps and loses the DraftKey link)
9 New items: fields as in Item fields, code from series 79, serial management always asked Confirmed (2026-11-07) From the 50 latest items in COMPU
10 Receive-first pilot supplier: PROART (PL0148) Confirmed (2026-11-07) Invoices in guaraníes; phones and notebooks, mostly serial-managed; no e-invoices yet
11 The GRPO stores the remisión CDC and its invoice CDC Proposed The UDF to use is to agree; U_SIFEN_CDC holds the document's own CDC on invoices
12 Second flow B pilot with e-invoices: TIGERS DEL ESTE (PL0178) Proposed Tests remisión → GRPO → e-invoice draft; its remisión sample names its invoice's CDC
13 Paper invoices become the same A/P invoice draft as e-invoices, read from a photo and checked by the server, then follow flow A Confirmed (2026-11-07) Receiving, serials and posting stay one tool; see New pieces 6. Tested in ZZ_COMPU_3: PROART reading → draft 6170 → A/P invoice 24323 with 4 serials; a transposed amount was refused; a second import found draft 6170
14 No supplier is created from a photo Confirmed (2026-11-07) A misread RUC or name would create a wrong supplier; new suppliers stay with the e-invoice import or SAP
15 New items are created by their own tool, b1_create_items, with one confirmation for all items of a document; receiving then uses them Confirmed (2026-11-09) A document with new items takes two confirmations. Rejected: creating them inside the receiving confirmation (one confirmation, but a bigger receiving tool, and items would stay created if posting failed)
16 New items get no prices Confirmed (2026-11-09) Clerks don't set prices; the result says the item has none yet
17 Items in group 157 with FX-/CPI- codes and mixed-case names come from another integration Confirmed (2026-11-09) The duplicate check finds them by the supplier's code (SupplierCatalogNo ending in - and the code), so Claude doesn't create them again
18 A rejected delivery leaves the draft unposted with a text line Rechazado en la recepción (date): reason Confirmed (2026-11-09) The text line keeps b1_document_action from posting it; receiving it later replaces the note. Tested in ZZ_COMPU_3
19 A serial scanned twice is a warning and counts once Confirmed (2026-11-09) Double scans are the common scanner mistake; the count per line still stops a short scan
20 Item suggestions rank and explain; the clerk confirms every item. Also a standalone read-only tool, b1_suggest_items Confirmed (2026-11-10) For flow B delivery notes, paper invoices and "do we have this?"; the server never chooses

Pilot

  • Fastrax for flow A: invoiced directly, e-invoices by email, GTINs match our items, serial-managed products.
  • PROART for flow B.
  • The e-invoice import already runs on COMPU.
  • Test data in ZZ_COMPU_3 (set up 2026-11-07; ZZ_COMPU_3 is an older copy, 10 of the 12 items didn't exist and two had other serial settings):
  • items 10539, 09004, 08712, 09457, 08633, 09463, 09453, 10508, 10517, 10518 created from their COMPU master data, linked to the warehouses of item 05553; 05553 and 06523 switched to serial management as in COMPU;
  • USD rates for 2026-11-03 to 11-07 copied from production documents (approximate, for tests);
  • draft 6166: Fastrax invoice FCR 38309 (COMPU A/P invoice 25415) as the import would leave it: four item lines, three "Sin artículo en B1" text lines, REVISAR:. The flow A test case; the real serials are on COMPU invoice 25415;
  • draft 6167 → reserve invoice 24314 → GRPO 1138: the difference test above;
  • for flow B, PROART's COMPU GRPO 1722 (DocEntry 4089: a phone, three notebooks and a tablet, 4 serials) is the expected result; the remisión and label photos are in docs/local/remission-samples and docs/local/items-pictures.
  • PROART doesn't issue e-invoices yet (its invoices in COMPU have U_CENT_COMPROBANTE 109 and no CDC; Fastrax's have 999). SET is rolling out the e-invoicing obligation and almost every supplier already has it, so suppliers like PROART are a shrinking exception. In the last 30 goods invoices, though, 9 were still paper (flow C). Their A/P invoice is copied from the GRPO with b1_copy_document when the paper invoice arrives, or created from a photo of it (flow C). PROART still tests the GRPO part of flow B (photo of the delivery note, serial-heavy notebooks and phones); the full loop (remisión → GRPO → e-invoice draft copying it) needs a supplier with e-invoices (decision 12).
  • Time a few documents of each flow before starting, to replace the "more than 15 minutes" estimate with a baseline (an invoice header alone takes about 3 minutes today).