Commit Graph

11 Commits

Author SHA1 Message Date
326adf865a fix(statements): restore Customer list button (merge listview_settings)
The list button was registered by reassigning
frappe.listview_settings['Customer'] in a globally-loaded script, but
ERPNext's own Customer list_js (loaded when the list opens) overwrote it,
so the button never appeared. Register it via doctype_list_js instead —
which Frappe appends after the doctype's own list_js — and merge into the
existing settings (wrapping onload, preserving ERPNext's add_fields)
rather than reassigning. The form button and shared ns_statements helpers
stay in customer_statements.js.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 20:36:21 -04:00
46967208e9 feat(statements): Customer-form button, consolidated UI, disable-fee toggle
Replace customer_list.js with customer_statements.js (loaded globally),
which adds the statement UI to both entry points:
- Customer list: 'Generate Statements' multi-select action.
- Customer form: 'Generate Statement' button for a single customer.

Both open a popup with a 'Generate late payment fee' checkbox (default on)
that maps to generate_statements(skip_late_fee), so fee billing can be
turned off per run. Shared generate/print helpers live on ns_statements.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 19:52:15 -04:00
acd7df1129 feat(statements): bill late fee as a collectible Sales Invoice
Charge a late-payment fee when statements are generated so the customer's
receivable reflects it (the gap ERPNext Dunning leaves — it never
increases AR). The fee is billed as a submitted Sales Invoice (item ->
Dunning Type income account, rate = computed fee) rather than a Journal
Entry, so the app's existing payment flow (Run Payment / AutoPay /
multi-invoice) charges and settles it automatically via its Sales Invoice
references — a bare JE would sit uncollected.

Fee schedule/amounts come from the existing Dunning Type settings (yearly
rate_of_interest + flat dunning_fee), interest computed with ERPNext's own
Dunning formula. The fee Item is configured via a new Late Fee Item custom
field on Dunning Type (created in an after_migrate hook; ns_app/setup.py).
Nothing is auto-seeded: generation stops with a clear error if no Dunning
Type is configured or its income account / fee item is unset.

Billing is idempotent per customer/company/month, and prior fee invoices
are excluded from the interest base (no fee-on-fee). The fee invoice shows
on the statement flagged 'late fee', folded into Total Due (which equals
the customer's balance and is fully collectible).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 19:35:04 -04:00
9e2e86cead feat(statements): add Customer list "Generate Statements" button
Register doctype_list_js for Customer and add customer_list.js, which
lists customers with overdue invoices in a selection dialog (checkbox
table + select-all), then calls generate_statements and opens the
printable, one-page-per-customer document in a new window.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 19:08:14 -04:00
Ty Reynolds
75600fdbeb Custom Quick entry version 1 done. Zip API done and Customer backend added. 2026-02-09 15:03:17 -05:00
Ty Reynolds
5b70cd43fa updated url in hooks. 2026-01-21 13:44:31 -05:00
Ty Reynolds
69f7b2fd72 Fixed the hooks for the print format. 2026-01-20 15:15:28 -05:00
Ty Reynolds
113aeda82f Add Quotation print format and updated the Invoice and Sales Order 2026-01-20 11:48:51 -05:00
Ty Reynolds
eee74501cd Invoice print format added. 2026-01-14 10:15:27 -05:00
Ty Reynolds
f871334fb4 Autopay api logic prototype. 2026-01-13 11:10:35 -05:00
Ty Reynolds
61bd56e6da Initial ERPNext custom app scaffold 2026-01-02 09:45:03 -05:00