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 26237a4..db11e6d 100644 Binary files a/AppCode/__pycache__/CITHandler.cpython-313.pyc and b/AppCode/__pycache__/CITHandler.cpython-313.pyc differ diff --git a/AppCode/__pycache__/ITRHandler.cpython-313.pyc b/AppCode/__pycache__/ITRHandler.cpython-313.pyc index a982d03..f427476 100644 Binary files a/AppCode/__pycache__/ITRHandler.cpython-313.pyc and b/AppCode/__pycache__/ITRHandler.cpython-313.pyc differ 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 @@
-
- - +
+
+ + +
+
+ + +