feat: apply customer withholding automatically on new receipts

Tick Apply Tax Withholding Amount on unsaved customer receipts whose
references include a Sales Invoice carrying withholding: in the
get_payment_entry override (Create > Payment), in the
allocate_amount_to_references doc method (Get Outstanding Invoices /
Paid Amount changes, so the tax row updates live) and on first save.
Saved entries keep the user's choice; unticking now removes the row.
Client script recomputes the row when the checkbox or category changes.
This commit is contained in:
2026-09-13 07:56:21 +00:00
parent 6a082edc56
commit 9b99be9abd
4 changed files with 120 additions and 14 deletions
+5 -5
View File
@@ -196,11 +196,11 @@ doc_events = {
# Overriding Methods
# ------------------------------
#
# override_whitelisted_methods = {
# "frappe.desk.doctype.event.event.get_events": "default_thai_company.event.get_events"
# }
#
override_whitelisted_methods = {
"erpnext.accounts.doctype.payment_entry.payment_entry.get_payment_entry": "default_thai_company.tax_withholding.get_payment_entry",
}
# each overriding function accepts a `data` argument;
# generated from the base implementation of the doctype dashboard,
# along with any modifications made in other Frappe apps