[fix] Show debit note button in purchase invoice

This commit is contained in:
Nabin Hait 2016-02-26 16:26:20 +05:30
parent 8f810c55d2
commit bdf0f0a08d

View File

@ -28,7 +28,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
this.frm.add_custom_button(__('Payment'), this.make_bank_entry, __("Make")); this.frm.add_custom_button(__('Payment'), this.make_bank_entry, __("Make"));
cur_frm.page.set_inner_btn_group_as_primary(__("Make")); cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
} }
if(Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) { if(doc.outstanding_amount >= 0 || Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) {
cur_frm.add_custom_button(__('Debit Note'), this.make_debit_note, __("Make")); cur_frm.add_custom_button(__('Debit Note'), this.make_debit_note, __("Make"));
} }
} }