{"id":"acct-invoice-fields-to-json","audience":"accounting","category":"finance-work","track":"finance","technique":"format","level":"intermediate","title":"Extract invoice fields into JSON and compute the due date","free":false,"task":"You're capturing an invoice for AP. Write a prompt for one JSON code block holding one object with exactly the keys vendor, invoice_number, invoice_date, due_date, subtotal, shipping and total. Dates as YYYY-MM-DD, amounts as numbers. The due date is the invoice date plus the net terms. One key per line is fine. Outside the code block write at most 12 words.","materialLabel":"Invoice text (attached to your prompt automatically)","material":"TALLIS FREIGHT LLC\n88 Harbor Road, Hallworth\n\nINVOICE # TF-88213\nDate: 14 Oct 2026\nBill to: Larkin Foods, Accounts Payable\nTerms: Net 30\nPO reference: 7712 (not an invoice number)\n\nDescription                          Qty   Amount\nPallet transport, Hallworth to Dunmore  4   $1,600.00\nLoading surcharge                       1     $240.00\nSubtotal                                    $1,840.00\nShipping and handling                        $60.00\nTotal due                                 $1,900.00\n\nRemit to: Tallis Freight LLC, account on file. Late fee: 1.5% per month.\nPrevious invoice reference TF-88100 is shown for information only.\n\nAP intake notes: received by email Oct 16 as a PDF scan; the scan quality is poor but the amounts above were checked against the PDF. Vendor ID V-0418. This invoice is for the October 6 freight run to Dunmore. No credit memos are attached. Payment run is every Thursday. The AP clerk typed the PO number into the notes field by mistake last month, which caused a duplicate flag.","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":10},{"type":"maxProseWords","max":12}],"promptHints":[{"label":"Gives the keys","patterns":["vendor","invoice_number","due_date"]},{"label":"Sets date format and rule","patterns":["yyyy-mm-dd","net 30","\\+ 30"]},{"label":"Excludes other numbers","patterns":["not the po","previous invoice"]},{"label":"Sets amount format","patterns":["numbers","no \\$"]},{"label":"Limits prose","patterns":["12 words","code block"]}],"mistakes":[{"title":"Using the PO number","why":"The AI sets invoice_number to 7712.","fix":"Add: \"invoice_number is the invoice's own number, not the PO reference.\"","checks":["r1"]},{"title":"Wrong due date","why":"The AI copies the invoice date or adds 30 to the wrong month.","fix":"Say: \"due_date = invoice date + 30 days.\"","checks":["r1"]},{"title":"Dollar signs and strings","why":"The AI writes \"$1,900.00\" as text.","fix":"Add: \"Amounts as numbers (no $ or commas).\"","checks":["r2"]},{"title":"Wrong keys","why":"The AI uses 'Vendor Name' or adds extra keys.","fix":"Say: \"Exactly these keys: vendor, invoice_number, ...\"","checks":["r0"]},{"title":"Commentary around the block","why":"The AI explains the extraction.","fix":"Add: \"At most 12 words outside the code block.\"","checks":["codeBlocks","maxCodeLines","maxProseWords"]}],"hint":"Extraction needs exact keys, a date rule and the right number. Name all three.","rubricLabels":["One JSON object in a single code block with exactly the keys vendor, invoice_number, invoice_date, due_date, subtotal, shipping and total","vendor is Tallis Freight LLC, invoice_number is TF-88213 (not 7712 or TF-88100), invoice_date is 2026-10-14 and due_date is 2026-11-13","subtotal is 1840, shipping is 60 and total is 1900, as numbers without dollar signs"]}