From 40d25f4010e632d20841f072ab0fd69c4473c3c8 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 26 Jun 2019 10:57:45 +0530 Subject: [PATCH] fix: Show close button if per_ordered is less than 99.999999 (#18067) --- erpnext/accounts/report/non_billed_report.py | 3 ++- erpnext/buying/doctype/purchase_order/purchase_order.js | 2 +- erpnext/selling/doctype/sales_order/sales_order.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/report/non_billed_report.py b/erpnext/accounts/report/non_billed_report.py index c238606443..a9e25bc25b 100644 --- a/erpnext/accounts/report/non_billed_report.py +++ b/erpnext/accounts/report/non_billed_report.py @@ -25,7 +25,8 @@ def get_ordered_to_be_billed_data(args): from `{parent_tab}`, `{child_tab}` where - `{parent_tab}`.name = `{child_tab}`.parent and `{parent_tab}`.docstatus = 1 and `{parent_tab}`.status != 'Closed' + `{parent_tab}`.name = `{child_tab}`.parent and `{parent_tab}`.docstatus = 1 + and `{parent_tab}`.status not in ('Closed', 'Completed') and `{child_tab}`.amount > 0 and round(`{child_tab}`.billed_amt * ifnull(`{parent_tab}`.conversion_rate, 1), {precision}) < `{child_tab}`.base_amount order by diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 1134b0479e..b2a2f01f44 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -107,7 +107,7 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( if(doc.docstatus == 1) { if(!in_list(["Closed", "Delivered"], doc.status)) { if (this.frm.has_perm("submit")) { - if(flt(doc.per_billed, 2) < 100 || doc.per_received < 100) { + if(flt(doc.per_billed, 6) < 100 || flt(doc.per_received, 6) < 100) { if (doc.status != "On Hold") { this.frm.add_custom_button(__('Hold'), () => this.hold_purchase_order(), __("Status")); } else{ diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 1ded58da24..38b7b566aa 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -34,7 +34,7 @@ frappe.ui.form.on("Sales Order", { }, refresh: function(frm) { if(frm.doc.docstatus === 1 && frm.doc.status !== 'Closed' - && flt(frm.doc.per_delivered) < 100 && flt(frm.doc.per_billed) < 100) { + && flt(frm.doc.per_delivered, 6) < 100 && flt(frm.doc.per_billed, 6) < 100) { frm.add_custom_button(__('Update Items'), () => { erpnext.utils.update_child_items({ frm: frm,