From 1819c49433baa0b097cd808b34d107562e768a9c Mon Sep 17 00:00:00 2001 From: pjpatil12 Date: Fri, 6 Feb 2026 16:37:54 +0530 Subject: [PATCH] code edit cit from and auto save mat ceadit and utility --- AppCode/CITHandler.py | 2 +- .../__pycache__/CITHandler.cpython-313.pyc | Bin 7674 -> 7818 bytes .../__pycache__/ITRHandler.cpython-313.pyc | Bin 8456 -> 8456 bytes main.py | 17 ++++++++++++-- static/js/cit_calc.js | 22 ++++++++++++++++++ templates/add_cit.html | 19 +++++++++++---- 6 files changed, 53 insertions(+), 7 deletions(-) diff --git a/AppCode/CITHandler.py b/AppCode/CITHandler.py index 7762870..e214620 100644 --- a/AppCode/CITHandler.py +++ b/AppCode/CITHandler.py @@ -43,7 +43,7 @@ class CITHandler: 'tax_payable', 'surcharge', 'edu_cess', 'total_tax_payable', 'mat_credit_created', 'mat_credit_utilized', 'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', - 'sat', 'tax_on_assessment', 'refund', 'Remarks' + 'sat', 'tax_on_assessment', 'refund', 'Remarks','created_at' ] values = [data.get(col, 0) for col in columns] diff --git a/AppCode/__pycache__/CITHandler.cpython-313.pyc b/AppCode/__pycache__/CITHandler.cpython-313.pyc index 26237a43b678cd8217b93375ce81ae5b985db865..db11e6d47a81c9e108d57bc6305ca16f528b2c0d 100644 GIT binary patch delta 381 zcmexm-DS)BnU|M~0SI0mY0X@_kvE5pNmFKXHQNG4o?BeWMX8A;sVVV^C7Y!=&M+ow zN*5^sl@=+32o(^a3L?}%ggS`O01=uXLJLG_g9sfEp$j7PK!iSsFaQyTAi@Yl7=s8C zATilRM04|7PGt^8<;j9V5{xR7wS?puRVRB1$uX);&J;3s0a;Te;Gd`9n^~N!5R{sn znpsd%47Rw611RiYl95^jc0!dHkQ$a1f?dYW)_qb7iofoIe^0cB^jwj zMOq-P7?2yBnyg@KuHcecoS2i7U!ItkoLZzkxjW zk>2F(!V2p8AW?3RXh33RVp2|OkpW1AH@LJYIU}(sJr$^0wa9StKVb<;Ban<>NPbCT ljsmg{OVTu%v%*)Hg00diiZ{+%?001~`1^)m5 delta 19 ZcmeBh>Tu%v%*)Hg00h@(Z{+%?0020d1_1y7 diff --git a/main.py b/main.py index 72d5e9a..2a15f75 100644 --- a/main.py +++ b/main.py @@ -193,7 +193,7 @@ def add_ao(): year=request.form["year"], mat_created=float(request.form.get("mat_credit_created", 0)), mat_utilized=float(request.form.get("mat_credit_utilized", 0)), - remarks="Created via ITR" + remarks="Created via ao" ) flash("AO record added successfully!", "success") @@ -252,12 +252,25 @@ def display_cit(): def add_cit(): if request.method == 'POST': cit = CITHandler() + mat = MatCreditHandler() cit.add_cit(request.form) cit.close() + + if 'documents' in request.files: + doc = DocumentHandler() + doc.Upload(request) + + # AUTO SAVE MAT FROM ITR + mat.save_from_itr( + year=request.form["year"], + mat_created=float(request.form.get("mat_credit_created", 0)), + mat_utilized=float(request.form.get("mat_credit_utilized", 0)), + remarks="Created via cit" + ) flash("CIT record added successfully!", "success") return redirect(url_for('display_cit')) - return render_template('add_cit.html') + return render_template('add_cit.html', current_date=date.today().isoformat()) # 3 delete CIT records by id @app.route('/cit/delete/', methods=['POST']) diff --git a/static/js/cit_calc.js b/static/js/cit_calc.js index 1a08b64..26b731e 100644 --- a/static/js/cit_calc.js +++ b/static/js/cit_calc.js @@ -68,6 +68,28 @@ document.addEventListener("DOMContentLoaded", function () { var total_tax_payable = tax_payable + surcharge + edu_cess; setValue("total_tax_payable", total_tax_payable); + + // --- mat credit_utilized --- + var a = tax185 + var b = total_tax_payable + var result = 0 + if (a > b) { + result = a - b + setValue("mat_credit_created", result); + } + else { + setValue("mat_credit_created", result); + } + + if (b > a) { + result = b - a + setValue("mat_credit_utilized", result); + } + else { + setValue("mat_credit_utilized", result); + } + + // --- FINAL TAX --- var mat_credit = getValue("mat_credit_utilized"); var interest_234c = getValue("interest_234c"); diff --git a/templates/add_cit.html b/templates/add_cit.html index ad7c933..6b4ea4f 100644 --- a/templates/add_cit.html +++ b/templates/add_cit.html @@ -9,7 +9,8 @@ {% block content %}

New CIT Form

-
+ +
@@ -20,6 +21,10 @@
+
+ + +
@@ -166,9 +171,15 @@
-
- - +
+
+ + +
+
+ + +