From a3e15bf68cf0ed0df94619c6d4c4d38d5ee23877 Mon Sep 17 00:00:00 2001 From: phyusin Date: Thu, 21 Dec 2017 18:04:27 +0630 Subject: [PATCH] check Add oth charges data --- .../origami/other_charges/index.html.erb | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/app/views/origami/other_charges/index.html.erb b/app/views/origami/other_charges/index.html.erb index 0317d120..627e7342 100755 --- a/app/views/origami/other_charges/index.html.erb +++ b/app/views/origami/other_charges/index.html.erb @@ -96,7 +96,8 @@
- + +
@@ -278,12 +279,19 @@ if ($("#is_taxable:checked").length > 0) { is_taxable = 1 } + $("#other-charges-amountErr").html(""); + if(charge_amount != ""){ + $("#other-charges-amount").val(""); + $("#reasons").val(""); + // Update sub total + $('#order-sub-total').text(parseFloat(sub_total) + parseFloat(charge_amount)); - // Update sub total - $('#order-sub-total').text(parseFloat(sub_total) + parseFloat(charge_amount)); - - var item_row = item_row_template(sale_id, charge_amount, reasons, is_taxable); - $("#order-items-table tbody").append(item_row); + var item_row = item_row_template(sale_id, charge_amount, reasons, is_taxable); + $("#order-items-table tbody").append(item_row); + } + else{ + $("#other-charges-amountErr").html("can't be blank"); + } }); // Calculate Other Charges for Payment @@ -361,4 +369,13 @@ return item_row; } + function isNumberKey(evt) { + var charCode = (evt.which) ? evt.which : event.keyCode; + if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { + return false; + } else { + return true; + } + } +