fix: allow over-payment against SO (#35079)

This commit is contained in:
Raffael Meyer 2023-05-14 05:29:58 +02:00 committed by GitHub
parent 19cd687784
commit 870b02b03c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -264,7 +264,7 @@ erpnext.selling.SalesOrderController = class SalesOrderController extends erpnex
} }
} }
// payment request // payment request
if(flt(doc.per_billed)<100) { if(flt(doc.per_billed, precision('per_billed', doc)) < 100 + frappe.boot.sysdefaults.over_billing_allowance) {
this.frm.add_custom_button(__('Payment Request'), () => this.make_payment_request(), __('Create')); this.frm.add_custom_button(__('Payment Request'), () => this.make_payment_request(), __('Create'));
this.frm.add_custom_button(__('Payment'), () => this.make_payment_entry(), __('Create')); this.frm.add_custom_button(__('Payment'), () => this.make_payment_entry(), __('Create'));
} }

View File

@ -21,6 +21,10 @@ def boot_session(bootinfo):
bootinfo.sysdefaults.allow_stale = cint( bootinfo.sysdefaults.allow_stale = cint(
frappe.db.get_single_value("Accounts Settings", "allow_stale") frappe.db.get_single_value("Accounts Settings", "allow_stale")
) )
bootinfo.sysdefaults.over_billing_allowance = frappe.db.get_single_value(
"Accounts Settings", "over_billing_allowance"
)
bootinfo.sysdefaults.quotation_valid_till = cint( bootinfo.sysdefaults.quotation_valid_till = cint(
frappe.db.get_single_value("CRM Settings", "default_valid_till") frappe.db.get_single_value("CRM Settings", "default_valid_till")
) )