UI changes

This commit is contained in:
2026-01-07 17:22:18 +05:30
parent 68511b7558
commit 58139ea239
21 changed files with 114 additions and 198 deletions

View File

@@ -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()
conn.close()
# CLOSE CONNECTION
def close(self):
self.cursor.close()
self.conn.close()

View File

@@ -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)

View File

@@ -169,7 +169,6 @@
</div>
{% block extra_js %}
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
<script src="{{ url_for('static', filename='js/ao_calc.js') }}"></script>
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}

View File

@@ -168,7 +168,6 @@
{% endblock %}
{% block extra_js %}
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
<script src="{{ url_for('static', filename='js/cit_calc.js') }}"></script>
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}

View File

@@ -171,7 +171,6 @@
{% endblock %}
{% block extra_js %}
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
<script src="{{ url_for('static', filename='js/itr_calc.js') }}"></script>
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}

View File

@@ -31,11 +31,5 @@
</div>
</div>
{% block scripts %}
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
{% endblock %}
{% block extra_js %} <script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}
{% endblock %}
{% endblock %}

View File

@@ -27,31 +27,37 @@
<a href="{{ url_for('index') }}">
<h2>Dashboard</h2>
</a>
<!-- ITR model -->
<div class="menu-btn" onclick="toggleMenu('itrMenu')">ITR ▼</div>
<div class="submenu" id="itrMenu">
<a href="{{ url_for('add_itr') }}"> Add ITR</a>
<a href="{{ url_for('display_itr') }}">🧾 ITR Records</a>
</div>
<!-- AO model -->
<div class="menu-btn" onclick="toggleMenu('aoMenu')">AO ▼</div>
<div class="submenu" id="aoMenu">
<a href="{{ url_for('add_ao') }}"> Add AO</a>
<a href="{{ url_for('display_ao') }}">🧾 AO Records</a>
</div>
<!-- CIT model -->
<div class="menu-btn" onclick="toggleMenu('citMenu')">CIT ▼</div>
<div class="submenu" id="citMenu">
<a href="{{ url_for('add_cit') }}"> Add CIT</a>
<a href="{{ url_for('display_cit') }}">🧾 CIT Records</a>
</div>
<!-- ITAT model -->
<div class="menu-btn" onclick="toggleMenu('itatMenu')">ITAT ▼</div>
<div class="submenu" id="itatMenu">
<a href="{{ url_for('add_itat') }}"> Add ITAT</a>
<a href="{{ url_for('display_itat') }}">🧾 ITAT Records</a>
</div>
<!-- MAT credit model -->
<div class="menu-btn" onclick="toggleMenu('matCredit')">Mat Credit ▼</div>
<div class="submenu" id="matCredit">
<a href="{{ url_for('mat_credit') }}">📄 Mat Credit from</a>
</div>
<!-- Documents & Reports -->
<div class="menu-btn" onclick="toggleMenu('docMenu')">Documents & Reports ▼</div>
<div class="submenu" id="docMenu">
<a href="{{ url_for('upload_file') }}">📂 Upload</a>
@@ -60,14 +66,6 @@
<a href="{{ url_for('summary_report') }}">📝 Summary Report</a>
</div>
<div class="menu-btn" onclick="toggleMenu('matCredit')">Mat Credit ▼</div>
<div class="submenu" id="matCredit">
<a href="{{ url_for('mat_credit') }}">📄 Mat Credit from</a>
<!-- <a href="{{ url_for('view_documents') }}">📄 Documents</a> -->
</div>
<!-- Logout at bottom -->
<a href="{{ url_for('auth.logout') }}" class="sidebar-logout">
<img src="{{ url_for('static', filename='images/logout_icon.png') }}" class="logout-icon" alt="Logout" />

View File

@@ -30,12 +30,5 @@
</div>
</div>
{% block scripts %}
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
{% endblock %}
{% block extra_js %} <script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}
{% endblock %}
{% endblock %}

View File

@@ -54,8 +54,4 @@
{% endif %}
</div>
</div>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
{% endblock %}

View File

@@ -46,7 +46,7 @@
<td>{{ "{:,.2f}".format(record.gross_total_income) }}</td>
<td>{{ "{:,.2f}".format(record.net_taxable_income) }}</td>
<td>{{ "{:,.2f}".format(record.total_tax_payable) }}</td>
<td>{{ "{:,.2f}".format(record.refund) }}</td>>
<td>{{ "{:,.2f}".format(record.refund) }}</td>
<td class="action-cell">
<a href="{{ url_for('update_itat', id=record.id) }}" class="btn btn-update">Edit</a>
@@ -68,8 +68,5 @@
</div>
</div>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
{% endblock %}
</div>
{% endblock %}

View File

@@ -9,4 +9,4 @@
Welcome to Income Tax Utilities Dashboard
</p>
</div>
{% endblock %}
{% endblock %}

View File

