fix: post customer withholding as a Deduct tax row, not a deduction

With a deduction row ERPNext treats Paid Amount as cash received and
credits the party for paid + deduction, so a gross Paid Amount (what Get
Outstanding Invoices fills) over-credited Debtors and posted the gross
to the bank. Use the taxes table with add_deduct_tax=Deduct like
supplier TDS: Paid Amount is the gross settlement, bank receives paid
minus withholding, receivable is debited. Override Payment Entry
build_gl_map to flag the bank entry post_net_value so the merged bank
line shows the net amount.
This commit is contained in:
2026-09-13 07:45:11 +00:00
parent abeb2af0c8
commit 6a082edc56
3 changed files with 75 additions and 39 deletions
+1
View File
@@ -145,6 +145,7 @@ fixtures = [
override_doctype_class = {
"Sales Invoice": "default_thai_company.tax_withholding.ThaiSalesInvoice",
"Payment Entry": "default_thai_company.tax_withholding.ThaiPaymentEntry",
}
# Document Events