code edit itat from and mat ceadit and utility save

This commit is contained in:
2026-02-06 17:23:37 +05:30
parent 1819c49433
commit ded8d1f3b2
3 changed files with 31 additions and 7 deletions

18
main.py
View File

@@ -132,7 +132,7 @@ def add_itr():
return render_template('add_itr.html',current_date=date.today().isoformat())
## 4. DELETE an ITR record
## 4. DELETE an ITR records
@app.route('/itr/delete/<int:id>', methods=['POST'])
@auth.login_required
def delete_itr(id):
@@ -322,13 +322,27 @@ def display_itat():
def add_itat():
if request.method == 'POST':
itat = ITATHandler()
mat = MatCreditHandler()
data = {k: request.form.get(k, 0) for k in request.form}
itat.add_itat(data)
itat.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 ITR"
)
flash("ITAT record added successfully!", "success")
return redirect(url_for('display_itat'))
return render_template('add_itat.html')
return render_template('add_itat.html',current_date=date.today().isoformat())
# 3.Update ITAT records by id
@app.route('/itat/update/<int:id>', methods=['GET', 'POST'])

View File

@@ -10,8 +10,8 @@
{% block content %}
<div class="container">
<h2 style="text-align:center;">New Income Tax Appellate Tribunal Form</h2>
<form id="itat" method="POST" onsubmit="return showSuccessMessage()">
<form id="itat" method="POST" enctype="multipart/form-data" onsubmit="return showSuccessMessage()">
<input type="hidden" name="stage" value="itr">
<div class="form-group full-width inline-2">
<div>
<label>Assessment Year:</label>
@@ -22,6 +22,10 @@
</select>
<div id="yearError" style="color:red; display:none; margin-bottom:10px;"></div>
</div>
<div>
<label>Record Created Date:</label>
<input type="date" name="created_at" value="{{ current_date }}" required>
</div>
</div>
<div class="form-group full-width inline-2">
@@ -172,10 +176,16 @@
<input type="number" name="refund" class="auto" step="any" value="0.00" readonly>
</div>
<div class="form-group">
<div class="form-group full-width inline-2">
<div>
<label>Select Documents:</label>
<input type="file" name="documents" multiple>
</div>
<div>
<label>Remarks:</label>
<input type="text" name="Remarks">
</div>
</div>
<button type="submit">Submit</button>
</form>