Controllo delle fatture fornitori
di Guidance Studio
Usa quando la persona manda, inoltra o nomina una fattura ricevuta da un fornitore (un PDF, una fattura elettronica XML, una scansione, o una mail che ne porta una) e chiede di leggerla, controllarla o dire se si può pagare. Legge la fattura, ne riporta i dati (fornitore, numero, date, righe, imponibile, IVA, totale, scadenza, dati di pagamento, l'ordine o il documento di trasporto a cui si riferisce) e la controlla: i conti di ogni riga e dei totali, una seconda fattura con lo stesso numero, l'ordine o il preventivo a cui deve corrispondere, e dati bancari diversi da quelli delle fatture precedenti dello stesso fornitore. Chiude con cosa è in ordine e cosa verificare. Non paga e non registra nulla; una mail al fornitore su ciò che non torna viene preparata o inviata solo quando la persona la chiede, e aspetta la sua approvazione.
Informazioni sul pacchetto
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 underdownloads/; - 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
- 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. - 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. - 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 withcall_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. - 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. - 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.