feat(skills,cli): sandbox avoir (credit note) + arcodange sandbox CLI group #22

Merged
arcodange merged 1 commits from claude/dolibarr-sandbox-write-cli into main 2026-06-29 21:05:26 +02:00
Owner

Builds on the V9 write skill (erp#21).

  • creditnote-create.sh — create a customer avoir (credit note): a customer invoice type=2 referencing source_invoice (fk_facture_source); amounts come out negative, validates to an AVC… ref. (The user asked for avoirs "si c'est facile" — it was: one type flag + the source ref.)
  • bin/arcodange sandbox — new command group wiring all the write scripts:
    arcodange sandbox thirdparty   # client/supplier fiche
    arcodange sandbox invoice      # customer/supplier invoice + product/service lines
    arcodange sandbox payment      # règlement
    arcodange sandbox creditnote   # avoir
    arcodange sandbox write …      # raw host-guarded write
    
    (JSON on stdin). Header/usage updated: the CLI is now "read-only on prod; host-guarded sandbox writes".

Verified live (incl. the lines, per your ask)

Read straight back from the sandbox — the product/service lines land exactly:

FAC004-CL0003001  Conseil qty2 pu500 tva20% [service] → HT 1000 ; Licence qty1 pu100 tva20% [product] → HT 100  (HT 1100/TTC 1320)

And the full CLI chain: thirdparty → invoice (FAC004-CL0004001) → avoir (AVC002-CL0004001, TTC −240, fk_facture_source=21), host-guard intact.

Follow-ups: supplier avoirs, banque lire for account listing, the human-gated promote-to-prod replay.

🤖 Generated with Claude Code

Builds on the V9 write skill (erp#21). - **`creditnote-create.sh`** — create a customer **avoir** (credit note): a customer invoice `type=2` referencing `source_invoice` (`fk_facture_source`); amounts come out negative, validates to an `AVC…` ref. (The user asked for avoirs "si c'est facile" — it was: one `type` flag + the source ref.) - **`bin/arcodange sandbox`** — new command group wiring all the write scripts: ``` arcodange sandbox thirdparty # client/supplier fiche arcodange sandbox invoice # customer/supplier invoice + product/service lines arcodange sandbox payment # règlement arcodange sandbox creditnote # avoir arcodange sandbox write … # raw host-guarded write ``` (JSON on stdin). Header/usage updated: the CLI is now "read-only on prod; host-guarded sandbox writes". ### Verified live (incl. the lines, per your ask) Read straight back from the sandbox — the **product/service lines** land exactly: ``` FAC004-CL0003001 Conseil qty2 pu500 tva20% [service] → HT 1000 ; Licence qty1 pu100 tva20% [product] → HT 100 (HT 1100/TTC 1320) ``` And the full CLI chain: `thirdparty → invoice (FAC004-CL0004001) → avoir (AVC002-CL0004001, TTC −240, fk_facture_source=21)`, host-guard intact. Follow-ups: supplier avoirs, `banque lire` for account listing, the human-gated promote-to-prod replay. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
arcodange added 1 commit 2026-06-29 21:05:11 +02:00
- dolibarr-sandbox-write/scripts/creditnote-create.sh: create a customer avoir
  (credit note) — a customer invoice type=2 referencing source_invoice
  (fk_facture_source); amounts negative, validates to an AVC… ref. Proven live.
- bin/arcodange: new `sandbox` command group wiring the write scripts —
  `arcodange sandbox {thirdparty|invoice|payment|creditnote|write}` (JSON on
  stdin). Header + usage updated to note the CLI now does host-guarded sandbox
  writes (still read-only on prod).
- SKILL.md: avoir workflow + CLI notes.

Verified end-to-end through the CLI: thirdparty -> invoice (FAC…) -> avoir
(AVC…, total_ttc -240, fk_facture_source set); host-guard intact via the CLI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
arcodange merged commit e4c67c0108 into main 2026-06-29 21:05:26 +02:00
arcodange deleted branch claude/dolibarr-sandbox-write-cli 2026-06-29 21:05:27 +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#22