From 58139ea239680335c4aa0b8611964867a8a1fe90 Mon Sep 17 00:00:00 2001 From: pjpatil12 Date: Wed, 7 Jan 2026 17:22:18 +0530 Subject: [PATCH] UI changes --- AppCode/MatCreditHandler.py | 38 ++++----- main.py | 3 +- templates/add_ao.html | 1 - templates/add_cit.html | 1 - templates/add_itat.html | 1 - templates/ao_reports.html | 8 +- templates/base.html | 22 +++-- templates/cit_reports.html | 9 +- templates/display_cit.html | 4 - templates/display_itat.html | 9 +- templates/index.html | 2 +- templates/itat_reports.html | 14 +--- templates/itr_reports.html | 11 +-- templates/login.html | 149 ++++++++++++++++----------------- templates/stage_reports.html | 2 - templates/summary_reports.html | 5 +- templates/update_ao.html | 6 -- templates/update_cit.html | 6 -- templates/update_itat.html | 6 -- templates/update_itr.html | 6 -- templates/upload.html | 9 -- 21 files changed, 114 insertions(+), 198 deletions(-) diff --git a/AppCode/MatCreditHandler.py b/AppCode/MatCreditHandler.py index 892ef12..167163c 100644 --- a/AppCode/MatCreditHandler.py +++ b/AppCode/MatCreditHandler.py @@ -6,30 +6,24 @@ import mysql.connector class MatCreditHandler: def __init__(self): - db = DBConfig() - self.conn = db.get_db_connection() + # db = DBConfig() + self.conn = DBConfig.get_db_connection() self.cursor = self.conn.cursor(dictionary=True) - @staticmethod - def fetch_all(): - conn = DBConfig.get_db_connection() - cur = conn.cursor(dictionary=True) - + # get all Mat credit data + def fetch_all(self): try: - # Stored Procedure returns TWO result sets - cur.callproc("GetMatCedit") - - result_sets = cur.stored_results() - - mat_rows = next(result_sets).fetchall() - utilization_rows = next(result_sets).fetchall() - - return mat_rows, utilization_rows + self.cursor.callproc("GetMatCedit") + result_sets = self.cursor.stored_results() + mat_rows = next(result_sets).fetchall() + utilization_rows = next(result_sets).fetchall() + return mat_rows, utilization_rows finally: - cur.close() - conn.close() + self.cursor.close() + self.cursor.close() + # Save Mat credit data single row @staticmethod def save_single(data): conn = DBConfig.get_db_connection() @@ -81,6 +75,7 @@ class MatCreditHandler: conn.close() + # save all Mat credit data @staticmethod def save_bulk(rows): conn = DBConfig.get_db_connection() @@ -120,4 +115,9 @@ class MatCreditHandler: finally: cur.close() - conn.close() \ No newline at end of file + conn.close() + + # CLOSE CONNECTION + def close(self): + self.cursor.close() + self.conn.close() diff --git a/main.py b/main.py index 85df8a3..5985e0b 100644 --- a/main.py +++ b/main.py @@ -452,8 +452,8 @@ def check_year(): def mat_credit(): mat= MatCreditHandler() - mat_rows, utilization_rows = mat.fetch_all() + mat.close() utilization_map = {} all_years = set() @@ -492,7 +492,6 @@ def save_mat_all(): return jsonify({"error": str(e)}), 500 - # run if __name__ == '__main__': app.run(host='0.0.0.0', port=5003, debug=True) \ No newline at end of file diff --git a/templates/add_ao.html b/templates/add_ao.html index cc71b75..d72d16b 100644 --- a/templates/add_ao.html +++ b/templates/add_ao.html @@ -169,7 +169,6 @@ {% block extra_js %} - {% endblock %} diff --git a/templates/add_cit.html b/templates/add_cit.html index 832fd5d..aa77ac8 100644 --- a/templates/add_cit.html +++ b/templates/add_cit.html @@ -168,7 +168,6 @@ {% endblock %} {% block extra_js %} - {% endblock %} \ No newline at end of file diff --git a/templates/add_itat.html b/templates/add_itat.html index 0fe26ec..c345de5 100644 --- a/templates/add_itat.html +++ b/templates/add_itat.html @@ -171,7 +171,6 @@ {% endblock %} {% block extra_js %} - {% endblock %} diff --git a/templates/ao_reports.html b/templates/ao_reports.html index 8b23b5f..4f3b40e 100644 --- a/templates/ao_reports.html +++ b/templates/ao_reports.html @@ -31,11 +31,5 @@ -{% block scripts %} - - -{% endblock %} -{% block extra_js %} -{% endblock %} -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index b894a44..b1eff67 100644 --- a/templates/base.html +++ b/templates/base.html @@ -27,31 +27,37 @@

Dashboard

