add dolibarr-thirdparty-completeness and dolibarr-tva-deductible

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>
This commit is contained in:
2026-05-29 06:14:28 +02:00
parent fe9e8274f1
commit 585b7beb03
18 changed files with 5736 additions and 0 deletions

View File

@@ -0,0 +1,257 @@
{
"module": null,
"id": "1",
"entity": "1",
"import_key": null,
"array_options": [],
"array_languages": null,
"contacts_ids": null,
"contacts_ids_internal": null,
"linkedObjectsIds": [],
"canvas": null,
"fk_project": null,
"contact_id": null,
"user": null,
"origin_type": null,
"origin_id": null,
"ref": "FAF2026001",
"ref_ext": "",
"statut": "2",
"status": "2",
"country_id": null,
"country_code": null,
"state_id": null,
"region_id": null,
"mode_reglement_id": "2",
"cond_reglement_id": null,
"demand_reason_id": null,
"transport_mode_id": null,
"shipping_method_id": null,
"shipping_method": null,
"fk_multicurrency": "0",
"multicurrency_code": "EUR",
"multicurrency_tx": "1.00000000",
"multicurrency_total_ht": "50.00000000",
"multicurrency_total_tva": "0.00000000",
"multicurrency_total_localtax1": null,
"multicurrency_total_localtax2": null,
"multicurrency_total_ttc": "50.00000000",
"last_main_doc": null,
"fk_account": "1",
"note_public": "",
"note_private": "",
"total_ht": "50.00000000",
"total_tva": "0.00000000",
"total_localtax1": "0.00000000",
"total_localtax2": "0.00000000",
"total_ttc": "50.00000000",
"lines": [
{
"module": null,
"id": "1",
"entity": null,
"import_key": null,
"array_options": [],
"array_languages": null,
"contacts_ids": null,
"contacts_ids_internal": null,
"linkedObjectsIds": null,
"canvas": null,
"origin_type": null,
"origin_id": null,
"ref": null,
"ref_ext": null,
"statut": null,
"status": null,
"state_id": null,
"region_id": null,
"demand_reason_id": null,
"transport_mode_id": null,
"shipping_method": null,
"multicurrency_tx": null,
"multicurrency_total_ht": "50.00000000",
"multicurrency_total_tva": "0.00000000",
"multicurrency_total_localtax1": null,
"multicurrency_total_localtax2": null,
"multicurrency_total_ttc": "50.00000000",
"last_main_doc": null,
"fk_account": null,
"total_ht": "50.00000000",
"total_tva": "0.00000000",
"total_localtax1": "0.00000000",
"total_localtax2": "0.00000000",
"total_ttc": "50.00000000",
"lines": null,
"actiontypecode": null,
"civility_code": null,
"date_creation": null,
"date_validation": null,
"date_modification": null,
"tms": null,
"date_cloture": null,
"user_author": null,
"user_creation": null,
"user_creation_id": null,
"user_valid": null,
"user_validation": null,
"user_validation_id": null,
"user_closing_id": null,
"user_modification": null,
"user_modification_id": null,
"fk_user_creat": null,
"fk_user_modif": null,
"specimen": 0,
"totalpaid": null,
"extraparams": [],
"product": null,
"cond_reglement_supplier_id": null,
"deposit_percent": null,
"retained_warranty_fk_cond_reglement": null,
"warehouse_id": null,
"parent_element": "facture_fourn",
"fk_parent_attribute": "fk_facture_fourn",
"fk_unit": null,
"date_debut_prevue": null,
"date_debut_reel": null,
"date_fin_prevue": null,
"date_fin_reel": null,
"weight": null,
"weight_units": null,
"length": null,
"length_units": null,
"width": null,
"width_units": null,
"height": null,
"height_units": null,
"surface": null,
"surface_units": null,
"volume": null,
"volume_units": null,
"multilangs": null,
"product_type": "1",
"fk_product": null,
"desc": "Ouverture compte -&nbsp;<em>Exon&eacute;ration de TVA &ndash; Article 261 C du CGI</em>",
"description": "Ouverture compte -&nbsp;<em>Exon&eacute;ration de TVA &ndash; Article 261 C du CGI</em>",
"product_ref": null,
"product_label": null,
"product_barcode": null,
"product_desc": null,
"fk_product_type": null,
"qty": "1",
"duree": null,
"remise_percent": "0",
"info_bits": "0",
"special_code": "0",
"subprice": "50.00000000",
"subprice_ttc": null,
"tva_tx": "0.0000",
"multicurrency_subprice": "50.00000000",
"multicurrency_subprice_ttc": null,
"ref_supplier": "",
"pu_ht": "50.00000000",
"pu_ttc": "50.00000000",
"fk_facture_fourn": "1",
"label": null,
"date_start": "",
"date_end": "",
"fk_code_ventilation": null,
"situation_percent": null,
"fk_prev_id": null,
"vat_src_code": "",
"localtax1_tx": "0.0000",
"localtax2_tx": "0.0000",
"pa_ht": null,
"fk_remise_except": null,
"fk_parent_line": null,
"rang": "1",
"localtax1_type": "0",
"localtax2_type": "0",
"libelle": null,
"fk_accounting_account": "9"
}
],
"actiontypecode": null,
"name": null,
"lastname": null,
"firstname": null,
"civility_id": null,
"civility_code": null,
"date_creation": null,
"date_validation": null,
"date_modification": null,
"tms": 1771929935,
"date_cloture": null,
"user_author": null,
"user_creation": null,
"user_creation_id": "2",
"user_valid": null,
"user_validation": null,
"user_validation_id": "2",
"user_closing_id": null,
"user_modification": null,
"user_modification_id": null,
"fk_user_creat": null,
"fk_user_modif": null,
"specimen": 0,
"totalpaid": null,
"extraparams": [],
"product": null,
"cond_reglement_supplier_id": null,
"deposit_percent": null,
"retained_warranty_fk_cond_reglement": null,
"warehouse_id": null,
"title": null,
"type": 0,
"subtype": 0,
"fk_soc": null,
"socid": "2",
"paye": "1",
"date": 1769382000,
"date_lim_reglement": null,
"cond_reglement_code": null,
"cond_reglement_label": null,
"cond_reglement_doc": null,
"mode_reglement_code": "VIR",
"revenuestamp": null,
"totaldeposits": null,
"totalcreditnotes": null,
"sumpayed": null,
"sumpayed_multicurrency": null,
"sumdeposit": null,
"sumdeposit_multicurrency": null,
"sumcreditnote": null,
"sumcreditnote_multicurrency": null,
"remaintopay": null,
"nbofopendirectdebitorcredittransfer": null,
"creditnote_ids": [],
"stripechargedone": null,
"stripechargeerror": null,
"description": null,
"ref_client": null,
"situation_cycle_ref": null,
"close_code": null,
"close_note": null,
"postactionmessages": null,
"fk_incoterms": "0",
"label_incoterms": null,
"location_incoterms": "",
"ref_supplier": "PLAN_ORDER_CHECKOUT-invoice-23917601",
"libelle": "",
"label": "",
"fk_statut": "2",
"paid": "1",
"datec": 1771931434,
"date_echeance": 1769382000,
"amount": 0,
"remise": 0,
"tva": null,
"localtax1": null,
"localtax2": null,
"propalid": null,
"vat_reverse_charge": 0,
"fournisseur": null,
"fk_facture_source": null,
"fac_rec": null,
"fk_fac_rec_source": null,
"fk_user_valid": null
}