fix(erp): webhook templates and usage datetimes for the live ERPNext #49

Merged
sharang merged 3 commits from fix/erp-live-templates into main 2026-09-30 08:43:18 +00:00
3 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 fc7407ba42 test(erpsetup): drop unused result (ineffassign)
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 23m42s
ci / image (pull_request) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-30 10:18:52 +02:00
Sharang ParnerkarandClaude Opus 5.5 12a43c0c4c feat(erpsetup): GoBD invoice number range RE-JJJJ-NNNN
ci / shared (pull_request) Successful in 14s
ci / test (pull_request) Failing after 15m23s
ci / image (pull_request) Skipped
The GoBD Verfahrensdokumentation (§ 9) fixes the outgoing-invoice number
range at RE-JJJJ-NNNN, one range per calendar year for invoices and
returns. ERPNext shipped ACC-SINV-.YYYY.-. erpsetup now makes
RE-.YYYY.-.#### the only and the default Sales Invoice series (Property
Setters) and sets it back if it was changed; the dry run reports
"would update".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-30 09:53:18 +02:00
Sharang ParnerkarandClaude Opus 5.5 0ba5f38122 fix(erp): webhook templates and usage datetimes for the live ERPNext
ci / shared (pull_request) Successful in 15s
ci / test (pull_request) Failing after 14m49s
ci / image (pull_request) Skipped
Found in the first sales-order test on the live ERPNext (the staging mock
renders no Jinja and takes any date):
- Frappe renders webhook bodies with only {doc: <dict>, utils}: doc.items
  is the dict's items() method, so the sales-order webhook failed before
  it was sent; the overdue template used frappe.utils, which is not there.
  Now doc["items"] and utils.date_diff; checked by rendering all four
  on the live ERPNext against the submitted order.
- erpsetup updates an existing webhook whose body or condition differs
  (in place; dry run reports "would update").
- Usage Record occurred_at is sent as "YYYY-MM-DD HH:MM:SS" in
  Europe/Berlin; MariaDB refused RFC 3339, so usage records have not
  reached ERPNext since go-live (the outbox kept retrying).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-30 09:40:24 +02:00