V4 bundle — two more sibling skills, both read-only, both depending on the dolibarr base skill. dolibarr-thirdparty-completeness: - audit-thirdparty.sh <socid>: country-aware completeness audit for any thirdparty (FR: SIREN + SIRET + tva_intra; EU non-FR: tva_intra; extra-EU: national tax id). Generalizes the V1 KM-hardcoded script. - audit-all-thirdparties.sh: loops over /thirdparties and surfaces a compact table of gaps. --clients-only / --suppliers-only flags. - Live baseline finds 5/10 thirdparties with mandatory gaps: KissMetrics (US tax id), Wise Europe SA (BE tva_intra), Medialex (FR SIRET + tva_intra), Qonto (SIRET), Infogreffe (SIRET). dolibarr-tva-deductible: - deductible-by-month.sh: TVA déductible aggregated per period × rate. - deductible-line-detail.sh: per supplier-invoice line with country- based CA3 bucket assignment (ligne 20 for 20 % FR, ligne 19 for reduced rates, ligne 17+24 for intra-UE autoliquidation). - Live baseline: 223.22 € total TVA déductible across 13 lines. Wise Europe SA correctly identified as intra-UE autoliquidation; La Poste correctly identified as FR exempt (timbres). - Mirrors dolibarr-tva-reconciliation on the supplier side. Together they give the two numbers a CA3 monthly declaration needs. Also extends dolibarr/SKILL.md endpoint catalogue with /supplierinvoices (noting the 403 on the /lines sub-endpoint — inline lines on the detail endpoint make this a non-issue). dolibarr/README.md gains two new permission checkboxes for Factures fournisseurs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6.4 KiB
dolibarr skill. SKIP for write/correction tasks (use the Dolibarr UI), for invoice-side mandatory mentions (handled by dolibarr-invoice-audit), and for TVA computation (handled by dolibarr-tva-reconciliation / dolibarr-tva-deductible).
requires:
bins: ["curl", "jq", "python3"]
auth: true
dolibarr-thirdparty-completeness — generalized thirdparty audit
Replaces the V1 KM-only dolibarr-invoice-audit/scripts/audit-km-thirdparty.sh with a generalized, country-aware audit that scales as Arcodange adds more clients and suppliers.
Depends on the dolibarr base skill.
The country-aware checklist
| Country | Mandatory | Optional but useful |
|---|---|---|
| FR | name, address, zip, town, country_code, SIREN (idprof1), SIRET (idprof2), tva_intra (if supplier or VAT-registered) | APE (idprof3), email, phone, url, IBAN |
| EU non-FR | name, address, zip, town, country_code, tva_intra (required for B2B autoliquidation under article 196 directive TVA) | national registration id (idprof1), email, phone, url |
| Extra-EU | name, address, zip, town, country_code, national tax id (idprof1 — EIN for US, equivalent elsewhere) | idprof2, email, phone, url |
The rules mirror the field a French accountant would expect to file on monthly TVA declarations and on the customer file as audit evidence.
Workflow 1 — Audit one thirdparty
./scripts/audit-thirdparty.sh 1 # KissMetrics (US, client)
./scripts/audit-thirdparty.sh 2 # Wise Europe SA (BE, supplier)
./scripts/audit-thirdparty.sh 5 # Medialex (FR, supplier)
echo "exit: $?" # 0 = complete, 1 = mandatory gap
Live output for the FR-supplier case (captured at examples/audit-thirdparty-5.txt):
================================================================================
Thirdparty 5 — Medialex [supplier, country=FR]
================================================================================
[OK] name = 'Medialex'
[OK] address = '10 rue du Breil'
[OK] zip = '35063'
[OK] town = 'Rennes'
[OK] country_code = 'FR'
[OK] idprof1 (SIREN) = '353403074'
[XX] idprof2 (SIRET) = ''
[OK] idprof3 (APE) = '7312Z' (optional)
[XX] tva_intra (VAT) = ''
...
8 pass, 2 mandatory fail(s), 2 optional unset
Status codes:
[OK]— value present.[XX]— mandatory and missing.[--]— optional and unset.
Workflow 2 — Audit all visible thirdparties
./scripts/audit-all-thirdparties.sh # everyone
./scripts/audit-all-thirdparties.sh --clients-only
./scripts/audit-all-thirdparties.sh --suppliers-only
echo "exit: $?" # 0 if dataset is fully compliant
Live output (captured at examples/audit-all-thirdparties.txt) — 5 / 10 thirdparties have mandatory gaps:
id name cnty role missing
--------------------------------------------------------------------------------------------------------------
1 KissMetrics US client tax_id
2 Wise Europe SA BE supplier tva_intra
3 Greffe du tribunal de commerce Évry FR supplier (complete)
4 YOLAW FR supplier (complete)
5 Medialex FR supplier SIRET, tva_intra
6 Qonto FR supplier SIRET
7 OVH FR supplier (complete)
8 La Poste FR supplier (complete)
9 Infogreffe FR supplier SIRET
10 Darnis Operations FR supplier (complete)
--------------------------------------------------------------------------------------------------------------
# 10 thirdparties audited, 5 with mandatory gaps
The 5 gaps to surface to the cohort review / accountant:
- KissMetrics: US tax id (EIN) — already known from V1, still pending.
- Wise Europe SA: BE tva_intra missing (mandatory for intra-UE B2B autoliquidation; currently the FAF2026001 supplier invoice is recorded with TVA=0 but no tva_intra, which the accountant will flag).
- Medialex: SIRET + tva_intra. SIREN is present so the SIRET should be derivable (SIRET = SIREN + 5-digit NIC). The tva_intra is FR + 2 chars + SIREN.
- Qonto, Infogreffe: SIRET missing on otherwise-complete records.
Fixing these is a Dolibarr UI task — this skill is read-only.
Relationship with V1
The V1 dolibarr-invoice-audit/scripts/audit-km-thirdparty.sh is kept for backward compatibility but is now a special case of this skill. Recommendation: invoke ./scripts/audit-thirdparty.sh 1 from this skill instead of the V1 script for any new automation.
Out of scope
- Writes / corrections. The API key is read-only. Fix via the Dolibarr UI.
- VAT-number validation against the EU VIES service. Future enhancement:
tva_intracould be looked up againsthttps://ec.europa.eu/taxation_customs/vies/services/checkVatServiceto validate the number. Out of scope here (external API). - idprof normalization across forks of Dolibarr. The idprof1..6 slots can be reordered or relabeled by Dolibarr admins. This skill assumes the stock French Dolibarr mapping (idprof1=SIREN, idprof2=SIRET, idprof3=APE).