From e5c349bbf4158bba1452a5d9af8a7d61ec81c308 Mon Sep 17 00:00:00 2001 From: pjpatil12 Date: Tue, 10 Feb 2026 15:41:18 +0530 Subject: [PATCH] new field added in the from all model changes --- .env | 3 +- AppCode/__pycache__/AOHandler.cpython-313.pyc | Bin 8290 -> 8290 bytes .../__pycache__/CITHandler.cpython-313.pyc | Bin 7818 -> 7818 bytes .../DocumentHandler.cpython-313.pyc | Bin 12225 -> 12225 bytes .../__pycache__/ITRHandler.cpython-313.pyc | Bin 8456 -> 8456 bytes static/js/ao_calc.js | 4 +- static/js/itr_calc.js | 112 ++++++++++-------- templates/add_ao.html | 35 +++++- templates/add_cit.html | 38 +++++- templates/add_itat.html | 41 ++++++- templates/add_itr.html | 44 +++++-- 11 files changed, 209 insertions(+), 68 deletions(-) diff --git a/.env b/.env index 6ef70f0..61e9800 100644 --- a/.env +++ b/.env @@ -18,8 +18,9 @@ DB_DIALECT=mysql # DB_DRIVER=pymysql DB_HOST=127.0.0.1 # DB_HOST=db # this is production for use docker +DB_NAME=income_tax_db DB_PORT=3306 -DB_NAME=test_income_taxdb +# DB_NAME=test_income_taxdb DB_USER=root DB_PASSWORD=root diff --git a/AppCode/__pycache__/AOHandler.cpython-313.pyc b/AppCode/__pycache__/AOHandler.cpython-313.pyc index 87bd7a5fe94cc717694b7c660160644234ac8b8a..1f11a88a6b2766ebc79f2e73d9ff82f634ce05b8 100644 GIT binary patch delta 19 ZcmaFl@W_GdGcPX}0}zDY*~k^4002Su1Ye=wfwGcPX}0}wnc+sL(D9{@vp23i0B delta 19 ZcmX>Ye=wfwGcPX}0}xc@Zsgjo4*)>q1?m6* diff --git a/AppCode/__pycache__/ITRHandler.cpython-313.pyc b/AppCode/__pycache__/ITRHandler.cpython-313.pyc index 9de580ccbf300fd21af39ecd86348717a7e06696..d3fca2c4d538b02cc4b6eb7cdac03fbd9b2392d7 100644 GIT binary patch delta 19 ZcmeBh>Tu%v%*)Hg00a-qHgf$_001}~1?B(% delta 19 ZcmeBh>Tu%v%*)Hg00dRJ8@c`|001?G1$F=c diff --git a/static/js/ao_calc.js b/static/js/ao_calc.js index 95c4d73..ced978d 100644 --- a/static/js/ao_calc.js +++ b/static/js/ao_calc.js @@ -117,13 +117,13 @@ document.addEventListener("DOMContentLoaded", function () { var result = 0; var zero = 0; if (b > a) { - result = a - b; + result = b - a; setValue("mat_credit_created", result); setValue("mat_credit_utilized", zero); } if (a > b) { - result = b - a; + result = a - b; setValue("mat_credit_utilized", result); setValue("mat_credit_created", zero); } diff --git a/static/js/itr_calc.js b/static/js/itr_calc.js index f44b7b7..f695d9a 100644 --- a/static/js/itr_calc.js +++ b/static/js/itr_calc.js @@ -1,44 +1,62 @@ document.addEventListener("DOMContentLoaded", function () { - function getValue(id) { - var el = document.getElementsByName(id)[0]; + function getValue(name) { + var el = document.getElementsByName(name)[0]; return el ? parseFloat(el.value) || 0 : 0; } - function setValue(id, val) { - var el = document.getElementsByName(id)[0]; + function setValue(name, val) { + var el = document.getElementsByName(name)[0]; if (el) el.value = Number(val).toFixed(2); } + // ---- Track last edited field for Tax(A) ---- + let lastEditedTaxA = null; + + document.getElementsByName("per_a")[0].addEventListener("input", () => { + lastEditedTaxA = "percentage"; + }); + + document.getElementsByName("tax_30_percent")[0].addEventListener("input", () => { + lastEditedTaxA = "amount"; + }); + window.calculate = function () { - // --- BASIC INPUTS --- + // ---------------- BASIC INPUTS ---------------- var gross_total_income = getValue("gross_total_income"); var disallowance_14a = getValue("disallowance_14a"); var disallowance_37 = getValue("disallowance_37"); - // -- total gross income -- - var gross_total = gross_total_income + disallowance_37 + disallowance_14a + var gross_total = gross_total_income + disallowance_14a + disallowance_37; setValue("gti_as_per_ao", gross_total); - // --- DEDUCTIONS --- + // ---------------- DEDUCTIONS ---------------- var d80_business = getValue("deduction_80ia_business"); var d80_misc = getValue("deduction_80ia_misc"); var d80_other = getValue("deduction_80ia_other"); var d80_sec37 = getValue("deduction_sec37_disallowance"); + var deduction_80g = getValue("deduction_80g"); var deduction = d80_business + d80_misc + d80_other + d80_sec37 - 1.35; - var deduction_80g = getValue("deduction_80g"); - - // --- NET TAXABLE INCOME --- var net_taxable_income = gross_total - deduction - deduction_80g; setValue("net_taxable_income", net_taxable_income); - // ----------------------- TAX A% --------------------- + // ================= TAX (A) – TWO WAY ================= var per_a = getValue("per_a"); - var tax30 = net_taxable_income * (per_a / 100); - setValue("tax_30_percent", tax30); + var tax30 = getValue("tax_30_percent"); + + if (net_taxable_income > 0) { + if (lastEditedTaxA === "percentage") { + tax30 = net_taxable_income * (per_a / 100); + setValue("tax_30_percent", tax30); + } + else if (lastEditedTaxA === "amount") { + per_a = (tax30 / net_taxable_income) * 100; + setValue("per_a", per_a); + } + } var per_surcharge_a = getValue("per_surcharge_a"); var surcharge_a = tax30 * (per_surcharge_a / 100); @@ -51,8 +69,7 @@ document.addEventListener("DOMContentLoaded", function () { var sum_of_a = tax30 + surcharge_a + edu_cess_a; setValue("sum_of_a", sum_of_a); - - // -------------------- TAX PAYABLE B% (18.5%) --------------------------- + // ================= TAX (B) ================= var tax185 = getValue("tax_book_profit_18_5"); var per_surcharge_b = getValue("per_surcharge_b"); @@ -66,53 +83,52 @@ document.addEventListener("DOMContentLoaded", function () { var sum_of_b = tax185 + surcharge_b + edu_cess_b; setValue("sum_of_b", sum_of_b); - - // --- Tax Payable (Higher of A or B): --- - var tax_payable = (tax30 > tax185) ? tax30 : tax185; + // ================= TAX PAYABLE ================= + var tax_payable = (sum_of_a > sum_of_b) ? tax30 : tax185; setValue("tax_payable", tax_payable); - // ---- total_tax_payable ---- - var total_tax_payable = (tax30 > tax185) ? sum_of_a : sum_of_b; + + var total_tax_payable = (sum_of_a > sum_of_b) ? sum_of_a : sum_of_b; setValue("total_tax_payable", total_tax_payable); + // ================= MAT CREDIT ================= + var mat_created = 0; + var mat_utilized = 0; - // --- mat_credit_created --- new - // setValue("mat_credit_created", Math.max(tax185 - total_tax_payable, 0)); - // // --- mat credit_utilized --- new - // setValue("mat_credit_utilized", Math.max(total_tax_payable - tax185, 0)); - - // --- mat credit_utilized --- - var a = sum_of_a - var b = sum_of_b - var result = 0 - var zero = 0 - if (a < b) { - result = b - a - setValue("mat_credit_created", result); - setValue("mat_credit_utilized", zero); - } - else { - result = a - b - setValue("mat_credit_utilized", result); - setValue("mat_credit_created", zero); + if (sum_of_a < sum_of_b) { + mat_created = sum_of_b - sum_of_a; + } else { + mat_utilized = sum_of_a - sum_of_b; } - // --- FINAL TAX --- - var mat_credit_utilized = getValue("mat_credit_utilized"); + setValue("mat_credit_created", mat_created); + setValue("mat_credit_utilized", mat_utilized); + + // ================= Opening Balance and closing ================= + var opening_balance = getValue("opening_balance"); + var closing_balance = (opening_balance + mat_created) - mat_utilized + setValue("closing_balance", closing_balance); + + // ================= FINAL TAX ================= var interest_234c = getValue("interest_234c"); - // var total_tax = total_tax_payable + mat_credit + interest_234c; - var total_tax = total_tax_payable + interest_234c - mat_credit_utilized; + var total_tax = total_tax_payable + interest_234c - mat_utilized; setValue("total_tax", total_tax); - // --- ASSESSMENT --- + // ================= ADJUSTMENTS ================= var adv_tax = getValue("advance_tax"); var tds = getValue("tds"); var tcs = getValue("tcs"); - var tax_on_regular_assessment = getValue("tax_on_assessment"); + var tax_on_assessment = getValue("tax_on_assessment"); + var interest_244a_per143 = getValue("interest_244a_per143"); + var refund_received = getValue("refund_received"); - var all_tax = adv_tax + tds + tcs + tax_on_regular_assessment; + var paid_tax = adv_tax + tds + tcs + tax_on_assessment; - var refund = total_tax - all_tax; + var refund = total_tax - paid_tax; setValue("refund", refund); + + var balance_receivable = (refund + interest_244a_per143) - refund_received + setValue("balance_receivable", balance_receivable); + }; }); diff --git a/templates/add_ao.html b/templates/add_ao.html index 43d3800..4419879 100644 --- a/templates/add_ao.html +++ b/templates/add_ao.html @@ -93,7 +93,7 @@
- +
@@ -158,14 +158,19 @@ - - -
+ +
+
+ + +
+
+
@@ -175,6 +180,13 @@
+
+ +
+
+ + +
@@ -219,6 +231,21 @@
+
+
+ + +
+
+ + +
+
+ + +
+
diff --git a/templates/add_cit.html b/templates/add_cit.html index a124afc..f7e48a5 100644 --- a/templates/add_cit.html +++ b/templates/add_cit.html @@ -42,6 +42,13 @@
+
+
+ + +
+
+
@@ -92,8 +99,6 @@
-
@@ -160,6 +165,13 @@
+
+
+ + +
+
+
@@ -169,6 +181,12 @@
+
+
+
+ + +
@@ -212,6 +230,22 @@
+
+
+ + +
+
+ + +
+
+ + +
+
+
diff --git a/templates/add_itat.html b/templates/add_itat.html index 14ff495..77e18d0 100644 --- a/templates/add_itat.html +++ b/templates/add_itat.html @@ -43,6 +43,13 @@
+
+
+ + +
+
+
@@ -59,8 +66,6 @@
- -
@@ -95,8 +100,6 @@
-
@@ -160,6 +163,13 @@
+
+
+ + +
+
+
@@ -169,6 +179,13 @@
+
+ +
+
+ + +
@@ -214,6 +231,22 @@
+
+
+ + +
+
+ + +
+
+ + +
+
+
diff --git a/templates/add_itr.html b/templates/add_itr.html index 0a4db66..33569f3 100644 --- a/templates/add_itr.html +++ b/templates/add_itr.html @@ -90,16 +90,13 @@
- +
-
@@ -165,6 +162,13 @@
+
+
+ + +
+
+
@@ -174,6 +178,13 @@
+
+ +
+
+ + +
@@ -214,9 +225,28 @@
-
- - + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +