feat(payment): return the bank transaction id on règlements (reconciliation link) #26

Merged
arcodange merged 1 commits from claude/dolibarr-payment-txn into main 2026-06-30 00:18:00 +02:00
Owner

Il faut l'id des transactions pour les règlements — voilà.

A payment only returned its paiement id, which is not what bank reconciliation keys on. payment-record.sh now emits {id, bank_transaction_id, num}:

  • bank_transaction_id = the Dolibarr bank line (llx_bank.fk_bank_line) the payment created, resolved via GET /{invoices|supplierinvoices}/{id}/payments (correlated by num, else the most recent line). Customer + supplier.
  • num stores the originating bank tx id (Qonto/Wise) and lands on that bank line's num_chq — so arcodange-bank-reco can match a règlement to a statement line by id instead of fuzzy amount/date. Both ends captured at write time.

Proven live

customer:  {"id":13,"bank_transaction_id":35,"num":"QONTO-TX-1234"}
supplier:  {"id":16,"bank_transaction_id":36,"num":"WISE-TX-5678"}
llx_bank:  35 → num_chq=QONTO-TX-1234   36 → num_chq=WISE-TX-5678   (rappro=0)

promote-apply still extracts .id unchanged (backward compatible).

Natural follow-up (not in this PR): teach bank-match to prefer an exact num_chq ↔ feed-tx-id match when present — now that the link exists, reconciliation can be exact.

🤖 Generated with Claude Code

Il faut l'id des transactions pour les règlements — voilà. A payment only returned its `paiement` id, which is **not** what bank reconciliation keys on. `payment-record.sh` now emits **`{id, bank_transaction_id, num}`**: - **`bank_transaction_id`** = the Dolibarr bank line (`llx_bank.fk_bank_line`) the payment created, resolved via `GET /{invoices|supplierinvoices}/{id}/payments` (correlated by `num`, else the most recent line). Customer + supplier. - **`num`** stores the originating bank tx id (Qonto/Wise) and lands on that bank line's `num_chq` — so `arcodange-bank-reco` can match a règlement to a statement line **by id** instead of fuzzy amount/date. Both ends captured at write time. ### Proven live ``` customer: {"id":13,"bank_transaction_id":35,"num":"QONTO-TX-1234"} supplier: {"id":16,"bank_transaction_id":36,"num":"WISE-TX-5678"} llx_bank: 35 → num_chq=QONTO-TX-1234 36 → num_chq=WISE-TX-5678 (rappro=0) ``` `promote-apply` still extracts `.id` unchanged (backward compatible). Natural follow-up (not in this PR): teach `bank-match` to prefer an exact `num_chq` ↔ feed-tx-id match when present — now that the link exists, reconciliation can be exact. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
arcodange added 1 commit 2026-06-30 00:17:55 +02:00
A payment only returned its paiement id, which isn't what bank reconciliation
keys on. payment-record.sh now emits {id, bank_transaction_id, num}:

- bank_transaction_id = the Dolibarr bank line (llx_bank.fk_bank_line) the payment
  created, resolved via GET /{invoices|supplierinvoices}/{id}/payments (correlated
  by num, else the most recent line). Works for customer and supplier.
- num stores the originating bank tx id (Qonto/Wise) and lands on that bank line's
  num_chq — so arcodange-bank-reco can match a règlement to a statement line by id
  instead of fuzzy amount/date. Both ends captured at write time.

Proven live: customer {id:13,bank_transaction_id:35,num:QONTO-TX-1234},
supplier {id:16,bank_transaction_id:36,num:WISE-TX-5678}; llx_bank rows 35/36
carry the refs in num_chq. promote-apply still extracts .id unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
arcodange merged commit d81bff0ed3 into main 2026-06-30 00:18:00 +02:00
arcodange deleted branch claude/dolibarr-payment-txn 2026-06-30 00:18:01 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: arcodange-org/erp#26