From eb243c2470b7a13291cddb12a8d42fbe5d83d37f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 20 May 2023 21:03:59 +0530 Subject: [PATCH] fix: allow over-payment against SO (#35079) fix: allow over-payment against SO (#35079) (cherry picked from commit 870b02b03cec923bedf1fa75ffdc488ca958ded7) Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> Co-authored-by: Deepesh Garg --- erpnext/selling/doctype/sales_order/sales_order.js | 2 +- erpnext/startup/boot.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index dd88b6c498fc..3d7c33401ac5 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -235,7 +235,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( } } // 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'), () => this.make_payment_entry(), __('Create')); } diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py index 9790d9954776..1949fa7e8fec 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -22,6 +22,10 @@ def boot_session(bootinfo): bootinfo.sysdefaults.allow_stale = cint( 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( frappe.db.get_single_value("Selling Settings", "default_valid_till") )