From 3264c135453f16896baa9c4a15cd5051ad894553 Mon Sep 17 00:00:00 2001 From: Helkyd Date: Wed, 22 Nov 2017 16:06:22 +0100 Subject: [PATCH] No ZERO payment If no payment mode selected does not process ... to avoid having SI with payment pending as POS for sure was paid.. --- erpnext/public/js/payment/payments.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/payment/payments.js b/erpnext/public/js/payment/payments.js index 77209e093a..554566ad95 100644 --- a/erpnext/public/js/payment/payments.js +++ b/erpnext/public/js/payment/payments.js @@ -27,9 +27,14 @@ erpnext.payments = erpnext.stock.StockController.extend({ var me = this; this.dialog.set_primary_action(__("Submit"), function() { - me.dialog.hide() - me.submit_invoice() - }) + //Allow no ZERO payment + $.each(me.frm.doc.payments, function (index, data) { + if (data.amount != 0) { + me.dialog.hide(); + me.submit_invoice(); + return; + } + }); }) }, make_keyboard: function(){