-
+
+
@@ -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;
+ }
+ }
+