Skip to content

Commit

Permalink
fix: allow over-payment against SO (#35079)
Browse files Browse the repository at this point in the history
fix: allow over-payment against SO (#35079)

(cherry picked from commit 870b02b)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
  • Loading branch information
3 people committed May 20, 2023
1 parent f7ed4ec commit eb243c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/selling/doctype/sales_order/sales_order.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down
4 changes: 4 additions & 0 deletions erpnext/startup/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
Expand Down

0 comments on commit eb243c2

Please sign in to comment.