Compare commits

44 Commits

Author SHA1 Message Date
2058cfed95 changes of report and models 2026-02-14 17:32:30 +05:30
e5c349bbf4 new field added in the from all model changes 2026-02-10 15:41:18 +05:30
4d26ee4f0f cit and itat model changes 2026-02-09 11:23:36 +05:30
6e4efad834 ao model changes 2026-02-08 13:23:32 +05:30
64fc455f5c code updated 2026-02-08 13:05:23 +05:30
33e27f73b5 new field added on Tax calculation and mat conditions appply 2026-02-08 12:42:12 +05:30
eb12d4cd2e Merge pull request 'swapnil-dev' (#3) from swapnil-dev into main
Reviewed-on: #3
2026-02-07 13:42:20 +00:00
Swapnil9693
32b6ab9b10 AO_Form_New_Updated 2026-02-07 18:50:08 +05:30
Swapnil9693
b8d540263b AO_Form_New_Updated 2026-02-07 18:36:31 +05:30
9b1b8732ef Merge pull request 'pankaj-dev' (#2) from pankaj-dev into main
Reviewed-on: #2
2026-02-07 05:45:32 +00:00
ded8d1f3b2 code edit itat from and mat ceadit and utility save 2026-02-06 17:23:37 +05:30
1819c49433 code edit cit from and auto save mat ceadit and utility 2026-02-06 16:37:54 +05:30
aaab008a9d update itr and ao from and auto save mat ceadit and utility 2026-02-06 15:14:13 +05:30
a9af2cde8a update itr and ao from and auto save mat ceadit and utility 2026-02-06 15:11:58 +05:30
a0f4568ba2 added docker and chnages of from model changes commits 2026-02-05 15:02:55 +05:30
Swapnil9693
a8e47af61c Summary report UI improvements and JS preview logic 2026-02-05 14:57:38 +05:30
438f84e284 changes of ui in dropwon select opptions and bottun colours add 2026-01-31 11:45:26 +05:30
a7eec85b8f display from and summary report heading changes 2026-01-30 12:16:32 +05:30
4592113f76 changes of cess cal 2026-01-29 18:19:49 +05:30
1a21732174 report formate changes all model 2026-01-24 18:22:28 +05:30
30a7a4287e UI changes of update from 2026-01-24 16:29:04 +05:30
50f0e77f77 UI chnage mobile view and desktop view apllyign css 2026-01-24 02:11:19 +05:30
539561c8d8 update code 2026-01-22 13:39:14 +05:30
2a9a29d4cd chnages of store proce. use and code optimize 2026-01-22 01:36:21 +05:30
7bdcee0656 changes of .env file 2026-01-21 22:59:36 +05:30
40fc148287 update year dropdown in html page 2026-01-12 15:15:12 +05:30
58139ea239 UI changes 2026-01-07 17:22:18 +05:30
68511b7558 new fom of MAT credit add in table formate and update show 2026-01-07 16:26:59 +05:30
9c2486fdd6 changes of summary report 2026-01-07 00:49:42 +05:30
f49935d706 delete not use files 2026-01-06 16:04:19 +05:30
91b7932a2f changes of ITAT from new desing and sql insert update proce chnage code of v2 2026-01-06 15:52:08 +05:30
a65e7efa63 V2 code commit 2025-12-29 15:46:50 +05:30
4da1e92a70 modification ui changes base pages,login, manus and from chnages and adding filds. V2 commit 2025-12-29 15:22:15 +05:30
425f213606 year check valid or not All form commit 2025-12-08 13:40:33 +05:30
bd24fa5f4e add dropdown year as AY yyyy formate and seprate css files commit 2025-12-06 23:17:22 +05:30
7ee2376455 add auto-calculation of CIT form commit 2025-12-04 21:09:07 +05:30
4fce58adec add auto-calculation of Itr and Ao form and also back-to dashboard button commit 2025-12-04 17:31:12 +05:30
dd339070ab modify upload documents and filter store-proc commit 2025-12-03 19:08:28 +05:30
21eb55d4b4 testing code and modify commit. 2025-12-03 10:49:31 +05:30
3cf258ba0d summary report download code commit. 2025-12-02 15:38:19 +05:30
d21daaa83f AO, cit, itat report download code commit. 2025-12-02 00:36:46 +05:30
7cf8287b34 add itai model and irt report download code commit. 2025-12-01 17:45:16 +05:30
aa063b7a80 cit model commit. 2025-12-01 12:04:07 +05:30
0d6c873515 AO model code commit 2025-11-30 20:38:41 +05:30
95 changed files with 7470 additions and 3588 deletions

5
.dockerignore Normal file
View File

@@ -0,0 +1,5 @@
__pycache__/
*.pyc
.git
.idea
venv

26
.env Normal file
View File

@@ -0,0 +1,26 @@
# -----------------------------
# Flask App Configuration
# -----------------------------
FLASK_ENV=development
FLASK_DEBUG=true
FLASK_HOST=0.0.0.0
FLASK_PORT=5010
# -----------------------------
# Security
# -----------------------------
SECRET_KEY=secret1234
# -----------------------------
# Database Configuration
# -----------------------------
DB_DIALECT=mysql
# DB_DRIVER=pymysql
DB_HOST=127.0.0.1
# DB_HOST=db # this is production for use docker
DB_NAME=income_tax_db
DB_PORT=3306
# DB_NAME=test_income_taxdb
DB_USER=root
DB_PASSWORD=root

28
.gitignore vendored Normal file
View File

@@ -0,0 +1,28 @@
# Python
*.__pycache__
*.pyc
*.pyo
*.pyd
__pycache__
# Ingnor upload files
static/uploads/
# Ignore files
venv
# Ignore Log files ss
logs/
# Environment variables
.env
# Python cache
__pycache__/
*.pyc
# OS / Editor
.vscode/
.idea/

3
.idea/.gitignore generated vendored
View File

@@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml

8
.idea/New folder.iml generated
View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -1,14 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="pandas" />
</list>
</value>
</option>
</inspection_tool>
</profile>
</component>

View File

@@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

7
.idea/misc.xml generated
View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.13 (New folder)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 (New folder)" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml generated
View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/New folder.iml" filepath="$PROJECT_DIR$/.idea/New folder.iml" />
</modules>
</component>
</project>

View File

@@ -1,7 +1,7 @@
from AppCode.Config import DBConfig
import mysql.connector
import pandas as pd
import io
class AOHandler:
@@ -9,10 +9,8 @@ class AOHandler:
self.conn = DBConfig.get_db_connection()
self.cursor = self.conn.cursor(dictionary=True)
# GET ALL AO RECORDS using stored procedure "GetAllItr"
def get_all_ao(self):
self.cursor.callproc("GetAllAO")
records = []
@@ -21,75 +19,199 @@ class AOHandler:
return records
# get ao recourd
def get_ao_by_id(self, id):
# Call stored procedure
self.cursor.callproc('GetAORById', [id])
# Fetch result
self.cursor.callproc('GetAOById', [id])
records = []
for result in self.cursor.stored_results():
records = result.fetchall()
if records:
print(records[0])
return records[0] # return single record
return records[0]
return None
# Add AO record
def add_ao(self, data):
try:
fields= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g',
'net_taxable_income', 'per_tax_a', 'tax_a_cal', 'per_surcharge_a', 'surcharge_a_cal', 'per_cess_a', 'edu_cess_a_cal', 'sum_of_a',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'created_at'
]
values = [data.get(f, 0) for f in fields]
self.cursor.callproc("InsertAO", values)
self.conn.commit()
except Exception as e:
self.conn.rollback()
raise e
finally:
self.cursor.close()
self.conn.close()
# UPDATE AO RECORD by AO id
def update_ao(self, id, data):
fields= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g',
'net_taxable_income', 'per_tax_a', 'tax_a_cal', 'per_surcharge_a', 'surcharge_a_cal', 'per_cess_a', 'edu_cess_a_cal', 'sum_of_a',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'updated_at'
]
values = [id] + [data.get(f, 0) for f in fields]
self.cursor.callproc("UpdateAOById", values)
self.conn.commit()
# DELETE RECORD by AO id
def delete_ao_by_id(self, id):
self.cursor.callproc('DeleteAOById', [id])
self.conn.commit()
# INSERT ITR RECORD using procedure "add_itr"
# def add_itr(self, data):
# report download by year
def ao_report_download(self, selected_year):
try:
# AY calculation (2020 -> AY 2020-2021)
ay_start = int(selected_year)
ay_end = ay_start + 1
assessment_year = f"AY {ay_start}-{ay_end}"
# columns = [
# 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
# 'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
# 'deduction_sec37_disallowance', 'deduction_80g', 'net_taxable_income',
# 'tax_30_percent', 'tax_book_profit_18_5', 'tax_payable', 'surcharge_12',
# 'edu_cess_3', 'total_tax_payable', 'mat_credit', 'interest_234c',
# 'total_tax', 'advance_tax', 'tds', 'tcs', 'tax_on_assessment', 'refund'
# ]
# Fetch AO records
self.cursor.callproc("GetAOByYear", [selected_year])
# values = [data.get(col, 0) for col in columns]
rows = []
for result in self.cursor.stored_results():
rows = result.fetchall()
# # Call your stored procedure
# self.cursor.callproc("InsertITR", values)
# self.conn.commit()
if not rows:
return None
# UPDATE ITR RECORD by ITR id
# def update(self, id, data):
# Remove id column if exists
for row in rows:
row.pop("id", None)
# columns = [
# 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
# 'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
# 'deduction_sec37_disallowance', 'deduction_80g', 'net_taxable_income',
# 'tax_30_percent', 'tax_book_profit_18_5', 'tax_payable', 'surcharge_12',
# 'edu_cess_3', 'total_tax_payable', 'mat_credit', 'interest_234c',
# 'total_tax', 'advance_tax', 'tds', 'tcs', 'tax_on_assessment', 'refund'
# ]
# Mapping DB fields → readable Excel labels
field_mapping = {
"gross_total_income": "Gross Total Income",
"disallowance_14a": "Add: Disallowance u/s 14A",
"disallowance_37": "Add: Disallowance u/s 37",
"-" : "-",
"deduction_80ia_business": "Less: Deduction u/s 80IA - On Business Income",
"deduction_80ia_misc": "On Misc Receipts",
"deduction_80ia_other": "On Other",
"deduction_sec37_disallowance": "On Sec 37 Disallowance",
"deduction_80g": "Less: Deduction u/s 80G",
"net_taxable_income": "Net Taxable Income",
"-" : "-",
"per_tax_a" : "Per% Tax @(A)",
"tax_a_cal" : "Tax cal(A)",
"per_surcharge_a" : "Per% surcharge @(A)",
"surcharge_a_cal" : "Surcharge cal (A)",
"per_cess_a" : "Per% cess(A)",
"edu_cess_a_cal" : "Edu cess cal(A)",
"sum_of_a" : "Sum of tax_cal(A)",
"-" : "-",
"per_tax_b" : "Per% Tax @(B)",
"tax_b_cal" : "Tax cal(B)",
"per_surcharge_b" : "Per% surcharge @(B)",
"surcharge_b_cal" : "Surcharge cal (B)",
"per_cess_b" : "Per% cess(B)",
"edu_cess_b_cal" : "Edu cess cal(B)",
"sum_of_b" : "Sum of tax_cal(B)",
"tax_payable": "Tax Payable",
"total_tax_payable": "Total Tax Payable",
"opening_balance": "Opening Balance",
"mat_credit_created": "Add: MAT Credit Created",
"mat_credit_utilized": "Less: MAT Credit Utilized",
"closing_balance": "Closing Balance",
"interest_234c": "Add: Interest u/s 234C",
"total_tax": "Total Tax",
"advance_tax": "Advance Tax",
"tds": "TDS",
"tcs": "TCS",
"sat": "SAT",
"tax_on_assessment": "Tax on Regular Assessment",
"refund" : "Refund",
"interest_244a_per143" : "Add : Interest u/s 244A as per 143",
"refund_received" : "Less : Refund Received on",
"balance_receivable" : "Balance Receivable",
"Remarks" : "Remarks"
}
# set_clause = ", ".join([f"{col}=%s" for col in columns])
# Vertical AO structure
data = []
for key, label in field_mapping.items():
value = rows[0].get(key, 0)
data.append([label, value])
# query = f"UPDATE itr SET {set_clause} WHERE id = %s"
df = pd.DataFrame(data, columns=["Particulars", "AO"])
# values = [data.get(col, 0) for col in columns]
# values.append(id)
# Excel output
output = io.BytesIO()
with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
workbook = writer.book
worksheet = workbook.add_worksheet("AO Report")
writer.sheets["AO Report"] = worksheet
# self.cursor.execute(query, tuple(values))
# self.conn.commit()
# Formats
title_fmt = workbook.add_format({
"bold": True,
"align": "center",
"font_size": 14
})
header_fmt = workbook.add_format({
"bold": True,
"border": 1,
"align": "center"
})
text_fmt = workbook.add_format({"border": 1})
num_fmt = workbook.add_format({
"border": 1,
"num_format": "#,##0.00"
})
# Company Name
worksheet.merge_range(
"A1:B1",
"Laxmi Civil Engineering Services Pvt Ltd",
title_fmt
)
# # DELETE RECORD by ITR id
# def delete_itr_by_id(self, id):
# # Call the stored procedure
# self.cursor.callproc('DeleteITRById', [id])
# self.conn.commit()
# Assessment Year
worksheet.merge_range(
"A2:B2",
f"Assessment Year : {assessment_year}",
workbook.add_format({"bold": True, "align": "center"})
)
# Header
worksheet.write_row("A4", ["Particulars", "AO"], header_fmt)
# Data rows
row_no = 4
for _, row in df.iterrows():
worksheet.write(row_no, 0, row["Particulars"], text_fmt)
worksheet.write(row_no, 1, row["AO"], num_fmt)
row_no += 1
# Column width
worksheet.set_column("A:A", 45)
worksheet.set_column("B:B", 20)
output.seek(0)
return output
except mysql.connector.Error as e:
print("MySQL Error →", e)
return None
# CLOSE CONNECTION
def close(self):
self.cursor.close()
self.conn.close()
self.conn.close()

213
AppCode/CITHandler.py Normal file
View File

@@ -0,0 +1,213 @@
from AppCode.Config import DBConfig
import mysql.connector
import pandas as pd
import io
class CITHandler:
def __init__(self):
db = DBConfig()
self.conn = db.get_db_connection()
self.cursor = self.conn.cursor(dictionary=True)
# GET ALL CIT RECORDS
def get_all_cit(self):
self.cursor.callproc("GetAllCIT")
records = []
for result in self.cursor.stored_results():
records = result.fetchall()
return records
# GET CIT BY ID
def get_cit_by_id(self, id):
self.cursor.callproc("GetCITById", [id])
records = []
for result in self.cursor.stored_results():
records = result.fetchall()
if records:
return records[0]
return None
# INSERT CIT RECORD
def add_cit(self, data):
columns= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g',
'net_taxable_income', 'per_tax_a', 'tax_a_cal', 'per_surcharge_a', 'surcharge_a_cal', 'per_cess_a', 'edu_cess_a_cal', 'sum_of_a',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'created_at'
]
values = [data.get(col, 0) for col in columns]
self.cursor.callproc("InsertCIT", values)
self.conn.commit()
# UPDATE CIT RECORD
def update_cit(self, id, data):
columns= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g',
'net_taxable_income', 'per_tax_a', 'tax_a_cal', 'per_surcharge_a', 'surcharge_a_cal', 'per_cess_a', 'edu_cess_a_cal', 'sum_of_a',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'updated_at'
]
values = [id] + [data.get(col, 0) for col in columns]
self.cursor.callproc("UpdateCITById", values)
self.conn.commit()
# DELETE CIT RECORD
def delete_cit(self, id):
self.cursor.callproc("DeleteCITById", [id])
self.conn.commit()
#
def cit_report_download(self, selected_year):
try:
# AY calculation (2020 -> AY 2020-2021)
ay_start = int(selected_year)
ay_end = ay_start + 1
assessment_year = f"AY {ay_start}-{ay_end}"
# Fetch CIT records
self.cursor.callproc("GetCITByYear", [selected_year])
rows = []
for result in self.cursor.stored_results():
rows = result.fetchall()
if not rows:
return None
# Remove id column if exists
for row in rows:
row.pop("id", None)
# Mapping DB fields → readable Excel labels
field_mapping = {
"gross_total_income": "Gross Total Income",
"disallowance_14a": "Add: Disallowance u/s 14A",
"disallowance_37": "Add: Disallowance u/s 37",
"-" : "-",
"deduction_80ia_business": "Less: Deduction u/s 80IA - On Business Income",
"deduction_80ia_misc": "On Misc Receipts",
"deduction_80ia_other": "On Other",
"deduction_sec37_disallowance": "On Sec 37 Disallowance",
"deduction_80g": "Less: Deduction u/s 80G",
"net_taxable_income": "Net Taxable Income",
"-" : "-",
"per_tax_a" : "Per% Tax @(A)",
"tax_a_cal" : "Tax cal(A)",
"per_surcharge_a" : "Per% surcharge @(A)",
"surcharge_a_cal" : "Surcharge cal (A)",
"per_cess_a" : "Per% cess(A)",
"edu_cess_a_cal" : "Edu cess cal(A)",
"sum_of_a" : "Sum of tax_cal(A)",
"-" : "-",
"per_tax_b" : "Per% Tax @(B)",
"tax_b_cal" : "Tax cal(B)",
"per_surcharge_b" : "Per% surcharge @(B)",
"surcharge_b_cal" : "Surcharge cal (B)",
"per_cess_b" : "Per% cess(B)",
"edu_cess_b_cal" : "Edu cess cal(B)",
"sum_of_b" : "Sum of tax_cal(B)",
"tax_payable": "Tax Payable",
"total_tax_payable": "Total Tax Payable",
"opening_balance": "Opening Balance",
"mat_credit_created": "Add: MAT Credit Created",
"mat_credit_utilized": "Less: MAT Credit Utilized",
"closing_balance": "Closing Balance",
"interest_234c": "Add: Interest u/s 234C",
"total_tax": "Total Tax",
"advance_tax": "Advance Tax",
"tds": "TDS",
"tcs": "TCS",
"sat": "SAT",
"tax_on_assessment": "Tax on Regular Assessment",
"refund" : "Refund",
"interest_244a_per143" : "Add : Interest u/s 244A as per 143",
"refund_received" : "Less : Refund Received on",
"balance_receivable" : "Balance Receivable",
"Remarks" : "Remarks"
}
# Vertical CIT structure (single record per year)
data = []
for key, label in field_mapping.items():
value = rows[0].get(key, 0)
data.append([label, value])
df = pd.DataFrame(data, columns=["Particulars", "CIT"])
# Excel output
output = io.BytesIO()
with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
workbook = writer.book
worksheet = workbook.add_worksheet("CIT Report")
writer.sheets["CIT Report"] = worksheet
# Formats
title_fmt = workbook.add_format({
"bold": True,
"align": "center",
"font_size": 14
})
header_fmt = workbook.add_format({
"bold": True,
"border": 1,
"align": "center"
})
text_fmt = workbook.add_format({"border": 1})
num_fmt = workbook.add_format({
"border": 1,
"num_format": "#,##0.00"
})
# Company Name
worksheet.merge_range(
"A1:B1",
"Laxmi Civil Engineering Services Pvt Ltd",
title_fmt
)
# Assessment Year
worksheet.merge_range(
"A2:B2",
f"Assessment Year : {assessment_year}",
workbook.add_format({"bold": True, "align": "center"})
)
# Header
worksheet.write_row("A4", ["Particulars", "CIT"], header_fmt)
# Data rows
row_no = 4
for _, row in df.iterrows():
worksheet.write(row_no, 0, row["Particulars"], text_fmt)
worksheet.write(row_no, 1, row["CIT"], num_fmt)
row_no += 1
# Column widths
worksheet.set_column("A:A", 45)
worksheet.set_column("B:B", 20)
output.seek(0)
return output
except mysql.connector.Error as e:
print("MySQL Error →", e)
return None
# CLOSE CONNECTION
def close(self):
self.cursor.close()
self.conn.close()

View File

@@ -1,21 +1,43 @@
# import mysql.connector
# import os
# # Database Config
# class DBConfig:
# MYSQL_HOST = os.getenv("DB_HOST")
# MYSQL_USER = os.getenv("DB_USER")
# MYSQL_PASSWORD = os.getenv("DB_PASSWORD")
# MYSQL_DB = os.getenv("DB_NAME")
# @staticmethod
# def get_db_connection():
# """
# Returns a MySQL connection object.
# """
# return mysql.connector.connect(
# host=DBConfig.MYSQL_HOST,
# user=DBConfig.MYSQL_USER,
# password=DBConfig.MYSQL_PASSWORD,
# database=DBConfig.MYSQL_DB
# )
import mysql.connector
import os
class DBConfig:
# Database credentials (can also be read from environment variables)
MYSQL_HOST = os.getenv("MYSQL_HOST", "127.0.0.1")
MYSQL_USER = os.getenv("MYSQL_USER", "root")
MYSQL_PASSWORD = os.getenv("MYSQL_PASSWORD", "root")
MYSQL_DB = os.getenv("MYSQL_DB", "income_tax")
class DBConfig:
@staticmethod
def get_db_connection():
"""
Returns a MySQL connection object.
Create and return a MySQL database connection
using environment variables.
"""
return mysql.connector.connect(
host=DBConfig.MYSQL_HOST,
user=DBConfig.MYSQL_USER,
password=DBConfig.MYSQL_PASSWORD,
database=DBConfig.MYSQL_DB
host=os.getenv("DB_HOST", "db"), # Docker service name
port=int(os.getenv("DB_PORT", 3306)),
user=os.getenv("DB_USER", "root"),
password=os.getenv("DB_PASSWORD", "root"),
database=os.getenv("DB_NAME", "test_income_taxdb"),
autocommit=False
)

View File

