From e6f329ddb0b192e0bc36e71dc25070dd5027b776 Mon Sep 17 00:00:00 2001 From: reshma1 Date: Tue, 17 Oct 2017 11:45:01 +0530 Subject: [PATCH 1/5] 'CESS' option is added in category for tax. --- gkwebapp/templates/addcategory.jinja2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gkwebapp/templates/addcategory.jinja2 b/gkwebapp/templates/addcategory.jinja2 index 6a770f44..22be5d3b 100644 --- a/gkwebapp/templates/addcategory.jinja2 +++ b/gkwebapp/templates/addcategory.jinja2 @@ -351,7 +351,8 @@ {% else %} - + + {% endif%} -- GitLab From 845b7299f9ac0c9a4a0134e667754f149269917c Mon Sep 17 00:00:00 2001 From: reshma1 Date: Tue, 17 Oct 2017 13:11:44 +0530 Subject: [PATCH 2/5] 'CESS' option is added in edit category for tax table. --- gkwebapp/static/js/editcategory.js | 32 +++++++++++++++++++++++--- gkwebapp/templates/editcategory.jinja2 | 7 +++++- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/gkwebapp/static/js/editcategory.js b/gkwebapp/static/js/editcategory.js index f6d6c7d0..7052c37a 100644 --- a/gkwebapp/static/js/editcategory.js +++ b/gkwebapp/static/js/editcategory.js @@ -104,7 +104,7 @@ $(document).ready(function() { $('#category_edit_tax_table tbody tr:last').attr({value: tax["taxid"]}); $('#category_edit_tax_table tbody tr:last td:eq(0) select').val(tax["taxname"]); $('#category_edit_tax_table tbody tr:last td:eq(1) select').val(tax["state"]); - if(tax["taxname"] == "CVAT" || tax["taxname"] == "IGST"){ + if(tax["taxname"] != "VAT"){ $('#category_edit_tax_table tbody tr:last td:eq(1) select').prop("disabled", true); } $('#category_edit_tax_table tbody tr:last td:eq(2) input').val(tax["taxrate"]); @@ -116,7 +116,7 @@ $(document).ready(function() { $('#category_edit_tax_table tbody').append(taxfieldhtml); $(".tax_del:first").hide(); } - + }) .fail(function() { console.log("error"); @@ -290,8 +290,34 @@ $(document).ready(function() { $('#category_edit_tax_table tbody tr:eq('+curindex+') td:eq(1) select').focus(); event.preventDefault(); } - else if (($("#category_edit_tax_table tbody tr:eq("+curindex+") td:eq(0) select").val()=='CVAT' || $("#category_edit_tax_table tbody tr:eq("+curindex+") td:eq(0) select").val()=='IGST') && event.which==13 ) { + else if (($("#category_edit_tax_table tbody tr:eq("+curindex+") td:eq(0) select").val() !='VAT') && event.which==13 ) { event.preventDefault(); + var types = []; + $('#category_edit_tax_table tbody tr').each(function(){ + if($(".tax_name",this).val()=='IGST') { + types.push($(".tax_name",this).val()); + } + if($(".tax_name",this).val()=='CESS') { + types.push($(".tax_name",this).val()); + } + if ($(".tax_name",this).val()=='CVAT') { + types.push($(".tax_name",this).val()); + } + }); + types.sort(); + var duplicatetypes = []; + for (var i = 0; i < types.length - 1; i++) { + if (types[i + 1] == types[i]) { + duplicatetypes.push(types[i]); + } + } + if (duplicatetypes.length > 0) { + $("#cvat-alert").alert(); + $("#cvat-alert").fadeTo(2250, 500).slideUp(500, function(){ + $("#cvat-alert").hide(); + }); + return false; + } $('#category_edit_tax_table tbody tr:eq('+curindex+') td:eq(1) select').prop("disabled", true); $('#category_edit_tax_table tbody tr:eq('+curindex+') td:eq(2) input').focus().select(); } diff --git a/gkwebapp/templates/editcategory.jinja2 b/gkwebapp/templates/editcategory.jinja2 index 14c47961..b19e0336 100644 --- a/gkwebapp/templates/editcategory.jinja2 +++ b/gkwebapp/templates/editcategory.jinja2 @@ -124,6 +124,10 @@ {% trans %}Duplicate Tax!{% endtrans %} +
@@ -148,7 +152,8 @@ {% else %} - + + {% endif%} -- GitLab From 92226743687a9979ce926c71e9f8adf766fe8aeb Mon Sep 17 00:00:00 2001 From: abhi1tb Date: Mon, 16 Oct 2017 17:09:52 +0530 Subject: [PATCH 3/5] Solved State Code Issue in Print Invoice --- gkwebapp/templates/printinvoice.jinja2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gkwebapp/templates/printinvoice.jinja2 b/gkwebapp/templates/printinvoice.jinja2 index 38b7bafe..d20a8d40 100644 --- a/gkwebapp/templates/printinvoice.jinja2 +++ b/gkwebapp/templates/printinvoice.jinja2 @@ -173,7 +173,7 @@
- {% if gkresult["inoutflag"] == 9 %}{{ gkresult["sourcestatecode"] }}{% endif %}{% if gkresult["inoutflag"] == 15 %}{{ gkresult["destinationstatecode"] }}{% endif %} + {% if gkresult["inoutflag"] == 9 %}{{ gkresult["sourcestatecode"] }}{% endif %}{% if gkresult["inoutflag"] == 15 %}{{ gkresult["taxstatecode"] }}{% endif %}
-- GitLab From 4d6afbd520937172fe3f4c9ae4d2f3946f0e903f Mon Sep 17 00:00:00 2001 From: abhi1tb Date: Fri, 20 Oct 2017 14:59:28 +0530 Subject: [PATCH 4/5] Tax issue solved in add category --- gkwebapp/static/js/addcategory.js | 12 +++++++----- gkwebapp/templates/addcategory.jinja2 | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gkwebapp/static/js/addcategory.js b/gkwebapp/static/js/addcategory.js index a881e89d..5da5d205 100644 --- a/gkwebapp/static/js/addcategory.js +++ b/gkwebapp/static/js/addcategory.js @@ -600,11 +600,13 @@ $(document).ready(function() { }); taxes = []; $("#category_tax_table tbody tr").each(function() { - var obj = {}; // dict for storing tax details - obj.taxname = $.trim($("td:eq(0) select option:selected", this).val()); - obj.state = $.trim($("td:eq(1) select option:selected", this).val()); - obj.taxrate = $.trim($("input", this).val()); - taxes.push(obj); + var obj = {}; // dict for storing tax details + if($("td:eq(0) select option:selected", this).val() != ""){ + obj.taxname = $.trim($("td:eq(0) select option:selected", this).val()); + obj.state = $.trim($("td:eq(1) select option:selected", this).val()); + obj.taxrate = $.trim($("input", this).val()); + taxes.push(obj); + } }); $.ajax({ url: '/category?action=save', diff --git a/gkwebapp/templates/addcategory.jinja2 b/gkwebapp/templates/addcategory.jinja2 index 22be5d3b..1c096b72 100644 --- a/gkwebapp/templates/addcategory.jinja2 +++ b/gkwebapp/templates/addcategory.jinja2 @@ -349,10 +349,10 @@ {% else %} + + - - {% endif%} @@ -368,7 +368,7 @@ - + -- GitLab From 3e01065d9bf46828bdaa57478b7d6a033cbe266c Mon Sep 17 00:00:00 2001 From: abhi1tb Date: Mon, 23 Oct 2017 11:17:04 +0530 Subject: [PATCH 5/5] Pressing Insert button saves Customer Supplier --- gkwebapp/static/js/addcustomersupplier.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gkwebapp/static/js/addcustomersupplier.js b/gkwebapp/static/js/addcustomersupplier.js index 0b718e26..b58f54a0 100644 --- a/gkwebapp/static/js/addcustomersupplier.js +++ b/gkwebapp/static/js/addcustomersupplier.js @@ -1,6 +1,6 @@ /* Copyright (C) 2013, 2014, 2015, 2016 Digital Freedom Foundation -This file is part of GNUKhata:A modular,robust and Free Accounting System. + This file is part of GNUKhata:A modular,robust and Free Accounting System. GNUKhata is Free Software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -37,7 +37,7 @@ $(document).ready(function() { if ($.trim($("#add_cussup").val())=="") { $("#role-blank-alert").alert(); $("#role-blank-alert").fadeTo(2250, 500).slideUp(500, function(){ - $("#role-blank-alert").hide(); + $("#role-blank-alert").hide(); }); $("#add_cussup").focus(); return false; @@ -292,9 +292,18 @@ else{ }); $("#add_cussup_reset").click(function(event) { // click the customer/supplier create tab to reload the current page in tab creating a reset effect - $("#customersupplier_create").click(); + $("#customersupplier_create").click(); }); - $("#cussup_save").click(function(event) { + + $(document).one("keyup", function(event) { + if(event.which == 45) { + $("#cussup_save").click(); + event.preventDefault(); + return false; + } + }); + + $("#cussup_save").click(function(event) { //save event for saving the customer/supplier event.preventDefault(); var allow = 1; -- GitLab