fix(txid): normalize bank tx ids to fit Dolibarr's num_payment varchar(50)
Qonto transaction ids run ~67 chars (<org>-<n>-<n>-transaction-<uuid>) but Dolibarr stores num_payment in varchar(50) (llx_paiement.num_paiement, llx_paiementfourn.num_paiement) — POSTing a payment with the raw id fails HTTP 400 "value too long for type character varying(50)". Parade proven live on the sandbox (2026-07-11): store the UUID suffix (globally unique, ~37 chars). Wise ids (short numerics) are unaffected. Writer side — payment-record.sh strips everything through "transaction-" before POST, announces the normalization on stderr, REFUSES (never truncates) ids still >50 chars after normalization, and emits the normalized num in the output JSON. Reader side — bank-match.sh PASS 0 (exact tx-id, erp#28) now compares BOTH sides in raw AND canonical short form: Qonto feed ids are carried long+short, payment nums are normalized on compare — so nums stored short (the varchar(50) form) and historical long-form nums both keep matching. Wise ids untouched. Proven offline (no credentials, no network, no sandbox/prod writes): - arcodange-bank-reco/tests/run-tests.sh — new bank-match --fixtures offline mode: long feed id ↔ short num, long ↔ long (back-compat), Wise numeric, each Δ+19d outside the ±7d window so only PASS 0 can pair them (exit 0, 3×[tx-id]); plus the empty-num negative (exit 1, 0 matched). - dolibarr-sandbox-write/tests/run-tests.sh — payment-record via a stubbed dol-write.sh (DOL_WRITE hook): long→short in POST body + output JSON, Wise untouched, >50-after-normalization refused BEFORE any POST, citing varchar(50). Both SKILL.md document the canonical short form + the varchar(50) constraint. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
[
|
||||
{ "id": 1, "ref": "QON1", "label": "Qonto principal", "country_code": "FR" }
|
||||
]
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1,3 @@
|
||||
[
|
||||
{ "id": 201, "ref": "FS-OVH-2606", "fk_account": 1, "socid": 12 }
|
||||
]
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
[
|
||||
{
|
||||
"date": "2026-06-20 12:00:00",
|
||||
"amount": "96.00",
|
||||
"num": "",
|
||||
"fk_bank_line": "556"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"transactions": [
|
||||
{
|
||||
"id": "arcodange-1246-1-transaction-019f14c5-e254-7ac9-9e9f-307ed9-d55f44",
|
||||
"settled_at": "2026-06-01T09:00:00Z",
|
||||
"amount": "96.0",
|
||||
"side": "debit",
|
||||
"label": "OVH SAS",
|
||||
"operation_type": "transfer"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "activities": [] }
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
[
|
||||
{ "id": 1, "ref": "QON1", "label": "Qonto principal", "country_code": "FR" },
|
||||
{ "id": 2, "ref": "WIS1", "label": "Wise EUR", "country_code": "BE" }
|
||||
]
|
||||
@@ -0,0 +1,3 @@
|
||||
[
|
||||
{ "id": 101, "ref": "FAC003-CL0001003", "fk_account": 2, "socid": 7 }
|
||||
]
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
[
|
||||
{
|
||||
"date": "2026-06-24 12:00:00",
|
||||
"amount": "2147.00",
|
||||
"num": "2159468139",
|
||||
"fk_bank_line": "555"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,4 @@
|
||||
[
|
||||
{ "id": 201, "ref": "FS-OVH-2606", "fk_account": 1, "socid": 12 },
|
||||
{ "id": 202, "ref": "FS-SCW-2606", "fk_account": 1, "socid": 13 }
|
||||
]
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
[
|
||||
{
|
||||
"date": "2026-06-20 12:00:00",
|
||||
"amount": "96.00",
|
||||
"num": "019f14c5-e254-7ac9-9e9f-307ed9-d55f44",
|
||||
"fk_bank_line": "556"
|
||||
}
|
||||
]
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
[
|
||||
{
|
||||
"date": "2026-06-22 12:00:00",
|
||||
"amount": "42.50",
|
||||
"num": "arcodange-1246-1-transaction-019f22aa-4b31-7c02-8d5e-11aa22-bb33cc",
|
||||
"fk_bank_line": "557"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"transactions": [
|
||||
{
|
||||
"id": "arcodange-1246-1-transaction-019f14c5-e254-7ac9-9e9f-307ed9-d55f44",
|
||||
"settled_at": "2026-06-01T09:00:00Z",
|
||||
"amount": "96.0",
|
||||
"side": "debit",
|
||||
"label": "OVH SAS",
|
||||
"operation_type": "transfer"
|
||||
},
|
||||
{
|
||||
"id": "arcodange-1246-1-transaction-019f22aa-4b31-7c02-8d5e-11aa22-bb33cc",
|
||||
"settled_at": "2026-06-03T09:00:00Z",
|
||||
"amount": "42.5",
|
||||
"side": "debit",
|
||||
"label": "SCALEWAY",
|
||||
"operation_type": "card"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"activities": [
|
||||
{
|
||||
"id": "act-9f0e77aa",
|
||||
"type": "TRANSFER",
|
||||
"createdOn": "2026-06-05T10:00:00Z",
|
||||
"primaryAmount": "<positive>+ 2,147.00 EUR</positive>",
|
||||
"title": "Kissmetrics Holdings Inc",
|
||||
"resource": { "type": "TRANSFER", "id": 2159468139 }
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user