@@ -1,7 +1,15 @@
from flask import (
render_template, request, send_file, jsonify
)
from werkzeug.utils import secure_filename
import pandas as pd
import os
import io
from AppCode.Config import DBConfig
from AppCode.FileHandler import FileHandler
from werkzeug.utils import secure_filename
from AppCode.YearGet import YearGet
class DocumentHandler:
@@ -11,11 +19,33 @@ class DocumentHandler:
self.isSuccess = False
self.resultMessage = ""
# VIEW DOCUMENTS
# =========================
# Utility: Parse Year
# =========================
def parse_year(self, year_value):
if not year_value:
return None
year_value = year_value.strip()
if year_value.isdigit():
return int(year_value)
try:
# "AY 2026-2027" → 2026
return int(year_value.split()[1].split('-')[0])
except Exception:
return None
# =========================
# View Documents
# =========================
def View(self, request):
year = request.args.get('year', '')
year_raw = request.args.get('year', '')
stage = request.args.get('stage', '')
year = self.parse_year(year_raw)
dbconfig = DBConfig()
connection = dbconfig.get_db_connection()
@@ -25,75 +55,394 @@ class DocumentHandler:
cursor = connection.cursor(dictionary=True)
# --- FILTER QUERY ---
query = "SELECT * FROM documents WHERE 1=1"
params = []
cursor.callproc("GetDocuments", [year, stage])
if year != "":
query += " AND year = %s"
params.append(year)
for result in cursor.stored_results():
self.documents = result.fetchall()
break
if stage != "":
query += " AND stage = %s"
params.append(stage)
cursor.execute(query, params)
self.documents = cursor.fetchall()
# ---- GET YEARS FROM STORED PROCEDURE ----
cursor.callproc("GetYear")
for result in cursor.stored_results():
year_rows = result.fetchall()
break # only first result set
break
self.years = [row['year'] for row in year_rows]
cursor.close()
connection.close()
self.isSuccess = True
# UPLOAD DOCUMENTS
# =========================
# Upload Documents
# =========================
def Upload(self, request):
"""Log user actions with timestamp, user, action, and details."""
dbconfig = DBConfig()
connection = dbconfig.get_db_connection()
if connection:
cursor = connection.cursor()
files = request.files.getlist('documents')
year = request.form['year']
stage = request.form['stage']
for file in files:
if file is not FileHandler.ALLOWED_EXTENSIONS:
continue
if not connection:
return
cursor = connection.cursor()
filename = secure_filename(file.filename)
filepath = os.path.join(FileHandler.UPLOAD_FOLDER, filename)
extension = file.filename.rsplit('.', 1)[1]
# Need to Check whetehr all three items are required
files = request.files.getlist('documents')
year_raw = request.form.get('year')
stage = request.form.get('stage')
file.save(filepath)
year = self.parse_year(year_raw)
# cursor.execute("""
# INSERT INTO documents (filename, filepath, filetype, year, stage)
# VALUES (%s, %s, %s, %s, %s)
# """, (filename, filepath, file.filename.rsplit('.', 1)[1], year, stage))
if not year:
self.resultMessage = "Invalid year selected."
return
for file in files:
if '.' not in file.filename:
continue
cursor.callproc('InsertDocument', [
filename,
filepath,
extension,
year,
stage
])
extension = file.filename.rsplit('.', 1)[1].lower()
connection.commit()
cursor.close()
if extension not in FileHandler.ALLOWED_EXTENSIONS:
print("Skipping invalid file:", extension)
continue
filename = secure_filename(file.filename)
filepath = os.path.join(FileHandler.UPLOAD_FOLDER, filename)
file.save(filepath)
cursor.callproc(
'InsertDocument',
[filename, filepath, extension, year, stage]
)
connection.commit()
cursor.close()
connection.close()
# =========================
# Summary Preview (JSON)
# =========================
def Summary_preview(self, request):
"""
Returns JSON preview of summary report for selected year.
"""
year_raw = request.args.get("year")
year = self.parse_year(year_raw)
if not year:
return jsonify([])
dbconfig = DBConfig()
connection = dbconfig.get_db_connection()
if not connection:
return jsonify([])
try:
stages = {
"ITR": "itr",
"AO": "ao",
"CIT": "cit",
"ITAT": "itat",
}
stage_data = {}
for stage_name, table_name in stages.items():
cursor = connection.cursor(dictionary=True)
cursor.callproc("sp_get_stage_data", [table_name, year])
rows = []
for result in cursor.stored_results():
rows = result.fetchall()
stage_data[stage_name] = pd.DataFrame(rows) if rows else pd.DataFrame()
cursor.close()
columns = [
'gross_total_income', 'disallowance_14a',
'disallowance_37',
'gross_total_income'+'disallowance_14a'+'disallowance_37',
'deduction_80ia_business',
'deduction_80ia_misc',
'deduction_80ia_other',
'deduction_sec37_disallowance',
'deduction_80g', '-',
'net_taxable_income',
'-',
'per_tax_a',
'tax_a_cal',
'per_surcharge_a',
'surcharge_a_cal',
'per_cess_a',
'edu_cess_a_cal',
'sum_of_a',
'-',
'per_tax_b',
'tax_b_cal',
'per_surcharge_b',
'surcharge_b_cal',
'per_cess_b',
'edu_cess_b_cal',
'sum_of_b',
'-',
'tax_payable',
'total_tax_payable',
'opening_balance',
'mat_credit_created',
'mat_credit_utilized',
'closing_balance',
'interest_234c', 'total_tax',
'-', 'advance_tax', 'tds',
'tcs', 'sat',
'tax_on_assessment',
'refund',
'interest_244a_per143',
'refund_received',
'balance_receivable',
'Remarks'
]
particulars = [
"Gross Total Income", "Add: Disallowance u/s 14A",
"Add: Disallowance u/s 37", "GTI as per",
"Less: Deduction u/s 80IA - On Business Income",
"- On Misc Receipts", "- On Other",
"- On Sec 37 Disallowance",
"Less: Deduction u/s 80G", "-",
"Net Taxable Income", "-",
"Per% Tax @(A)",
"Tax cal(A)",
"Per% surcharge @(A)",
"Surcharge cal (A)",
"Per% cess(A)",
"Edu cess cal(A)",
"Sum of tax_cal(A)",
"-",
"Per% Tax @(B)",
"Tax cal(B)",
"Per% surcharge @(B)",
"Surcharge cal (B)",
"Per% cess(B)",
"Edu cess cal(B)",
"Sum of tax_cal(B)",
"-",
"Tax Payable",
"Total Tax Payable",
"Opening Balance:",
"Add: MAT Credit Created",
"Less: MAT Credit Utilized",
"Closing Balance",
"Add: Interest u/s 234C",
"Total Tax", "-",
"Advance Tax", "TDS", "TCS", "SAT",
"Tax on Regular Assessment",
"Refund", "Add : Interest u/s 244A as per 143",
"Less : Refund Received on:","Balance Receivable","Remarks"
]
def safe_get(df, col):
return df[col].values[0] if col in df.columns and not df.empty else 0
preview = []
for i, part in enumerate(particulars):
preview.append({
"Particular": part,
"ITR": safe_get(stage_data['ITR'], columns[i]),
"AO": safe_get(stage_data['AO'], columns[i]),
"CIT": safe_get(stage_data['CIT'], columns[i]),
"ITAT": safe_get(stage_data['ITAT'], columns[i]),
})
return jsonify(preview)
finally:
connection.close()
# return redirect(url_for('view_documents'))
def Summary_report(self, request):
dbconfig = DBConfig()
connection = dbconfig.get_db_connection()
year_raw = request.args.get('year')
# Safely parse year to int
try:
year = int(year_raw)
except (TypeError, ValueError):
year = None
if not year:
yearGetter = YearGet()
allYears = yearGetter.get_year_by_model("AllYearsInAllModel")
yearGetter.close()
return render_template(
'summary_reports.html',
years=allYears,
message="Please select a valid year to download."
)
try:
stages = {
"ITR": "itr",
"AO": "ao",
"CIT": "cit",
"ITAT": "itat",
}
stage_data = {}
for stage_name, table_name in stages.items():
cursor = connection.cursor(dictionary=True)
cursor.callproc("sp_get_stage_data", [table_name, year])
rows = []
for result in cursor.stored_results():
rows = result.fetchall()
stage_data[stage_name] = pd.DataFrame(rows) if rows else pd.DataFrame()
cursor.close()
def safe_get(df, col):
return df[col].values[0] if col in df.columns and not df.empty else "-"
particulars = [
"Gross Total Income", "Add: Disallowance u/s 14A",
"Add: Disallowance u/s 37", "GTI as per",
"Less: Deduction u/s 80IA - On Business Income",
"- On Misc Receipts", "- On Other",
"- On Sec 37 Disallowance",
"Less: Deduction u/s 80G", "-",
"Net Taxable Income", "-",
"Per% Tax @(A)",
"Tax cal(A)",
"Per% surcharge @(A)",
"Surcharge cal (A)",
"Per% cess(A)",
"Edu cess cal(A)",
"Sum of tax_cal(A)",
"-",
"Per% Tax @(B)",
"Tax cal(B)",
"Per% surcharge @(B)",
"Surcharge cal (B)",
"Per% cess(B)",
"Edu cess cal(B)",
"Sum of tax_cal(B)",
"-",
"Tax Payable",
"Total Tax Payable",
"Opening Balance",
"Add: MAT Credit Created",
"Less: MAT Credit Utilized",
"Closing Balance",
"Add: Interest u/s 234C",
"Total Tax", "-",
"Advance Tax", "TDS", "TCS", "SAT",
"Tax on Regular Assessment",
"Refund", "Add : Interest u/s 244A as per 143",
"Less : Refund Received on","Balance Receivable","Remarks"
]
columns = [
'gross_total_income', 'disallowance_14a',
'disallowance_37',
'gross_total_income'+'disallowance_14a'+'disallowance_37',
'deduction_80ia_business',
'deduction_80ia_misc',
'deduction_80ia_other',
'deduction_sec37_disallowance',
'deduction_80g', '-',
'net_taxable_income',
'-',
'per_tax_a',
'tax_a_cal',
'per_surcharge_a',
'surcharge_a_cal',
'per_cess_a',
'edu_cess_a_cal',
'sum_of_a',
'-',
'per_tax_b',
'tax_b_cal',
'per_surcharge_b',
'surcharge_b_cal',
'per_cess_b',
'edu_cess_b_cal',
'sum_of_b',
'-',
'tax_payable',
'total_tax_payable',
'opening_balance',
'mat_credit_created',
'mat_credit_utilized',
'closing_balance',
'interest_234c', 'total_tax',
'-', 'advance_tax', 'tds',
'tcs', 'sat',
'tax_on_assessment',
'refund',
'interest_244a_per143',
'refund_received',
'balance_receivable',
'Remarks'
]
data = {
"Particulars": particulars,
"ITR": [safe_get(stage_data['ITR'], col) for col in columns],
"AO": [safe_get(stage_data['AO'], col) for col in columns],
"CIT": [safe_get(stage_data['CIT'], col) for col in columns],
"ITAT": [safe_get(stage_data['ITAT'], col) for col in columns],
}
df = pd.DataFrame(data)
output = io.BytesIO()
with pd.ExcelWriter(output, engine='xlsxwriter') as writer:
sheet_name = f"AY {year}-{year + 1}"
df.to_excel(writer, index=False, sheet_name=sheet_name, startrow=2)
workbook = writer.book
worksheet = writer.sheets[sheet_name]
title = workbook.add_format({
'bold': True,
'font_size': 14,
'align': 'center'
})
worksheet.merge_range(
0, 0, 0, len(df.columns) - 1,
"Laxmi Civil Engineering Services Pvt Ltd",
title
)
header = workbook.add_format({
'bold': True,
'align': 'center',
'bg_color': '#007bff',
'font_color': 'white',
'border': 1
})
cell = workbook.add_format({'border': 1})
for col_num, col_name in enumerate(df.columns):
worksheet.write(2, col_num, col_name, header)
worksheet.set_column(col_num, col_num, 25)
for row in range(len(df)):
for col in range(len(df.columns)):
worksheet.write(row + 3, col, df.iloc[row, col], cell)
worksheet.freeze_panes(3, 1)
output.seek(0)
return send_file(
output,
download_name=f"AY{year}-{year + 1}_Summary_Report.xlsx",
as_attachment=True,
mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
)
finally:
connection.close()

View File

@@ -9,4 +9,5 @@ class FileHandler:
def CHeckExistingOrCreateNewUploadFolder():
#Wheteher path exists
os.makedirs(FileHandler.UPLOAD_FOLDER, exist_ok=True)
return
return

208
AppCode/ITATHandler.py Normal file
View File

@@ -0,0 +1,208 @@
from AppCode.Config import DBConfig
import mysql.connector
import pandas as pd
import io
class ITATHandler:
def __init__(self):
self.conn = DBConfig.get_db_connection()
self.cursor = self.conn.cursor(dictionary=True)
# GET ALL ITAT RECORDS (PROC)
def get_all_itat(self):
self.cursor.callproc("GetAllITAT")
records = []
for result in self.cursor.stored_results():
records = result.fetchall()
return records
# GET ITAT BY ID (PROC)
def get_itat_by_id(self, id):
self.cursor.callproc("GetITATById", [id])
records = []
for result in self.cursor.stored_results():
records = result.fetchall()
if records:
return records[0]
return None
# INSERT ITAT (PROC)
def add_itat(self, data):
columns= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g',
'net_taxable_income', 'per_tax_a', 'tax_a_cal', 'per_surcharge_a', 'surcharge_a_cal', 'per_cess_a', 'edu_cess_a_cal', 'sum_of_a',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'created_at'
]
values = [data.get(col, 0) for col in columns]
self.cursor.callproc("InsertITAT", values)
self.conn.commit()
# UPDATE ITAT (PROC)
def update_itat(self, id, data):
columns= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g',
'net_taxable_income', 'per_tax_a', 'tax_a_cal', 'per_surcharge_a', 'surcharge_a_cal', 'per_cess_a', 'edu_cess_a_cal', 'sum_of_a',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'updated_at'
]
values = [id] + [data.get(col, 0) for col in columns]
self.cursor.callproc("UpdateITAT", values)
self.conn.commit()
# DELETE ITAT BY ID (PROC)
def delete_itat_by_id(self, id):
self.cursor.callproc("DeleteITATById", [id])
self.conn.commit()
def itat_report_download(self, selected_year):
try:
# AY calculation (2020 -> AY 2020-2021)
ay_start = int(selected_year)
ay_end = ay_start + 1
assessment_year = f"AY {ay_start}-{ay_end}"
# Fetch ITAT data
self.cursor.callproc("GetITATByYear", [selected_year])
rows = []
for result in self.cursor.stored_results():
rows = result.fetchall()
if not rows:
return None
# Remove id column if exists
for row in rows:
row.pop("id", None)
# Mapping DB fields → readable Excel labels
field_mapping = {
"gross_total_income": "Gross Total Income",
"disallowance_14a": "Add: Disallowance u/s 14A",
"disallowance_37": "Add: Disallowance u/s 37",
"-" : "-",
"deduction_80ia_business": "Less: Deduction u/s 80IA - On Business Income",
"deduction_80ia_misc": "On Misc Receipts",
"deduction_80ia_other": "On Other",
"deduction_sec37_disallowance": "On Sec 37 Disallowance",
"deduction_80g": "Less: Deduction u/s 80G",
"net_taxable_income": "Net Taxable Income",
"-" : "-",
"per_tax_a" : "Per% Tax @(A)",
"tax_a_cal" : "Tax cal(A)",
"per_surcharge_a" : "Per% surcharge @(A)",
"surcharge_a_cal" : "Surcharge cal (A)",
"per_cess_a" : "Per% cess(A)",
"edu_cess_a_cal" : "Edu cess cal(A)",
"sum_of_a" : "Sum of tax_cal(A)",
"-" : "-",
"per_tax_b" : "Per% Tax @(B)",
"tax_b_cal" : "Tax cal(B)",
"per_surcharge_b" : "Per% surcharge @(B)",
"surcharge_b_cal" : "Surcharge cal (B)",
"per_cess_b" : "Per% cess(B)",
"edu_cess_b_cal" : "Edu cess cal(B)",
"sum_of_b" : "Sum of tax_cal(B)",
"tax_payable": "Tax Payable",
"total_tax_payable": "Total Tax Payable",
"opening_balance": "Opening Balance",
"mat_credit_created": "Add: MAT Credit Created",
"mat_credit_utilized": "Less: MAT Credit Utilized",
"closing_balance": "Closing Balance",
"interest_234c": "Add: Interest u/s 234C",
"total_tax": "Total Tax",
"advance_tax": "Advance Tax",
"tds": "TDS",
"tcs": "TCS",
"sat": "SAT",
"tax_on_assessment": "Tax on Regular Assessment",
"refund" : "Refund",
"interest_244a_per143" : "Add : Interest u/s 244A as per 143",
"refund_received" : "Less : Refund Received on",
"balance_receivable" : "Balance Receivable",
"Remarks" : "Remarks"
}
# Vertical ITAT structure
data = []
for key, label in field_mapping.items():
value = rows[0].get(key, 0)
data.append([label, value])
df = pd.DataFrame(data, columns=["Particulars", "ITAT"])
# Excel output
output = io.BytesIO()
with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
workbook = writer.book
worksheet = workbook.add_worksheet("ITAT Report")
writer.sheets["ITAT Report"] = worksheet
# Formats
title_fmt = workbook.add_format({
"bold": True,
"align": "center",
"font_size": 14
})
header_fmt = workbook.add_format({
"bold": True,
"border": 1,
"align": "center"
})
text_fmt = workbook.add_format({"border": 1})
num_fmt = workbook.add_format({
"border": 1,
"num_format": "#,##0.00"
})
# Company Name
worksheet.merge_range(
"A1:B1",
"Laxmi Civil Engineering Services Pvt Ltd",
title_fmt
)
# Assessment Year
worksheet.merge_range(
"A2:B2",
f"Assessment Year : {assessment_year}",
workbook.add_format({"bold": True, "align": "center"})
)
# Header
worksheet.write_row("A4", ["Particulars", "ITAT"], header_fmt)
# Data rows
row_no = 4
for _, row in df.iterrows():
worksheet.write(row_no, 0, row["Particulars"], text_fmt)
worksheet.write(row_no, 1, row["ITAT"], num_fmt)
row_no += 1
# Column widths
worksheet.set_column("A:A", 45)
worksheet.set_column("B:B", 20)
output.seek(0)
return output
except mysql.connector.Error as e:
print("MySQL Error →", e)
return None
# CLOSE CONNECTION
def close(self):
self.cursor.close()
self.conn.close()

View File

@@ -1,6 +1,9 @@
from AppCode.Config import DBConfig
import mysql.connector
import pandas as pd
import io
from flask import send_file, render_template, request
from AppCode.Config import DBConfig
class ITRHandler:
@@ -9,20 +12,16 @@ class ITRHandler:
self.conn = DBConfig.get_db_connection()
self.cursor = self.conn.cursor(dictionary=True)
# GET ALL ITR RECORDS using stored procedure "GetAllItr"
def get_all_itr(self):
# self.cursor = conn.cursor(dictionary=True)
self.cursor.callproc("GetAllItr")
records = []
for result in self.cursor.stored_results():
records = result.fetchall()
return records
# get itr record by id
def get_itr_by_id(self, id):
# Call stored procedure
self.cursor.callproc('GetITRById', [id])
@@ -39,58 +38,178 @@ class ITRHandler:
return None
# INSERT ITR RECORD using procedure "add_itr"
def add_itr(self, data):
try:
columns= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g',
'net_taxable_income', 'per_tax_a', 'tax_a_cal', 'per_surcharge_a', 'surcharge_a_cal', 'per_cess_a', 'edu_cess_a_cal', 'sum_of_a',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'created_at'
]
columns = [
'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
'deduction_sec37_disallowance', 'deduction_80g', 'net_taxable_income',
'tax_30_percent', 'tax_book_profit_18_5', 'tax_payable', 'surcharge_12',
'edu_cess_3', 'total_tax_payable', 'mat_credit', 'interest_234c',
'total_tax', 'advance_tax', 'tds', 'tcs', 'tax_on_assessment', 'refund'
]
values = [data.get(col, 0) for col in columns]
values = [data.get(col, 0) for col in columns]
# Call your stored procedure
self.cursor.callproc("InsertITR", values)
self.conn.commit()
except Exception as e:
self.conn.rollback()
raise e
finally:
self.cursor.close()
self.conn.close()
# Call your stored procedure
self.cursor.callproc("InsertITR", values)
self.conn.commit()
# UPDATE ITR RECORD by ITR id
# update itr by id
def update(self, id, data):
columns= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g',
'net_taxable_income', 'per_tax_a', 'tax_a_cal', 'per_surcharge_a', 'surcharge_a_cal', 'per_cess_a', 'edu_cess_a_cal', 'sum_of_a',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'updated_at'
]
columns = [
'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
'deduction_sec37_disallowance', 'deduction_80g', 'net_taxable_income',
'tax_30_percent', 'tax_book_profit_18_5', 'tax_payable', 'surcharge_12',
'edu_cess_3', 'total_tax_payable', 'mat_credit', 'interest_234c',
'total_tax', 'advance_tax', 'tds', 'tcs', 'tax_on_assessment', 'refund'
]
set_clause = ", ".join([f"{col}=%s" for col in columns])
query = f"UPDATE itr SET {set_clause} WHERE id = %s"
values = [data.get(col, 0) for col in columns]
values.append(id)
self.cursor.execute(query, tuple(values))
values = [id] + [data.get(col, 0) for col in columns]
self.cursor.callproc("UpdateITR", values)
self.conn.commit()
# DELETE RECORD by ITR id
# DELETE RECORD by ITR id
def delete_itr_by_id(self, id):
# Call the stored procedure
self.cursor.callproc('DeleteITRById', [id])
self.conn.commit()
# # report download by year
def itr_report_download(self, selected_year):
try:
# Call stored procedure
self.cursor.callproc("GetITRByYear", [selected_year])
rows = []
for result in self.cursor.stored_results():
rows = result.fetchall()
if not rows:
return None
for row in rows:
row.pop('id', None)
# Mapping DB fields → Excel labels (NO underscores)
field_mapping = {
"gross_total_income": "Gross Total Income",
"disallowance_14a": "Add: Disallowance u/s 14A",
"disallowance_37": "Add: Disallowance u/s 37",
"-" : "-",
"deduction_80ia_business": "Less: Deduction u/s 80IA - On Business Income",
"deduction_80ia_misc": "On Misc Receipts",
"deduction_80ia_other": "On Other",
"deduction_sec37_disallowance": "On Sec 37 Disallowance",
"deduction_80g": "Less: Deduction u/s 80G",
"net_taxable_income": "Net Taxable Income",
"-" : "-",
"per_tax_a" : "Per% Tax @(A)",
"tax_a_cal" : "Tax cal(A)",
"per_surcharge_a" : "Per% surcharge @(A)",
"surcharge_a_cal" : "Surcharge cal (A)",
"per_cess_a" : "Per% cess(A)",
"edu_cess_a_cal" : "Edu cess cal(A)",
"sum_of_a" : "Sum of tax_cal(A)",
"-" : "-",
"per_tax_b" : "Per% Tax @(B)",
"tax_b_cal" : "Tax cal(B)",
"per_surcharge_b" : "Per% surcharge @(B)",
"surcharge_b_cal" : "Surcharge cal (B)",
"per_cess_b" : "Per% cess(B)",
"edu_cess_b_cal" : "Edu cess cal(B)",
"sum_of_b" : "Sum of tax_cal(B)",
"tax_payable": "Tax Payable",
"total_tax_payable": "Total Tax Payable",
"opening_balance": "Opening Balance",
"mat_credit_created": "Add: MAT Credit Created",
"mat_credit_utilized": "Less: MAT Credit Utilized",
"closing_balance": "Closing Balance",
"interest_234c": "Add: Interest u/s 234C",
"total_tax": "Total Tax",
"advance_tax": "Advance Tax",
"tds": "TDS",
"tcs": "TCS",
"sat": "SAT",
"tax_on_assessment": "Tax on Regular Assessment",
"refund" : "Refund",
"interest_244a_per143" : "Add : Interest u/s 244A as per 143",
"refund_received" : "Less : Refund Received on",
"balance_receivable" : "Balance Receivable",
"Remarks" : "Remarks"
}
# Convert to vertical structures
data = []
for key, label in field_mapping.items():
value = rows[0].get(key, 0)
data.append([label, value])
df = pd.DataFrame(data, columns=["Particulars", "ITR"])
# Excel output
output = io.BytesIO()
with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
workbook = writer.book
worksheet = workbook.add_worksheet("ITR Report")
writer.sheets["ITR Report"] = worksheet
# Formats
title_fmt = workbook.add_format({
"bold": True, "align": "center", "valign": "vcenter",
"font_size": 14
})
header_fmt = workbook.add_format({
"bold": True, "border": 1, "align": "center"
})
cell_fmt = workbook.add_format({"border": 1})
num_fmt = workbook.add_format({"border": 1, "num_format": "#,##0.00"})
# Company name
worksheet.merge_range("A1:B1", "Laxmi Civil Engineering Services Pvt Ltd", title_fmt)
ay_start = int(selected_year)
ay_end = ay_start + 1
assessment_year = f"AY {ay_start}-{ay_end}"
# Assessment Year
worksheet.merge_range(
"A2:B2",
f"Assessment Year : {assessment_year}",
workbook.add_format({"align": "center", "bold": True})
)
# Headers
worksheet.write_row("A4", ["Particulars", "ITR"], header_fmt)
# Data rows
row_no = 4
for _, row in df.iterrows():
worksheet.write(row_no, 0, row["Particulars"], cell_fmt)
worksheet.write(row_no, 1, row["ITR"], num_fmt)
row_no += 1
# Column widths
worksheet.set_column("A:A", 45)
worksheet.set_column("B:B", 20)
output.seek(0)
return output
except mysql.connector.Error as e:
print("MySQL Error →", e)
return None
# CLOSE CONNECTION
def close(self):
self.cursor.close()
self.conn.close()
self.conn.close()

View File

@@ -1,10 +1,9 @@
import os
from flask import Flask, render_template, request, redirect, url_for, send_from_directory, flash, jsonify, json
from flask import current_app
from datetime import datetime
from flask_login import LoginManager, UserMixin, login_user, logout_user, login_required, current_user
import os
class LogHelper:
@staticmethod
@@ -14,9 +13,7 @@ class LogHelper:
logData.WriteLog(action, details="")
class LogData:
filepath = ""
timestamp = None

1
AppCode/Login.py Normal file
View File

@@ -0,0 +1 @@

75
AppCode/LoginAuth.py Normal file
View File

@@ -0,0 +1,75 @@
from flask import Blueprint, render_template, request, redirect, url_for, flash, session
from functools import wraps
from ldap3 import Server, Connection, ALL
from ldap3.core.exceptions import LDAPException
class LoginAuth:
def __init__(self):
# Create Blueprint
self.bp = Blueprint("auth", __name__)
# -------------------------------
# LDAP CONFIGURATION
# -------------------------------
self.LDAP_SERVER = "ldap://localhost:389"
self.BASE_DN = "ou=users,dc=lcepl,dc=org" # LDAP Users DN
# -------------------------------
# LOGIN ROUTE
# -------------------------------
@self.bp.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'POST':
username = request.form.get("username")
password = request.form.get("password")
if not username or not password:
flash("Username and password are required!", "danger")
return render_template("login.html")
user_dn = f"uid={username},{self.BASE_DN}"
server = Server(self.LDAP_SERVER, get_info=ALL)
try:
# Attempt LDAP bind
conn = Connection(server, user=user_dn, password=password, auto_bind=True)
if conn.bound:
session['user'] = username
flash(f"Login successful! Welcome {username}", "success")
return redirect(url_for('welcome'))
else:
flash("Invalid username or password!", "danger")
except LDAPException as e:
flash(f"LDAP login failed: {str(e)}", "danger")
finally:
if 'conn' in locals():
conn.unbind()
# GET request: show login form
return render_template("login.html")
# -------------------------------
# LOGOUT ROUTE
# -------------------------------
@self.bp.route('/logout')
def logout():
session.clear()
flash("Logged out successfully!", "success")
return redirect(url_for('auth.login'))
# ===================================================
# LOGIN REQUIRED DECORATOR INSIDE CLASS
# ===================================================
def login_required(self, f):
"""
Protect routes: redirect to login if user not authenticated.
"""
@wraps(f)
def wrapper(*args, **kwargs):
if "user" not in session:
flash("Please login first!", "danger")
return redirect(url_for("auth.login"))
return f(*args, **kwargs)
return wrapper

128
AppCode/MatCreditHandler.py Normal file
View File

@@ -0,0 +1,128 @@
from AppCode.Config import DBConfig
class MatCreditHandler:
def __init__(self):
self.conn = DBConfig.get_db_connection()
self.cursor = self.conn.cursor(dictionary=True)
# --------------------------------------------------
# FETCH ALL MAT CREDIT + UTILIZATION (For UI Display)
# --------------------------------------------------
def fetch_all(self):
try:
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:
self.cursor.close()
self.conn.close()
# --------------------------------------------------
# SAVE / UPDATE SINGLE MAT ROW (FROM MANUAL UI)
# --------------------------------------------------
@staticmethod
def save_single(data):
conn = DBConfig.get_db_connection()
cur = conn.cursor(dictionary=True)
try:
# Save / Update MAT Credit
cur.callproc(
"SaveOrUpdateMatCredit",
(
data["financial_year"],
data["mat_credit"],
data["balance"],
data.get("remarks", "")
)
)
mat_id = None
for result in cur.stored_results():
mat_id = result.fetchone()["mat_id"]
# Save utilization rows
for u in data.get("utilization", []):
if float(u["amount"]) > 0:
cur.callproc(
"InsertMatUtilization",
(mat_id, u["year"], u["amount"])
)
conn.commit()
except Exception as e:
conn.rollback()
raise e
finally:
cur.close()
conn.close()
# --------------------------------------------------
# AUTO SAVE MAT FROM ITR (MAIN LOGIC)
# --------------------------------------------------
@staticmethod
def save_from_itr(year, mat_created, mat_utilized, remarks="Auto from"):
conn = DBConfig.get_db_connection()
cur = conn.cursor(dictionary=True)
try:
mat_created = float(mat_created or 0)
mat_utilized = float(mat_utilized or 0)
balance = mat_created - mat_utilized
# Save / Update MAT Credit
cur.callproc(
"SaveOrUpdateMatCredit",
(year, mat_created, balance, remarks)
)
mat_id = None
for result in cur.stored_results():
mat_id = result.fetchone()["mat_id"]
# Save utilization only if used
if mat_utilized > 0:
cur.callproc(
"InsertMatUtilization",
(mat_id, year, mat_utilized)
)
conn.commit()
except Exception as e:
conn.rollback()
raise e
finally:
cur.close()
conn.close()
# --------------------------------------------------
# DELETE MAT CREDIT SAFELY (OPTIONAL)
# --------------------------------------------------
def delete_by_year(self, financial_year):
try:
self.cursor.execute(
"DELETE FROM mat_credit WHERE financial_year=%s",
(financial_year,)
)
self.conn.commit()
finally:
self.cursor.close()
self.conn.close()
# --------------------------------------------------
# CLOSE CONNECTION (MANUAL USE)
# --------------------------------------------------
def close(self):
if self.cursor:
self.cursor.close()
if self.conn:
self.conn.close()

41
AppCode/YearGet.py Normal file
View File

@@ -0,0 +1,41 @@
from AppCode.Config import DBConfig
import mysql.connector
class YearGet:
def __init__(self):
self.conn = DBConfig.get_db_connection()
self.cursor = self.conn.cursor(dictionary=True)
# get year fetch in perticular Model name.
def get_year_by_model(self, proc_name):
try:
self.cursor.callproc(proc_name)
years = []
for result in self.cursor.stored_results():
rows = result.fetchall()
years = [row["year"] for row in rows]
return years
except mysql.connector.Error as e:
print("MySQL Error:", e)
return []
def CheckYearExists(self, table_name, year):
try:
self.cursor.callproc('CheckYearExists', (table_name, year))
result = 0
for result_set in self.cursor.stored_results():
result = result_set.fetchone()[0]
return {"exists": result > 0}
except mysql.connector.Error as e:
print("MySQL Error:", e)
return {"exists": False, "error": str(e)}
def close(self):
self.cursor.close()
self.conn.close()

Binary file not shown.

Binary file not shown.

22
Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
FROM python:3.11-slim
# Prevent Python buffering
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install system deps (if needed later)
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["python", "main.py"]

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# Income tax Software
Income tax Software

View File

@@ -1,8 +0,0 @@
db_config = {
'host': 'localhost',
'user': 'root',
'password': 'root',
'database': 'income_tax',
'port': 3306
}

