diff --git a/AppCode/AOHandler.py b/AppCode/AOHandler.py index c90af37..b0002eb 100644 --- a/AppCode/AOHandler.py +++ b/AppCode/AOHandler.py @@ -58,6 +58,7 @@ class AOHandler: ] values = [data.get(f, 0) for f in fields] + print("---- values ---- ",values) self.cursor.callproc("InsertAO", values) self.conn.commit() diff --git a/AppCode/DocumentHandler.py b/AppCode/DocumentHandler.py index e59d6b4..7e7b006 100644 --- a/AppCode/DocumentHandler.py +++ b/AppCode/DocumentHandler.py @@ -206,7 +206,7 @@ class DocumentHandler: worksheet.write(row, col, df.iloc[row - 1, col], cell) output.seek(0) - + return send_file( output, download_name=f"Summary_Report_{year}.xlsx", diff --git a/AppCode/__pycache__/AOHandler.cpython-313.pyc b/AppCode/__pycache__/AOHandler.cpython-313.pyc index a1d3fca..6f2f327 100644 Binary files a/AppCode/__pycache__/AOHandler.cpython-313.pyc and b/AppCode/__pycache__/AOHandler.cpython-313.pyc differ diff --git a/AppCode/__pycache__/DocumentHandler.cpython-313.pyc b/AppCode/__pycache__/DocumentHandler.cpython-313.pyc index 915c4e3..9be5c9a 100644 Binary files a/AppCode/__pycache__/DocumentHandler.cpython-313.pyc and b/AppCode/__pycache__/DocumentHandler.cpython-313.pyc differ diff --git a/AppCode/__pycache__/YearGet.cpython-313.pyc b/AppCode/__pycache__/YearGet.cpython-313.pyc index 20db534..7a34475 100644 Binary files a/AppCode/__pycache__/YearGet.cpython-313.pyc and b/AppCode/__pycache__/YearGet.cpython-313.pyc differ diff --git a/main.py b/main.py index b427c66..1b193d3 100644 --- a/main.py +++ b/main.py @@ -84,8 +84,6 @@ def uploaded_file(filename): - - # @app.route('/itr', methods=['GET', 'POST']) # def itr_form(): # if request.method == 'POST': @@ -639,11 +637,9 @@ def add_itat(): # return redirect(url_for('display_itat')) - -# (You will also need to add update_itat and delete_itat functions later) - -@app.route('/cit', methods=['GET', 'POST']) -def cit_form(): +# -------------------- i dont use ------------------------- +# @app.route('/cit', methods=['GET', 'POST']) +# def cit_form(): if request.method == 'POST': data = {key: request.form.get(key, 0) for key in request.form} conn = mysql.connector.connect(**db_config) @@ -689,31 +685,31 @@ def cit_form(): return render_template('cit_form.html') - -@app.route('/itat', methods=['GET', 'POST']) -def itat_form(): - if request.method == 'POST': - mat_tax_credit = request.form['mat_tax_credit'] - surcharge = request.form['surcharge'] - cess = request.form['cess'] - total_credit = request.form['total_credit'] - year=request.form['year'] - conn = mysql.connector.connect(**db_config) - cursor = conn.cursor() - cursor.execute(""" - INSERT INTO itat (year, mat_tax_credit, surcharge, cess, total_credit) - VALUES (%s,%s, %s, %s, %s) - """, (year,mat_tax_credit, surcharge, cess, total_credit)) - conn.commit() - cursor.close() - conn.close() - return redirect(url_for('index')) - return render_template('itat_form.html') +# -------------------- i dont use ------------------------- +# @app.route('/itat', methods=['GET', 'POST']) +# def itat_form(): +# if request.method == 'POST': +# mat_tax_credit = request.form['mat_tax_credit'] +# surcharge = request.form['surcharge'] +# cess = request.form['cess'] +# total_credit = request.form['total_credit'] +# year=request.form['year'] +# conn = mysql.connector.connect(**db_config) +# cursor = conn.cursor() +# cursor.execute(""" +# INSERT INTO itat (year, mat_tax_credit, surcharge, cess, total_credit) +# VALUES (%s,%s, %s, %s, %s) +# """, (year,mat_tax_credit, surcharge, cess, total_credit)) +# conn.commit() +# cursor.close() +# conn.close() +# return redirect(url_for('index')) +# return render_template('itat_form.html') -def get_db_connection(): - connection = mysql.connector.connect(**db_config) - return connection +# def get_db_connection(): +# connection = mysql.connector.connect(**db_config) +# return connection @app.route('/reports') def reports(): @@ -1000,21 +996,21 @@ def itat_report(): # finally: # connection.close() +# -------------------- i dont use ------------------------- +# @app.route('/download/') +# def download_report(doc_id): +# conn = get_db_connection() +# cursor = conn.cursor(dictionary=True) -@app.route('/download/') -def download_report(doc_id): - conn = get_db_connection() - cursor = conn.cursor(dictionary=True) +# cursor.execute("SELECT * FROM documents WHERE id = %s", (doc_id,)) +# document = cursor.fetchone() +# conn.close() - cursor.execute("SELECT * FROM documents WHERE id = %s", (doc_id,)) - document = cursor.fetchone() - conn.close() +# if not document: +# return "Document not found", 404 - if not document: - return "Document not found", 404 - - file_path = os.path.join('static', 'uploads', document['filename']) # adjust as per your storage - return send_from_directory(directory='static/uploads', path=document['filename'], as_attachment=True) +# file_path = os.path.join('static', 'uploads', document['filename']) # adjust as per your storage +# return send_from_directory(directory='static/uploads', path=document['filename'], as_attachment=True) # @app.route('/summary_report', methods=['GET']) diff --git a/templates/update_cit.html b/templates/update_cit.html index 7a32d7f..090cae8 100644 --- a/templates/update_cit.html +++ b/templates/update_cit.html @@ -1,29 +1,74 @@ + Update CIT Record +

Update CIT Record for Year {{ record.year }}

{% for field in record.keys() if field != 'id' %} - - + + {% endfor %}
- + + \ No newline at end of file