- + - + - + - + + + + + - - - - Logout diff --git a/templates/cit_reports.html b/templates/cit_reports.html index 0c50921..53d1226 100644 --- a/templates/cit_reports.html +++ b/templates/cit_reports.html @@ -30,12 +30,5 @@ -{% block scripts %} - - -{% endblock %} - -{% block extra_js %} -{% endblock %} -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/templates/display_cit.html b/templates/display_cit.html index 7c700bb..0e0bd79 100644 --- a/templates/display_cit.html +++ b/templates/display_cit.html @@ -54,8 +54,4 @@ {% endif %} -{% endblock %} - -{% block scripts %} - {% endblock %} \ No newline at end of file diff --git a/templates/display_itat.html b/templates/display_itat.html index 2eeeb0b..bd98535 100644 --- a/templates/display_itat.html +++ b/templates/display_itat.html @@ -46,7 +46,7 @@ {{ "{:,.2f}".format(record.gross_total_income) }} {{ "{:,.2f}".format(record.net_taxable_income) }} {{ "{:,.2f}".format(record.total_tax_payable) }} - {{ "{:,.2f}".format(record.refund) }}> + {{ "{:,.2f}".format(record.refund) }} Edit @@ -68,8 +68,5 @@ - {% endblock %} - - {% block scripts %} - - {% endblock %} \ No newline at end of file + +{% endblock %} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 948d9f3..0b06567 100644 --- a/templates/index.html +++ b/templates/index.html @@ -9,4 +9,4 @@ Welcome to Income Tax Utilities Dashboard

-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/templates/itat_reports.html b/templates/itat_reports.html index f10600f..e3f8955 100644 --- a/templates/itat_reports.html +++ b/templates/itat_reports.html @@ -11,31 +11,21 @@

Download ITAT Report

-

- -
-
-
-{% block scripts %} - - -{% endblock %} -{% block extra_js %} -{% endblock %} -{% endblock %} + +{% endblock %} \ No newline at end of file diff --git a/templates/itr_reports.html b/templates/itr_reports.html index 2628a9c..a5844d7 100644 --- a/templates/itr_reports.html +++ b/templates/itr_reports.html @@ -11,7 +11,6 @@

Download ITR Report

-

@@ -23,20 +22,12 @@
-
-
-{% block scripts %} - - -{% endblock %} -{% block extra_js %} -{% endblock %} -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/templates/login.html b/templates/login.html index db9b763..66e1788 100644 --- a/templates/login.html +++ b/templates/login.html @@ -1,85 +1,84 @@ - - - LCEPL Income Tax - - - -
-

Laxmi Civil Engineering Services

-

LOGIN

+ .flash { + color: red; + text-align: center; + margin-bottom: 1rem; + } - {% with messages = get_flashed_messages(with_categories=true) %} {% if - messages %} {% for category, message in messages %} -
{{ message }}
- {% endfor %} {% endif %} {% endwith %} + .title { + text-align: center; + color: #007bff; + } -
- - - -
-
- - + .subtitle { + text-align: center; + } + + + + +
+

Laxmi Civil Engineering Services

+

LOGIN

+ + {% with messages = get_flashed_messages(with_categories=true) %} {% if + messages %} {% for category, message in messages %} +
{{ message }}
+ {% endfor %} {% endif %} {% endwith %} + +
+ + + +
+
+ + + \ No newline at end of file diff --git a/templates/stage_reports.html b/templates/stage_reports.html index 4fd933f..2aa4bb9 100644 --- a/templates/stage_reports.html +++ b/templates/stage_reports.html @@ -127,8 +127,6 @@
- -

{{ stage }} Reports

diff --git a/templates/summary_reports.html b/templates/summary_reports.html index 63a794b..b5c594f 100644 --- a/templates/summary_reports.html +++ b/templates/summary_reports.html @@ -30,9 +30,6 @@
-{% block scripts %} - - -{% endblock %} + {% endblock %} \ No newline at end of file diff --git a/templates/update_ao.html b/templates/update_ao.html index 8e47dad..261ee90 100644 --- a/templates/update_ao.html +++ b/templates/update_ao.html @@ -31,10 +31,4 @@ -{% endblock %} - -{% block extra_js %} - - - {% endblock %} \ No newline at end of file diff --git a/templates/update_cit.html b/templates/update_cit.html index 595ca1c..549d13c 100644 --- a/templates/update_cit.html +++ b/templates/update_cit.html @@ -30,10 +30,4 @@ -{% endblock %} - -{% block extra_js %} - - - {% endblock %} \ No newline at end of file diff --git a/templates/update_itat.html b/templates/update_itat.html index 9098846..c7c7180 100644 --- a/templates/update_itat.html +++ b/templates/update_itat.html @@ -28,10 +28,4 @@ -{% endblock %} - -{% block extra_js %} - - - {% endblock %} \ No newline at end of file diff --git a/templates/update_itr.html b/templates/update_itr.html index 4949ac4..4c10348 100644 --- a/templates/update_itr.html +++ b/templates/update_itr.html @@ -31,10 +31,4 @@ -{% endblock %} - -{% block extra_js %} - - - {% endblock %} \ No newline at end of file diff --git a/templates/upload.html b/templates/upload.html index 4e3a475..3dd8b70 100644 --- a/templates/upload.html +++ b/templates/upload.html @@ -35,13 +35,4 @@ -{% endblock %} - -{% block scripts %} - - -{% endblock %} - -{% block extra_js %} - {% endblock %} \ No newline at end of file