29
docker-compose.yml Normal file
View File

@@ -0,0 +1,29 @@
version: "3.9"
services:
db:
image: mysql:8.0
container_name: income_tax_db
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test_income_taxdb
ports:
- "3307:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./db/income_tax.sql:/docker-entrypoint-initdb.d/income_tax.sql
web:
build: .
container_name: income_tax_web
restart: always
ports:
- "5010:5010"
env_file:
- .env
depends_on:
- db
volumes:
mysql_data:

View File

@@ -1,13 +0,0 @@
import React from 'react';
import FormPage from './components/FormPage';
function App() {
return (
<div>
<h2>Income Tax Entry Form</h2>
<FormPage table="cit" />
</div>
);
}
export default App;

View File

@@ -1,50 +0,0 @@
import React, { useState } from 'react';
import axios from 'axios';
const FormPage = ({ table }) => {
const [formData, setFormData] = useState({
gross_total_income: '',
net_taxable_income: '',
tax_payable: '',
total_tax_payable: '',
refund: ''
});
const handleChange = e => {
setFormData({ ...formData, [e.target.name]: e.target.value });
};
const handleSubmit = async e => {
e.preventDefault();
await axios.post(`http://localhost:5000/add/${table}`, formData);
alert('Entry saved');
setFormData({
gross_total_income: '',
net_taxable_income: '',
tax_payable: '',
total_tax_payable: '',
refund: ''
});
};
return (
<form onSubmit={handleSubmit}>
{Object.keys(formData).map(key => (
<div key={key}>
<label>{key.replaceAll('_', ' ')}:</label>
<input
type="number"
step="0.01"
name={key}
value={formData[key]}
onChange={handleChange}
required
/>
</div>
))}
<button type="submit">Save</button>
</form>
);
};
export default FormPage;

1240
main.py

File diff suppressed because it is too large Load Diff

13
requirements.txt Normal file
View File

@@ -0,0 +1,13 @@
Flask==3.0.1
python-dotenv==1.0.1
pandas==2.2.0
Werkzeug==3.0.1
mysql-connector-python==8.3.0
Flask-HTTPAuth==4.8.0
openpyxl==3.1.2
xlrd==2.0.1
gunicorn==21.2.0

151
static/css/add_model.css Normal file
View File

@@ -0,0 +1,151 @@
/* ================= PAGE WRAPPER ================= */
.main {
margin-left: 260px;
width: calc(100% - 260px);
margin-top: 80px;
padding: 20px;
transition: all 0.3s ease;
}
/* ================= CONTAINER ================= */
.container {
background: #ffffff;
padding: 25px;
width: 100%;
max-width: 1200px;
margin: auto;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
/* ================= PAGE TITLE ================= */
.container h2 {
color: #007bff;
font-size: 22px;
font-weight: 700;
margin-bottom: 25px;
}
/* ================= FORM ================= */
form {
width: 100%;
}
/* ================= FORM GROUP ================= */
.form-group {
margin-bottom: 16px;
font-weight: 600;
display: flex;
flex-direction: column;
}
/* ================= INPUTS ================= */
form input,
form select {
padding: 10px 12px;
width: 100%;
margin-top: 6px;
border: 1px solid #ccc;
border-radius: 6px;
background-color: #f8f9ff;
font-size: 14px;
}
form input:focus,
form select:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 6px rgba(0, 123, 255, 0.35);
}
/* ================= AUTO FIELDS ================= */
.auto {
background-color: #d5edd7;
font-weight: 600;
}
/* ================= INLINE 2 COLUMNS ================= */
.form-group.inline-2 {
flex-direction: row;
gap: 16px;
}
.form-group.inline-2>div {
flex: 1;
}
/* ================= SUBMIT BUTTON ================= */
button {
width: 60%;
margin: 25px auto 0;
padding: 12px 20px;
background-color: #28a745;
color: white;
border: none;
border-radius: 6px;
font-size: 15px;
font-weight: 600;
cursor: pointer;
display: block;
transition: 0.3s;
}
button:hover {
background-color: #218838;
box-shadow: 0 4px 10px rgba(40, 167, 69, 0.35);
}
/* ================= MOBILE ================= */
@media (max-width: 768px) {
.main {
margin-left: 0;
width: 100%;
padding: 15px;
margin-top: 70px;
}
.container {
padding: 18px;
}
.container h2 {
font-size: 18px;
}
/* STACK INPUTS */
.form-group.inline-2 {
flex-direction: column;
gap: 10px;
}
button {
width: 100%;
}
}
/* ================= SMALL MOBILE ================= */
@media (max-width: 420px) {
form input,
form select {
font-size: 13px;
padding: 9px;
}
.container h2 {
font-size: 17px;
}
}
/* ================= LARGE SCREEN ================= */
@media (min-width: 1200px) {
.container {
max-width: 1300px;
}
.container h2 {
font-size: 24px;
}
}

View File

@@ -0,0 +1,189 @@
/* ================= RESET ================= */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Segoe UI", sans-serif;
}
/* ================= BODY ================= */
body {
background-color: #f4f7f6;
}
/* ================= MAIN CONTENT ================= */
.main {
margin-left: 260px;
padding: 30px;
width: calc(100% - 260px);
margin-top: 80px;
transition: 0.3s;
}
/* ================= CONTAINER ================= */
.container {
max-width: 1200px;
width: 100%;
margin: auto;
background: #ffffff;
padding: 25px;
border-radius: 10px;
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}
/* ================= HEADING ================= */
.container h2 {
text-align: center;
margin-bottom: 20px;
color: #003366;
font-weight: 600;
}
/* ================= BUTTONS ================= */
.btn {
padding: 8px 14px;
border-radius: 6px;
color: #ffffff;
border: none;
cursor: pointer;
font-size: 14px;
font-weight: 600;
text-decoration: none;
}
.btn-add {
background-color: #28a745;
}
.btn-update {
background-color: #007bff;
}
.btn-delete {
background-color: #dc3545;
}
.btn:hover {
opacity: 0.9;
}
/* ================= NO RECORD ================= */
.no-record {
text-align: center;
font-size: 16px;
margin-top: 20px;
color: #555;
padding: 15px;
background: #f9f9f9;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
/* ================= TABLE ================= */
.table-wrapper {
overflow-x: auto;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
min-width: 900px;
/* allows horizontal scroll on mobile */
}
th,
td {
padding: 12px;
border: 1px solid #dee2e6;
white-space: nowrap;
font-size: 14px;
}
th {
background-color: #007bff;
color: white;
text-align: center;
}
td {
text-align: right;
}
td:first-child,
th:first-child {
text-align: left;
}
tr:nth-child(even) {
background-color: #f0f8ff;
}
/* ================= ACTION COLUMN ================= */
.action-cell {
display: flex;
gap: 6px;
justify-content: center;
}
.action-cell form {
margin: 0;
}
/* ================= TABLET ================= */
@media (max-width: 992px) {
.main {
margin-left: 0;
width: 100%;
padding: 20px;
}
.container {
padding: 20px;
}
table {
min-width: 800px;
}
}
/* ================= MOBILE ================= */
@media (max-width: 768px) {
.container {
padding: 15px;
}
.container h2 {
font-size: 18px;
}
.btn {
font-size: 13px;
padding: 7px 12px;
}
table {
min-width: 700px;
}
}
/* ================= SMALL MOBILE ================= */
@media (max-width: 480px) {
.container h2 {
font-size: 16px;
}
.btn-add {
width: 100%;
text-align: center;
margin-bottom: 15px;
display: block;
}
table {
min-width: 650px;
}
}

207
static/css/documents.css Normal file
View File

@@ -0,0 +1,207 @@
/* ================= GLOBAL ================= */
body {
background-color: #f4f6f9;
font-family: "Segoe UI", Arial, sans-serif;
margin: 0;
padding: 0;
overflow-x: hidden;
/* prevent horizontal scroll for page */
}
/* ================= MAIN CONTENT ================= */
.main {
margin-left: 260px;
/* sidebar width */
padding: 70px 30px 40px 30px;
/* top padding for navbar */
overflow-x: hidden;
/* prevent horizontal scroll */
transition: margin-left 0.3s ease;
}
/* ================= CONTAINER ================= */
.container {
max-width: 1100px;
margin: 0 auto;
background: #ffffff;
padding: 35px 40px;
border-radius: 12px;
box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
overflow-x: hidden;
/* prevent horizontal scroll */
}
/* ================= HEADING ================= */
.container h2 {
text-align: center;
color: #0d6efd;
font-size: 26px;
margin-bottom: 30px;
}
/* ================= FILTER FORM ================= */
form {
display: flex;
align-items: flex-end;
justify-content: center;
gap: 18px;
flex-wrap: wrap;
margin-bottom: 30px;
}
form label {
font-size: 14px;
font-weight: 500;
}
form select {
width: 220px;
padding: 10px;
border-radius: 6px;
border: 1px solid #ced4da;
font-size: 14px;
}
form button {
background-color: #28a745;
color: #ffffff;
border: none;
padding: 11px 28px;
border-radius: 6px;
font-size: 15px;
font-weight: 600;
cursor: pointer;
transition: background 0.3s ease;
}
form button:hover {
background-color: #218838;
}
/* ================= TABLE RESPONSIVE ================= */
.table-responsive {
width: 100%;
overflow-x: auto;
/* only table scrolls */
-webkit-overflow-scrolling: touch;
/* smooth scroll on mobile */
}
/* ================= TABLE ================= */
table {
width: 100%;
border-collapse: collapse;
font-size: 14px;
min-width: 700px;
/* ensures horizontal scroll on small screens */
}
/* Table Head */
thead {
background-color: #0d6efd;
color: #ffffff;
}
thead th {
padding: 14px 12px;
text-align: center;
font-weight: 600;
}
/* Table Body */
tbody td {
padding: 12px;
text-align: center;
border-bottom: 1px solid #e3e6ea;
}
tbody tr:nth-child(even) {
background-color: #f8f9fa;
}
tbody tr:hover {
background-color: #eef4ff;
}
/* Table action buttons */
table a {
text-decoration: none;
color: #ffffff;
padding: 7px 16px;
border-radius: 6px;
font-size: 13px;
display: inline-block;
transition: background 0.3s ease;
}
table a[href*="download"] {
background-color: #17a2b8;
}
table a[href*="download"]:hover {
background-color: #138496;
}
table a[href*="view"] {
background-color: #20c997;
}
table a[href*="view"]:hover {
background-color: #17a589;
}
/* ================= RESPONSIVE ================= */
/* Medium screens: tablets */
@media (max-width: 992px) {
.main {
margin-left: 0;
padding: 50px 20px 20px 20px;
}
form {
flex-direction: column;
align-items: stretch;
}
form select,
form button {
width: 100%;
}
}
/* Small screens: mobile */
@media (max-width: 576px) {
.main {
padding: 40px 15px 15px 15px;
}
.container {
padding: 20px;
}
.container h2 {
font-size: 22px;
}
table {
font-size: 12px;
min-width: 100%;
/* table scrolls only */
}
table a {
padding: 5px 10px;
font-size: 12px;
}
form label {
font-size: 13px;
}
form select,
form button {
font-size: 13px;
padding: 8px;
}
}

219
static/css/index.css Normal file
View File

@@ -0,0 +1,219 @@
/* ================= RESET ================= */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Segoe UI", sans-serif;
}
body {
background-color: #f4f7f6;
display: flex;
}
/* ================= NAVBAR ================= */
.navbar {
width: 100%;
height: 60px;
background-color: #007bff;
display: flex;
align-items: center;
padding: 0 20px;
position: fixed;
top: 0;
left: 0;
color: white;
z-index: 1000;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.nav-left {
display: flex;
align-items: center;
gap: 15px;
}
.nav-logo {
height: 46px;
filter: brightness(0) invert(1);
}
.toggle-btn {
font-size: 26px;
cursor: pointer;
display: none;
/* hidden on desktop */
}
/* ================= SIDEBAR ================= */
.sidebar {
width: 250px;
background: #ffffff;
height: calc(100vh - 60px);
position: fixed;
top: 60px;
left: 0;
padding-top: 20px;
overflow-y: auto;
border-right: 1px solid #e5d1be;
transition: 0.3s;
display: flex;
flex-direction: column;
}
.sidebar h2 {
color: #007bff;
text-align: center;
margin-bottom: 20px;
font-size: 22px;
}
/* Menu buttons */
.menu-btn {
padding: 14px 20px;
font-size: 17px;
color: #007bff;
cursor: pointer;
border-bottom: 1px solid #f0d6c6;
transition: 0.2s;
}
.menu-btn:hover {
background: #88ccfa;
}
/* Submenu */
.submenu {
display: none;
background: #ffffff;
}
.submenu a {
display: block;
padding: 12px 35px;
color: #007bff;
text-decoration: none;
border-bottom: 1px solid #f3cab1;
transition: 0.2s;
}
.submenu a:hover {
background: #b3dbf7;
}
/* Logout */
.sidebar-logout {
margin-top: auto;
padding: 12px;
background: #007bff;
display: flex;
justify-content: center;
border-radius: 6px;
}
.sidebar-logout:hover {
background: #a8d8f8;
}
.logout-icon {
width: 22px;
height: 22px;
}
/* ================= MAIN ================= */
.main {
margin-left: 250px;
margin-top: 60px;
padding: 30px;
width: calc(100% - 250px);
}
/* Container */
.container {
background: white;
padding: 40px;
border-radius: 12px;
max-width: 900px;
margin: auto;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
}
/* ================= TABLET ================= */
@media (max-width: 992px) {
.nav-left h3 {
font-size: 16px;
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.nav-logo {
height: 40px;
}
/* sidebar still visible */
.sidebar {
width: 220px;
}
.main {
margin-left: 220px;
width: calc(100% - 220px);
}
}
/* ================= MOBILE ================= */
@media (max-width: 768px) {
body {
display: block;
}
/* Show toggle only on mobile */
.toggle-btn {
display: block;
}
.nav-left h3 {
font-size: 14px;
max-width: 160px;
}
.nav-logo {
height: 36px;
}
/* Sidebar as drawer */
.sidebar {
left: -100%;
width: 85%;
max-width: 280px;
z-index: 2000;
box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
}
.sidebar.show {
left: 0;
}
/* Main content full width */
.main {
margin-left: 0;
width: 100%;
margin-top: 70px;
padding: 15px;
}
.container {
padding: 20px;
width: 100%;
}
}
/* ================= VERY SMALL PHONES ================= */
@media (max-width: 480px) {
.nav-left h3 {
display: none;
}
}

169
static/css/login.css Normal file
View File

@@ -0,0 +1,169 @@
/* ================= RESET ================= */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* ================= BODY ================= */
body {
font-family: "Segoe UI", Arial, sans-serif;
background: #eef2f6;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
padding: 15px;
}
/* ================= LOGIN CARD ================= */
.login-container {
background: #ffffff;
width: 100%;
max-width: 420px;
padding: 28px;
border-radius: 14px;
text-align: center;
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}
/* ================= MAIN HEADING ================= */
.title {
color: #007bff;
font-size: 20px;
font-weight: 700;
white-space: nowrap;
/* keep single line */
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 6px;
}
/* ================= SUB HEADING ================= */
.sub-title {
font-size: 14px;
font-weight: 600;
color: #444;
white-space: nowrap;
/* keep single line */
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 14px;
}
/* ================= LOGIN TEXT ================= */
.subtitle {
font-size: 14px;
color: #555;
margin-bottom: 22px;
letter-spacing: 1px;
}
/* ================= FLASH MESSAGE ================= */
.flash {
color: #d9534f;
font-size: 14px;
margin-bottom: 12px;
}
/* ================= INPUTS ================= */
input[type="text"],
input[type="password"] {
width: 100%;
padding: 12px 14px;
margin-bottom: 16px;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 15px;
outline: none;
}
input:focus {
border-color: #007bff;
}
/* ================= BUTTON ================= */
button {
width: 100%;
padding: 12px;
background: #007bff;
color: #ffffff;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
}
button:hover {
background: #0056b3;
}
/* ================= MOBILE DEVICES ================= */
@media (max-width: 480px) {
.login-container {
padding: 22px;
}
.title {
font-size: 17px;
}
.sub-title {
font-size: 13px;
}
.subtitle {
font-size: 13px;
}
input {
font-size: 14px;
}
button {
font-size: 15px;
}
}
/* ================= TABLETS ================= */
@media (min-width: 481px) and (max-width: 768px) {
.title {
font-size: 19px;
}
.sub-title {
font-size: 14px;
}
}
/* ================= LARGE SCREENS ================= */
@media (min-width: 1200px) {
.login-container {
max-width: 460px;
}
.title {
font-size: 22px;
}
.sub-title {
font-size: 15px;
}
}

209
static/css/mat_credit.css Normal file
View File

@@ -0,0 +1,209 @@
/* =========================
CONTAINER
========================= */
.mat-container {
max-width: 1200px;
margin: 30px auto;
padding: 25px;
background: #ffffff;
border-radius: 10px;
box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}
.page-title {
text-align: center;
margin-bottom: 20px;
font-weight: 600;
}
/* =========================
YEAR CONTROLS
========================= */
.year-controls {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 15px;
}
.year-controls select {
padding: 8px 10px;
font-size: 14px;
border-radius: 6px;
border: 1px solid #ced4da;
}
.year-controls button {
padding: 8px 14px;
font-size: 14px;
border-radius: 6px;
border: none;
cursor: pointer;
background-color: #0d6efd;
color: #ffffff;
}
.year-controls button:hover {
background-color: #0b5ed7;
}
/* =========================
TABLE WRAPPER
========================= */
.table-wrapper {
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
/* =========================
TABLE
========================= */
#matTable {
width: 100%;
min-width: 900px;
border-collapse: collapse;
font-size: 14px;
text-align: center;
}
/* =========================
HEADER
========================= */
#matTable thead th {
background: linear-gradient(135deg, #0d6efd, #0a58ca);
color: #ffffff;
padding: 12px 8px;
border: 1px solid #0a58ca;
white-space: nowrap;
}
/* =========================
BODY CELLS
========================= */
#matTable tbody td {
padding: 8px;
border: 1px solid #dcdcdc;
background-color: #ffffff;
}
#matTable tbody td:first-child {
font-weight: 600;
background-color: #f5f8ff;
}
/* =========================
INPUTS
========================= */
#matTable input {
width: 100%;
padding: 6px;
border: 1px solid #cfd8dc;
border-radius: 4px;
font-size: 13px;
text-align: right;
box-sizing: border-box;
}
#matTable input:focus {
border-color: #0d6efd;
box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
outline: none;
}
/* =========================
BUTTONS
========================= */
#matTable button {
background-color: #198754;
border: none;
color: white;
padding: 6px 14px;
border-radius: 4px;
cursor: pointer;
font-size: 13px;
}
#matTable button:hover {
background-color: #157347;
}
.add-row-btn {
background-color: #0d6efd;
color: #fff;
border: none;
padding: 8px 18px;
border-radius: 6px;
cursor: pointer;
}
.add-row-btn:hover {
background-color: #0b5ed7;
}
/* =========================
ROW STATES
========================= */
#matTable tbody tr:hover {
background-color: #f1f6ff;
}
.input-error {
border-color: #dc3545 !important;
background-color: #fff5f5;
}
.row-saved {
background-color: #e9f7ef !important;
}
/* =========================
ACTION FOOTER
========================= */
.action-footer {
margin-top: 15px;
}
/* =========================
MOBILE ONLY FIXES
(DOES NOT AFFECT DESKTOP)
========================= */
@media (max-width: 768px) {
.mat-container {
margin: 10px;
padding: 15px;
}
/* YEAR CONTROLS STACKED */
.year-controls {
flex-direction: column;
align-items: stretch;
}
.year-controls select,
.year-controls button {
width: 100%;
font-size: 14px;
}
/* TABLE */
#matTable {
font-size: 12px;
min-width: 800px;
}
#matTable input {
font-size: 12px;
}
#matTable button {
font-size: 12px;
padding: 5px 10px;
}
/* ADD ROW BUTTON FULL WIDTH */
.add-row-btn {
width: 50%;
}
}

162
static/css/report.css Normal file
View File

@@ -0,0 +1,162 @@
/* ================= RESET ================= */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
/* ================= BODY ================= */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background-color: #f4f7f9;
overflow: hidden;
/* ❌ no scroll desktop/laptop */
}
/* ================= MAIN WRAPPER ================= */
.main {
margin-left: 260px;
margin-top: 80px;
width: calc(100% - 260px);
height: calc(100vh - 80px);
padding: 0 30px;
display: flex;
align-items: center;
justify-content: center;
}
/* ================= CONTAINER ================= */
.container {
max-width: 900px;
width: 100%;
background: #ffffff;
padding: 45px 55px;
border-radius: 16px;
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
/* ⬇️ MOVE UP & LEFT */
transform: translate(-40px, -30px);
}
/* ================= HEADING ================= */
.container h2 {
font-size: 28px;
font-weight: 700;
color: #1f2d3d;
margin-bottom: 32px;
text-align: center;
}
/* ================= REPORT LIST ================= */
ul {
list-style: none;
display: grid;
grid-template-columns: 1fr;
gap: 18px;
}
/* ================= REPORT BUTTONS ================= */
ul li a {
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
background: linear-gradient(135deg, #f1f7ff, #e9f2ff);
border-radius: 12px;
color: #0056ff;
font-size: 17px;
font-weight: 600;
text-decoration: none;
transition: all 0.3s ease;
border: 1px solid #e1ecff;
}
ul li a:hover {
background: linear-gradient(135deg, #e3efff, #dbe9ff);
transform: translateY(-3px);
box-shadow: 0 8px 18px rgba(0, 86, 255, 0.15);
}
/* ================= LAPTOP VIEW ================= */
@media (max-width: 1400px) and (min-width: 992px) {
.container {
max-width: 820px;
padding: 40px 45px;
transform: translate(-30px, -20px);
/* ⬅️ softer move */
}
.container h2 {
font-size: 26px;
}
ul li a {
font-size: 16px;
padding: 18px;
}
}
/* ================= TABLET ================= */
@media (max-width: 992px) {
body {
overflow-y: auto;
}
.main {
margin-left: 0;
width: 100%;
height: auto;
padding: 40px 25px;
display: block;
}
.container {
transform: none;
/* ❌ reset move */
padding: 40px 32px;
}
}
/* ================= MOBILE ================= */
@media (max-width: 768px) {
body {
overflow-y: auto;
}
.main {
margin-top: 70px;
height: auto;
padding: 25px 15px;
}
.container {
transform: none;
/* ❌ reset move */
padding: 28px 22px;
}
.container h2 {
font-size: 22px;
}
ul li a {
font-size: 15px;
padding: 15px;
}
}
/* ================= SMALL MOBILE ================= */
@media (max-width: 480px) {
.container {
padding: 22px 18px;
}
ul li a {
font-size: 14px;
padding: 14px;
}
}

237
static/css/report_model.css Normal file
View File

@@ -0,0 +1,237 @@
/* ================= RESET ================= */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
/* ================= BODY ================= */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background-color: #f4f7f9;
height: 100vh;
overflow: hidden;
/* no scroll desktop */
}
/* ================= LINKS ================= */
a {
text-decoration: none !important;
color: #007bff;
}
/* ================= NAVBAR ================= */
.navbar {
width: 100%;
height: 60px;
background-color: #007bff;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
position: fixed;
top: 0;
left: 0;
color: white;
z-index: 1000;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.nav-left {
display: flex;
align-items: center;
gap: 15px;
}
.nav-logo {
height: 70px;
filter: brightness(0) invert(1);
}
.toggle-btn {
font-size: 26px;
cursor: pointer;
}
/* ================= SIDEBAR ================= */
.sidebar {
width: 250px;
background: white;
height: calc(100vh - 60px);
position: fixed;
top: 60px;
left: 0;
padding-top: 20px;
border-right: 1px solid #d6d6d6;
display: flex;
flex-direction: column;
}
.sidebar.hide {
left: -250px;
}
.menu-items {
flex: 1;
display: flex;
flex-direction: column;
}
.menu-btn {
padding: 14px 20px;
font-size: 16px;
color: #007bff;
font-weight: 600;
cursor: pointer;
border-bottom: 1px solid #e5e5e5;
}
.menu-btn:hover {
background: #e9f3ff;
}
.submenu {
display: none;
background: #f4faff;
}
.submenu a {
padding: 12px 35px;
display: block;
color: #0056b3;
}
/* ================= MAIN ================= */
.main {
margin-left: 250px;
margin-top: 60px;
width: calc(100% - 250px);
height: calc(100vh - 60px);
display: flex;
align-items: center;
/* ✅ vertical center */
justify-content: center;
/* ✅ horizontal center */
padding: 30px;
}
/* ================= CONTAINER ================= */
.container {
width: 100%;
max-width: 680px;
/* 🔥 laptop & desktop size */
background: #ffffff;
padding: 45px 55px;
border-radius: 14px;
box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
text-align: center;
}
/* ================= HEADING ================= */
.container h2 {
font-size: 28px;
font-weight: 700;
color: #1f2d3d;
margin-bottom: 25px;
}
/* ================= FORM ================= */
form {
display: flex;
flex-direction: column;
align-items: center;
}
/* ================= FORM ELEMENTS ================= */
label {
font-weight: 600;
margin-bottom: 6px;
color: #333;
}
select {
width: 100%;
max-width: 320px;
padding: 12px 14px;
border-radius: 8px;
border: 1px solid #ccc;
font-size: 16px;
}
select:focus {
border-color: #007bff;
outline: none;
box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.18);
}
/* ================= BUTTON ================= */
button {
margin-top: 22px;
width: 100%;
max-width: 320px;
padding: 13px;
font-size: 16px;
font-weight: 600;
background-color: #007bff;
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
}
button:hover {
background-color: #0069d9;
}
/* ================= LAPTOP ================= */
@media (max-width: 1400px) {
.container {
max-width: 620px;
padding: 40px 48px;
}
}
/* ================= TABLET ================= */
@media (max-width: 992px) {
body {
overflow-y: auto;
}
.main {
margin-left: 0;
width: 100%;
height: auto;
padding: 40px 20px;
}
.container {
max-width: 560px;
}
}
/* ================= MOBILE ================= */
@media (max-width: 768px) {
body {
overflow-y: auto;
}
.main {
margin-top: 70px;
height: auto;
padding: 20px 15px;
}
.container {
max-width: 100%;
padding: 28px 22px;
}
.container h2 {
font-size: 22px;
}
select,
button {
max-width: 100%;
}
}

278
static/css/summary.css Normal file
View File

@@ -0,0 +1,278 @@
/* ================= PAGE WRAPPER ================= */
.main {
margin-left: 260px;
width: calc(100% - 260px);
margin-top: 80px;
padding: 20px;
transition: all 0.3s ease;
}
/* ================= CONTAINER ================= */
.container {
width: 100%;
max-width: none;
margin: 0;
padding: 25px 30px;
background: #ffffff;
border-radius: 12px;
box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}
/* ================= PAGE TITLE ================= */
.container h2 {
text-align: center;
color: #007bff;
font-size: 22px;
font-weight: 700;
margin-bottom: 20px;
}
h3 {
text-align: center;
margin-top: 10px;
}
/* ================= FORM ================= */
form {
width: 100%;
}
form label {
display: block;
margin-top: 10px;
font-weight: 600;
color: #333;
}
/* ================= INPUTS ================= */
form input,
form select {
width: 100%;
padding: 10px 12px;
margin-top: 6px;
border: 1px solid #ccc;
border-radius: 6px;
background-color: #f8f9ff;
font-size: 14px;
}
form input:focus,
form select:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 6px rgba(0, 123, 255, 0.35);
}
/* ================= AUTO FIELDS ================= */
.auto {
background-color: #d5edd7;
font-weight: 600;
}
/* ================= FORM GROUP ================= */
.form-group {
margin-bottom: 16px;
display: flex;
flex-direction: column;
font-weight: 600;
}
/* Inline two columns */
.form-group.inline-2 {
flex-direction: row;
gap: 16px;
}
.form-group.inline-2 > div {
flex: 1;
}
/* ================= BUTTONS ================= */
button {
display: block;
width: 60%;
margin: 25px auto 0;
padding: 12px 20px;
background-color: #28a745;
color: #fff;
border: none;
border-radius: 6px;
font-size: 15px;
font-weight: 600;
cursor: pointer;
transition: 0.3s;
}
button:hover {
background-color: #218838;
box-shadow: 0 4px 10px rgba(40, 167, 69, 0.35);
}
/* ================= BACK BUTTON ================= */
.back-btn {
display: inline-block;
margin-top: 20px;
padding: 10px 18px;
background-color: #007bff;
color: #fff;
font-size: 15px;
font-weight: 600;
border-radius: 6px;
text-decoration: none;
transition: 0.3s;
}
.back-btn:hover {
background-color: #006ae6;
}
/* ================= STICKY FILTER BAR ================= */
.head {
position: sticky;
top: 60px;
background: #fff;
z-index: 1000;
padding: 15px 0;
border-bottom: 1px solid #ccc;
}
/* ================= SELECT + DOWNLOAD ================= */
.select-download-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 10px;
}
.select-download-wrapper select {
max-width: 300px;
}
select {
width: 100%;
max-width: 300px;
padding: 10px 12px;
border: 1px solid #ccc;
border-radius: 6px;
margin-top: 6px;
font-size: 15px;
background-color: white;
cursor: pointer;
transition: 0.2s;
}
select:focus {
border-color: #007bff;
box-shadow: 0 0 5px rgba(0,123,255,0.5);
outline: none;
}
/* ================= DOWNLOAD BUTTON ================= */
#downloadBtn {
display: none;
padding: 10px 20px;
font-size: 16px;
background-color: #28a745;
color: #fff;
text-decoration: none;
border-radius: 4px;
white-space: nowrap;
transition: 0.3s;
}
#downloadBtn:hover {
background-color: #218838;
}
/* ================= TABLE PREVIEW ================= */
#previewContent {
max-height: 60vh;
overflow-y: auto;
overflow-x: auto;
width: 100%;
margin-top: 15px;
}
#previewContent table {
width: 100%;
min-width: 600px;
border-collapse: collapse;
}
#previewContent th,
#previewContent td {
padding: 10px;
border: 1px solid #ccc;
white-space: nowrap;
}
/* Sticky table header */
#previewContent th {
position: sticky;
top: 0;
background-color: #007bff;
color: #fff;
z-index: 10;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
/* ================= MESSAGE ================= */
.message {
margin-top: 15px;
color: #555;
font-size: 14px;
}
/* ================= RESPONSIVE ================= */
@media (max-width: 992px) {
.main {
margin-left: 0;
width: 100%;
padding: 20px;
}
button {
width: 100%;
}
}
@media (max-width: 768px) {
.container {
padding: 18px;
}
.container h2 {
font-size: 18px;
}
.form-group.inline-2 {
flex-direction: column;
gap: 10px;
}
}
@media (max-width: 576px) {
.main {
padding: 15px;
margin-top: 70px;
}
#previewContent table {
min-width: 500px;
}
#previewContent th,
#previewContent td {
font-size: 13px;
padding: 8px;
}
}
@media (max-width: 420px) {
form input,
form select {
font-size: 13px;
padding: 9px;
}
}

