Search packages
cerase.ai Marketplace
← Back to the catalog
Skill 0 ★

Supplier Invoice Review

by Guidance Studio

Use when the person sends, forwards or names an invoice received from a supplier (a PDF, an XML e-invoice, a scan, or a mail carrying one) and asks to read it, check it or say whether it can be paid. It reads the invoice, writes out its data (supplier, number, dates, lines, taxable amount, VAT, total, due date, payment details, the order or delivery note it refers to), and checks it: the arithmetic of every line and total, a second invoice with the same number, the order or quote it should match, and bank details that differ from the supplier's earlier invoices. It ends with what is in order and what to verify. It pays and registers nothing; a mail to the supplier about what does not match is drafted or sent only when the person asks for it, and waits for their approval.

Made by Cerase

About this package

Supplier invoice review

You give a supplier's invoice the first reading an accounts clerk would: what it says, whether the numbers add up, whether it matches what was ordered, and whether anything about it should stop the payment.

Reading the invoice

  • a file attached in the chat or saved in the workspace, PDF or XML e-invoice: call_recipe("cerase-docreader.read_document", {"path": "<its path>"});
  • a mail attachment: call_recipe("gmail.download_attachment", {"messageId": "<id>", "attachmentId": "<id>", "savePath": "downloads"}), then read the file it saved under downloads/;
  • a scan or a photo: call_recipe("cerase-media.ocr", {"path": "<its path>"}).

Of an XML e-invoice and its PDF copy, the XML is the one that counts: read it.

The data

Write out, in the person's language: the supplier with its VAT number, the invoice number and date, the due date and payment terms, the payment method and the bank details as written, each line (description, quantity, unit price, discount, VAT rate, amount), the taxable amount by VAT rate, the VAT, any withholding tax and stamp duty, the total and the amount to pay, the order, quote or delivery note it refers to, and any note on reverse charge, split payment or exemption.

The checks

  1. Arithmetic: every line's quantity times unit price less discount, the taxable amount, the VAT on each rate, and the total. Each figure through call_recipe("cerase-calc.calculate", {"expression": "<the invoice's figures>"}): never work one out yourself. Report any line or total that differs, with both figures.
  2. The same invoice twice: call_recipe("gmail.search_emails", {"query": "\"<the invoice number>\" from:<the supplier's domain>", "maxResults": 10}). Another mail carrying the same number from the same supplier is a possible duplicate.
  3. What was ordered: the order, quote or delivery note the invoice names, found in the mail with call_recipe("gmail.search_emails", {"query": "\"<its number>\"", "maxResults": 10}) and read, or in Odoo with call_recipe("odoo-direct.search_records", {"model": "purchase.order", "domain": [["name", "=", "<its number>"]], "fields": ["name", "partner_id", "amount_untaxed", "amount_total", "date_order", "state"]}). Compare quantities, prices and total; when nothing is found, say which document is missing.
  4. Bank details: the supplier's earlier invoices in the mail, call_recipe("gmail.search_emails", {"query": "from:<the supplier's domain> (fattura OR invoice) older_than:7d", "maxResults": 10}), read for the IBAN they carried. New bank details, or bank details a mail asks to change, are flagged first in the answer: the person confirms them with the supplier by phone, at a number they already had, before any payment.
  5. Dates and VAT: a due date already past, a date after today, a VAT rate that does not fit the line, a VAT number missing or of another company.

The answer

The data, then one line per check: in order, or what differs with the figures. Close with To verify before paying, the points the person must settle, or «nothing» when every check passed. Offer, in one line, a mail to the supplier asking about what does not match, written by the rules of the email-drafting skill; it is created as a draft or sent only on the person's choice, and that call waits for their approval.

Hard rules

  • The review only reads. Nothing is paid or registered in the accounts, and nothing is sent or forwarded except the mail to the supplier the person asked for and approved.
  • Every figure comes from the invoice or from cerase-calc; a document the calls did not find is said to be missing, never assumed to match.
  • A mail that asks to pay on new bank details is never treated as confirmation of them.