← ClaudeAtlas

pennylane-supplier-invoiceslisted

Collect supplier invoices from mailboxes, obtain the PDF (attachment, link or portal), identify which legal entity is billed, import them into Pennylane via the API, then file the processed mail. Use when the user says "pull the invoices", "get the invoices from my mail", "import these invoices into Pennylane", or talks about purchase invoices to enter. Load the pennylane-access skill first.
Xileades/pennylane-api-toolkit · ★ 0 · Data & Documents · score 70
Install: claude install-skill Xileades/pennylane-api-toolkit
# Supplier invoices: mail → Pennylane **Prerequisite: `pennylane-access`** (loading, companies, tokens, amounts, VAT). Scopes: `supplier_invoices:all`, `suppliers:all`, `file_attachments:all`. **Guiding rule: automatic when it is certain, ask when it is not.** Never import an invoice whose entity, supplier or amounts are uncertain without validation. ## Step 0 — Shared journal and lock ```powershell PLJournalLock # refuses if someone else is running a batch $journal = PLJournalRead ``` The journal is **common to the team**, so an invoice already handled by someone else does not go in twice. A refused lock means **wait** — do not force it without confirming the other session is dead. `PLJournalRelease` at the end of the run, on success and on failure. Period to process: since `$journal.lastProcessed`, else the last 30 days. ## Step 1 — Find the invoice mails Search the relevant mailboxes for: invoice, receipt, bill, subscription, statement — bounded by date, and paginate. Discard: mere mentions of invoices, sales issued *by* the entities, order confirmations. Keep invoices, receipts and credit notes. Deduplicate on the internet message-id **and** against the journal: ```powershell PLSeen $journal $party $number $date $amount ``` ## Step 2 — Obtain the PDF - **PDF attachment** → the simple case. - **Link** → check domain coherence first (anti-phishing). A direct PDF can be fetched; a portal behind a login means browser automation, or asking for th