[fix] Show credit note button in sales invoice

This commit is contained in:
Nabin Hait 2016-02-26 13:01:22 +05:30
parent 36c0faa744
commit 0f6eac3b35

View File

@ -57,7 +57,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
return item.is_delivered_by_supplier ? true : false; return item.is_delivered_by_supplier ? true : false;
}) })
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(doc.update_stock ? __('Sales Return') : __('Credit Note'), cur_frm.add_custom_button(doc.update_stock ? __('Sales Return') : __('Credit Note'),
this.make_sales_return, __("Make")); this.make_sales_return, __("Make"));
cur_frm.page.set_inner_btn_group_as_primary(__("Make")); cur_frm.page.set_inner_btn_group_as_primary(__("Make"));