@@ -11,31 +11,21 @@
<div class="container">
<h2>Download ITAT Report</h2>
<form method="GET" action="{{ url_for('itat_report') }}" target="_blank">
<label for="year">Select Year:</label><br>
<select name="year" id="year" required>
<option value="">-- Select Year --</option>
{% for y in years %}
<option value="{{ y }}">AY {{ y }} - {{ y + 1 }}</option>
{% endfor %}
</select>
<br>
<button type="submit">Download Excel</button>
</form>
</div>
</div>
{% block scripts %}
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
{% endblock %}
{% block extra_js %} <script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}
{% endblock %}
{% endblock %}

View File

@@ -11,7 +11,6 @@
<div class="container">
<h2>Download ITR Report</h2>
<form method="GET" action="{{ url_for('itr_report') }}" target="_blank">
<label for="year">Select Year:</label><br>
@@ -23,20 +22,12 @@
</select>
<br>
<button type="submit">
Download Excel
</button>
</form>
</div>
</div>
{% block scripts %}
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
{% endblock %}
{% block extra_js %} <script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}
{% endblock %}
{% endblock %}

View File

@@ -1,85 +1,84 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>LCEPL Income Tax</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f3f3f3;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.login-container {
background: white;
padding: 2rem;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
width: 300px;
}
<head>
<meta charset="UTF-8" />
<title>LCEPL Income Tax</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f3f3f3;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
h2 {
text-align: center;
margin-bottom: 1.5rem;
}
.login-container {
background: white;
padding: 2rem;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
width: 300px;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 0.5rem;
margin-bottom: 1rem;
border: 1px solid #ccc;
border-radius: 5px;
}
h2 {
text-align: center;
margin-bottom: 1.5rem;
}
button {
width: 100%;
padding: 0.5rem;
background: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 0.5rem;
margin-bottom: 1rem;
border: 1px solid #ccc;
border-radius: 5px;
}
.flash {
color: red;
text-align: center;
margin-bottom: 1rem;
}
.title {
text-align: center;
color: #007bff;
}
button {
width: 100%;
padding: 0.5rem;
background: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.subtitle {
text-align: center;
}
</style>
</head>
<body>
<div class="login-container">
<h1 class="title">Laxmi Civil Engineering Services</h1>
<h4 class="subtitle">LOGIN</h4>
.flash {
color: red;
text-align: center;
margin-bottom: 1rem;
}
{% with messages = get_flashed_messages(with_categories=true) %} {% if
messages %} {% for category, message in messages %}
<div class="flash flash-{{ category }}">{{ message }}</div>
{% endfor %} {% endif %} {% endwith %}
.title {
text-align: center;
color: #007bff;
}
<form method="post">
<input type="text" name="username" placeholder="Username" required />
<input
type="password"
name="password"
placeholder="Password"
required
/>
<button type="submit">Login</button>
</form>
</div>
</body>
</html>
.subtitle {
text-align: center;
}
</style>
</head>
<body>
<div class="login-container">
<h1 class="title">Laxmi Civil Engineering Services</h1>
<h4 class="subtitle">LOGIN</h4>
{% with messages = get_flashed_messages(with_categories=true) %} {% if
messages %} {% for category, message in messages %}
<div class="flash flash-{{ category }}">{{ message }}</div>
{% endfor %} {% endif %} {% endwith %}
<form method="post">
<input type="text" name="username" placeholder="Username" required />
<input type="password" name="password" placeholder="Password" required />
<button type="submit">Login</button>
</form>
</div>
</body>
</html>

View File

@@ -127,8 +127,6 @@
<body>
<div class="container">
<!-- Back to Dashboard Button -->
<!-- <a href="{{ url_for('index') }}" class="back-btn">← Back to Dashboard</a>-->
<h2>{{ stage }} Reports</h2>

View File

@@ -30,9 +30,6 @@
</div>
</div>
{% block scripts %}
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
{% endblock %}
{% endblock %}

View File

@@ -31,10 +31,4 @@
</div>
</div>
{% endblock %}
{% block extra_js %}
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
<!-- <script src="{{ url_for('static', filename='js/cit_calc.js') }}"></script> -->
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}

View File

@@ -30,10 +30,4 @@
</div>
{% endblock %}
{% block extra_js %}
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
<!-- <script src="{{ url_for('static', filename='js/cit_calc.js') }}"></script> -->
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}

View File

@@ -28,10 +28,4 @@
</div>
{% endblock %}
{% block extra_js %}
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
<!-- <script src="{{ url_for('static', filename='js/cit_calc.js') }}"></script> -->
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}

View File

@@ -31,10 +31,4 @@
</div>
</div>
{% endblock %}
{% block extra_js %}
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
<!-- <script src="{{ url_for('static', filename='js/cit_calc.js') }}"></script> -->
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}

View File

@@ -35,13 +35,4 @@
</div>
</div>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
{% endblock %}
{% block extra_js %}
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}