Back to results  ยท  documents/PROMPT.md

You are helping an accounts payable team. The folder inbox/ holds 45 documents that suppliers sent us this year. suppliers.csv is our supplier master list.

Create a file named invoices.csv in this folder with one row for every invoice or credit note in inbox/.

The columns, in this order, with this exact header row:
file,supplier_id,invoice_number,invoice_date,due_date,currency,net,vat,total,flag,reason

Rules:
1. Only invoices and credit notes get a row. Leave out anything else (statements, quotations, delivery notes).
2. file is the file name, for example doc_001.txt. supplier_id comes from suppliers.csv.
3. invoice_number exactly as printed.
4. Dates as YYYY-MM-DD. Suppliers in the United States write dates month first. All other suppliers write the day first.
5. due_date is the due date printed on the document. If the document only gives payment terms, due_date is the invoice date plus that number of days.
6. currency is the three-letter code (ZAR, USD, EUR, GBP).
7. net is the amount before tax, vat is the tax amount (0.00 if there is none) and total is the amount due. Write plain numbers with two decimals and no symbols or thousands separators, for example 12500.00. Credit notes are negative.
8. Record the amounts as printed in the document's totals, even if they look wrong. If a document prints only the total and the tax, net is total minus tax.
9. If an email contains a corrected version of an invoice, use the corrected figures.
10. flag is OK or CHECK. Use CHECK if one or more of these apply, and put the codes in reason, separated by semicolons, in alphabetical order:
    - MATH: the line amounts do not add up to the printed subtotal (or to the total, where prices include tax), or net plus vat does not equal total. Do not check the tax percentage itself.
    - DUPLICATE: the same invoice has been sent to us in more than one file. Flag every copy. A statement that only lists an invoice number does not count.
    - NO_PO: the document has no purchase order number.
    - DATES: the due date is earlier than the invoice date.
    Leave reason empty when flag is OK.

Work only inside this folder. Do not look outside it.

Create invoices.csv and stop. Do not ask me any questions.