fix: Due to decimal issue make purchase receipt button not showing from PO (#22629)

This commit is contained in:
rohitwaghchaure 2020-07-09 20:07:40 +05:30 committed by GitHub
parent d14666e419
commit 3a3787f9e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,14 +123,14 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
} }
if(doc.status != "Closed") { if(doc.status != "Closed") {
if (doc.status != "On Hold") { if (doc.status != "On Hold") {
if(flt(doc.per_received, 2) < 100 && allow_receipt) { if(flt(doc.per_received) < 100 && allow_receipt) {
cur_frm.add_custom_button(__('Receipt'), this.make_purchase_receipt, __('Create')); cur_frm.add_custom_button(__('Receipt'), this.make_purchase_receipt, __('Create'));
if(doc.is_subcontracted==="Yes" && me.has_unsupplied_items()) { if(doc.is_subcontracted==="Yes" && me.has_unsupplied_items()) {
cur_frm.add_custom_button(__('Material to Supplier'), cur_frm.add_custom_button(__('Material to Supplier'),
function() { me.make_stock_entry(); }, __("Transfer")); function() { me.make_stock_entry(); }, __("Transfer"));
} }
} }
if(flt(doc.per_billed, 2) < 100) if(flt(doc.per_billed) < 100)
cur_frm.add_custom_button(__('Invoice'), cur_frm.add_custom_button(__('Invoice'),
this.make_purchase_invoice, __('Create')); this.make_purchase_invoice, __('Create'));