101
static/css/upload.css Normal file
View File

@@ -0,0 +1,101 @@
/* ===== RESET ===== */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Segoe UI", Arial, sans-serif;
}
/* ===== BODY ===== */
body {
background-color: #f4f7f6;
overflow: hidden;
/* NO SCROLL */
}
/* ===== MAIN AREA (NAVBAR ALREADY EXISTS) ===== */
.main {
margin-top: 70px;
/* height of navbar */
height: calc(100vh - 70px);
display: flex;
justify-content: flex-start;
/* LEFT */
align-items: flex-start;
/* TOP */
padding: 20px;
}
/* ===== FORM CONTAINER ===== */
.container {
width: 100%;
max-width: 520px;
background: #ffffff;
padding: 28px 30px;
border-radius: 12px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}
/* ===== HEADING ===== */
.container h2 {
text-align: center;
color: #0d6efd;
font-size: 22px;
font-weight: 700;
margin-bottom: 20px;
}
/* ===== FORM ELEMENTS ===== */
form label {
display: block;
margin-top: 14px;
font-size: 14px;
font-weight: 600;
color: #333;
}
form select,
form input[type="file"] {
width: 100%;
padding: 10px;
margin-top: 6px;
border-radius: 6px;
border: 1px solid #ccc;
font-size: 14px;
}
/* ===== BUTTON ===== */
button {
width: 100%;
margin-top: 22px;
padding: 12px;
background-color: #0d6efd;
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
}
button:hover {
background-color: #0b5ed7;
}
/* ===== MOBILE VIEW ===== */
@media (max-width: 768px) {
.main {
margin-top: 60px;
height: calc(100vh - 60px);
padding: 12px;
}
.container {
max-width: 100%;
padding: 22px;
}
.container h2 {
font-size: 18px;
}
}

BIN
static/images/lcepllogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 B

View File

@@ -11,7 +11,7 @@ body {
padding: 30px;
background-color: #ffffff;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
h2 {
@@ -52,3 +52,54 @@ form button {
form button:hover {
background-color: #0056b3;
}
input[type="file"] {
padding: 10px 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
transition: border-color 0.3s ease;
}
input[type="file"]:focus {
border-color: #007BFF;
outline: none;
}
/* Back button styling */
.back-btn {
display: inline-block;
margin-bottom: 20px;
padding: 10px 18px;
background: #6c757d;
color: white;
font-size: 15px;
font-weight: 600;
border-radius: 6px;
text-decoration: none;
transition: background 0.3s ease;
}
.back-btn:hover {
background: #5a6268;
}
.form-group select {
width: 100%;
padding: 10px 12px;
border: 1px solid #cbd3da;
border-radius: 8px;
font-size: 16px;
background-color: #fdfdfd;
height: 40px;
cursor: pointer;
transition: all 0.25s ease-in-out;
}
.form-group select:focus {
border-color: #007BFF;
background: #ffffff;
box-shadow: 0 0 8px rgba(0, 123, 255, 0.25);
outline: none;
}

149
static/js/ao_calc.js Normal file
View File

@@ -0,0 +1,149 @@
document.addEventListener("DOMContentLoaded", function () {
function getValue(id) {
var el = document.getElementsByName(id)[0];
return el ? parseFloat(el.value) || 0 : 0;
}
function setValue(id, val) {
var el = document.getElementsByName(id)[0];
if (el) el.value = Number(val).toFixed(2);
}
window.calculate = function () {
// --- BASIC INPUTS ---
var gross_total_income = getValue("gross_total_income");
var disallowance_14a = getValue("disallowance_14a");
var disallowance_37 = getValue("disallowance_37");
// -- total gross income --
var gross_total = gross_total_income + disallowance_37 + disallowance_14a;
setValue("gti_as_per_ao", gross_total);
// --- DEDUCTIONS ---
var d80_business = getValue("deduction_80ia_business");
var d80_misc = getValue("deduction_80ia_misc");
var d80_other = getValue("deduction_80ia_other");
var d80_sec37 = getValue("deduction_sec37_disallowance");
// -- TAX A CALCULATIONS --
var per_a = getValue("per_a");
var tax_a = getValue("tax_a");
var per_surcharge_a = getValue("per_surcharge_a");
var surcharge_a = getValue("surcharge_a");
var per_cess_a = getValue("per_cess_a");
var edu_cess_a = getValue("edu_cess_a");
// -- TAX b CALCULATIONS --
var tax_book_profit = getValue("tax_book_profit");
console.log(tax_book_profit);
var per_surcharge_b = getValue("per_surcharge_b");
var surcharge_b = getValue("surcharge_b");
var per_cess_b = getValue("per_cess_b");
var edu_cess_b = getValue("edu_cess_b");
var deduction = d80_business + d80_misc + d80_other + d80_sec37 - 1.35;
var deduction_80g = getValue("deduction_80g");
// --- NET TAXABLE INCOME ---
var net_taxable_income = gross_total - deduction - deduction_80g;
setValue("net_taxable_income", net_taxable_income);
// --- TAX (A)% AMOUNT ---
var tax_a = net_taxable_income * (per_a / 100);
setValue("tax_a", tax_a);
// --- SURCHARGE (A)% AMOUNT ---
var surcharge_a = tax_a * (per_surcharge_a / 100);
setValue("surcharge_a", surcharge_a);
// --- CESS (A)% AMOUNT ---
var edu_cess_a = (surcharge_a + tax_a) * (per_cess_a / 100);
setValue("edu_cess_a", edu_cess_a);
//SUM OF (A)%
var sum_of_a = tax_a + surcharge_a + edu_cess_a;
setValue("sum_of_a", sum_of_a);
//-----------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------
// --- SURCHARGE (B)% AMOUNT ---
var surcharge_b = tax_book_profit * (per_surcharge_b / 100);
setValue("surcharge_b", surcharge_b);
// --- CESS (B)% AMOUNT ---
var edu_cess_b = (surcharge_b + tax_book_profit) * (per_cess_b / 100);
setValue("edu_cess_b", edu_cess_b);
//SUM OF (B)%
var sum_of_b = tax_book_profit + surcharge_b + edu_cess_b;
setValue("sum_of_b", sum_of_b);
// --- TAX PAYABLE (18.5%) ---
var tax185 = getValue("tax_book_profit_18_5");
// --- Education Cess 3% ---
var tax_payable = tax_a > tax_book_profit ? tax_a : tax_book_profit;
setValue("tax_payable", tax_payable);
// --- SURCHARGE ---
var percent = getValue("persentage");
var surcharge = tax_payable * (percent / 100);
setValue("surcharge", surcharge);
// --- EDUCATION CESS ---
var per_cess = getValue("persentage_cess");
var edu_cess = (tax_payable + surcharge) * (per_cess / 100);
setValue("edu_cess", edu_cess);
// --- total tax payable ---
var total_tax_payable = sum_of_a > sum_of_b ? sum_of_a : sum_of_b;
setValue("total_tax_payable", total_tax_payable);
// // --- mat_credit_created --- new
// setValue("mat_credit_created", Math.max(tax185 - total_tax_payable, 0));
// // --- mat credit_utilized --- new
// setValue("mat_credit_utilized", Math.max(total_tax_payable - tax185, 0));
// --- MAT credit and utilized ---
var a = sum_of_a;
var b = sum_of_b;
var result = 0;
var zero = 0;
if (b > a) {
result = b - a;
setValue("mat_credit_created", result);
setValue("mat_credit_utilized", zero);
}
if (a > b) {
result = a - b;
setValue("mat_credit_utilized", result);
setValue("mat_credit_created", zero);
}
// --- FINAL TAX ---
var mat_credit_uti = getValue("mat_credit_utilized");
var interest_234c = getValue("interest_234c");
// var total_tax = total_tax_payable + mat_credit + interest_234c;
var total_tax = total_tax_payable + interest_234c - mat_credit_uti;
setValue("total_tax", total_tax);
// --- ASSESSMENT ---
var adv_tax = getValue("advance_tax");
var tds = getValue("tds");
var tcs = getValue("tcs");
var tax_on_regular_assessment = getValue("tax_on_assessment");
var all_tax = adv_tax + tds + tcs + tax_on_regular_assessment;
var refund = total_tax - all_tax;
setValue("refund", refund);
};
});

111
static/js/cit_calc.js Normal file
View File

@@ -0,0 +1,111 @@
document.addEventListener("DOMContentLoaded", function () {
function getValue(id) {
var el = document.getElementsByName(id)[0];
return el ? parseFloat(el.value) || 0 : 0;
}
function setValue(id, val) {
var el = document.getElementsByName(id)[0];
if (el) el.value = Number(val).toFixed(2);
}
window.calculate = function () {
// --- BASIC INPUTS ---
var gross_total_income = getValue("gross_total_income");
var disallowance_14a = getValue("disallowance_14a");
var disallowance_37 = getValue("disallowance_37");
// -- total gross income --
var gross_total = gross_total_income + disallowance_37 + disallowance_14a
console.log("gross_total income:: " + gross_total)
// --- DEDUCTIONS ---
var d80_business = getValue("deduction_80ia_business");
var d80_misc = getValue("deduction_80ia_misc");
var d80_other = getValue("deduction_80ia_other");
var d80_sec37 = getValue("deduction_sec37_disallowance");
var deduction = d80_business + d80_misc + d80_other + d80_sec37;
var deduction_80g = getValue("deduction_80g");
// --- NET TAXABLE INCOME ---
var net_taxable_income = gross_total - deduction - deduction_80g;
setValue("net_taxable_income", net_taxable_income);
// --- TAX 30% ---
var tax30 = net_taxable_income * 0.30;
setValue("tax_30_percent", tax30);
// --- TAX PAYABLE (18.5%) ---
var tax185 = getValue("tax_book_profit_18_5");
var tax_payable = (tax30 > tax185) ? tax30 : tax185;
setValue("tax_payable", tax_payable);
// // --- SURCHARGE ---
// var percent = getValue("persentage");
// var surcharge = tax_payable * (percent / 100);
// setValue("surcharge_12", surcharge);
// // --- Education Cess 3% ---
// var edu_cess = (tax_payable + surcharge) * 0.03;
// setValue("edu_cess_3", edu_cess);
// --- SURCHARGE ---
var percent = getValue("persentage");
var surcharge = tax_payable * (percent / 100);
setValue("surcharge", surcharge);
// --- EDUCATION CESS ---
var per_cess = getValue("persentage_cess");
var edu_cess = (tax_payable + surcharge) * (per_cess / 100);
setValue("edu_cess", edu_cess);
// --- total tax payable ---
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");
var total_tax = total_tax_payable + mat_credit + interest_234c;
setValue("total_tax", total_tax);
// --- ASSESSMENT ---
var adv_tax = getValue("advance_tax");
var tds = getValue("tds");
var tcs = getValue("tcs");
var tax_on_regular_assessment = getValue("tax_on_assessment");
var all_tax = adv_tax + tds + tcs + tax_on_regular_assessment;
var refund = total_tax - all_tax;
setValue("refund", refund);
};
});

134
static/js/itr_calc.js Normal file
View File

@@ -0,0 +1,134 @@
document.addEventListener("DOMContentLoaded", function () {
function getValue(name) {
var el = document.getElementsByName(name)[0];
return el ? parseFloat(el.value) || 0 : 0;
}
function setValue(name, val) {
var el = document.getElementsByName(name)[0];
if (el) el.value = Number(val).toFixed(2);
}
// ---- Track last edited field for Tax(A) ----
let lastEditedTaxA = null;
document.getElementsByName("per_tax_a")[0].addEventListener("input", () => {
lastEditedTaxA = "percentage";
});
document.getElementsByName("tax_a_cal")[0].addEventListener("input", () => {
lastEditedTaxA = "amount";
});
window.calculate = function () {
// ---------------- BASIC INPUTS ----------------
var gross_total_income = getValue("gross_total_income");
var disallowance_14a = getValue("disallowance_14a");
var disallowance_37 = getValue("disallowance_37");
var gross_total = gross_total_income + disallowance_14a + disallowance_37;
setValue("gti_as_per_ao", gross_total);
// ---------------- DEDUCTIONS ----------------
var d80_business = getValue("deduction_80ia_business");
var d80_misc = getValue("deduction_80ia_misc");
var d80_other = getValue("deduction_80ia_other");
var d80_sec37 = getValue("deduction_sec37_disallowance");
var deduction_80g = getValue("deduction_80g");
var deduction = d80_business + d80_misc + d80_other + d80_sec37 - 1.35;
var net_taxable_income = gross_total - deduction - deduction_80g;
setValue("net_taxable_income", net_taxable_income);
// ================= TAX (A) TWO WAY =================
var per_tax_a = getValue("per_tax_a");
var tax_a_cal = getValue("tax_a_cal");
if (net_taxable_income > 0) {
if (lastEditedTaxA === "percentage") {
tax_a_cal = net_taxable_income * (per_tax_a / 100);
setValue("tax_a_cal", tax_a_cal);
}
else if (lastEditedTaxA === "amount") {
per_tax_a = (tax_a_cal / net_taxable_income) * 100;
setValue("per_tax_a", per_tax_a);
}
}
var per_surcharge_a = getValue("per_surcharge_a");
var surcharge_a_cal = tax_a_cal * (per_surcharge_a / 100);
setValue("surcharge_a_cal", surcharge_a_cal);
var per_cess_a = getValue("per_cess_a");
var edu_cess_a_cal = (tax_a_cal + surcharge_a_cal) * (per_cess_a / 100);
setValue("edu_cess_a_cal", edu_cess_a_cal);
var sum_of_a = tax_a_cal + surcharge_a_cal + edu_cess_a_cal;
setValue("sum_of_a", sum_of_a);
// ================= TAX (B) =================
var tax_b_cal = getValue("tax_b_cal");
var per_surcharge_b = getValue("per_surcharge_b");
var surcharge_b_cal = tax_b_cal * (per_surcharge_b / 100);
setValue("surcharge_b_cal", surcharge_b_cal);
var per_cess_b = getValue("per_cess_b");
var edu_cess_b_cal = (tax_b_cal + surcharge_b_cal) * (per_cess_b / 100);
setValue("edu_cess_b_cal", edu_cess_b_cal);
var sum_of_b = tax_b_cal + surcharge_b_cal + edu_cess_b_cal;
setValue("sum_of_b", sum_of_b);
// ================= TAX PAYABLE =================
var tax_payable = (sum_of_a > sum_of_b) ? tax_a_cal : tax_b_cal;
setValue("tax_payable", tax_payable);
var total_tax_payable = (sum_of_a > sum_of_b) ? sum_of_a : sum_of_b;
setValue("total_tax_payable", total_tax_payable);
// ================= MAT CREDIT =================
var mat_created = 0;
var mat_utilized = 0;
if (sum_of_a < sum_of_b) {
mat_created = sum_of_b - sum_of_a;
} else {
mat_utilized = sum_of_a - sum_of_b;
}
setValue("mat_credit_created", mat_created);
setValue("mat_credit_utilized", mat_utilized);
// ================= Opening Balance and closing =================
var opening_balance = getValue("opening_balance");
var closing_balance = (opening_balance + mat_created) - mat_utilized
setValue("closing_balance", closing_balance);
// ================= FINAL TAX =================
var interest_234c = getValue("interest_234c");
var total_tax = total_tax_payable + interest_234c - mat_utilized;
setValue("total_tax", total_tax);
// ================= ADJUSTMENTS =================
var adv_tax = getValue("advance_tax");
var tds = getValue("tds");
var tcs = getValue("tcs");
var tax_on_assessment = getValue("tax_on_assessment");
var interest_244a_per143 = getValue("interest_244a_per143");
var refund_received = getValue("refund_received");
var paid_tax = adv_tax + tds + tcs + tax_on_assessment;
var refund = total_tax - paid_tax;
setValue("refund", refund);
var balance_receivable = (refund + interest_244a_per143) - refund_received
setValue("balance_receivable", balance_receivable);
};
});

175
static/js/mat_credit.js Normal file
View File

@@ -0,0 +1,175 @@
let addedYears = [];
// INITIALIZE YEARS FROM DATABASE HEADERS
document.addEventListener("DOMContentLoaded", () => {
const headers = document.querySelectorAll("#tableHeader th");
headers.forEach(th => {
if (th.innerText.startsWith("Utilized")) {
const year = th.innerText.replace("Utilized", "").trim();
if (!addedYears.includes(year)) {
addedYears.push(year);
}
}
});
});
// ADD YEAR COLUMN (DYNAMIC)
function addYearColumn() {
const yearSelect = document.getElementById("yearSelect");
const year = yearSelect.value;
if (!year) {
alert("Please select AY");
return;
}
if (addedYears.includes(year)) {
alert("This AY is already added");
return;
}
addedYears.push(year);
// Add header column
const headerRow = document.getElementById("tableHeader");
const th = document.createElement("th");
th.innerText = "Utilized " + year;
// Insert before Balance column
headerRow.insertBefore(th, headerRow.children[headerRow.children.length - 2]);
// Add input cells to all existing rows
document.querySelectorAll("#matTable tbody tr").forEach(tr => {
const td = document.createElement("td");
td.innerHTML = `<input type="number">`;
tr.insertBefore(td, tr.children[tr.children.length - 2]);
});
}
// ADD NEW ROW
function addRow() {
const tbody = document.querySelector("#matTable tbody");
const tr = document.createElement("tr");
let utilizedCols = "";
addedYears.forEach(() => {
utilizedCols += `<td><input type="number"></td>`;
});
tr.innerHTML = `
<td contenteditable="true"></td>
<td><input></td>
${utilizedCols}
<td><input></td>
<td>
<button onclick="saveRow(this)">Save</button>
</td>
`;
tbody.appendChild(tr);
}
// SAVE SINGLE ROW
function saveRow(btn) {
const tr = btn.closest("tr");
const inputs = tr.querySelectorAll("input");
const financialYear = tr.children[0].innerText.trim();
if (!financialYear) {
alert("AY is required");
return;
}
let payload = {
financial_year: financialYear,
mat_credit: inputs[0].value || 0,
balance: inputs[inputs.length - 1].value || 0,
utilization: []
};
addedYears.forEach((year, i) => {
const value = inputs[i + 1].value;
if (value) {
payload.utilization.push({
year: year,
amount: value
});
}
});
fetch("/save_mat_row", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload)
})
.then(res => res.json().then(j => ({ ok: res.ok, data: j })))
.then(res => {
if (res.ok) {
alert("✅ " + res.data.message);
} else {
alert("⚠️ " + res.data.error);
}
})
.catch(() => {
alert("Server error");
});
}
// SAVE ALL ROWS
function saveAll() {
let rows = [];
document.querySelectorAll("#matTable tbody tr").forEach(tr => {
const inputs = tr.querySelectorAll("input");
const financialYear = tr.children[0].innerText.trim();
if (!financialYear) return;
let row = {
financial_year: financialYear,
mat_credit: inputs[0].value || 0,
balance: inputs[inputs.length - 1].value || 0,
utilization: []
};
addedYears.forEach((year, i) => {
const value = inputs[i + 1].value;
if (value) {
row.utilization.push({
year: year,
amount: value
});
}
});
rows.push(row);
});
if (!rows.length) {
alert("No data to save");
return;
}
fetch("/save_mat_all", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(rows)
})
.then(res => res.json())
.then(res => {
let msg = "✅ " + res.message;
if (res.skipped && res.skipped.length) {
msg += "\n\nSkipped AY:\n" + res.skipped.join(", ");
}
alert(msg);
})
.catch(() => {
alert("Server error");
});
}

View File

@@ -0,0 +1,50 @@
document.getElementById("year").addEventListener("change", function () {
const year = this.value;
const downloadBtn = document.getElementById("downloadBtn");
const previewDiv = document.getElementById("preview");
const contentDiv = document.getElementById("previewContent");
if (!year) {
downloadBtn.style.display = "none";
previewDiv.style.display = "none";
contentDiv.innerHTML = "";
return;
}
downloadBtn.href = `/summary/download?year=${year}`;
downloadBtn.style.display = "inline-block";
fetch(`/summary/preview?year=${year}`)
.then(res => res.json())
.then(data => {
let html = `<table>
<thead>
<tr>
<th>Particular</th>
<th>ITR</th>
<th>AO</th>
<th>CIT</th>
<th>ITAT</th>
</tr>
</thead>
<tbody>`;
data.forEach(row => {
html += `<tr>
<td>${row.Particular}</td>
<td>${row.ITR}</td>
<td>${row.AO}</td>
<td>${row.CIT}</td>
<td>${row.ITAT}</td>
</tr>`;
});
html += `</tbody></table>`;
contentDiv.innerHTML = html;
// Show preview
previewDiv.style.display = "block";
})
.catch(err => console.error("Preview load error:", err));
});

14
static/js/toggle.js Normal file
View File

@@ -0,0 +1,14 @@
function toggleSidebar() {
// Toggle ONLY on mobile
if (window.innerWidth <= 768) {
document.getElementById("sidebar").classList.toggle("show");
}
}
function toggleMenu(id) {
const menu = document.getElementById(id);
menu.style.display = (menu.style.display === "block") ? "none" : "block";
}

View File

@@ -0,0 +1,69 @@
document.addEventListener("DOMContentLoaded", function () {
const yearDropdown = document.getElementById("year");
const errorDiv = document.getElementById("yearError");
const form = document.querySelector("form");
const tableName = form.id.toLowerCase(); // ao, cit, etc.
const currentYear = new Date().getFullYear();
const startYear = 1990;
/* ---------- Fill Year Dropdown ---------- */
for (let y = currentYear; y >= startYear; y--) {
let nextYear = y + 1;
let option = document.createElement("option");
option.value = y; // IMPORTANT
option.textContent = `AY ${y}-${nextYear}`;
yearDropdown.appendChild(option);
}
/* ---------- Validate on Change ---------- */
yearDropdown.addEventListener("change", function () {
const selectedYear = this.value;
// If empty → block submit
if (!selectedYear) {
errorDiv.style.display = "block";
errorDiv.innerText = "Please select an Assessment Year.";
form.onsubmit = () => false;
return;
}
fetch("/check_year", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
table: tableName,
year: selectedYear
})
})
.then(res => res.json())
.then(data => {
if (data.exists) {
errorDiv.style.display = "block";
errorDiv.innerText = `AY ${selectedYear}-${parseInt(selectedYear) + 1} already exists!`;
form.onsubmit = () => false;
} else {
errorDiv.style.display = "none";
errorDiv.innerText = "";
form.onsubmit = null; // allow submit
}
})
.catch(() => {
errorDiv.style.display = "block";
errorDiv.innerText = "Error validating year. Please try again.";
form.onsubmit = () => false;
});
});
/* ---------- Final Safety Check on Submit ---------- */
form.addEventListener("submit", function (e) {
if (!yearDropdown.value) {
e.preventDefault();
errorDiv.style.display = "block";
errorDiv.innerText = "Assessment Year is required.";
}
});
});

Binary file not shown.

View File

