feat(skills,cli): supplier avoirs + banque lire (bank-account discovery)

The two V9 follow-ups, both proven live on the sandbox.

- creditnote-create.sh: `kind:"supplier"` makes an avoir fournisseur on
  /supplierinvoices (type=2 + fk_facture_source, carries ref_supplier); default
  customer path unchanged. Proven: customer AVC002 (-240) + supplier AVF2026001
  (-144, ref_supplier carried, linked to source, validated).
- bank-accounts.sh + `arcodange sandbox accounts`: list bank accounts (id/label/
  bank) so a payment can pick its account_id. Needs `banque lire` (rights 111),
  now added to the provisioner's WRITE_IDS so fresh runs include it; the existing
  ai_agent_sandbox user was granted it live. GET /bankaccounts now returns the 3
  accounts (QONTO, WISE EURO, Compte Courant Asso).
- SKILL.md: supplier-avoir example + accounts helper + updated banque-lire note.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-30 00:07:48 +02:00
parent 09a2cbab0a
commit 64d2cb4237
5 changed files with 52 additions and 17 deletions

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# List the sandbox bank accounts (id + label) so a payment can pick its account_id.
# Read-only; needs the ai_agent_sandbox user to hold `banque lire` (rights id 111).
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
W="${DOL_WRITE:-${SCRIPT_DIR}/dol-write.sh}"
"${W}" GET "/bankaccounts" | python3 -c "import json,sys
d = json.load(sys.stdin); rows = d if isinstance(d, list) else []
if not rows:
print('(no bank accounts defined)'); sys.exit(0)
print('%-4s %-34s %-10s %s' % ('id', 'label', 'bank', 'currency'))
for a in rows:
print('%-4s %-34s %-10s %s' % (a.get('id'), (a.get('label') or '')[:34],
a.get('bank') or '', a.get('currency_code') or ''))"