From 0cbad8c6751ca94c1f97808108dab1d9473813b5 Mon Sep 17 00:00:00 2001 From: nitesh Date: Tue, 24 Oct 2017 13:41:37 +0530 Subject: [PATCH 1/3] Solved tax rate bug in Invoice --- gkwebapp/static/js/addinvoice.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gkwebapp/static/js/addinvoice.js b/gkwebapp/static/js/addinvoice.js index 080c8ed2..0af88eb1 100644 --- a/gkwebapp/static/js/addinvoice.js +++ b/gkwebapp/static/js/addinvoice.js @@ -214,6 +214,7 @@ $(document).ready(function() { $(this).val(pad($(this).val(), 2)); }); $("#invoice_year").blur(function(event) { + $(this).val(yearpad($(this).val(), 4)); invoicedatestring = $("#invoice_date").val() + $("#invoice_month").val() + $("#invoice_year").val(); invoicedate = Date.parseExact(invoicedatestring, "ddMMyyyy"); if (invoicedatestring.length == 0) { @@ -270,7 +271,6 @@ $(document).ready(function() { $("#vathelp").show(); } } - $(this).val(yearpad($(this).val(), 4)); }); //Key Event for Invoice Date Field. @@ -1928,8 +1928,8 @@ if (event.which == 13) { var allow = 1; $("#invoice_save").click(function(event) { - event.stopPropagation(); - //event.preventDefault(); + event.preventDefault(); + event.stopPropagation(); var financialstart = Date.parseExact(sessionStorage.yyyymmddyear1, "yyyy-MM-dd"); if ($.trim($('#invoice_challanno').val()) == "") { $('html,body').animate({scrollTop: ($("#orgdata").offset().top)},'fast'); @@ -2031,7 +2031,6 @@ if (event.which == 13) { var productqtys = []; var quantity; var ppu; - if($("#consigneename").val() != ""){ consignee["consigneename"] = $.trim($("#consigneename").val()); consignee["tinconsignee"] = $.trim($("#tinconsignee").val()); @@ -2130,7 +2129,7 @@ if (event.which == 13) { let obj = {}; ppu = $.trim($("#invoice_product_table_vat tbody tr:eq(" + i + ") td:eq(3) input").val()); obj[ppu] = $.trim($("#invoice_product_table_vat tbody tr:eq(" + i + ") td:eq(1) input").val()); - tax[productcode] = $.trim($("#invoice_product_table_vat tbody tr:eq(" + i + ") td:eq(4) input").val()); + tax[productcode] = $.trim($("#invoice_product_table_vat tbody tr:eq(" + i + ") td:eq(6) input").val()); contents[productcode] = obj; items[productcode] = $.trim($("#invoice_product_table_vat tbody tr:eq(" + i + ") td:eq(1) input").val()); freeqty[productcode] = $.trim($("#invoice_product_table_vat tbody tr:eq(" + i + ") td:eq(2) input").val()); @@ -2242,7 +2241,6 @@ if (event.which == 13) { for (var i = 0; i < files.length; i++) { form_data.append("file" + i, files[i]); } - event.preventDefault(); $('.modal-backdrop').remove(); $('.modal').modal('hide'); $('#confirm_yes').modal('show').one('click', '#tn_save_yes', function(e) { -- GitLab From d290eefc7a54dd70bf30f51dea979b66644bbb0a Mon Sep 17 00:00:00 2001 From: nitesh Date: Tue, 24 Oct 2017 13:50:41 +0530 Subject: [PATCH 2/3] Fixed tax error in cashmemo --- gkwebapp/static/js/addcashmemo.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gkwebapp/static/js/addcashmemo.js b/gkwebapp/static/js/addcashmemo.js index 1e79db8e..47547a97 100644 --- a/gkwebapp/static/js/addcashmemo.js +++ b/gkwebapp/static/js/addcashmemo.js @@ -149,7 +149,7 @@ $("#totalinvoicevalue").text(parseFloat(totalamount).toFixed(2)); if (str.length == 1) { return str.length < max ? pad("0" + str, max) : str; } else { - return str + return str; } } @@ -161,7 +161,7 @@ $("#totalinvoicevalue").text(parseFloat(totalamount).toFixed(2)); } else if (str.length == 2) { return str.length < max ? pad("20" + str, max) : str; } else { - return str + return str; } } $("#invoice_date").blur(function(event) { @@ -172,6 +172,7 @@ $("#totalinvoicevalue").text(parseFloat(totalamount).toFixed(2)); }); $("#invoice_year").blur(function(event) { + $(this).val(yearpad($(this).val(), 4)); invoicedatestring = $("#invoice_date").val() + $("#invoice_month").val() + $("#invoice_year").val(); invoicedate = Date.parseExact(invoicedatestring, "ddMMyyyy"); if (invoicedatestring.length == 0) { @@ -214,7 +215,6 @@ $("#totalinvoicevalue").text(parseFloat(totalamount).toFixed(2)); $("#vathelp").show(); } } - $(this).val(yearpad($(this).val(), 4)); }); //Key Event for Cash Memo Date Field. @@ -1011,7 +1011,7 @@ $(document).off("keyup").on("keyup", function(event) { var ppu = $("#invoice_product_table_vat tbody tr:eq(" + i + ") td:eq(3) input").val(); obj[ppu] = $("#invoice_product_table_vat tbody tr:eq(" + i + ") td:eq(1) input").val(); //tax is stored as a dict with key as productcode and value as the tax rate - tax[productcode] = $("#invoice_product_table_vat tbody tr:eq(" + i + ") td:eq(4) input").val(); + tax[productcode] = $("#invoice_product_table_vat tbody tr:eq(" + i + ") td:eq(6) input").val(); // nested dictionary with key as product code and value is another dict with key as priceperunit and value is the product quantity contents[productcode] = obj; items[productcode] = $("#invoice_product_table_vat tbody tr:eq(" + i + ") td:eq(1) input").val(); -- GitLab From 5ab92b89a3c49c2145479282c59665676fc1930e Mon Sep 17 00:00:00 2001 From: nitesh Date: Tue, 24 Oct 2017 15:31:36 +0530 Subject: [PATCH 3/3] 'Delivery Note' is replaced by 'Deli. Note No.' in invoice. --- gkwebapp/templates/addinvoice.jinja2 | 2 +- gkwebapp/templates/printinvoice.jinja2 | 2 +- gkwebapp/templates/viewsingleinvoice.jinja2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gkwebapp/templates/addinvoice.jinja2 b/gkwebapp/templates/addinvoice.jinja2 index fb4a7fbf..5420cdb3 100644 --- a/gkwebapp/templates/addinvoice.jinja2 +++ b/gkwebapp/templates/addinvoice.jinja2 @@ -69,7 +69,7 @@

Details of Invoice:

- +