@@ -1,127 +1,268 @@
<!DOCTYPE html>
<html>
<head>
<title>AO Form Entry</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
/* Reset and base styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
{% extends "base.html" %}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f5f7fa;
color: #333;
padding: 30px 0;
}
{% block title %}Add New AO Record{% endblock %}
.container {
width: 90%;
max-width: 700px;
margin: auto;
background-color: #fff;
padding: 40px;
border-radius: 12px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
{% block extra_css %}
<!-- Child page CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}">
{% endblock %}
h2 {
text-align: center;
margin-bottom: 30px;
font-size: 28px;
color: #2c3e50;
}
{% block content %}
<div class="container">
<h2 style="text-align:center;">New AO Form</h2>
<form id="ao" method="POST" enctype="multipart/form-data">
<input type="hidden" name="stage" value="ao">
<div class="form-group full-width inline-2">
<div>
<label>Assessment Year:</label>
<select id="year" name="year" required>
<option value="" disabled selected>
-- Please select Assessment Year --
</option>
</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">
<div>
<label>Gross Total Income:</label>
<input type="number" name="gross_total_income" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 14A:</label>
<input type="number" name="disallowance_14a" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 37:</label>
<input type="number" name="disallowance_37" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>GTI as per AO</label>
<input type="number" name="gti_as_per_ao" class="auto" step="any" value="0.00" readonly>
</div>
</div>
form {
display: flex;
flex-direction: column;
}
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction 80IA Business Income:</label>
<input type="number" name="deduction_80ia_business" step="any" value="0.00" oninput="calculate()"
required>
</div>
<div>
<label>Less :Deduction 80IA Misc:</label>
<input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Less : Deduction 80IA Other Operating Revenue:</label>
<input type="number" name="deduction_80ia_other" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
label {
margin-top: 15px;
margin-bottom: 6px;
font-weight: 600;
color: #333;
}
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction Sec 37 Disallowance:</label>
<input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()"
required>
</div>
<div>
<label>Less: Deduction 80G: </label>
<input type="number" name="deduction_80g" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
input[type="number"] {
padding: 10px 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
transition: border-color 0.3s ease;
}
<div class="form-group full-width inline-2">
<div>
<label>Net Taxable Income:</label>
<input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly>
</div>
</div>
input[type="number"]:focus {
border-color: #007BFF;
outline: none;
}
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) calculate: Tax(A):</label>
<input type="number" name="per_tax_a" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Tax @(A):</label>
<input type="number" name="tax_a_cal" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Enter Percentage(%) calculate: Tax(B):</label>
<input type="number" name="per_tax_b" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Tax @ 18.5% on Book Profit (B):</label>
<input type="number" name="tax_b_cal" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
button[type="submit"] {
margin-top: 30px;
padding: 12px;
background-color: #007BFF;
border: none;
border-radius: 6px;
color: white;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease;
}
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Surcharge:Tax(A):</label>
<input type="number" name="per_surcharge_a" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(A):</label>
<input type="number" name="surcharge_a_cal" class="auto" value="0.00" readonly>
</div>
button[type="submit"]:hover {
background-color: #0056b3;
}
<div>
<label>Enter Percentage(%) Surcharge:Tax(B)</label>
<input type="number" name="per_surcharge_b" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(B):</label>
<input type="number" name="surcharge_b_cal" class="auto" value="0.00" readonly>
</div>
</div>
@media (max-width: 600px) {
.container {
padding: 20px;
}
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Cess:Tax(A):</label>
<input type="number" name="per_cess_a" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(A): </label>
<input type="number" name="edu_cess_a_cal" class="auto" step="any" value="0.00" readonly>
</div>
<div>
<label>Enter Percentage(%) Cess:Tax(B):</label>
<input type="number" name="per_cess_b" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(B): </label>
<input type="number" name="edu_cess_b_cal" class="auto" step="any" value="0.00" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Total cal Tax(A): </label>
<input type="number" name="sum_of_a" class="auto" step="any" value="0.00" readonly>
</div>
<div>
<label>Total cal Tax(B): </label>
<input type="number" name="sum_of_b" class="auto" step="any" value="0.00" readonly>
</div>
</div>
h2 {
font-size: 22px;
}
<div class="form-group full-width inline-2">
<div>
<label>Tax Payable (Higher of A or B):</label>
<input type="number" name="tax_payable" class="auto" step="any" value="0.00" readonly>
</div>
<div>
<label>Total tax Payable:</label>
<input type="number" name="total_tax_payable" class="auto" step="any" value="0.00" readonly>
</div>
</div>
input[type="number"] {
font-size: 15px;
}
<div class="form-group full-width inline-2">
<div>
<label>Opening Balance:</label>
<input type="number" name="opening_balance" step="any" value="0.00" oninput="calculate()">
</div>
</div>
button[type="submit"] {
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="container">
<h2>AO Form Entry</h2>
<form method="POST" onsubmit="return showSuccessMessage()">
<label>Year:</label>
<input type="number" name="year" required>
{% for field in [
"gross_total_income", "disallowance_14a", "disallowance_37",
"deduction_80ia_business", "deduction_sec37_disallowance", "deduction_80g",
"net_taxable_income", "tax_30_percent", "tax_book_profit_18_5",
"surcharge_12", "edu_cess_3", "total_tax_payable", "mat_credit",
"interest_234c", "total_tax", "advance_tax", "tds", "tcs",
"tax_on_assessment", "refund"
] %}
<label for="{{ field }}">{{ field.replace("_", " ").title() }}:</label>
<input type="number" name="{{ field }}" step="0.01" required>
{% endfor %}
<button type="submit">Submit</button>
</form>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Mat Credit Created:</label>
<input type="number" name="mat_credit_created" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Less :Mat Credit Utilized:</label>
<input type="number" name="mat_credit_utilized" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<!-- JavaScript Alert -->
<script>
function showSuccessMessage() {
alert("Form submitted successfully!");
return true; // allow form to submit after showing alert
}
</script>
</body>
</html>
<div class="form-group full-width inline-2">
<div>
<label>Closing Balance:</label>
<input type="number" name="closing_balance" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Add :Interest 234c:</label>
<input type="number" name="interest_234c" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Total Tax:</label>
<input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Advance Tax:</label>
<input type="number" name="advance_tax" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>TDS :</label>
<input type="number" name="tds" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>TCS :</label>
<input type="number" name="tcs" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>SAT :</label>
<input type="number" name="sat" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Tax on Regular Assessment:</label>
<input type="number" name="tax_on_assessment" step="any" value="0.00" oninput="calculate()">
</div>
</div>
<div class="form-group">
<label>Refund:</label>
<input type="number" name="refund" class="auto" step="any" value="0.00" readonly>
</div>
<div class="form-group full-width inline-2">
<div class="form-group">
<label>Add : Interest u/s 244A as per 143:</label>
<input type="number" name="interest_244a_per143" step="any" value="0.00" oninput="calculate()">
</div>
<div class="form-group">
<label>Less : Refund Received on:</label>
<input type="number" name="refund_received" step="any" value="0.00" oninput="calculate()">
</div>
<div class="form-group">
<label>Balance Receivable:</label>
<input type="number" name="balance_receivable" class="auto" step="any" value="0.00"
oninput="calculate()">
</div>
</div>
<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>
</div>
{% endblock %}
{% block extra_js %}
<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

@@ -1,124 +1,267 @@
<!DOCTYPE html>
<html>
<head>
<title>CIT Form Entry</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
/* ...existing styles... (no changes needed) */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
{% extends "base.html" %}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f5f7fa;
color: #333;
padding: 30px 0;
}
{% block title %}CIT Form Entry{% endblock %}
.container {
width: 90%;
max-width: 700px;
margin: auto;
background-color: #fff;
padding: 40px;
border-radius: 12px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
{% block extra_css %}
<!-- Child page CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}">
{% endblock %}
{% block content %}
<div class="container">
<h2 style="text-align:center;">New CIT Form </h2>
<form id="cit" method="POST" enctype="multipart/form-data">
<input type="hidden" name="stage" value="itr">
<div class="form-group full-width inline-2">
<div>
<label>Assessment Year:</label>
<select id="year" name="year" required>
<option value="" disabled selected>
-- Please select Assessment Year --
</option>
</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>
h2 {
text-align: center;
margin-bottom: 30px;
font-size: 28px;
color: #2c3e50;
}
<div class="form-group full-width inline-2">
<div>
<label>Gross Total Income:</label>
<input type="number" name="gross_total_income" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 14A:</label>
<input type="number" name="disallowance_14a" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 37:</label>
<input type="number" name="disallowance_37" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
form {
display: flex;
flex-direction: column;
}
<div class="form-group full-width inline-2">
<div>
<label>GTI as per CIT</label>
<input type="number" name="gti_as_per_ao" class="auto" step="any" value="0.00" readonly>
</div>
</div>
label {
margin-top: 15px;
margin-bottom: 6px;
font-weight: 600;
color: #333;
}
<div class="form-group full-width inline-2">
<div>
<label>Deduction 80IA Business Income:</label>
<input type="number" name="deduction_80ia_business" step="any" value="0.00" oninput="calculate()"
required>
</div>
<div>
<label>Deduction 80IA Misc:</label>
<input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Deduction 80IA Other Operating Revenue:</label>
<input type="number" name="deduction_80ia_other" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
input[type="number"] {
padding: 10px 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
}
<div class="form-group full-width inline-2">
<div>
<label>Deduction Sec 37 Disallowance:</label>
<input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()"
required>
</div>
<div>
<label>Less: Deduction 80G: </label>
<input type="number" name="deduction_80g" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
input[type="number"]:focus {
border-color: #007BFF;
outline: none;
}
<div class="form-group full-width inline-2">
<div>
<label>Net Taxable Income:</label>
<input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly>
</div>
</div>
button[type="submit"] {
margin-top: 30px;
padding: 12px;
background-color: #007BFF;
border: none;
border-radius: 6px;
color: white;
font-size: 18px;
cursor: pointer;
}
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) calculate: Tax(A):</label>
<input type="number" name="per_tax_a" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Tax @(A):</label>
<input type="number" name="tax_a_cal" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Enter Percentage(%) calculate: Tax(B):</label>
<input type="number" name="per_tax_b" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Tax @ 18.5% on Book Profit (B):</label>
<input type="number" name="tax_b_cal" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
button[type="submit"]:hover {
background-color: #0056b3;
}
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Surcharge:Tax(A):</label>
<input type="number" name="per_surcharge_a" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(A):</label>
<input type="number" name="surcharge_a_cal" class="auto" value="0.00" readonly>
</div>
@media (max-width: 600px) {
.container {
padding: 20px;
}
<div>
<label>Enter Percentage(%) Surcharge:Tax(B)</label>
<input type="number" name="per_surcharge_b" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(B):</label>
<input type="number" name="surcharge_b_cal" class="auto" value="0.00" readonly>
</div>
</div>
h2 {
font-size: 22px;
}
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Cess:Tax(A):</label>
<input type="number" name="per_cess_a" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(A): </label>
<input type="number" name="edu_cess_a_cal" class="auto" step="any" value="0.00" readonly>
</div>
<div>
<label>Enter Percentage(%) Cess:Tax(B):</label>
<input type="number" name="per_cess_b" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(B): </label>
<input type="number" name="edu_cess_b_cal" class="auto" step="any" value="0.00" readonly>
</div>
</div>
input[type="number"] {
font-size: 15px;
}
<div class="form-group full-width inline-2">
<div>
<label>Total cal Tax(A): </label>
<input type="number" name="sum_of_a" class="auto" step="any" value="0.00" readonly>
</div>
<div>
<label>Total cal Tax(B): </label>
<input type="number" name="sum_of_b" class="auto" step="any" value="0.00" readonly>
</div>
</div>
button[type="submit"] {
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="container">
<h2>CIT Form Entry</h2>
<form method="POST">
<label>Year:</label>
<input type="number" name="year" required value="{{ record.year if record else '' }}">
<div class="form-group full-width inline-2">
<div>
<label>Tax Payable (Higher of A or B):</label>
<input type="number" name="tax_payable" class="auto" step="any" value="0.00" readonly>
</div>
<div>
<label>Total tax Payable:</label>
<input type="number" name="total_tax_payable" class="auto" step="any" value="0.00" readonly>
</div>
</div>
{% for field in [
"gross_total_income", "deduction_80ia_business", "deduction_sec37_disallowance",
"deduction_80g", "net_taxable_income", "tax_30_percent", "tax_book_profit_18_5",
"tax_payable", "surcharge_12", "edu_cess_3", "total_tax_payable", "mat_credit",
"interest_234c", "total_tax", "advance_tax", "tds", "tcs", "tax_on_assessment", "refund"
] %}
<label for="{{ field }}">{{ field.replace("_", " ").title() }}:</label>
<input type="number" name="{{ field }}" step="0.01" required value="{{ record[field] if record else '' }}">
{% endfor %}
<button type="submit">{{ 'Update' if record else 'Submit' }}</button>
</form>
<div class="form-group full-width inline-2">
<div>
<label>Opening Balance:</label>
<input type="number" name="opening_balance" step="any" value="0.00" oninput="calculate()">
</div>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Mat Credit Created:</label>
<input type="number" name="mat_credit_created" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Less :Mat Credit Utilized:</label>
<input type="number" name="mat_credit_utilized" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Closing Balance:</label>
<input type="number" name="closing_balance" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Add :Interest 234c:</label>
<input type="number" name="interest_234c" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<script>
function showSuccessMessage() {
alert("Form submitted successfully!");
return true; // continue with form submission
}
</script>
</body>
</html>
<div class="form-group full-width inline-2">
<div>
<label>Total Tax:</label>
<input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Advance Tax:</label>
<input type="number" name="advance_tax" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>TDS :</label>
<input type="number" name="tds" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>TCS :</label>
<input type="number" name="tcs" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>SAT :</label>
<input type="number" name="sat" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Tax on Regular Assessment:</label>
<input type="number" name="tax_on_assessment" step="any" value="0.00" oninput="calculate()">
</div>
</div>
<div class="form-group">
<label>Refund:</label>
<input type="number" name="refund" class="auto" step="any" value="0.00" readonly>
</div>
<div class="form-group full-width inline-2">
<div class="form-group">
<label>Add : Interest u/s 244A as per 143:</label>
<input type="number" name="interest_244a_per143" step="any" value="0.00" oninput="calculate()">
</div>
<div class="form-group">
<label>Less : Refund Received on:</label>
<input type="number" name="refund_received" step="any" value="0.00" oninput="calculate()">
</div>
<div class="form-group">
<label>Balance Receivable:</label>
<input type="number" name="balance_receivable" class="auto" step="any" value="0.00"
oninput="calculate()">
</div>
</div>
<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>
</div>
{% endblock %}
{% block extra_js %}
<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

@@ -1,126 +1,271 @@
<!DOCTYPE html>
<html>
<head>
<title>ITAT Form Entry</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
/* Same styling for layout */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
{% extends "base.html" %}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f5f7fa;
color: #333;
padding: 30px 0;
}
{% block title %}Add New ITAT Record{% endblock %}
.container {
width: 90%;
max-width: 700px;
margin: auto;
background-color: #fff;
padding: 40px;
border-radius: 12px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
{% block extra_css %}
<!-- Child page CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}">
{% endblock %}
h2 {
text-align: center;
margin-bottom: 30px;
font-size: 28px;
color: #2c3e50;
}
{% block content %}
<div class="container">
<h2 style="text-align:center;">New Income Tax Appellate Tribunal Form</h2>
<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>
<select id="year" name="year" required>
<option value="" disabled selected>
-- Please select Assessment Year --
</option>
</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>
form {
display: flex;
flex-direction: column;
}
<div class="form-group full-width inline-2">
<div>
<label>Gross Total Income:</label>
<input type="number" name="gross_total_income" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 14A:</label>
<input type="number" name="disallowance_14a" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 37:</label>
<input type="number" name="disallowance_37" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
label {
margin-top: 15px;
margin-bottom: 6px;
font-weight: 600;
color: #333;
}
<div class="form-group full-width inline-2">
<div>
<label>GTI as per AO</label>
<input type="number" name="gti_as_per_ao" class="auto" step="any" value="0.00" readonly>
</div>
</div>
input[type="number"] {
padding: 10px 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
}
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction 80IA Business Income:</label>
<input type="number" name="deduction_80ia_business" step="any" value="0.00" oninput="calculate()"
required>
</div>
<div>
<label>Less :Deduction 80IA Misc:</label>
<input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Less :Deduction 80IA Other Operating Revenue:</label>
<input type="number" name="deduction_80ia_other" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
input[type="number"]:focus {
border-color: #007BFF;
outline: none;
}
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction Sec 37 Disallowance:</label>
<input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()"
required>
</div>
<div>
<label>Less: Deduction 80G: </label>
<input type="number" name="deduction_80g" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
button[type="submit"] {
margin-top: 30px;
padding: 12px;
background-color: #007BFF;
border: none;
border-radius: 6px;
color: white;
font-size: 18px;
cursor: pointer;
}
<div class="form-group full-width inline-2">
<div>
<label>Net Taxable Income:</label>
<input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly>
</div>
</div>
button[type="submit"]:hover {
background-color: #0056b3;
}
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) calculate: Tax(A):</label>
<input type="number" name="per_tax_a" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Tax @(A):</label>
<input type="number" name="tax_a_cal" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Enter Percentage(%) calculate: Tax(B):</label>
<input type="number" name="per_tax_b" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Tax @ 18.5% on Book Profit (B):</label>
<input type="number" name="tax_b_cal" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
@media (max-width: 600px) {
.container {
padding: 20px;
}
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Surcharge:Tax(A):</label>
<input type="number" name="per_surcharge_a" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(A):</label>
<input type="number" name="surcharge_a_cal" class="auto" value="0.00" readonly>
</div>
h2 {
font-size: 22px;
}
<div>
<label>Enter Percentage(%) Surcharge:Tax(B)</label>
<input type="number" name="per_surcharge_b" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(B):</label>
<input type="number" name="surcharge_b_cal" class="auto" value="0.00" readonly>
</div>
</div>
input[type="number"] {
font-size: 15px;
}
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Cess:Tax(A):</label>
<input type="number" name="per_cess_a" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(A): </label>
<input type="number" name="edu_cess_a_cal" class="auto" step="any" value="0.00" readonly>
</div>
<div>
<label>Enter Percentage(%) Cess:Tax(B):</label>
<input type="number" name="per_cess_b" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(B): </label>
<input type="number" name="edu_cess_b_cal" class="auto" step="any" value="0.00" readonly>
</div>
</div>
button[type="submit"] {
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="container">
<h2>ITAT Form Entry</h2>
<form method="POST" onsubmit="return showSuccessMessage()">
<label>Year:</label>
<input type="number" name="year" step="0.01" required>
<div class="form-group full-width inline-2">
<div>
<label>Total cal Tax(A): </label>
<input type="number" name="sum_of_a" class="auto" step="any" value="0.00" readonly>
</div>
<div>
<label>Total cal Tax(B): </label>
<input type="number" name="sum_of_b" class="auto" step="any" value="0.00" readonly>
</div>
</div>
<label>MAT Tax Credit:</label>
<input type="number" name="mat_tax_credit" step="0.01" required>
<div class="form-group full-width inline-2">
<div>
<label>Tax Payable (Higher of A or B):</label>
<input type="number" name="tax_payable" class="auto" step="any" value="0.00" readonly>
</div>
<div>
<label>Total tax Payable:</label>
<input type="number" name="total_tax_payable" class="auto" step="any" value="0.00" readonly>
</div>
</div>
<label>Surcharge:</label>
<input type="number" name="surcharge" step="0.01" required>
<div class="form-group full-width inline-2">
<div>
<label>Opening Balance:</label>
<input type="number" name="opening_balance" step="any" value="0.00" oninput="calculate()">
</div>
</div>
<label>Cess:</label>
<input type="number" name="cess" step="0.01" required>
<div class="form-group full-width inline-2">
<div>
<label>Less :Mat Credit Created:</label>
<input type="number" name="mat_credit_created" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Less :Mat Credit Utilized:</label>
<input type="number" name="mat_credit_utilized" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<label>Total Credit:</label>
<input type="number" name="total_credit" step="0.01" required>
<div class="form-group full-width inline-2">
<div>
<label>Closing Balance:</label>
<input type="number" name="closing_balance" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Add :Interest 234c:</label>
<input type="number" name="interest_234c" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<button type="submit">Submit</button>
</form>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Total Tax:</label>
<input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly>
</div>
</div>
<script>
function showSuccessMessage() {
alert("Form submitted successfully!");
return true;
}
</script>
</body>
</html>
<div class="form-group full-width inline-2">
<div>
<label>Advance Tax:</label>
<input type="number" name="advance_tax" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>TDS :</label>
<input type="number" name="tds" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>TCS :</label>
<input type="number" name="tcs" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>SAT :</label>
<input type="number" name="sat" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Tax on Regular Assessment:</label>
<input type="number" name="tax_on_assessment" step="any" value="0.00" oninput="calculate()">
</div>
</div>
<div class="form-group">
<label>Refund:</label>
<input type="number" name="refund" class="auto" step="any" value="0.00" readonly>
</div>
<div class="form-group full-width inline-2">
<div class="form-group">
<label>Add : Interest u/s 244A as per 143:</label>
<input type="number" name="interest_244a_per143" step="any" value="0.00" oninput="calculate()">
</div>
<div class="form-group">
<label>Less : Refund Received on:</label>
<input type="number" name="refund_received" step="any" value="0.00" oninput="calculate()">
</div>
<div class="form-group">
<label>Balance Receivable:</label>
<input type="number" name="balance_receivable" class="auto" step="any" value="0.00"
oninput="calculate()">
</div>
</div>
<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>
</div>
{% endblock %}
{% block extra_js %}
<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

@@ -1,133 +1,272 @@
<!DOCTYPE html>
<html lang="en">
{% extends "base.html" %}
<head>
<meta charset="UTF-8">
<title>Add New Income Tax Return Record</title>
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
background: #eef2f7;
margin: 0;
padding: 40px;
color: #333;
}
{% block title %}Add New Income Tax Return Record{% endblock %}
.container {
max-width: 900px;
margin: auto;
background: #fff;
padding: 40px 50px;
border-radius: 12px;
box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
transition: box-shadow 0.3s ease;
}
{% block extra_css %}
<!-- Child page CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}">
{% endblock %}
.container:hover {
box-shadow: 0 10px 35px rgba(0, 0, 0, 0.15);
}
{% block content %}
<div class="container">
<h2 style="text-align:center;">New Income Tax Return Form</h2>
<form id="itr" method="POST" enctype="multipart/form-data">
<input type="hidden" name="stage" value="itr">
<div class="form-group full-width inline-2">
<div>
<label>Assessment Year:</label>
<select id="year" name="year" required>
<option value="" disabled selected>
-- Please select Assessment Year --
</option>
</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">
<div>
<label>Gross Total Income:</label>
<input type="number" name="gross_total_income" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 14A:</label>
<input type="number" name="disallowance_14a" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 37:</label>
<input type="number" name="disallowance_37" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>GTI as per AO</label>
<input type="number" name="gti_as_per_ao" class="auto" step="any" value="0.00" readonly>
</div>
</div>
h2 {
text-align: center;
margin-bottom: 35px;
font-size: 30px;
color: #2c3e50;
font-weight: 700;
letter-spacing: 0.5px;
}
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction 80IA Business Income:</label>
<input type="number" name="deduction_80ia_business" step="any" value="0.00" oninput="calculate()"
required>
</div>
<div>
<label>Less :Deduction 80IA Misc:</label>
<input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Less : Deduction 80IA Other Operating Revenue:</label>
<input type="number" name="deduction_80ia_other" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
form {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px 30px;
}
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction Sec 37 Disallowance:</label>
<input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()"
required>
</div>
<div>
<label>Less: Deduction 80G: </label>
<input type="number" name="deduction_80g" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
.form-group {
display: flex;
flex-direction: column;
}
<div class="form-group full-width inline-2">
<div>
<label>Net Taxable Income:</label>
<input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly>
</div>
</div>
label {
font-weight: 600;
margin-bottom: 8px;
color: #555;
font-size: 14px;
}
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) calculate: Tax(A):</label>
<input type="number" name="per_tax_a" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Tax @(A):</label>
<input type="number" name="tax_a_cal" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Enter Percentage(%) calculate: Tax(B):</label>
<input type="number" name="per_tax_b" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Tax @ 18.5% on Book Profit (B):</label>
<input type="number" name="tax_b_cal" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
input[type="number"] {
padding: 10px 12px;
border: 1px solid #ccd1d9;
border-radius: 6px;
font-size: 15px;
background-color: #fafafa;
transition: all 0.25s ease-in-out;
}
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Surcharge:Tax(A):</label>
<input type="number" name="per_surcharge_a" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(A):</label>
<input type="number" name="surcharge_a_cal" class="auto" value="0.00" readonly>
</div>
input[type="number"]:focus {
border-color: #007BFF;
background: #fff;
box-shadow: 0 0 8px rgba(0, 123, 255, 0.25);
outline: none;
}
<div>
<label>Enter Percentage(%) Surcharge:Tax(B)</label>
<input type="number" name="per_surcharge_b" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(B):</label>
<input type="number" name="surcharge_b_cal" class="auto" value="0.00" readonly>
</div>
</div>
button[type="submit"] {
grid-column: span 2;
margin-top: 25px;
padding: 15px;
background: linear-gradient(135deg, #007BFF, #0056b3);
border: none;
border-radius: 8px;
color: #fff;
font-size: 18px;
font-weight: 600;
cursor: pointer;
transition: transform 0.2s, background 0.3s;
}
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Cess:Tax(A):</label>
<input type="number" name="per_cess_a" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(A): </label>
<input type="number" name="edu_cess_a_cal" class="auto" step="any" value="0.00" readonly>
</div>
<div>
<label>Enter Percentage(%) Cess:Tax(B):</label>
<input type="number" name="per_cess_b" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(B): </label>
<input type="number" name="edu_cess_b_cal" class="auto" step="any" value="0.00" readonly>
</div>
</div>
button[type="submit"]:hover {
background: linear-gradient(135deg, #0056b3, #00408f);
transform: translateY(-2px);
}
<div class="form-group full-width inline-2">
<div>
<label>Total cal Tax(A): </label>
<input type="number" name="sum_of_a" class="auto" step="any" value="0.00" readonly>
</div>
<div>
<label>Total cal Tax(B): </label>
<input type="number" name="sum_of_b" class="auto" step="any" value="0.00" readonly>
</div>
</div>
/* Responsive */
@media (max-width: 768px) {
form {
grid-template-columns: 1fr;
}
<div class="form-group full-width inline-2">
<div>
<label>Tax Payable (Higher of A or B):</label>
<input type="number" name="tax_payable" class="auto" step="any" value="0.00" readonly>
</div>
<div>
<label>Total tax Payable:</label>
<input type="number" name="total_tax_payable" class="auto" step="any" value="0.00" readonly>
</div>
</div>
h2 {
font-size: 24px;
}
}
</style>
</head>
<div class="form-group full-width inline-2">
<div>
<label>Opening Balance:</label>
<input type="number" name="opening_balance" step="any" value="0.00" oninput="calculate()">
</div>
</div>
<body>
<div class="container">
<h2>Add New Income Tax Return Record</h2>
<form method="POST" action="{{ url_for('add_itr') }}">
<div class="form-group">
<label>Year:</label>
<input type="number" name="year" required>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Mat Credit Created:</label>
<input type="number" name="mat_credit_created" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Less :Mat Credit Utilized:</label>
<input type="number" name="mat_credit_utilized" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
{% for field in [
"gross_total_income", "disallowance_14a", "disallowance_37",
"deduction_80ia_business", "deduction_80ia_misc", "deduction_80ia_other",
"deduction_sec37_disallowance", "deduction_80g", "net_taxable_income",
"tax_30_percent", "tax_book_profit_18_5", "tax_payable", "surcharge_12",
"edu_cess_3", "total_tax_payable", "mat_credit", "interest_234c",
"total_tax", "advance_tax", "tds", "tcs", "tax_on_assessment", "refund"
] %}
<div class="form-group">
<label>{{ field.replace("_", " ").title() }}:</label>
<input type="number" name="{{ field }}" step="any" value="0.00" required>
</div>
{% endfor %}
<div class="form-group full-width inline-2">
<div>
<label>Closing Balance:</label>
<input type="number" name="closing_balance" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Add :Interest 234c:</label>
<input type="number" name="interest_234c" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<button type="submit">Submit</button>
<div class="form-group full-width inline-2">
<div>
<label>Total Tax:</label>
<input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Advance Tax:</label>
<input type="number" name="advance_tax" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>TDS :</label>
<input type="number" name="tds" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>TCS :</label>
<input type="number" name="tcs" step="any" value="0.00" oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>SAT :</label>
<input type="number" name="sat" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Tax on Regular Assessment:</label>
<input type="number" name="tax_on_assessment" step="any" value="0.00" oninput="calculate()">
</div>
</div>
<div class="form-group full-width inline-2">
<div class="form-group">
<label>Refund:</label>
<input type="number" name="refund" class="auto" step="any" value="0.00">
</div>
</div>
<div class="form-group full-width inline-2">
<div class="form-group">
<label>Add : Interest u/s 244A as per 143:</label>
<input type="number" name="interest_244a_per143" step="any" value="0.00" oninput="calculate()">
</div>
<div class="form-group">
<label>Less : Refund Received on:</label>
<input type="number" name="refund_received" step="any" value="0.00" oninput="calculate()">
</div>
<div class="form-group">
<label>Balance Receivable:</label>
<input type="number" name="balance_receivable" class="auto" step="any" value="0.00"
oninput="calculate()">
</div>
</div>
<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>
</div>
</body>
</div>
{% endblock %}
</html>
{% block extra_js %}
<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

@@ -1,127 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>AO Form Entry</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
/* Reset and base styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f5f7fa;
color: #333;
padding: 30px 0;
}
.container {
width: 90%;
max-width: 700px;
margin: auto;
background-color: #fff;
padding: 40px;
border-radius: 12px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
h2 {
text-align: center;
margin-bottom: 30px;
font-size: 28px;
color: #2c3e50;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-top: 15px;
margin-bottom: 6px;
font-weight: 600;
color: #333;
}
input[type="number"] {
padding: 10px 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
transition: border-color 0.3s ease;
}
input[type="number"]:focus {
border-color: #007BFF;
outline: none;
}
button[type="submit"] {
margin-top: 30px;
padding: 12px;
background-color: #007BFF;
border: none;
border-radius: 6px;
color: white;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease;
}
button[type="submit"]:hover {
background-color: #0056b3;
}
@media (max-width: 600px) {
.container {
padding: 20px;
}
h2 {
font-size: 22px;
}
input[type="number"] {
font-size: 15px;
}
button[type="submit"] {
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="container">
<h2>AO Form Entry</h2>
<form method="POST" onsubmit="return showSuccessMessage()">
<label>Year:</label>
<input type="number" name="year" required>
{% for field in [
"gross_total_income", "disallowance_14a", "disallowance_37",
"deduction_80ia_business", "deduction_sec37_disallowance", "deduction_80g",
"net_taxable_income", "tax_30_percent", "tax_book_profit_18_5",
"surcharge_12", "edu_cess_3", "total_tax_payable", "mat_credit",
"interest_234c", "total_tax", "advance_tax", "tds", "tcs",
"tax_on_assessment", "refund"
] %}
<label for="{{ field }}">{{ field.replace("_", " ").title() }}:</label>
<input type="number" name="{{ field }}" step="0.01" required>
{% endfor %}
<button type="submit">Submit</button>
</form>
</div>
<!-- JavaScript Alert -->
<script>
function showSuccessMessage() {
alert("Form submitted successfully!");
return true; // allow form to submit after showing alert
}
</script>
</body>
</html>

View File

@@ -1,74 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>Download AO Reports</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f7f9;
margin: 0;
padding: 0;
}
{% extends "base.html" %}
.container {
max-width: 600px;
margin: 60px auto;
padding: 30px;
background-color: white;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
text-align: center;
}
{% block title %}Download AO Report{% endblock %}
h2 {
color: #333;
margin-bottom: 30px;
}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/report_model.css') }}">
{% endblock %}
label {
font-weight: 600;
margin-right: 10px;
}
select {
padding: 8px 12px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 20px;
min-width: 200px;
}
button {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<h2>Download AO Report</h2>
<form method="GET" action="{{ url_for('ao_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 }}">{{ y }}</option>
{% endfor %}
</select>
<br><br>
<button type="submit">Download Excel</button>
</form>
</div>
</body>
</html>
{% block content %}
<div class="container">
<h2>Download AO Report</h2>
<form method="GET" action="{{ url_for('ao_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>
{% endblock %}

97
templates/base.html Normal file
View File

@@ -0,0 +1,97 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>{% block title %}Income Tax Utilities{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Main CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/index.css') }}">
{% block extra_css %}{% endblock %}
</head>
<body>
<!-- ================= NAVBAR ================= -->
<div class="navbar">
<div class="nav-left">
<!-- ☰ visible ONLY on mobile via CSS -->
<span class="toggle-btn" onclick="toggleSidebar()"></span>
<img src="{{ url_for('static', filename='images/lcepllogo.png') }}" class="nav-logo" alt="LCEPL Logo">
<h3>LAXMI CIVIL ENGINEERING SERVICES PVT. LTD.</h3>
</div>
</div>
<!-- ================= SIDEBAR ================= -->
<div class="sidebar" id="sidebar">
<a href="{{ url_for('index') }}">
<h2>Dashboard</h2>
</a>
<!-- ITR -->
<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 -->
<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 -->
<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 -->
<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 -->
<div class="menu-btn" onclick="toggleMenu('matMenu')">MAT Credit ▼</div>
<div class="submenu" id="matMenu">
<a href="{{ url_for('mat_credit') }}">📄 MAT Credit Form</a>
</div>
<!-- DOCUMENTS -->
<div class="menu-btn" onclick="toggleMenu('docMenu')">Documents & Reports ▼</div>
<div class="submenu" id="docMenu">
<a href="{{ url_for('upload_file') }}">📂 Upload</a>
<a href="{{ url_for('view_documents') }}">📄 Documents</a>
<a href="{{ url_for('reports') }}">📊 Reports</a>
<a href="{{ url_for('summary_report') }}">📝 Summary Report</a>
</div>
<!-- LOGOUT -->
<a href="{{ url_for('auth.logout') }}" class="sidebar-logout">
<img src="{{ url_for('static', filename='images/logout_icon.png') }}" class="logout-icon" alt="Logout">
</a>
</div>
<!-- ================= MAIN CONTENT ================= -->
<div class="main" id="main">
{% block content %}{% endblock %}
</div>
<!-- JS -->
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
{% block extra_js %}{% endblock %}
</body>
</html>

View File

@@ -1,123 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>CIT Form Entry</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
/* ...existing styles... (no changes needed) */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f5f7fa;
color: #333;
padding: 30px 0;
}
.container {
width: 90%;
max-width: 700px;
margin: auto;
background-color: #fff;
padding: 40px;
border-radius: 12px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
h2 {
text-align: center;
margin-bottom: 30px;
font-size: 28px;
color: #2c3e50;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-top: 15px;
margin-bottom: 6px;
font-weight: 600;
color: #333;
}
input[type="number"] {
padding: 10px 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
}
input[type="number"]:focus {
border-color: #007BFF;
outline: none;
}
button[type="submit"] {
margin-top: 30px;
padding: 12px;
background-color: #007BFF;
border: none;
border-radius: 6px;
color: white;
font-size: 18px;
cursor: pointer;
}
button[type="submit"]:hover {
background-color: #0056b3;
}
@media (max-width: 600px) {
.container {
padding: 20px;
}
h2 {
font-size: 22px;
}
input[type="number"] {
font-size: 15px;
}
button[type="submit"] {
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="container">
<h2>CIT Form Entry</h2>
<form method="POST" onsubmit="return showSuccessMessage()">
<label>Year:</label>
<input type="number" name="year" required>
{% for field in [
"gross_total_income", "deduction_80ia_business", "deduction_sec37_disallowance",
"deduction_80g", "net_taxable_income", "tax_30_percent", "tax_book_profit_18_5",
"tax_payable", "surcharge_12", "edu_cess_3", "total_tax_payable", "mat_credit",
"interest_234c", "total_tax", "advance_tax", "tds", "tcs", "tax_on_assessment", "refund"
] %}
<label for="{{ field }}">{{ field.replace("_", " ").title() }}:</label>
<input type="number" name="{{ field }}" step="0.01" required>
{% endfor %}
<button type="submit">Submit</button>
</form>
</div>
<script>
function showSuccessMessage() {
alert("Form submitted successfully!");
return true; // continue with form submission
}
</script>
</body>
</html>

View File

@@ -1,74 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>Download CIT Reports</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f7f9;
margin: 0;
padding: 0;
}
{% extends "base.html" %}
.container {
max-width: 600px;
margin: 60px auto;
padding: 30px;
background-color: white;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
text-align: center;
}
{% block title %}Download CIT Report{% endblock %}
h2 {
color: #333;
margin-bottom: 30px;
}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/report_model.css') }}">
{% endblock %}
label {
font-weight: 600;
margin-right: 10px;
}
select {
padding: 8px 12px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 20px;
min-width: 200px;
}
button {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<h2>Download CIT Report</h2>
<form method="GET" action="{{ url_for('cit_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 }}">{{ y }}</option>
{% endfor %}
</select>
<br><br>
<button type="submit">Download Excel</button>
</form>
</div>
</body>
</html>
{% block content %}
<div class="container">
<h2>Download CIT Report</h2>
<form method="GET" action="{{ url_for('cit_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>
{% endblock %}

View File

@@ -1,78 +1,57 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AO Records</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background-color: #f8f9fa; padding: 20px; color: #333; }
.container { max-width: 95%; margin: auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
h2 { text-align: center; margin-bottom: 20px; }
.btn { padding: 8px 15px; border-radius: 5px; text-decoration: none; color: white; border: none; cursor: pointer; font-size: 14px; }
.btn-add { background-color: #28a745; display: inline-block; margin-bottom: 20px; }
.btn-update { background-color: #007bff; }
.btn-delete { background-color: #dc3545; }
.action-cell form { display: inline-block; margin-left: 5px; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px; border: 1px solid #dee2e6; text-align: right; white-space: nowrap; }
th { background-color: #343a40; color: white; text-align: center; }
tr:nth-child(even) { background-color: #f2f2f2; }
td:first-child, th:first-child { text-align: left; }
.alert { padding: 10px 15px; margin-bottom: 20px; border-radius: 5px; }
.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
</style>
</head>
<body>
<div class="container">
<h2>Assessing Officer Records 👨‍💼</h2>
{% extends "base.html" %}
{% block title %}AO Records{% endblock %}
<!-- Flash Messages -->
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }}">{{ message }}</div>
{% endfor %}
{% endif %}
{% endwith %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/display_model.css') }}">
{% endblock %}
{% block content %}
<div class="container">
<h2 style="text-align: center;">Assessing Officer Records 👨‍💼</h2>
<!-- Add AO Record Button -->
<div style="text-align: right; margin-bottom: 10px;">
<a href="{{ url_for('add_ao') }}" class="btn btn-add"> Add AO Record</a>
{% if ao_records %}
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>ID</th>
<th>Year</th>
<th>Gross Total Income</th>
<th>Net Taxable Income</th>
<th>Total Tax</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for ao in ao_records %}
<tr>
<td>{{ ao.id }}</td>
<td>{{ ao.year }}</td>
<td>{{ ao.gross_total_income }}</td>
<td>{{ ao.net_taxable_income }}</td>
<td>{{ ao.total_tax }}</td>
<td class="action-cell">
<a href="{{ url_for('update_ao', id=ao.id) }}" class="btn btn-update">Edit</a>
<form action="{{ url_for('delete_ao', id=ao.id) }}" method="POST" style="display:inline;">
<button type="submit" class="btn btn-delete" onclick="return confirm('Are you sure you want to delete this AO?');">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p style="text-align: center; margin-top: 20px;">No AO records found. Add one above!</p>
{% endif %}
</div>
</body>
</html>
{% if ao_records %}
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Year</th>
<th>Gross Total Income</th>
<th>Net Taxable Income</th>
<th>Total Tax</th>
<th>Refund</th>
<th>Created Record Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for ao in ao_records %}
<tr>
<td>AY {{ ao.year }}-{{ ao.year+1 }}</td>
<td>{{ ao.gross_total_income }}</td>
<td>{{ ao.net_taxable_income }}</td>
<td>{{ ao.total_tax_payable }}</td>
<td>{{ "{:,.2f}".format(ao.refund) }}</td>
<td>{{ ao.created_at.strftime('%Y-%m-%d') }}</td>
<td>
<a href="{{ url_for('update_ao', id=ao.id) }}" class="btn btn-update">Edit</a>
<form action="{{ url_for('delete_ao', id=ao.id) }}" method="POST" style="display:inline">
<button class="btn btn-delete" onclick="return confirm('Are you sure?');">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p style="text-align: center; margin-top: 20px" class="no-record">
No records found. Click the button above to add one!
</p>
{% endif %}
</div>
{% endblock %}

View File

@@ -1,66 +1,58 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CIT Records</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background-color: #f8f9fa; padding: 20px; color: #333; }
.container { max-width: 95%; margin: auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
h2 { text-align: center; margin-bottom: 20px; }
.btn { padding: 8px 15px; border-radius: 5px; text-decoration: none; color: white; border: none; cursor: pointer; font-size: 14px; }
.btn-add { background-color: #28a745; display: inline-block; margin-bottom: 20px; }
.btn-update { background-color: #007bff; }
.btn-delete { background-color: #dc3545; }
.action-cell form { display: inline-block; margin-left: 5px; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px; border: 1px solid #dee2e6; text-align: right; white-space: nowrap; }
th { background-color: #343a40; color: white; text-align: center; }
tr:nth-child(even) { background-color: #f2f2f2; }
td:first-child, th:first-child { text-align: left; }
</style>
</head>
<body>
<div class="container">
<h2>CIT Records 🧾</h2>
{% extends "base.html" %}
{% block title %}CIT Records{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/display_model.css') }}">
{% endblock %}
{% block content %}
<div class="container">
<h2 style="text-align: center;">CIT Records🧾</h2>
<div style="text-align: right; margin-bottom: 10px;">
<a href="{{ url_for('add_cit') }}" class="btn btn-add"> Add New Record</a>
{% if cit_records %}
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Year</th>
<th>Gross Total Income</th>
<th>Net Taxable Income</th>
<th>Total Tax Payable</th>
<th>Refund</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for record in cit_records %}
<tr>
<td>{{ record.year }}</td>
<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 class="action-cell">
<a href="{{ url_for('update_cit', id=record.id) }}" class="btn btn-update">Edit</a>
<form action="{{ url_for('delete_cit', id=record.id) }}" method="post" onsubmit="return confirm('Are you sure you want to delete this record?');">
<button type="submit" class="btn btn-delete">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p style="text-align: center; margin-top: 20px;">No records found. Click the button above to add one!</p>
{% endif %}
</div>
</body>
</html>
{% if cit_records %}
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Year</th>
<th>Gross Total Income</th>
<th>Net Taxable Income</th>
<th>Total Tax Payable</th>
<th>Refund</th>
<th>Created Record Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for record in cit_records %}
<tr>
<td>AY {{ record.year }}-{{ record.year+1 }}</td>
<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>{{ record.created_at.strftime('%Y-%m-%d') }}</td>
<td class="action-cell">
<a href="{{ url_for('update_cit', id=record.id) }}" class="btn btn-update">Edit</a>
<form action="{{ url_for('delete_cit', id=record.id) }}" method="post"
onsubmit="return confirm('Are you sure you want to delete this record?');">
<button type="submit" class="btn btn-delete">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p style="text-align: center; margin-top: 20px;" class="no-record">
No records found. Click the button above to add one!
</p>
{% endif %}
</div>
{% endblock %}

View File

@@ -1,75 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ITAT Records</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background-color: #f8f9fa; padding: 20px; color: #333; }
.container { max-width: 95%; margin: auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
h2 { text-align: center; margin-bottom: 20px; }
.btn { padding: 8px 15px; border-radius: 5px; text-decoration: none; color: white; border: none; cursor: pointer; font-size: 14px; }
.btn-add { background-color: #28a745; display: inline-block; margin-bottom: 20px; }
.btn-update { background-color: #007bff; }
.btn-delete { background-color: #dc3545; }
.action-cell form { display: inline-block; margin-left: 5px; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px; border: 1px solid #dee2e6; text-align: right; white-space: nowrap; }
th { background-color: #343a40; color: white; text-align: center; }
tr:nth-child(even) { background-color: #f2f2f2; }
td:first-child, th:first-child { text-align: left; }
</style>
</head>
<body>
<div class="container">
<h2>ITAT Records 📄</h2>
{% extends "base.html" %}
{% block title %}ITAT Records{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/display_model.css') }}">
{% endblock %}
{% block content %}
<div class="container">
<h2 style="text-align: center;">Income Tax Appellate Tribunal Records 📄</h2>
<div style="text-align: right; margin-bottom: 10px;">
<a href="{{ url_for('add_itat') }}" class="btn btn-add"> Add New Record</a>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }}">{{ message }}</div>
{% endfor %}
{% endif %}
{% endwith %}
<!-- TABLE -->
{% if records %}
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Year</th>
<th>MAT Tax Credit</th>
<th>Surcharge</th>
<th>Cess</th>
<th>Total Credit</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for record in records %}
<tr>
<td>{{ record.year }}</td>
<td>{{ "{:,.2f}".format(record.mat_tax_credit) }}</td>
<td>{{ "{:,.2f}".format(record.surcharge) }}</td>
<td>{{ "{:,.2f}".format(record.cess) }}</td>
<td>{{ "{:,.2f}".format(record.total_credit) }}</td>
<td class="action-cell">
<a href="{{ url_for('update_itat', id=record.id) }}" class="btn btn-update">Edit</a>
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Year</th>
<th>Gross Total Income</th>
<th>Net Taxable Income</th>
<th>Total Tax Payable</th>
<th>Refund</th>
<th>Created Record Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for record in records %}
<tr>
<td>AY {{ record.year }}-{{ record.year+1 }}</td>
<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>{{ record.created_at.strftime('%Y-%m-%d') }}</td>
<td class="action-cell">
<a href="{{ url_for('update_itat', id=record.id) }}" class="btn btn-update">Edit</a>
<form action="{{ url_for('delete_itat', id=record.id) }}" method="post"
onsubmit="return confirm('Are you sure you want to delete this record?');">
<button type="submit" class="btn btn-delete">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<form action="{{ url_for('delete_itat', id=record.id) }}" method="post" onsubmit="return confirm('Are you sure you want to delete this record?');">
<button type="submit" class="btn btn-delete">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p style="text-align: center; margin-top: 20px;">No ITAT records found. Click the button above to add one!</p>
<p class="no-record">No records found. Click the button above to add one!</p>
{% endif %}
</div>
</body>
</html>
</div>
{% endblock %}

View File

@@ -1,66 +1,56 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ITR Records</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background-color: #f8f9fa; padding: 20px; color: #333; }
.container { max-width: 95%; margin: auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
h2 { text-align: center; margin-bottom: 20px; }
.btn { padding: 8px 15px; border-radius: 5px; text-decoration: none; color: white; border: none; cursor: pointer; font-size: 14px; }
.btn-add { background-color: #28a745; display: inline-block; margin-bottom: 20px; }
.btn-update { background-color: #007bff; }
.btn-delete { background-color: #dc3545; }
.action-cell form { display: inline-block; margin-left: 5px; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px; border: 1px solid #dee2e6; text-align: right; white-space: nowrap; }
th { background-color: #343a40; color: white; text-align: center; }
tr:nth-child(even) { background-color: #f2f2f2; }
td:first-child, th:first-child { text-align: left; }
</style>
</head>
<body>
<div class="container">
<h2>Income Tax Return Records 🧾</h2>
{% extends "base.html" %}
{% block title %}ITR Records{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/display_model.css') }}">
{% endblock %}
{% block content %}
<div class="container">
<h2>Income Tax Return Records 🧾</h2>
<div style="text-align: right; margin-bottom: 10px;">
<a href="{{ url_for('add_itr') }}" class="btn btn-add"> Add New Record</a>
{% if records %}
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Year</th>
<th>Gross Total Income</th>
<th>Net Taxable Income</th>
<th>Total Tax Payable</th>
<th>Refund</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for record in records %}
<tr>
<td>{{ record.year }}</td>
<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 class="action-cell">
<a href="{{ url_for('update_itr', id=record.id) }}" class="btn btn-update">Edit</a>
<form action="{{ url_for('delete_itr', id=record.id) }}" method="post" onsubmit="return confirm('Are you sure you want to delete this record?');">
<button type="submit" class="btn btn-delete">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p style="text-align: center; margin-top: 20px;">No records found. Click the button above to add one!</p>
{% endif %}
</div>
</body>
</html>
{% if records %}
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Year</th>
<th>Gross Total Income</th>
<th>Net Taxable Income</th>
<th>Total Tax Payable</th>
<th>Refund</th>
<th>Created Record Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for record in records %}
<tr>
<td>AY {{ record.year }}-{{record.year+1}}</td>
<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>{{ record.created_at.strftime('%Y-%m-%d') }}</td>
<td class="action-cell">
<a href="{{ url_for('update_itr', id=record.id) }}" class="btn btn-update">Edit</a>
<form action="{{ url_for('delete_itr', id=record.id) }}" method="post"
onsubmit="return confirm('Are you sure you want to delete this record?');">
<button type="submit" class="btn btn-delete">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p style="text-align: center; margin-top: 20px" class="no-record">
No records found. Click the button above to add one!
</p>
{% endif %}
</div>
{% endblock %}

View File

@@ -1,129 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dashboard | Income Tax Utilities</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f7f6;
color: #333;
line-height: 1.6;
}
.container {
max-width: 750px;
margin: 50px auto;
padding: 40px;
background-color: #fff;
border-radius: 12px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}
.header {
text-align: center;
margin-bottom: 40px;
font-size: 32px;
color: #2c3e50;
font-weight: 600;
}
.section {
margin-bottom: 35px;
}
.section h3 {
font-size: 22px;
color: #0056b3;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 2px solid #e9ecef;
}
ul {
list-style: none;
padding-left: 5px;
}
li {
margin: 15px 0;
}
a {
display: block;
text-decoration: none;
background-color: #007BFF;
color: white;
padding: 14px 20px;
border-radius: 8px;
font-size: 17px;
transition: all 0.3s ease;
box-shadow: 0 4px 6px rgba(0, 123, 255, 0.1);
}
a:hover {
background-color: #0056b3;
transform: translateY(-2px) scale(1.01);
box-shadow: 0 6px 12px rgba(0, 91, 179, 0.2);
}
/* Responsive */
@media (max-width: 600px) {
.container {
margin: 20px;
padding: 25px;
}
.header {
font-size: 26px;
}
a {
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="container">
<h2 class="header">Dashboard 🏛️</h2>
{% extends "base.html" %}
<div class="section">
<h3>ITR (Income Tax Return)</h3>
<ul>
<li><a href="{{ url_for('add_itr') }}"> Add New ITR Record</a></li>
<li><a href="{{ url_for('display_itr') }}">🧾 View & Manage ITR Records</a></li>
</ul>
</div>
{% block title %}Dashboard | Income Tax Utilities{% endblock %}
<div class="section">
<h3>AO (Assessing Officer)</h3>
<ul>
<li><a href="{{ url_for('add_ao') }}"> Add New AO Record</a></li>
<li><a href="{{ url_for('display_ao') }}">🧾 View & Manage AO Records</a></li>
</ul>
</div>
<div class="section">
<h3>CIT (Commissioner of Income Tax)</h3>
<ul>
<li><a href="{{ url_for('add_cit') }}"> Add New CIT Record</a></li>
<li><a href="{{ url_for('display_cit') }}">🧾 View & Manage CIT Records</a></li>
</ul>
</div>
<div class="section">
<h3>ITAT (Income Tax Appellate Tribunal)</h3>
<ul>
<li><a href="{{ url_for('add_itat') }}"> Add New ITAT Record</a></li>
<li><a href="{{ url_for('display_itat') }}">🧾 View & Manage ITAT Records</a></li>
</ul>
</div>
<div class="section">
<h3>Documents & Reports 📂</h3>
<ul>
<li><a href="/upload">→ Upload Documents</a></li>
<li><a href="/documents">→ View Documents</a></li>
<li><a href="/reports">→ Generate Reports</a></li>
<li><a href="/summary_report">→ Generate Summary Reports</a></li>
</ul>
</div>
</div>
</body>
</html>
{% block content %}
<div class="container">
<h2 class="header">Dashboard 🏛️</h2>
<p>
Welcome to Income Tax Utilities Dashboard
</p>
</div>
{% endblock %}

View File

@@ -1,126 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>ITAT Form Entry</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
/* Same styling for layout */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f5f7fa;
color: #333;
padding: 30px 0;
}
.container {
width: 90%;
max-width: 700px;
margin: auto;
background-color: #fff;
padding: 40px;
border-radius: 12px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
h2 {
text-align: center;
margin-bottom: 30px;
font-size: 28px;
color: #2c3e50;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-top: 15px;
margin-bottom: 6px;
font-weight: 600;
color: #333;
}
input[type="number"] {
padding: 10px 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
}
input[type="number"]:focus {
border-color: #007BFF;
outline: none;
}
button[type="submit"] {
margin-top: 30px;
padding: 12px;
background-color: #007BFF;
border: none;
border-radius: 6px;
color: white;
font-size: 18px;
cursor: pointer;
}
button[type="submit"]:hover {
background-color: #0056b3;
}
@media (max-width: 600px) {
.container {
padding: 20px;
}
h2 {
font-size: 22px;
}
input[type="number"] {
font-size: 15px;
}
button[type="submit"] {
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="container">
<h2>ITAT Form Entry</h2>
<form method="POST" onsubmit="return showSuccessMessage()">
<label>Year:</label>
<input type="number" name="year" step="0.01" required>
<label>MAT Tax Credit:</label>
<input type="number" name="mat_tax_credit" step="0.01" required>
<label>Surcharge:</label>
<input type="number" name="surcharge" step="0.01" required>
<label>Cess:</label>
<input type="number" name="cess" step="0.01" required>
<label>Total Credit:</label>
<input type="number" name="total_credit" step="0.01" required>
<button type="submit">Submit</button>
</form>
</div>
<script>
function showSuccessMessage() {
alert("Form submitted successfully!");
return true;
}
</script>
</body>
</html>

View File

@@ -1,74 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>Download ITAT Reports</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f7f9;
margin: 0;
padding: 0;
}
{% extends "base.html" %}
.container {
max-width: 600px;
margin: 60px auto;
padding: 30px;
background-color: white;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
text-align: center;
}
{% block title %}Download ITAT Report{% endblock %}
h2 {
color: #333;
margin-bottom: 30px;
}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/report_model.css') }}">
{% endblock %}
label {
font-weight: 600;
margin-right: 10px;
}
select {
padding: 8px 12px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 20px;
min-width: 200px;
}
button {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<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 }}">{{ y }}</option>
{% endfor %}
</select>
<br><br>
<button type="submit">Download Excel</button>
</form>
</div>
</body>
</html>
{% block content %}
<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>
{% endblock %}

View File

@@ -1,249 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>ITR Form Entry</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
/* Existing CSS here... */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f5f7fa;
color: #333;
padding: 30px 0;
}
.container {
width: 90%;
max-width: 700px;
margin: auto;
background-color: #fff;
padding: 40px;
border-radius: 12px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
h2 {
text-align: center;
margin-bottom: 30px;
font-size: 28px;
color: #2c3e50;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-top: 15px;
margin-bottom: 6px;
font-weight: 600;
}
input[type="number"] {
padding: 10px 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
transition: border-color 0.3s ease;
}
input[type="number"]:focus {
border-color: #007BFF;
outline: none;
}
button[type="submit"] {
margin-top: 30px;
padding: 12px;
background-color: #007BFF;
border: none;
border-radius: 6px;
color: white;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease;
}
button[type="submit"]:hover {
background-color: #0056b3;
}
@media (max-width: 600px) {
.container {
padding: 20px;
}
h2 {
font-size: 22px;
}
input[type="number"] {
font-size: 15px;
}
button[type="submit"] {
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="container">
<h2>Income Tax Return Form</h2>
<form method="POST" onsubmit="showSuccessMessage()">
<label>Year:</label>
<input type="number" name="year" required>
{% for field in [
"gross_total_income", "disallowance_14a", "disallowance_37",
"deduction_80ia_business", "deduction_80ia_misc", "deduction_80ia_other",
"deduction_sec37_disallowance", "deduction_80g", "net_taxable_income",
"tax_30_percent", "tax_book_profit_18_5", "tax_payable", "surcharge_12",
"edu_cess_3", "total_tax_payable", "mat_credit", "interest_234c",
"total_tax", "advance_tax", "tds", "tcs", "tax_on_assessment", "refund"
] %}
<label>{{ field.replace("_", " ").title() }}:</label>
<input type="number" name="{{ field }}" step="0.01" required>
{% endfor %}
<button type="submit">Submit</button>
</form>
</div>
<!-- JavaScript to show popup -->
<script>
function showSuccessMessage() {
alert("Form submitted successfully!");
}
</script>
</body>
</html>

View File

@@ -1,74 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>Download ITR Reports</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f7f9;
margin: 0;
padding: 0;
}
{% extends "base.html" %}
.container {
max-width: 600px;
margin: 60px auto;
padding: 30px;
background-color: white;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
text-align: center;
}
{% block title %}Download ITR Report{% endblock %}
h2 {
color: #333;
margin-bottom: 30px;
}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/report_model.css') }}">
{% endblock %}
label {
font-weight: 600;
margin-right: 10px;
}
select {
padding: 8px 12px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 20px;
min-width: 200px;
}
button {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<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>
<select name="year" id="year" required>
<option value="">-- Select Year --</option>
{% for y in years %}
<option value="{{ y }}">{{ y }}</option>
{% endfor %}
</select>
<br><br>
<button type="submit">Download Excel</button>
</form>
</div>
</body>
</html>
{% block content %}
<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>
<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>
{% endblock %}

30
templates/login.html Normal file
View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>LCEPL Income Tax</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{{ url_for('static', filename='css/login.css') }}">
</head>
<body>
<div class="login-container">
<h1 class="title">Laxmi Civil Engineering Services</h1>
<h2 class="sub-title">Income Tax Software</h2>
<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>

71
templates/mat_credit.html Normal file
View File

@@ -0,0 +1,71 @@
{% extends "base.html" %}
{% block title %}MAT Credit{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/mat_credit.css') }}">
{% endblock %}
{% block content %}
<div class="container mat-container">
<h2 class="page-title">MAT Credit and Utilization Records</h2>
<!-- YEAR ADD CONTROLS -->
<div class="year-controls">
<select id="yearSelect">
<option value="">-- Select AY --</option>
{% for y in range(2001, 2026) %}
<option value="{{ y }}-{{ y+1 }}">{{ y }}-{{ y+1 }}</option>
{% endfor %}
</select>
<button onclick="addYearColumn()"> Add Utilized Year</button>
</div>
<!-- TABLE WRAPPER -->
<div class="table-wrapper">
<table id="matTable">
<thead>
<tr id="tableHeader">
<th>AY</th>
<th>MAT Credit</th>
{% for y in added_years %}
<th>Utilized {{ y }}</th>
{% endfor %}
<th>Balance</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for row in mat_rows %}
<tr>
<td contenteditable="false">{{ row.financial_year }}-{{ row.financial_year | int + 1 }}</td>
<td><input value="{{ row.mat_credit }}"></td>
{% for y in added_years %}
<td>
<input value="{{ utilization_map.get(row.id, {}).get(y, '') }}">
</td>
{% endfor %}
<td><input value="{{ row.balance }}"></td>
<td><button onclick="saveRow(this)">Save</button></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="action-footer">
<button class="add-row-btn" onclick="addRow()"> Add New Row</button>
</div>
</div>
{% endblock %}
{% block extra_js %}
<script src="{{ url_for('static', filename='js/mat_credit.js') }}"></script>
{% endblock %}

View File

@@ -1,130 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<title>Reports Of Stages</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f7f9;
margin: 0;
padding: 0;
}
{% extends "base.html" %}
.container {
max-width: 900px;
margin: 40px auto;
padding: 30px;
background-color: white;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h2 {
color: #333;
text-align: center;
margin-bottom: 30px;
}
form {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 30px;
flex-wrap: wrap;
}
label {
font-weight: 600;
margin-right: 5px;
}
select {
padding: 6px 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
padding: 6px 14px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #0056b3;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
table, th, td {
border: 1px solid #ccc;
}
th {
background-color: #007bff;
color: white;
padding: 10px;
text-align: left;
}
td {
padding: 10px;
background-color: #f9f9f9;
}
tr:nth-child(even) td {
background-color: #eef3f7;
}
p {
text-align: center;
color: #777;
}
ul {
margin-top: 30px;
list-style: none;
padding-left: 0;
text-align: center;
}
ul li {
margin: 10px 0;
}
ul li a {
color: #007bff;
font-weight: 500;
text-decoration: none;
}
ul li a:hover {
text-decorat
}
</style>
</head>
<body>
<div class="container">
<h2>Reports</h2>
<ul>
<li><a href="/itr_report" >→ View ITR Reports</a></li>
<li><a href="/ao_report" >→ View AO Reports</a></li>
<li><a href="/cit_report" >→ View CIT Reports</a></li>
<li><a href="/itat_report" >→ View ITAT Reports</a></li>
</ul>
</div>
</body>
</html>
{% block title %}Reports Of Stages{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/report.css') }}">
{% endblock %}
{% block content %}
<div class="container">
<h2>Reports</h2>
<ul>
<li><a href="{{ url_for('itr_report') }}">→ View ITR Reports</a></li>
<li><a href="{{ url_for('ao_report') }}">→ View AO Reports</a></li>
<li><a href="{{ url_for('cit_report') }}">→ View CIT Reports</a></li>
<li><a href="{{ url_for('itat_report') }}">→ View ITAT Reports</a></li>
</ul>
</div>
{% endblock %}

View File

@@ -1,5 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<title>{{ stage }} Reports</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
@@ -61,7 +62,8 @@
font-size: 15px;
}
th, td {
th,
td {
padding: 12px;
border: 1px solid #ddd;
text-align: left;
@@ -102,10 +104,30 @@
font-size: 16px;
margin-top: 20px;
}
/* Back button styling */
.back-btn {
display: inline-block;
margin-bottom: 20px;
padding: 10px 18px;
background: #6c757d;
color: white;
font-size: 15px;
font-weight: 600;
border-radius: 6px;
text-decoration: none;
transition: background 0.3s ease;
}
.back-btn:hover {
background: #5a6268;
}
</style>
</head>
<body>
<div class="container">
<h2>{{ stage }} Reports</h2>
<form method="GET">
@@ -114,33 +136,34 @@
<select name="year" id="year" onchange="this.form.submit()">
<option value="">-- All Years --</option>
{% for y in years %}
<option value="{{ y }}" {% if y == request.args.get('year') %}selected{% endif %}>{{ y }}</option>
<option value="{{ y }}" {% if y==request.args.get('year') %}selected{% endif %}>{{ y }}</option>
{% endfor %}
</select>
</form>
{% if documents %}
<table>
<thead>
<tr>
<th>Year</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for doc in documents %}
<tr>
<td>{{ doc.year }}</td>
<td>
<a class="btn-download" href="{{ url_for('download_report', doc_id=doc.id) }}">Download</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<table>
<thead>
<tr>
<th>Year</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for doc in documents %}
<tr>
<td>{{ doc.year }}</td>
<td>
<a class="btn-download" href="{{ url_for('download_report', doc_id=doc.id) }}">Download</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="no-data">No reports found for this selection.</p>
<p class="no-data">No reports found for this selection.</p>
{% endif %}
</div>
</body>
</html>
</html>

View File

@@ -1,83 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>Download Summary Report</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
{% extends "base.html" %} {% block title %}Download Summary Report{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/summary.css') }}" />
.container {
background-color: white;
padding: 30px 40px;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
text-align: center;
}
{% endblock %} {% block content %}
<div class="container">
<div class="head">
<h2>Download Year-wise Summary Report</h2>
h2 {
margin-bottom: 20px;
color: #333;
}
{% if message %}
<p class="message">{{ message }}</p>
{% endif %}
form {
margin-top: 20px;
}
<div class="select-download-wrapper">
<select name="year" id="year" required>
<option value="">-- Select Year --</option>
{% for year in years %}
<option value="{{ year }}">AY {{ year }}-{{ year + 1 }}</option>
{% endfor %}
</select>
label {
font-weight: bold;
margin-right: 10px;
}
select {
padding: 8px 12px;
border: 1px solid #ccc;
border-radius: 5px;
margin-right: 10px;
}
button {
padding: 10px 16px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
.message {
color: red;
margin-top: 15px;
}
</style>
</head>
<body>
<div class="container">
<h2>Download Year-wise Summary Report</h2>
{% if message %}
<p class="message">{{ message }}</p>
{% endif %}
<form method="GET" action="{{ url_for('summary_report') }}">
<label for="year">Select Year:</label>
<select name="year" id="year" required>
<option value="">-- Select Year --</option>
{% for year in years %}
<option value="{{ year }}">{{ year }}</option>
{% endfor %}
</select>
<button type="submit">Download Summary Report</button>
</form>
<a id="downloadBtn" href="#">Download Summary Report</a>
</div>
</body>
</html>
</div>
<!-- Preview Section -->
<div id="preview" style="display: none">
<h3>Summary Preview</h3>
<div id="previewContent"></div>
</div>
</div>
{% endblock %} {% block extra_js %}
<script src="{{ url_for('static', filename='js/summary_preview.js') }}"></script>
{% endblock %}

View File

@@ -1,30 +1,285 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Update AO Record</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background-color: #f8f9fa; padding: 20px; color: #333; }
.container { max-width: 600px; margin: auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
h2 { text-align: center; margin-bottom: 20px; }
label { display: block; margin-top: 10px; font-weight: bold; }
input { width: 100%; padding: 8px; margin-top: 5px; border-radius: 5px; border: 1px solid #ccc; }
button { margin-top: 20px; padding: 10px 15px; border: none; border-radius: 5px; background-color: #007bff; color: white; cursor: pointer; font-size: 16px; }
button:hover { background-color: #0056b3; }
</style>
</head>
<body>
<div class="container">
<h2>Update AO Record for Year {{ record.year }}</h2>
<form method="POST" action="{{ url_for('update_ao', id=record.id) }}">
{% for field in record.keys() if field != 'id' %}
<label>{{ field.replace("_", " ").title() }}:</label>
<input type="number" step="any" name="{{ field }}" value="{{ record[field] }}" required>
{% endfor %}
<button type="submit">Update Record</button>
</form>
{% extends "base.html" %}
</div>
</body>
</html>
{% block title %}Update AO Record{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}">
{% endblock %}
{% block content %}
<div class="container">
<h2>Update AO Record for Year {{ record.year }} - {{ record.year + 1 }}</h2>
<form method="POST" action="{{ url_for('update_ao', id=record.id) }}">
<div class="form-group full-width inline-2">
<div>
<label>Year:</label>
<input type="tex" name="year" value="{{record.year}}" class="auto" readonly>
</div>
<div>
<label>Created Date:</label>
<input type="date" name="created_at"
value="{{ record.created_at.strftime('%Y-%m-%d') if record.created_at else current_date }}"
readonly>
</div>
<div>
<label>Last Updated:</label>
<input type="date" name="updated_at"
value="{{ record.updated_at.strftime('%Y-%m-%d') if record.updated_at else current_date }}">
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Gross Total Income:</label>
<input type="number" name="gross_total_income" step="any" value="{{ record.gross_total_income }}"
oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 14A:</label>
<input type="number" name="disallowance_14a" step="any" value="{{ record.disallowance_14a }}"
oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 37:</label>
<input type="number" name="disallowance_37" step="any" value="{{ record.disallowance_37 }}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>GTI as per AO</label>
<input type="number" name="gti_as_per_ao" class="auto" step="any"
value="{{ record.gross_total_income + record.disallowance_37 + record.disallowance_14a }}"
readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction 80IA Business Income:</label>
<input type="number" name="deduction_80ia_business" step="any"
value="{{ record.deduction_80ia_business }}" oninput="calculate()" required>
</div>
<div>
<label>Less :Deduction 80IA Misc:</label>
<input type="number" name="deduction_80ia_misc" step="any" value="{{ record.deduction_80ia_misc }}"
oninput="calculate()" required>
</div>
<div>
<label>Less :Deduction 80IA Other Operating Revenue:</label>
<input type="number" name="deduction_80ia_other" step="any" value="{{ record.deduction_80ia_other }}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction Sec 37 Disallowance:</label>
<input type="number" name="deduction_sec37_disallowance" step="any"
value="{{ record.deduction_sec37_disallowance }}" oninput="calculate()" required>
</div>
<div>
<label>Less: Deduction 80G: </label>
<input type="number" name="deduction_80g" step="any" value="{{ record.deduction_80g }}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Net Taxable Income:</label>
<input type="number" name="net_taxable_income" class="auto" step="any"
value="{{ record.net_taxable_income }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) calculate: Tax(A):</label>
<input type="number" name="per_tax_a" step="any" value="{{ record.per_tax_a }}" oninput="calculate()">
</div>
<div>
<label>Tax @(A):</label>
<input type="number" name="tax_a_cal" step="any" value="{{ record.tax_a_cal }}" oninput="calculate()">
</div>
<div>
<label>Enter Percentage(%) calculate: Tax(B):</label>
<input type="number" name="per_tax_b" step="any" value="{{ record.per_tax_b }}" oninput="calculate()">
</div>
<div>
<label>Tax @ 18.5% on Book Profit (B):</label>
<input type="number" name="tax_b_cal" step="any" value="{{ record.tax_b_cal }}" oninput="calculate()"
required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Surcharge:Tax(A):</label>
<input type="number" name="per_surcharge_a" step="any" value="{{ record.per_surcharge_a }}"
oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(A):</label>
<input type="number" name="surcharge_a_cal" class="auto" value="{{ record.surcharge_a_cal }}" readonly>
</div>
<div>
<label>Enter Percentage(%) Surcharge:Tax(B)</label>
<input type="number" name="per_surcharge_b" step="any" value="{{ record.per_surcharge_b}}"
oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(B):</label>
<input type="number" name="surcharge_b_cal" class="auto" value="{{ record.surcharge_b_cal }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Cess:Tax(A):</label>
<input type="number" name="per_cess_a" step="any" value="{{ record.per_cess_a }}" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(A): </label>
<input type="number" name="edu_cess_a_cal" class="auto" step="any" value="{{ record.edu_cess_a_cal }}"
readonly>
</div>
<div>
<label>Enter Percentage(%) Cess:Tax(B):</label>
<input type="number" name="per_cess_b" step="any" value="{{ record.per_cess_b }}" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(B): </label>
<input type="number" name="edu_cess_b_cal" class="auto" step="any" value="{{ record.edu_cess_b_cal }}"
readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Total cal Tax(A): </label>
<input type="number" name="sum_of_a" class="auto" step="any" value="{{ record.sum_of_a }}" readonly>
</div>
<div>
<label>Total cal Tax(B): </label>
<input type="number" name="sum_of_b" class="auto" step="any" value="{{ record.sum_of_b }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Tax Payable (Higher of A or B):</label>
<input type="number" name="tax_payable" class="auto" step="any" value="{{ record.tax_payable }}"
readonly>
</div>
<div>
<label>Total tax Payable:</label>
<input type="number" name="total_tax_payable" class="auto" step="any"
value="{{ record.total_tax_payable }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Opening Balance:</label>
<input type="number" name="opening_balance" step="any" value="{{ record.opening_balance }}"
oninput="calculate()">
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Mat Credit Created:</label>
<input type="number" name="mat_credit_created" step="any" value="{{ record.mat_credit_created }}"
oninput="calculate()" required>
</div>
<div>
<label>Less :Mat Credit Utilized:</label>
<input type="number" name="mat_credit_utilized" step="any" value="{{ record.mat_credit_utilized }}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Closing Balance:</label>
<input type="number" name="closing_balance" step="any" value="{{ record.closing_balance }}"
oninput="calculate()">
</div>
<div>
<label>Add :Interest 234c:</label>
<input type="number" name="interest_234c" step="any" value="{{ record.interest_234c }}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Total Tax:</label>
<input type="number" name="total_tax" step="any" class="auto" value="{{ record.total_tax }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Advance Tax:</label>
<input type="number" name="advance_tax" step="any" value="{{ record.advance_tax }}"
oninput="calculate()" required>
</div>
<div>
<label>TDS :</label>
<input type="number" name="tds" step="any" value="{{ record.tds }}" oninput="calculate()" required>
</div>
<div>
<label>TCS :</label>
<input type="number" name="tcs" step="any" value="{{ record.tcs }}" oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>SAT :</label>
<input type="number" name="sat" step="any" value="{{ record.sat }}" oninput="calculate()" required>
</div>
<div>
<label>Tax on Regular Assessment:</label>
<input type="number" name="tax_on_assessment" step="any" value="{{ record.tax_on_assessment }}"
oninput="calculate()">
</div>
</div>
<div class="form-group">
<label>Refund:</label>
<input type="number" name="refund" class="auto" step="any" value="{{ record.refund }}" readonly>
</div>
<div class="form-group full-width inline-2">
<div class="form-group">
<label>Add : Interest u/s 244A as per 143:</label>
<input type="number" name="interest_244a_per143" step="any" value="{{ record.interest_244a_per143 }}"
oninput="calculate()">
</div>
<div class="form-group">
<label>Less : Refund Received on:</label>
<input type="number" name="refund_received" step="any" value="{{ record.refund_received }}"
oninput="calculate()">
</div>
<div class="form-group">
<label>Balance Receivable:</label>
<input type="number" name="balance_receivable" class="auto" step="any"
value="{{ record.balance_receivable }}" oninput="calculate()">
</div>
</div>
<div class="form-group full-width inline-2">
<div class="form-group">
<label>Remarks:</label>
<input type="text" name="Remarks" value="{{ record.Remarks }}">
</div>
</div>
<button type="submit">Update Record</button>
</form>
</div>
{% endblock %}

View File

@@ -1,29 +1,280 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Update CIT Record</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background-color: #f8f9fa; padding: 20px; color: #333; }
.container { max-width: 700px; margin: auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
h2 { text-align: center; margin-bottom: 20px; }
label { display: block; margin-top: 15px; font-weight: bold; }
input[type="number"] { width: 100%; padding: 10px; margin-top: 5px; border: 1px solid #ccc; border-radius: 5px; }
button[type="submit"] { margin-top: 20px; padding: 12px 20px; background-color: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; }
button[type="submit"]:hover { background-color: #0056b3; }
</style>
</head>
<body>
<div class="container">
<h2>Update CIT Record for Year {{ record.year }}</h2>
<form method="POST" action="{{ url_for('update_cit', id=record.id) }}">
{% for field in record.keys() if field != 'id' %}
<label>{{ field.replace("_", " ").title() }}:</label>
<input type="number" name="{{ field }}" step="0.01" value="{{ record[field] }}" required>
{% endfor %}
<button type="submit">Update Record</button>
</form>
</div>
</body>
</html>
{% extends "base.html" %}
{% block title %}Update CIT Record{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}">
{% endblock %}
{% block content %}
<div class="container">
<h2>Update CIT Record for AY {{ record.year }}</h2>
<form method="POST" action="{{ url_for('update_cit', id=record.id) }}">
<div class="form-group full-width inline-2">
<div>
<label>Year:</label>
<input type="tex" name="year" value="{{record.year}}" class="auto" readonly>
</div>
<div>
<label>Created Date:</label>
<input type="date" name="created_at"
value="{{ record.created_at.strftime('%Y-%m-%d') if record.created_at else current_date }}"
readonly>
</div>
<div>
<label>Last Updated:</label>
<input type="date" name="updated_at"
value="{{ record.updated_at.strftime('%Y-%m-%d') if record.updated_at else current_date }}">
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Gross Total Income:</label>
<input type="number" name="gross_total_income" step="any" value="{{ record.gross_total_income}}"
oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 14A:</label>
<input type="number" name="disallowance_14a" step="any" value="{{ record.disallowance_14a}}"
oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 37:</label>
<input type="number" name="disallowance_37" step="any" value="{{ record.disallowance_37}}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>GTI as per AO</label>
<input type="number" name="gti_as_per_ao" class="auto" step="any"
value="{{ record.gross_total_income + record.disallowance_37 + record.disallowance_14a }}"
readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction 80IA Business Income:</label>
<input type="number" name="deduction_80ia_business" step="any"
value="{{ record.deduction_80ia_business}}" oninput="calculate()" required>
</div>
<div>
<label>Less :Deduction 80IA Misc:</label>
<input type="number" name="deduction_80ia_misc" step="any" value="{{ record.deduction_80ia_misc}}"
oninput="calculate()" required>
</div>
<div>
<label>Less :Deduction 80IA Other Operating Revenue:</label>
<input type="number" name="deduction_80ia_other" step="any" value="{{ record.deduction_80ia_other}}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction Sec 37 Disallowance:</label>
<input type="number" name="deduction_sec37_disallowance" step="any"
value="{{ record.deduction_sec37_disallowance}}" oninput="calculate()" required>
</div>
<div>
<label>Less: Deduction 80G: </label>
<input type="number" name="deduction_80g" step="any" value="{{ record.deduction_80g}}"
oninput="calculate()" required>
</div>
</div>
<div class=" form-group">
<label>Net Taxable Income:</label>
<input type="number" name="net_taxable_income" class="auto" step="any"
value="{{ record.net_taxable_income}}" readonly>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) calculate: Tax(A):</label>
<input type="number" name="per_tax_a" step="any" value="{{ record.per_tax_a }}" oninput="calculate()">
</div>
<div>
<label>Tax @(A):</label>
<input type="number" name="tax_a_cal" step="any" value="{{ record.tax_a_cal }}" oninput="calculate()">
</div>
<div>
<label>Enter Percentage(%) calculate: Tax(B):</label>
<input type="number" name="per_tax_b" step="any" value="{{ record.per_tax_b }}" oninput="calculate()">
</div>
<div>
<label>Tax @ 18.5% on Book Profit (B):</label>
<input type="number" name="tax_b_cal" step="any" value="{{ record.tax_b_cal }}" oninput="calculate()"
required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Surcharge:Tax(A):</label>
<input type="number" name="per_surcharge_a" step="any" value="{{ record.per_surcharge_a }}"
oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(A):</label>
<input type="number" name="surcharge_a_cal" class="auto" value="{{ record.surcharge_a_cal }}" readonly>
</div>
<div>
<label>Enter Percentage(%) Surcharge:Tax(B)</label>
<input type="number" name="per_surcharge_b" step="any" value="{{ record.per_surcharge_b}}"
oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(B):</label>
<input type="number" name="surcharge_b_cal" class="auto" value="{{ record.surcharge_b_cal }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Cess:Tax(A):</label>
<input type="number" name="per_cess_a" step="any" value="{{ record.per_cess_a }}" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(A): </label>
<input type="number" name="edu_cess_a_cal" class="auto" step="any" value="{{ record.edu_cess_a_cal }}"
readonly>
</div>
<div>
<label>Enter Percentage(%) Cess:Tax(B):</label>
<input type="number" name="per_cess_b" step="any" value="{{ record.per_cess_b }}" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(B): </label>
<input type="number" name="edu_cess_b_cal" class="auto" step="any" value="{{ record.edu_cess_b_cal }}"
readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Total cal Tax(A): </label>
<input type="number" name="sum_of_a" class="auto" step="any" value="{{ record.sum_of_a }}" readonly>
</div>
<div>
<label>Total cal Tax(B): </label>
<input type="number" name="sum_of_b" class="auto" step="any" value="{{ record.sum_of_b }}" readonly>
</div>
</div>
<div class=" form-group full-width inline-2">
<div>
<label>Tax Payable (Higher of A or B):</label>
<input type="number" name="tax_payable" class="auto" step="any" value="{{ record.tax_payable}}"
readonly>
</div>
<div>
<label>Total tax Payable:</label>
<input type="number" name="total_tax_payable" class="auto" step="any"
value="{{ record.total_tax_payable}}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Opening Balance:</label>
<input type="number" name="opening_balance" step="any" value="{{ record.opening_balance }}"
oninput="calculate()">
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Mat Credit Created:</label>
<input type="number" name="mat_credit_created" step="any" value="{{ record.mat_credit_created }}"
oninput="calculate()" required>
</div>
<div>
<label>Less :Mat Credit Utilized:</label>
<input type="number" name="mat_credit_utilized" step="any" value="{{ record.mat_credit_utilized }}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Closing Balance:</label>
<input type="number" name="closing_balance" step="any" value="{{ record.closing_balance }}"
oninput="calculate()">
</div>
<div>
<label>Add :Interest 234c:</label>
<input type="number" name="interest_234c" step="any" value="{{ record.interest_234c}}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Total Tax:</label>
<input type="number" name="total_tax" step="any" class="auto" value="{{ record.total_tax}}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Advance Tax:</label>
<input type="number" name="advance_tax" step="any" value="{{ record.advance_tax}}" oninput="calculate()"
required>
</div>
<div>
<label>TDS :</label>
<input type="number" name="tds" step="any" value="{{ record.tds}}" oninput="calculate()" required>
</div>
<div>
<label>TCS :</label>
<input type="number" name="tcs" step="any" value="{{ record.tcs}}" oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>SAT :</label>
<input type="number" name="sat" step="any" value="{{ record.sat}}" oninput="calculate()" required>
</div>
<div>
<label>Tax on Regular Assessment:</label>
<input type="number" name="tax_on_assessment" step="any" value="{{ record.tax_on_assessment}}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group">
<label>Refund:</label>
<input type="number" name="refund" class="auto" step="any" value="{{ record.refund}}" readonly>
</div>
<div class="form-group full-width inline-2">
<div class="form-group">
<label>Add : Interest u/s 244A as per 143:</label>
<input type="number" name="interest_244a_per143" step="any" value="{{ record.interest_244a_per143 }}"
oninput="calculate()">
</div>
<div class="form-group">
<label>Less : Refund Received on:</label>
<input type="number" name="refund_received" step="any" value="{{ record.refund_received }}"
oninput="calculate()">
</div>
<div class="form-group">
<label>Balance Receivable:</label>
<input type="number" name="balance_receivable" class="auto" step="any"
value="{{ record.balance_receivable }}" oninput="calculate()">
</div>
</div>
<div class="form-group">
<label>Remarks:</label>
<input type="text" name="Remarks" value="{{ record.Remarks}}">
</div>
<button type="submit">Update Record</button>
</form>
</div>
{% endblock %}

View File

@@ -1,30 +1,284 @@
<!DOCTYPE html>
<html>
<head>
<title>Update ITAT Record</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
</head>
<body>
<div class="container">
<h2>Update ITAT Record for Year {{ record.year }}</h2>
<form method="POST" action="{{ url_for('update_itat', id=record.id) }}">
<label>Year:</label>
<input type="number" name="year" step="1" value="{{ record.year }}" required>
{% extends "base.html" %}
{% block title %}Update ITAT Record{% endblock %}
{% block extra_css %}
<!-- Child page CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}">
{% endblock %}
{% block content %}
<label>MAT Tax Credit:</label>
<input type="number" name="mat_tax_credit" step="0.01" value="{{ record.mat_tax_credit }}" required>
<div class="container">
<h2>Update ITAT Record for Year {{ record.year }}</h2>
<form method="POST" action="{{ url_for('update_itat', id=record.id) }}">
<div class="form-group full-width inline-2">
<div>
<label>Year:</label>
<input type="tex" name="year" value="{{record.year}}" class="auto" readonly>
</div>
<div>
<label>Created Date:</label>
<input type="date" name="created_at"
value="{{ record.created_at.strftime('%Y-%m-%d') if record.created_at else current_date }}"
readonly>
</div>
<div>
<label>Last Updated:</label>
<input type="date" name="updated_at"
value="{{ record.updated_at.strftime('%Y-%m-%d') if record.updated_at else current_date }}">
</div>
</div>
<label>Surcharge:</label>
<input type="number" name="surcharge" step="0.01" value="{{ record.surcharge }}" required>
<div class="form-group full-width inline-2">
<div>
<label>Gross Total Income:</label>
<input type="number" name="gross_total_income" step="any" value="{{ record.gross_total_income}}"
oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 14A:</label>
<input type="number" name="disallowance_14a" step="any" value="{{ record.disallowance_14a}}"
oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 37:</label>
<input type="number" name="disallowance_37" step="any" value="{{ record.disallowance_37}}"
oninput="calculate()" required>
</div>
</div>
<label>Cess:</label>
<input type="number" name="cess" step="0.01" value="{{ record.cess }}" required>
<div class="form-group full-width inline-2">
<div>
<label>GTI as per AO</label>
<input type="number" name="gti_as_per_ao" class="auto" step="any"
value="{{ record.gross_total_income + record.disallowance_37 + record.disallowance_14a }}"
readonly>
</div>
</div>
<label>Total Credit:</label>
<input type="number" name="total_credit" step="0.01" value="{{ record.total_credit }}" required>
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction 80IA Business Income:</label>
<input type="number" name="deduction_80ia_business" step="any"
value="{{ record.deduction_80ia_business}}" oninput="calculate()" required>
</div>
<div>
<label>Less :Deduction 80IA Misc:</label>
<input type="number" name="deduction_80ia_misc" step="any" value="{{ record.deduction_80ia_misc}}"
oninput="calculate()" required>
</div>
<div>
<label>Less :Deduction 80IA Other Operating Revenue:</label>
<input type="number" name="deduction_80ia_other" step="any" value="{{ record.deduction_80ia_other}}"
oninput="calculate()" required>
</div>
</div>
<button type="submit">Update Record</button>
</form>
</div>
</body>
</html>
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction Sec 37 Disallowance:</label>
<input type="number" name="deduction_sec37_disallowance" step="any"
value="{{ record.deduction_sec37_disallowance}}" oninput="calculate()" required>
</div>
<div>
<label>Less: Deduction 80G: </label>
<input type="number" name="deduction_80g" step="any" value="{{ record.deduction_80g}}"
oninput="calculate()" required>
</div>
</div>
<div class=" form-group">
<label>Net Taxable Income:</label>
<input type="number" name="net_taxable_income" class="auto" step="any"
value="{{ record.net_taxable_income}}" readonly>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) calculate: Tax(A):</label>
<input type="number" name="per_tax_a" step="any" value="{{ record.per_tax_a }}" oninput="calculate()">
</div>
<div>
<label>Tax @(A):</label>
<input type="number" name="tax_a_cal" step="any" value="{{ record.tax_a_cal }}" oninput="calculate()">
</div>
<div>
<label>Enter Percentage(%) calculate: Tax(B):</label>
<input type="number" name="per_tax_b" step="any" value="{{ record.per_tax_b }}" oninput="calculate()">
</div>
<div>
<label>Tax @ 18.5% on Book Profit (B):</label>
<input type="number" name="tax_b_cal" step="any" value="{{ record.tax_b_cal }}" oninput="calculate()"
required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Surcharge:Tax(A):</label>
<input type="number" name="per_surcharge_a" step="any" value="{{ record.per_surcharge_a }}"
oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(A):</label>
<input type="number" name="surcharge_a_cal" class="auto" value="{{ record.surcharge_a_cal }}" readonly>
</div>
<div>
<label>Enter Percentage(%) Surcharge:Tax(B)</label>
<input type="number" name="per_surcharge_b" step="any" value="{{ record.per_surcharge_b}}"
oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(B):</label>
<input type="number" name="surcharge_b_cal" class="auto" value="{{ record.surcharge_b_cal }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Cess:Tax(A):</label>
<input type="number" name="per_cess_a" step="any" value="{{ record.per_cess_a }}" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(A): </label>
<input type="number" name="edu_cess_a_cal" class="auto" step="any" value="{{ record.edu_cess_a_cal }}"
readonly>
</div>
<div>
<label>Enter Percentage(%) Cess:Tax(B):</label>
<input type="number" name="per_cess_b" step="any" value="{{ record.per_cess_b }}" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(B): </label>
<input type="number" name="edu_cess_b_cal" class="auto" step="any" value="{{ record.edu_cess_b_cal }}"
readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Total cal Tax(A): </label>
<input type="number" name="sum_of_a" class="auto" step="any" value="{{ record.sum_of_a }}" readonly>
</div>
<div>
<label>Total cal Tax(B): </label>
<input type="number" name="sum_of_b" class="auto" step="any" value="{{ record.sum_of_b }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Tax Payable (Higher of A or B):</label>
<input type="number" name="tax_payable" class="auto" step="any" value="{{ record.tax_payable }}"
readonly>
</div>
<div>
<label>Total tax Payable:</label>
<input type="number" name="total_tax_payable" class="auto" step="any"
value="{{ record.total_tax_payable }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Opening Balance:</label>
<input type="number" name="opening_balance" step="any" value="{{ record.opening_balance }}"
oninput="calculate()">
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Mat Credit Created:</label>
<input type="number" name="mat_credit_created" step="any" value="{{ record.mat_credit_created }}"
oninput="calculate()" required>
</div>
<div>
<label>Less :Mat Credit Utilized:</label>
<input type="number" name="mat_credit_utilized" step="any" value="{{ record.mat_credit_utilized }}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Closing Balance:</label>
<input type="number" name="closing_balance" step="any" value="{{ record.closing_balance }}"
oninput="calculate()">
</div>
<div>
<label>Add :Interest 234c:</label>
<input type="number" name="interest_234c" step="any" value="{{ record.interest_234c}}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Total Tax:</label>
<input type="number" name="total_tax" step="any" class="auto" value="{{ record.total_tax}}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Advance Tax:</label>
<input type="number" name="advance_tax" step="any" value="{{ record.advance_tax}}" oninput="calculate()"
required>
</div>
<div>
<label>TDS :</label>
<input type="number" name="tds" step="any" value="{{ record.tds}}" oninput="calculate()" required>
</div>
<div>
<label>TCS :</label>
<input type="number" name="tcs" step="any" value="{{ record.tcs}}" oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>SAT :</label>
<input type="number" name="sat" step="any" value="{{ record.sat}}" oninput="calculate()" required>
</div>
<div>
<label>Tax on Regular Assessment:</label>
<input type="number" name="tax_on_assessment" step="any" value="{{ record.tax_on_assessment}}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group">
<label>Refund:</label>
<input type="number" name="refund" class="auto" step="any" value="{{ record.refund}}" readonly>
</div>
<div class="form-group full-width inline-2">
<div class="form-group">
<label>Add : Interest u/s 244A as per 143:</label>
<input type="number" name="interest_244a_per143" step="any" value="{{ record.interest_244a_per143 }}"
oninput="calculate()">
</div>
<div class="form-group">
<label>Less : Refund Received on:</label>
<input type="number" name="refund_received" step="any" value="{{ record.refund_received }}"
oninput="calculate()">
</div>
<div class="form-group">
<label>Balance Receivable:</label>
<input type="number" name="balance_receivable" class="auto" step="any"
value="{{ record.balance_receivable }}" oninput="calculate()">
</div>
</div>
<div class="form-group full-width inline-2">
<div class="form-group">
<label>Remarks:</label>
<input type="text" name="Remarks" value="{{ record.Remarks }}">
</div>
</div>
<button type="submit">Update Record</button>
</form>
</div>
{% endblock %}

View File

@@ -1,21 +1,288 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Update ITR Record</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style> /* ... your form styles ... */ </style>
</head>
<body>
<div class="container">
<h2>Update ITR Record for Year {{ record.year }}</h2>
<form method="POST" action="{{ url_for('update_itr', id=record.id) }}">
{% for field in record.keys() if field != 'id' %}
<label>{{ field.replace("_", " ").title() }}:</label>
<input type="number" name="{{ field }}" step="any" value="{{ record[field] }}" required>
{% endfor %}
<button type="submit">Update Record</button>
</form>
</div>
</body>
</html>
{% extends "base.html" %}
{% block title %}Update ITR Record{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}">
{% endblock %}
{% block content %}
<div class="container">
<h2>Update ITR Record for Year {{record.year}} - {{record.year+1}}</h2>
<form method="POST" action="{{ url_for('update_itr', id=record.id) }}">
<div class="form-group full-width inline-2">
<div>
<label>Year:</label>
<input type="tex" name="year" value="{{record.year}}" class="auto" readonly>
</div>
<div>
<label>Created Date:</label>
<input type="date" name="created_at"
value="{{ record.created_at.strftime('%Y-%m-%d') if record.created_at else current_date }}"
readonly>
</div>
<div>
<label>Last Updated:</label>
<input type="date" name="updated_at"
value="{{ record.updated_at.strftime('%Y-%m-%d') if record.updated_at else current_date }}">
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Gross Total Income:</label>
<input type="number" name="gross_total_income" step="any" value="{{ record.gross_total_income }}"
oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 14A:</label>
<input type="number" name="disallowance_14a" step="any" value="{{ record.disallowance_14a }}"
oninput="calculate()" required>
</div>
<div>
<label>Add :Disallowance u/s 37:</label>
<input type="number" name="disallowance_37" step="any" value="{{ record.disallowance_37 }}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>GTI as per AO</label>
<input type="number" name="gti_as_per_ao" class="auto" step="any"
value="{{ record.gross_total_income + record.disallowance_37 + record.disallowance_14a }}"
readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction 80IA Business Income:</label>
<input type="number" name="deduction_80ia_business" step="any"
value="{{ record.deduction_80ia_business }}" oninput="calculate()" required>
</div>
<div>
<label>Less :Deduction 80IA Misc:</label>
<input type="number" name="deduction_80ia_misc" step="any" value="{{ record.deduction_80ia_misc }}"
oninput="calculate()" required>
</div>
<div>
<label>Less :Deduction 80IA Other Operating Revenue:</label>
<input type="number" name="deduction_80ia_other" step="any" value="{{ record.deduction_80ia_other }}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Deduction Sec 37 Disallowance:</label>
<input type="number" name="deduction_sec37_disallowance" step="any"
value="{{ record.deduction_sec37_disallowance }}" oninput="calculate()" required>
</div>
<div>
<label>Less: Deduction 80G: </label>
<input type="number" name="deduction_80g" step="any" value="{{ record.deduction_80g }}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Net Taxable Income:</label>
<input type="number" name="net_taxable_income" class="auto" step="any"
value="{{ record.net_taxable_income }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) calculate: Tax(A):</label>
<input type="number" name="per_tax_a" step="any" value="{{ record.per_tax_a }}" oninput="calculate()">
</div>
<div>
<label>Tax @(A):</label>
<input type="number" name="tax_a_cal" step="any" value="{{ record.tax_a_cal }}" oninput="calculate()">
</div>
<div>
<label>Enter Percentage(%) calculate: Tax(B):</label>
<input type="number" name="per_tax_b" step="any" value="{{ record.per_tax_b }}" oninput="calculate()">
</div>
<div>
<label>Tax @ 18.5% on Book Profit (B):</label>
<input type="number" name="tax_b_cal" step="any" value="{{ record.tax_b_cal }}" oninput="calculate()"
required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Surcharge:Tax(A):</label>
<input type="number" name="per_surcharge_a" step="any" value="{{ record.per_surcharge_a }}"
oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(A):</label>
<input type="number" name="surcharge_a_cal" class="auto" value="{{ record.surcharge_a_cal }}" readonly>
</div>
<div>
<label>Enter Percentage(%) Surcharge:Tax(B)</label>
<input type="number" name="per_surcharge_b" step="any" value="{{ record.per_surcharge_b}}"
oninput="calculate()">
</div>
<div>
<label>Surcharge on Tax(B):</label>
<input type="number" name="surcharge_b_cal" class="auto" value="{{ record.surcharge_b_cal }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage(%) Cess:Tax(A):</label>
<input type="number" name="per_cess_a" step="any" value="{{ record.per_cess_a }}" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(A): </label>
<input type="number" name="edu_cess_a_cal" class="auto" step="any" value="{{ record.edu_cess_a_cal }}"
readonly>
</div>
<div>
<label>Enter Percentage(%) Cess:Tax(B):</label>
<input type="number" name="per_cess_b" step="any" value="{{ record.per_cess_b }}" oninput="calculate()">
</div>
<div>
<label>Education Cess:Tax(B): </label>
<input type="number" name="edu_cess_b_cal" class="auto" step="any" value="{{ record.edu_cess_b_cal }}"
readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Total cal Tax(A): </label>
<input type="number" name="sum_of_a" class="auto" step="any" value="{{ record.sum_of_a }}" readonly>
</div>
<div>
<label>Total cal Tax(B): </label>
<input type="number" name="sum_of_b" class="auto" step="any" value="{{ record.sum_of_b }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Tax Payable (Higher of A or B):</label>
<input type="number" name="tax_payable" class="auto" step="any" value="{{ record.tax_payable }}"
readonly>
</div>
<div>
<label>Total tax Payable:</label>
<input type="number" name="total_tax_payable" class="auto" step="any"
value="{{ record.total_tax_payable }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Opening Balance:</label>
<input type="number" name="opening_balance" step="any" value="{{ record.opening_balance }}"
oninput="calculate()">
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Less :Mat Credit Created:</label>
<input type="number" name="mat_credit_created" step="any" value="{{ record.mat_credit_created }}"
oninput="calculate()" required>
</div>
<div>
<label>Less :Mat Credit Utilized:</label>
<input type="number" name="mat_credit_utilized" step="any" value="{{ record.mat_credit_utilized }}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Closing Balance:</label>
<input type="number" name="closing_balance" step="any" value="{{ record.closing_balance }}"
oninput="calculate()">
</div>
<div>
<label>Add :Interest 234c:</label>
<input type="number" name="interest_234c" step="any" value="{{ record.interest_234c }}"
oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Total Tax:</label>
<input type="number" name="total_tax" step="any" class="auto" value="{{ record.total_tax }}" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Advance Tax:</label>
<input type="number" name="advance_tax" step="any" value="{{ record.advance_tax }}"
oninput="calculate()" required>
</div>
<div>
<label>TDS :</label>
<input type="number" name="tds" step="any" value="{{ record.tds }}" oninput="calculate()" required>
</div>
<div>
<label>TCS :</label>
<input type="number" name="tcs" step="any" value="{{ record.tcs }}" oninput="calculate()" required>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>SAT :</label>
<input type="number" name="sat" step="any" value="{{ record.sat }}" oninput="calculate()" required>
</div>
<div>
<label>Tax on Regular Assessment:</label>
<input type="number" name="tax_on_assessment" step="any" value="{{ record.tax_on_assessment }}"
oninput="calculate()">
</div>
</div>
<div class="form-group">
<label>Refund:</label>
<input type="number" name="refund" class="auto" step="any" value="{{ record.refund }}" readonly>
</div>
<div class="form-group full-width inline-2">
<div class="form-group">
<label>Add : Interest u/s 244A as per 143:</label>
<input type="number" name="interest_244a_per143" step="any" value="{{ record.interest_244a_per143 }}"
oninput="calculate()">
</div>
<div class="form-group">
<label>Less : Refund Received on:</label>
<input type="number" name="refund_received" step="any" value="{{ record.refund_received }}"
oninput="calculate()">
</div>
<div class="form-group">
<label>Balance Receivable:</label>
<input type="number" name="balance_receivable" class="auto" step="any"
value="{{ record.balance_receivable }}" oninput="calculate()">
</div>
</div>
<div class="form-group full-width inline-2">
<div class="form-group">
<label>Remarks:</label>
<input type="text" name="Remarks" value="{{ record.Remarks }}">
</div>
</div>
<button type="submit">Update Record</button>
</form>
</div>
{% endblock %}
{% block extra_js %}
<script src="{{ url_for('static', filename='js/itr_calc.js') }}"></script>
{% endblock %}

View File

@@ -1,123 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>Upload Documents</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
/* Reset and base styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
{% extends "base.html" %}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f5f7fa;
color: #333;
padding: 30px 0;
}
{% block title %}Upload Documents{% endblock %}
.container {
width: 90%;
max-width: 700px;
margin: auto;
background-color: #fff;
padding: 40px;
border-radius: 12px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/upload.css') }}">
{% endblock %}
h2 {
text-align: center;
margin-bottom: 30px;
font-size: 28px;
color: #2c3e50;
}
{% block content %}
<div class="container">
<h2>Upload Income Tax Documents</h2>
<form id="documents" method="POST" enctype="multipart/form-data">
<label>Year:</label>
<select id="year" name="year" required></select>
<div id="yearError" style="color: red; display: none; margin-bottom: 10px;"></div>
<label>Stage:</label>
<select name="stage" required>
<option value="ITR">ITR</option>
<option value="AO">AO</option>
<option value="CIT">CIT</option>
<option value="ITAT">ITAT</option>
</select>
<label>Select Documents:</label>
<input type="file" name="documents" multiple required>
form {
display: flex;
flex-direction: column;
}
<button type="submit">Upload</button>
</form>
</div>
{% endblock %}
label {
margin-top: 15px;
margin-bottom: 6px;
font-weight: 600;
}
input[type="number"],
select,
input[type="file"] {
padding: 10px 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
transition: border-color 0.3s ease;
}
input[type="number"]:focus,
select:focus,
input[type="file"]:focus {
border-color: #007BFF;
outline: none;
}
button[type="submit"] {
margin-top: 30px;
padding: 12px;
background-color: #007BFF;
border: none;
border-radius: 6px;
color: white;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease;
}
button[type="submit"]:hover {
background-color: #0056b3;
}
@media (max-width: 600px) {
.container {
padding: 20px;
}
h2 {
font-size: 22px;
}
input, select {
font-size: 15px;
}
button[type="submit"] {
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="container">
<h2>Upload Income Tax Documents</h2>
<form method="POST" enctype="multipart/form-data">
<label for="year">Year:</label>
<input type="number" name="year" required>
<label for="stage">Stage:</label>
<select name="stage" required>
<option value="ITR">ITR</option>
<option value="AO">AO</option>
<option value="CIT">CIT</option>
<option value="ITAT">ITAT</option>
</select>
<label for="documents">Select Documents:</label>
<input type="file" name="documents" multiple required>
<button type="submit">Upload</button>
</form>
</div>
</body>
</html>
{% block extra_js %}
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %}

View File

@@ -1,141 +1,39 @@
<!DOCTYPE html>
<html>
{% extends "base.html" %}
{% block title %}Document Records{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/documents.css') }}">
{% endblock %}
{% block content %}
<head>
<title>View Documents</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f7f9;
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 40px auto;
background: #fff;
padding: 30px 40px;
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
h2 {
text-align: center;
color: #2c3e50;
margin-bottom: 30px;
}
form {
display: flex;
justify-content: center;
gap: 20px;
flex-wrap: wrap;
margin-bottom: 30px;
}
label {
font-weight: 600;
color: #34495e;
}
select {
padding: 8px 12px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 14px;
background-color: #fff;
}
button {
padding: 10px 20px;
background-color: #3498db;
color: white;
border: none;
border-radius: 5px;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #2980b9;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 10px;
}
thead {
background-color: #2c3e50;
color: white;
}
th,
td {
padding: 12px 15px;
border: 1px solid #ddd;
text-align: center;
}
tbody tr:nth-child(even) {
background-color: #f9f9f9;
}
tbody tr:hover {
background-color: #f1f1f1;
}
a {
color: #2980b9;
text-decoration: none;
font-weight: 600;
}
a:hover {
text-decoration: underline;
}
@media (max-width: 768px) {
form {
flex-direction: column;
align-items: center;
}
.container {
padding: 20px;
}
}
</style>
</head>
<body>
<div class="container">
<h2>Document Records</h2>
<form method="GET">
<label for="year">Filter by Year:</label>
<select name="year">
<option value="">All</option>
{% for y in years %}
<option value="{{ y }}">{{ y }}</option>
{% endfor %}
</select>
<label for="stage">Filter by Stage:</label>
<select name="stage">
<option value="">All</option>
<option value="ITR">ITR</option>
<option value="AO">AO</option>
<option value="CIT">CIT</option>
<option value="ITAT">ITAT</option>
</select>
<button type="submit">Apply</button>
</form>
<div class="container">
<h2>Document Records</h2>
<!-- FILTER FORM -->
<form method="GET">
<label for="year">Filter by Year:</label>
<select name="year">
<option value="">All</option>
{% for y in years %}
<option value="{{ y }}">AY {{ y }}-{{ y+1 }}</option>
{% endfor %}
</select>
<label for="stage">Filter by Stage:</label>
<select name="stage">
<option value="">All</option>
{% set stages = ['ITR','AO','CIT','ITAT'] %}
{% for stage in stages %}
<option value="{{stage}}">{{stage}}</option>
{% endfor %}
</select>
<button type="submit">Apply</button>
</form>
{% with messages = get_flashed_messages(with_categories=true) %}
{% for category, message in messages %}
<div class="alert alert-{{ category }}">{{ message }}</div>
{% endfor %}
{% endwith %}
<!-- DOCUMENT TABLE -->
<div class="table-responsive">
<table>
<thead>
<tr>
@@ -148,15 +46,19 @@
<th>View</th>
</tr>
</thead>
<tbody>
{% for doc in documents %}
<tr>
<td>{{ doc.filename }}</td>
<td>{{ doc.filetype }}</td>
<td>{{ doc.stage }}</td>
<td>{{ doc.year }}</td>
<td>AY {{ doc.year }}-{{ doc.year +1 }}</td>
<td>{{ doc.uploaded_at }}</td>
<td><a href="{{ url_for('uploaded_file', filename=doc.filename) }}?mode=download">Download</a></td>
<td> <a href="{{ url_for('uploaded_file', filename=doc.filename) }}?mode=download">Download</a>
</td>
<td><a href="{{ url_for('uploaded_file', filename=doc.filename) }}?mode=view"
target="_blank">View</a></td>
</tr>
@@ -164,6 +66,5 @@
</tbody>
</table>
</div>
</body>
</html>
</div>
{% endblock %}

View File

@@ -1,55 +0,0 @@
<!-- templates/welcome.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Welcome - Laxmi Civil Engineering Pvt. Ltd</title>
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<style>
body {
background-color: #e8f0fe;
font-family: Arial, sans-serif;
text-align: center;
padding: 100px;
}
.logo {
width: 100px;
height: 100px;
}
h1 {
color: #333;
margin-top: 20px;
}
p {
font-size: 18px;
margin: 20px 0;
}
.enter-btn {
background-color: #007BFF;
color: white;
padding: 12px 25px;
font-size: 18px;
border: none;
border-radius: 6px;
cursor: pointer;
text-decoration: none;
}
.enter-btn:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<img src="https://tse1.mm.bing.net/th/id/OIP.fc5NZer25Y3YeS3Fd0PO9gAAAA?pid=Api&rs=1&c=1&qlt=95&w=92&h=92" class="logo" alt="Company Logo">
<h1>Welcome to Laxmi Civil Engineering Pvt. Ltd</h1>
<p>Income Tax Filing and Compliance</p>
<a href="{{ url_for('index') }}" class="enter-btn">Go To Dashboard</a>
</body>
</html>

103
test.py
View File

@@ -1,103 +0,0 @@
import os
from AppCode.Config import DBConfig
from AppCode.FileHandler import FileHandler
from werkzeug.utils import secure_filename
class DocumentHandler:
years = ""
documents = ""
isSuccess = False
resultMessage = ""
def View(self,request):
year = request.args.get('year')
stage = request.args.get('stage')
dbconfig = DBConfig()
connection = dbconfig.get_db_connection()
if not connection:
self.isSuccess = False
return
cursor = connection.cursor()
params = []
query = "SELECT * FROM documents WHERE 1=1"
if year:
query += " AND year = %s"
params.append(year)
if stage:
query += " AND stage = %s"
params.append(stage)
cursor.execute(query, params)
documentsdata = cursor.fetchall()
print("*************")
print(documentsdata)
cursor.callproc("GetYear")
# records = []
# for result in cursor.stored_results():
# records = result.fetchall()
yearsdata = ""
for res in cursor.stored_results():
yearsdata = res.fetchall()
print(yearsdata)
self.years = yearsdata
self.documents = documentsdata
self.isSuccess = True
print("document --",documentsdata)
cursor.close()
connection.close()
def Upload(self, request):
"""Log user actions with timestamp, user, action, and details."""
dbconfig = DBConfig()
connection = dbconfig.get_db_connection()
if connection:
cursor = connection.cursor()
files = request.files.getlist('documents')
year = request.form['year']
stage = request.form['stage']
for file in files:
if file is not FileHandler.ALLOWED_EXTENSIONS:
continue
filename = secure_filename(file.filename)
filepath = os.path.join(FileHandler.UPLOAD_FOLDER, filename)
extension = file.filename.rsplit('.', 1)[1]
# Need to Check whetehr all three items are required
file.save(filepath)
# cursor.execute("""
# INSERT INTO documents (filename, filepath, filetype, year, stage)
# VALUES (%s, %s, %s, %s, %s)
# """, (filename, filepath, file.filename.rsplit('.', 1)[1], year, stage))
cursor.callproc('InsertDocument', [
filename,
filepath,
extension,
year,
stage
])
connection.commit()
cursor.close()
connection.close()
# return redirect(url_for('view_documents'))
#return render_template('upload.html')