Compare commits

1 Commits

Author SHA1 Message Date
7bace5e4f3 .env add gitignore 2026-01-21 23:13:16 +05:30
99 changed files with 4227 additions and 5178 deletions

View File

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

6
.env
View File

@@ -2,7 +2,7 @@
# Flask App Configuration # Flask App Configuration
# ----------------------------- # -----------------------------
FLASK_ENV=development FLASK_ENV=development
FLASK_DEBUG=true FLASK_DEBUG=True
FLASK_HOST=0.0.0.0 FLASK_HOST=0.0.0.0
FLASK_PORT=5010 FLASK_PORT=5010
@@ -17,10 +17,8 @@ SECRET_KEY=secret1234
DB_DIALECT=mysql DB_DIALECT=mysql
# DB_DRIVER=pymysql # DB_DRIVER=pymysql
DB_HOST=127.0.0.1 DB_HOST=127.0.0.1
# DB_HOST=db # this is production for use docker
DB_NAME=income_tax_db
DB_PORT=3306 DB_PORT=3306
# DB_NAME=test_income_taxdb DB_NAME=test_income_taxdb
DB_USER=root DB_USER=root
DB_PASSWORD=root DB_PASSWORD=root

14
.gitignore vendored
View File

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

View File

@@ -3,6 +3,7 @@ import mysql.connector
import pandas as pd import pandas as pd
import io import io
class AOHandler: class AOHandler:
def __init__(self): def __init__(self):
@@ -32,35 +33,31 @@ class AOHandler:
# Add AO record # Add AO record
def add_ao(self, data): def add_ao(self, data):
fields = [
try: "year","gross_total_income", "disallowance_14a", "disallowance_37",
fields= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37', "deduction_80ia_business", "deduction_sec37_disallowance", "deduction_80g",
'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",
'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', "surcharge_12", "edu_cess_3", "total_tax_payable", "mat_credit",
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b', "interest_234c", "total_tax", "advance_tax", "tds", "tcs","sat",
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance', "tax_on_assessment", "refund","Remarks"
'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] values = [data.get(f, 0) for f in fields]
self.cursor.callproc("InsertAO", values) self.cursor.callproc("InsertAO", values)
self.conn.commit() 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 # UPDATE AO RECORD by AO id
def update_ao(self, id, data): 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', fields = [
'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', "year","gross_total_income", "disallowance_14a", "disallowance_37",
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b', "deduction_80ia_business", "deduction_sec37_disallowance", "deduction_80g",
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance', "net_taxable_income", "tax_30_percent", "tax_book_profit_18_5",
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund', "surcharge_12", "edu_cess_3", "total_tax_payable", "mat_credit",
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'updated_at' "interest_234c", "total_tax", "advance_tax", "tds", "tcs","sat",
"tax_on_assessment", "refund","Remarks"
] ]
values = [id] + [data.get(f, 0) for f in fields] values = [id] + [data.get(f, 0) for f in fields]
@@ -74,15 +71,16 @@ class AOHandler:
self.cursor.callproc('DeleteAOById', [id]) self.cursor.callproc('DeleteAOById', [id])
self.conn.commit() self.conn.commit()
# CLOSE CONNECTION
def close(self):
self.cursor.close()
self.conn.close()
# report download by year # report download by year
def ao_report_download(self, selected_year): def ao_report_download(self, selected_year):
try: try:
# AY calculation (2020 -> AY 2020-2021) # Call stored proc to fetch year-wise records
ay_start = int(selected_year)
ay_end = ay_start + 1
assessment_year = f"AY {ay_start}-{ay_end}"
# Fetch AO records
self.cursor.callproc("GetAOByYear", [selected_year]) self.cursor.callproc("GetAOByYear", [selected_year])
rows = [] rows = []
@@ -92,126 +90,30 @@ class AOHandler:
if not rows: if not rows:
return None return None
# Remove id column if exists df = pd.DataFrame(rows)
for row in rows:
row.pop("id", None)
# Mapping DB fields → readable Excel labels # TRANSPOSE
field_mapping = { df_transposed = df.transpose()
"gross_total_income": "Gross Total Income", df_transposed.insert(0, 'Field', df_transposed.index)
"disallowance_14a": "Add: Disallowance u/s 14A",
"disallowance_37": "Add: Disallowance u/s 37", # Rename columns: Record 1, 2, 3...
"-" : "-", record_cols = {
"deduction_80ia_business": "Less: Deduction u/s 80IA - On Business Income", i: f"Record {i}"
"deduction_80ia_misc": "On Misc Receipts", for i in df_transposed.columns if isinstance(i, int)
"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"
} }
df_transposed.rename(columns=record_cols, inplace=True)
df_transposed.reset_index(drop=True, inplace=True)
# Vertical AO structure # Excel Output
data = []
for key, label in field_mapping.items():
value = rows[0].get(key, 0)
data.append([label, value])
df = pd.DataFrame(data, columns=["Particulars", "AO"])
# Excel output
output = io.BytesIO() output = io.BytesIO()
with pd.ExcelWriter(output, engine="xlsxwriter") as writer: with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
workbook = writer.book df_transposed.to_excel(writer, index=False, sheet_name="AO_Vertical")
worksheet = workbook.add_worksheet("AO Report") worksheet = writer.sheets["AO_Vertical"]
writer.sheets["AO Report"] = worksheet worksheet.set_column(0, 0, 30)
# 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", "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) output.seek(0)
return output return output
except mysql.connector.Error as e: except mysql.connector.Error as e:
print("MySQL Error", e) print("MySQL Error:", e)
return None return None
# CLOSE CONNECTION
def close(self):
self.cursor.close()
self.conn.close()

View File

@@ -3,6 +3,8 @@ import mysql.connector
import pandas as pd import pandas as pd
import io import io
class CITHandler: class CITHandler:
def __init__(self): def __init__(self):
@@ -35,13 +37,13 @@ class CITHandler:
# INSERT CIT RECORD # INSERT CIT RECORD
def add_cit(self, data): def add_cit(self, data):
columns= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37', columns = [
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g', 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'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', 'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b', 'deduction_sec37_disallowance', 'deduction_80g', 'net_taxable_income',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance', 'tax_30_percent', 'tax_book_profit_18_5', 'tax_payable', 'surcharge_12',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund', 'edu_cess_3', 'total_tax_payable', 'mat_credit', 'interest_234c',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'created_at' 'total_tax', 'advance_tax', 'tds', 'tcs','sat', 'tax_on_assessment', 'refund', 'Remarks'
] ]
values = [data.get(col, 0) for col in columns] values = [data.get(col, 0) for col in columns]
@@ -49,15 +51,17 @@ class CITHandler:
self.cursor.callproc("InsertCIT", values) self.cursor.callproc("InsertCIT", values)
self.conn.commit() self.conn.commit()
# UPDATE CIT RECORD # UPDATE CIT RECORD
def update_cit(self, id, data): def update_cit(self, id, data):
columns= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37', columns = [
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g', 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'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', 'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b', 'deduction_sec37_disallowance', 'deduction_80g', 'net_taxable_income',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance', 'tax_30_percent', 'tax_book_profit_18_5', 'tax_payable', 'surcharge_12',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund', 'edu_cess_3', 'total_tax_payable', 'mat_credit', 'interest_234c',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'updated_at' 'total_tax', 'advance_tax', 'tds', 'tcs','sat', 'tax_on_assessment', 'refund', 'Remarks'
] ]
values = [id] + [data.get(col, 0) for col in columns] values = [id] + [data.get(col, 0) for col in columns]
@@ -65,19 +69,22 @@ class CITHandler:
self.cursor.callproc("UpdateCITById", values) self.cursor.callproc("UpdateCITById", values)
self.conn.commit() self.conn.commit()
# DELETE CIT RECORD # DELETE CIT RECORD
def delete_cit(self, id): def delete_cit(self, id):
self.cursor.callproc("DeleteCITById", [id]) self.cursor.callproc("DeleteCITById", [id])
self.conn.commit() self.conn.commit()
#
# CLOSE CONNECTION
def close(self):
self.cursor.close()
self.conn.close()
def cit_report_download(self, selected_year): def cit_report_download(self, selected_year):
try: try:
# AY calculation (2020 -> AY 2020-2021) # Call stored procedure
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]) self.cursor.callproc("GetCITByYear", [selected_year])
rows = [] rows = []
@@ -87,127 +94,28 @@ class CITHandler:
if not rows: if not rows:
return None return None
# Remove id column if exists df = pd.DataFrame(rows)
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 # Excel output
output = io.BytesIO() output = io.BytesIO()
with pd.ExcelWriter(output, engine="xlsxwriter") as writer: with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
workbook = writer.book
worksheet = workbook.add_worksheet("CIT Report")
writer.sheets["CIT Report"] = worksheet
# Formats for i, (_, row) in enumerate(df.iterrows(), start=1):
title_fmt = workbook.add_format({ # Convert row to vertical format
"bold": True, vertical_df = pd.DataFrame(row).reset_index()
"align": "center", vertical_df.columns = ['Field', 'Value']
"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 start_row = (i - 1) * (len(vertical_df) + 3) # gap between blocks
worksheet.merge_range( vertical_df.to_excel(
"A1:B1", writer,
"Laxmi Civil Engineering Services Pvt Ltd", sheet_name='CIT_Report',
title_fmt index=False,
startrow=start_row
) )
# 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) output.seek(0)
return output return output
except mysql.connector.Error as e: except mysql.connector.Error as e:
print("MySQL Error", e) print("MySQL Error:", e)
return None return None
# CLOSE CONNECTION
def close(self):
self.cursor.close()
self.conn.close()

View File

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

View File

@@ -1,13 +1,11 @@
from flask import (
render_template, request, send_file, jsonify
)
from werkzeug.utils import secure_filename
import pandas as pd
import os import os
import io
from AppCode.Config import DBConfig from AppCode.Config import DBConfig
from AppCode.FileHandler import FileHandler from AppCode.FileHandler import FileHandler
from werkzeug.utils import secure_filename
from flask import Flask, render_template, request, redirect, url_for, send_from_directory, abort, flash,send_file
import mysql.connector
import pandas as pd
import io
from AppCode.YearGet import YearGet from AppCode.YearGet import YearGet
@@ -19,33 +17,11 @@ class DocumentHandler:
self.isSuccess = False self.isSuccess = False
self.resultMessage = "" 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): def View(self, request):
year_raw = request.args.get('year', '') year = request.args.get('year', '')
stage = request.args.get('stage', '') stage = request.args.get('stage', '')
year = self.parse_year(year_raw)
dbconfig = DBConfig() dbconfig = DBConfig()
connection = dbconfig.get_db_connection() connection = dbconfig.get_db_connection()
@@ -54,13 +30,15 @@ class DocumentHandler:
return return
cursor = connection.cursor(dictionary=True) cursor = connection.cursor(dictionary=True)
# --- FILTER QUERY ---
cursor.callproc("GetDocuments", [year, stage]) cursor.callproc("GetDocuments", [year, stage])
# fetch first result set
for result in cursor.stored_results(): for result in cursor.stored_results():
self.documents = result.fetchall() self.documents = result.fetchall()
break break
# ---- GET YEARS FROM STORED PROCEDURE ----
cursor.callproc("GetYear") cursor.callproc("GetYear")
for result in cursor.stored_results(): for result in cursor.stored_results():
@@ -71,215 +49,56 @@ class DocumentHandler:
cursor.close() cursor.close()
connection.close() connection.close()
self.isSuccess = True self.isSuccess = True
# =========================
# Upload Documents # Upload Documents
# =========================
def Upload(self, request): def Upload(self, request):
dbconfig = DBConfig() dbconfig = DBConfig()
connection = dbconfig.get_db_connection() connection = dbconfig.get_db_connection()
if not connection: if connection:
return
cursor = connection.cursor() cursor = connection.cursor()
files = request.files.getlist('documents') files = request.files.getlist('documents')
year_raw = request.form.get('year') year = request.form['year']
stage = request.form.get('stage') stage = request.form['stage']
year = self.parse_year(year_raw)
if not year:
self.resultMessage = "Invalid year selected."
return
for file in files: for file in files:
if '.' not in file.filename: extension = file.filename.rsplit('.', 1)[1]
continue
extension = file.filename.rsplit('.', 1)[1].lower()
if extension not in FileHandler.ALLOWED_EXTENSIONS: if extension not in FileHandler.ALLOWED_EXTENSIONS:
print("Skipping invalid file:", extension) print("Skip invalid file type : ",extension)
continue continue
filename = secure_filename(file.filename) filename = secure_filename(file.filename)
filepath = os.path.join(FileHandler.UPLOAD_FOLDER, filename) filepath = os.path.join(FileHandler.UPLOAD_FOLDER, filename)
file.save(filepath) file.save(filepath)
cursor.callproc( cursor.callproc('InsertDocument', [ filename, filepath, extension, year, stage ])
'InsertDocument',
[filename, filepath, extension, year, stage]
)
connection.commit() connection.commit()
cursor.close() cursor.close()
connection.close() connection.close()
# return redirect(url_for('view_documents'))
# =========================
# 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()
def Summary_report(self, request): def Summary_report(self, request):
dbconfig = DBConfig() dbconfig = DBConfig()
connection = dbconfig.get_db_connection() connection = dbconfig.get_db_connection()
year_raw = request.args.get('year') year_str = request.args.get('year')
# Safely parse year to int # If year not selected
try: if not year_str or not year_str.isdigit():
year = int(year_raw)
except (TypeError, ValueError):
year = None
if not year:
yearGetter = YearGet() yearGetter = YearGet()
allYears = yearGetter.get_year_by_model("AllYearsInAllModel") allYears = yearGetter.get_year_by_model("AllYearsInAllModel")
yearGetter.close() yearGetter.close()
return render_template( return render_template(
'summary_reports.html', 'summary_reports.html',
years=allYears, years=allYears,
message="Please select a valid year to download." message="Please select a valid year to download."
) )
# Convert year to int (IMPORTANT FIX)
year = int(year_str)
try: try:
stages = { stages = {
"ITR": "itr", "ITR": "itr",
@@ -293,9 +112,11 @@ class DocumentHandler:
for stage_name, table_name in stages.items(): for stage_name, table_name in stages.items():
cursor = connection.cursor(dictionary=True) cursor = connection.cursor(dictionary=True)
cursor.callproc("sp_get_stage_data", [table_name, year]) cursor.callproc("sp_get_stage_data", [table_name, year])
rows = [] rows = []
for result in cursor.stored_results(): for result in cursor.stored_results():
rows = result.fetchall() rows = result.fetchall()
stage_data[stage_name] = pd.DataFrame(rows) if rows else pd.DataFrame() stage_data[stage_name] = pd.DataFrame(rows) if rows else pd.DataFrame()
cursor.close() cursor.close()
@@ -303,85 +124,25 @@ class DocumentHandler:
return df[col].values[0] if col in df.columns and not df.empty else "-" return df[col].values[0] if col in df.columns and not df.empty else "-"
particulars = [ particulars = [
"Gross Total Income", "Add: Disallowance u/s 14A", "Gross Total Income", "Add: Disallowance u/s 14A", "Add: Disallowance u/s 37",
"Add: Disallowance u/s 37", "GTI as per", "GTI as per", "Less: Deduction u/s 80IA - On Business Income", "- On Misc Receipts",
"Less: Deduction u/s 80IA - On Business Income", "- On Other", "- On Sec 37 Disallowance", "Less: Deduction u/s 80G", " ",
"- On Misc Receipts", "- On Other", "Net Taxable Income", "Tax @ 30%", "Tax @ 18.5% on Book Profit",
"- On Sec 37 Disallowance", "Tax Payable", "Surcharge @ %", "Education Cess @ 3%", "Total Tax Payable",
"Less: Deduction u/s 80G", "-", "Less: MAT Credit Utilized", "Add: Interest u/s 234C", "Total Tax", " ",
"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", "Advance Tax", "TDS", "TCS", "SAT",
"Tax on Regular Assessment", "Tax on Regular Assessment", "Refund" , "Remarks"
"Refund", "Add : Interest u/s 244A as per 143",
"Less : Refund Received on","Balance Receivable","Remarks"
] ]
columns = [ columns = [
'gross_total_income', 'disallowance_14a', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'disallowance_37', '-', 'deduction_80ia_business','deduction_80ia_misc',
'gross_total_income'+'disallowance_14a'+'disallowance_37', 'deduction_80ia_other', 'deduction_sec37_disallowance','deduction_80g', '-',
'deduction_80ia_business', 'net_taxable_income', 'tax_30_percent','tax_book_profit_18_5',
'deduction_80ia_misc', 'tax_payable','surcharge_12', 'edu_cess_3', 'total_tax_payable',
'deduction_80ia_other', 'mat_credit' , 'interest_234c','total_tax', '-',
'deduction_sec37_disallowance', 'advance_tax', 'tds', 'tcs', 'sat',
'deduction_80g', '-', 'tax_on_assessment', 'refund', 'Remarks'
'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 = { data = {
@@ -394,44 +155,56 @@ class DocumentHandler:
df = pd.DataFrame(data) df = pd.DataFrame(data)
# ===== Excel Export =====
output = io.BytesIO() output = io.BytesIO()
with pd.ExcelWriter(output, engine='xlsxwriter') as writer: with pd.ExcelWriter(output, engine='xlsxwriter') as writer:
sheet_name = f"AY {year}-{year + 1}" sheet_name = f"AY {year} - {year + 1}"
df.to_excel(writer, index=False, sheet_name=sheet_name, startrow=2) df.to_excel(writer, index=False, sheet_name=sheet_name, startrow=2)
workbook = writer.book workbook = writer.book
worksheet = writer.sheets[sheet_name] worksheet = writer.sheets[sheet_name]
title = workbook.add_format({ # ===== Company Heading =====
company_heading = workbook.add_format({
'bold': True, 'bold': True,
'font_size': 14, 'font_size': 14,
'align': 'center' 'font_color': 'black',
'align': 'center',
'valign': 'middle'
}) })
worksheet.merge_range( worksheet.merge_range(
0, 0, 0, len(df.columns) - 1, 0, 0, 0, len(df.columns) - 1,
"Laxmi Civil Engineering Services Pvt Ltd", "Laxmi Civil Engineering Services Pvt Ltd",
title company_heading
) )
# ===== Header Format =====
header = workbook.add_format({ header = workbook.add_format({
'bold': True, 'bold': True,
'align': 'center', 'align': 'center',
'valign': 'middle',
'bg_color': '#007bff', 'bg_color': '#007bff',
'font_color': 'white', 'font_color': 'white',
'border': 1 'border': 1
}) })
cell = workbook.add_format({'border': 1}) cell = workbook.add_format({
'border': 1,
'align': 'left',
'valign': 'middle'
})
# Write headers
for col_num, col_name in enumerate(df.columns): for col_num, col_name in enumerate(df.columns):
worksheet.write(2, col_num, col_name, header) worksheet.write(2, col_num, col_name, header)
worksheet.set_column(col_num, col_num, 25) max_len = max(df[col_name].astype(str).map(len).max(), len(col_name)) + 2
worksheet.set_column(col_num, col_num, max_len)
for row in range(len(df)): # Write data rows
for row in range(3, len(df) + 3):
for col in range(len(df.columns)): for col in range(len(df.columns)):
worksheet.write(row + 3, col, df.iloc[row, col], cell) worksheet.write(row, col, df.iloc[row - 3, col], cell)
worksheet.freeze_panes(3, 1) worksheet.freeze_panes(3, 1)

View File

@@ -1,3 +1,4 @@
from AppCode.Config import DBConfig from AppCode.Config import DBConfig
import mysql.connector import mysql.connector
import pandas as pd import pandas as pd
@@ -31,15 +32,14 @@ class ITATHandler:
# INSERT ITAT (PROC) # INSERT ITAT (PROC)
def add_itat(self, data): def add_itat(self, data):
columns= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37', columns = [
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g', 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'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', 'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b', 'deduction_sec37_disallowance', 'deduction_80g', 'net_taxable_income',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance', 'tax_30_percent', 'tax_book_profit_18_5', 'tax_payable', 'surcharge_12',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund', 'edu_cess_3', 'total_tax_payable', 'mat_credit', 'interest_234c',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'created_at' 'total_tax', 'advance_tax', 'tds', 'tcs','sat', 'tax_on_assessment', 'refund', 'Remarks'
] ]
values = [data.get(col, 0) for col in columns] values = [data.get(col, 0) for col in columns]
self.cursor.callproc("InsertITAT", values) self.cursor.callproc("InsertITAT", values)
@@ -47,13 +47,13 @@ class ITATHandler:
# UPDATE ITAT (PROC) # UPDATE ITAT (PROC)
def update_itat(self, id, data): def update_itat(self, id, data):
columns= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37', columns = [
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g', 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'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', 'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b', 'deduction_sec37_disallowance', 'deduction_80g', 'net_taxable_income',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance', 'tax_30_percent', 'tax_book_profit_18_5', 'tax_payable', 'surcharge_12',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund', 'edu_cess_3', 'total_tax_payable', 'mat_credit', 'interest_234c',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'updated_at' 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat','tax_on_assessment', 'refund','Remarks'
] ]
values = [id] + [data.get(col, 0) for col in columns] values = [id] + [data.get(col, 0) for col in columns]
@@ -66,14 +66,10 @@ class ITATHandler:
self.conn.commit() self.conn.commit()
def itat_report_download(self, selected_year): def itat_report_download(self, selected_year):
try: try:
# AY calculation (2020 -> AY 2020-2021) # Call stored procedure
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]) self.cursor.callproc("GetITATByYear", [selected_year])
rows = [] rows = []
for result in self.cursor.stored_results(): for result in self.cursor.stored_results():
@@ -82,126 +78,20 @@ class ITATHandler:
if not rows: if not rows:
return None return None
# Remove id column if exists df = pd.DataFrame(rows)
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 # Excel output
output = io.BytesIO() output = io.BytesIO()
with pd.ExcelWriter(output, engine="xlsxwriter") as writer: with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
workbook = writer.book df.T.to_excel(writer, header=False, sheet_name="ITAT_Report")
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) output.seek(0)
return output return output
except mysql.connector.Error as e: except mysql.connector.Error as e:
print("MySQL Error", e) print("MySQL Error:", e)
return None return None
# CLOSE CONNECTION # CLOSE CONNECTION
def close(self): def close(self):
self.cursor.close() self.cursor.close()

View File

@@ -1,9 +1,18 @@
from AppCode.Config import DBConfig
import mysql.connector
from AppCode.YearGet import YearGet
import pandas as pd
import pymysql
import io
# new
from AppCode.Config import DBConfig
import mysql.connector import mysql.connector
import pandas as pd import pandas as pd
import io import io
from flask import send_file, render_template, request from flask import send_file, render_template, request
from AppCode.Config import DBConfig
class ITRHandler: class ITRHandler:
@@ -12,6 +21,7 @@ class ITRHandler:
self.conn = DBConfig.get_db_connection() self.conn = DBConfig.get_db_connection()
self.cursor = self.conn.cursor(dictionary=True) self.cursor = self.conn.cursor(dictionary=True)
# GET ALL ITR RECORDS using stored procedure "GetAllItr" # GET ALL ITR RECORDS using stored procedure "GetAllItr"
def get_all_itr(self): def get_all_itr(self):
self.cursor.callproc("GetAllItr") self.cursor.callproc("GetAllItr")
@@ -40,14 +50,14 @@ class ITRHandler:
# INSERT ITR RECORD using procedure "add_itr" # INSERT ITR RECORD using procedure "add_itr"
def add_itr(self, data): def add_itr(self, data):
try:
columns= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37', columns = [
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g', 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'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', 'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b', 'deduction_sec37_disallowance', 'deduction_80g', 'net_taxable_income',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance', 'tax_30_percent', 'tax_book_profit_18_5', 'tax_payable', 'surcharge_12',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund', 'edu_cess_3', 'total_tax_payable', 'mat_credit', 'interest_234c',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'created_at' 'total_tax', 'advance_tax', 'tds', 'tcs','sat', 'tax_on_assessment', 'refund', 'Remarks'
] ]
values = [data.get(col, 0) for col in columns] values = [data.get(col, 0) for col in columns]
@@ -55,23 +65,16 @@ class ITRHandler:
# Call your stored procedure # Call your stored procedure
self.cursor.callproc("InsertITR", values) self.cursor.callproc("InsertITR", values)
self.conn.commit() self.conn.commit()
except Exception as e:
self.conn.rollback()
raise e
finally:
self.cursor.close()
self.conn.close()
# update itr by id # update itr by id
def update(self, id, data): def update(self, id, data):
columns= [ 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37', columns = [
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other', 'deduction_sec37_disallowance', 'deduction_80g', 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
'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', 'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
'per_tax_b', 'tax_b_cal', 'per_surcharge_b', 'surcharge_b_cal', 'per_cess_b', 'edu_cess_b_cal', 'sum_of_b', 'deduction_sec37_disallowance', 'deduction_80g', 'net_taxable_income',
'tax_payable','total_tax_payable', 'opening_balance', 'mat_credit_created', 'mat_credit_utilized', 'closing_balance', 'tax_30_percent', 'tax_book_profit_18_5', 'tax_payable', 'surcharge_12',
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat', 'tax_on_assessment', 'refund', 'edu_cess_3', 'total_tax_payable', 'mat_credit', 'interest_234c',
'interest_244a_per143', 'refund_received', 'balance_receivable', 'remarks', 'updated_at' 'total_tax', 'advance_tax', 'tds', 'tcs', 'sat','tax_on_assessment', 'refund','Remarks'
] ]
values = [id] + [data.get(col, 0) for col in columns] values = [id] + [data.get(col, 0) for col in columns]
@@ -85,7 +88,7 @@ class ITRHandler:
self.conn.commit() self.conn.commit()
# # report download by year # report download by year
def itr_report_download(self, selected_year): def itr_report_download(self, selected_year):
try: try:
# Call stored procedure # Call stored procedure
@@ -97,110 +100,27 @@ class ITRHandler:
if not rows: if not rows:
return None return None
for row in rows:
row.pop('id', None)
# Mapping DB fields → Excel labels (NO underscores) # Convert SQL rows to DataFrame
field_mapping = { df = pd.DataFrame(rows)
"gross_total_income": "Gross Total Income", # Transpose
"disallowance_14a": "Add: Disallowance u/s 14A", df_transposed = df.transpose()
"disallowance_37": "Add: Disallowance u/s 37", df_transposed.insert(0, 'Field', df_transposed.index)
"-" : "-",
"deduction_80ia_business": "Less: Deduction u/s 80IA - On Business Income", record_cols = {
"deduction_80ia_misc": "On Misc Receipts", i: f"Record {i}"
"deduction_80ia_other": "On Other", for i in df_transposed.columns if isinstance(i, int)
"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 df_transposed.rename(columns=record_cols, inplace=True)
data = [] df_transposed.reset_index(drop=True, inplace=True)
for key, label in field_mapping.items():
value = rows[0].get(key, 0)
data.append([label, value])
df = pd.DataFrame(data, columns=["Particulars", "ITR"]) # Save to Excel in memory
# Excel output
output = io.BytesIO() output = io.BytesIO()
with pd.ExcelWriter(output, engine="xlsxwriter") as writer: with pd.ExcelWriter(output, engine='xlsxwriter') as writer:
workbook = writer.book df_transposed.to_excel(writer, index=False, sheet_name='ITR_Vertical')
worksheet = workbook.add_worksheet("ITR Report") worksheet = writer.sheets['ITR_Vertical']
writer.sheets["ITR Report"] = worksheet worksheet.set_column(0, 0, 30)
# 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) output.seek(0)
return output return output

View File

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

View File

@@ -1,104 +1,30 @@
from flask import Blueprint, render_template, request, redirect, url_for, flash, session from flask import Blueprint, render_template, request, redirect, url_for, flash, session
<<<<<<< HEAD from flask import flash,redirect,url_for
import os
=======
>>>>>>> b9a8b9c0a9c322c129ac50b3dec0ffb3c6d82a83
from functools import wraps from functools import wraps
from ldap3 import Server, Connection, ALL from flask import session
from ldap3.core.exceptions import LDAPException
class LoginAuth: class LoginAuth:
def __init__(self): def __init__(self):
# Create Blueprint
self.bp = Blueprint("auth", __name__) self.bp = Blueprint("auth", __name__)
# -------------------------------
# LDAP CONFIGURATION
# -------------------------------
<<<<<<< HEAD
self.LDAP_SERVER = os.getenv(
"LDAP_SERVER",
"ldap://host.docker.internal:389"
)
=======
self.LDAP_SERVER = "ldap://localhost:389"
>>>>>>> b9a8b9c0a9c322c129ac50b3dec0ffb3c6d82a83
self.BASE_DN = "ou=users,dc=lcepl,dc=org" # LDAP Users DN
# -------------------------------
# LOGIN ROUTE # LOGIN ROUTE
# -------------------------------
@self.bp.route('/login', methods=['GET', 'POST']) @self.bp.route('/login', methods=['GET', 'POST'])
def login(): def login():
if request.method == 'POST': if request.method == 'POST':
username = request.form.get("username") username = request.form.get("username")
password = request.form.get("password") password = request.form.get("password")
<<<<<<< HEAD
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)
=======
if not username or not password: # Dummy validation — REPLACE with DB check later
flash("Username and password are required!", "danger") if username == "admin" and password == "admin123":
return render_template("login.html")
user_dn = f"uid={username},{self.BASE_DN}"
server = Server(self.LDAP_SERVER, get_info=ALL)
>>>>>>> b9a8b9c0a9c322c129ac50b3dec0ffb3c6d82a83
try:
# Attempt LDAP bind
conn = Connection(server, user=user_dn, password=password, auto_bind=True)
if conn.bound:
<<<<<<< HEAD
=======
>>>>>>> b9a8b9c0a9c322c129ac50b3dec0ffb3c6d82a83
session['user'] = username session['user'] = username
flash(f"Login successful! Welcome {username}", "success") flash("Login successful!", "success")
return redirect(url_for('welcome')) return redirect(url_for('welcome'))
else: else:
flash("Invalid username or password!", "danger") 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()
<<<<<<< HEAD
# GET request: show login form
return render_template("login.html") return render_template("login.html")
# 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")
# # Dummy validation — REPLACE with DB check later
# if username == "admin" and password == "admin123":
# session['user'] = username
# flash("Login successful!", "success")
# return redirect(url_for('welcome'))
# else:
# flash("Invalid username or password!", "danger")
# return render_template("login.html")
=======
# GET request: show login form
return render_template("login.html")
>>>>>>> b9a8b9c0a9c322c129ac50b3dec0ffb3c6d82a83
# -------------------------------
# LOGOUT ROUTE # LOGOUT ROUTE
# -------------------------------
@self.bp.route('/logout') @self.bp.route('/logout')
def logout(): def logout():
session.clear() session.clear()
@@ -109,9 +35,6 @@ class LoginAuth:
# LOGIN REQUIRED DECORATOR INSIDE CLASS # LOGIN REQUIRED DECORATOR INSIDE CLASS
# =================================================== # ===================================================
def login_required(self, f): def login_required(self, f):
"""
Protect routes: redirect to login if user not authenticated.
"""
@wraps(f) @wraps(f)
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
if "user" not in session: if "user" not in session:

View File

@@ -1,18 +1,16 @@
from AppCode.Config import DBConfig from AppCode.Config import DBConfig
import mysql.connector
class MatCreditHandler: class MatCreditHandler:
def __init__(self): def __init__(self):
# db = DBConfig()
self.conn = DBConfig.get_db_connection() self.conn = DBConfig.get_db_connection()
self.cursor = self.conn.cursor(dictionary=True) self.cursor = self.conn.cursor(dictionary=True)
# -------------------------------------------------- # get all Mat credit data
# FETCH ALL MAT CREDIT + UTILIZATION (For UI Display)
# --------------------------------------------------
def fetch_all(self): def fetch_all(self):
try: try:
self.cursor.callproc("GetMatCedit") self.cursor.callproc("GetMatCedit")
result_sets = self.cursor.stored_results() result_sets = self.cursor.stored_results()
mat_rows = next(result_sets).fetchall() mat_rows = next(result_sets).fetchall()
@@ -21,108 +19,103 @@ class MatCreditHandler:
return mat_rows, utilization_rows return mat_rows, utilization_rows
finally: finally:
self.cursor.close() self.cursor.close()
self.conn.close() self.cursor.close()
# -------------------------------------------------- # Save Mat credit data single row
# SAVE / UPDATE SINGLE MAT ROW (FROM MANUAL UI)
# --------------------------------------------------
@staticmethod @staticmethod
def save_single(data): def save_single(data):
conn = DBConfig.get_db_connection() conn = DBConfig.get_db_connection()
cur = conn.cursor(dictionary=True) cur = conn.cursor()
try: try:
# Save / Update MAT Credit cur.execute(
cur.callproc( "SELECT id FROM mat_credit WHERE financial_year=%s",
"SaveOrUpdateMatCredit", (data["financial_year"],)
(
data["financial_year"],
data["mat_credit"],
data["balance"],
data.get("remarks", "")
)
) )
row = cur.fetchone()
mat_id = None if row:
for result in cur.stored_results(): mat_id = row[0]
mat_id = result.fetchone()["mat_id"]
# Save utilization rows cur.execute("""
for u in data.get("utilization", []): UPDATE mat_credit
if float(u["amount"]) > 0: SET mat_credit=%s, balance=%s
cur.callproc( WHERE id=%s
"InsertMatUtilization", """, (data["mat_credit"], data["balance"], mat_id))
(mat_id, u["year"], u["amount"])
cur.execute(
"DELETE FROM mat_utilization WHERE mat_credit_id=%s",
(mat_id,)
) )
else:
cur.execute("""
INSERT INTO mat_credit (financial_year, mat_credit, balance)
VALUES (%s,%s,%s)
""", (data["financial_year"], data["mat_credit"], data["balance"]))
mat_id = cur.lastrowid
for u in data["utilization"]:
cur.execute("""
INSERT INTO mat_utilization
(mat_credit_id, utilized_year, utilized_amount)
VALUES (%s,%s,%s)
""", (mat_id, u["year"], u["amount"]))
conn.commit() conn.commit()
except Exception as e: except Exception:
conn.rollback() conn.rollback()
raise e raise
finally: finally:
cur.close() cur.close()
conn.close() conn.close()
# --------------------------------------------------
# AUTO SAVE MAT FROM ITR (MAIN LOGIC) # save all Mat credit data
# --------------------------------------------------
@staticmethod @staticmethod
def save_from_itr(year, mat_created, mat_utilized, remarks="Auto from"): def save_bulk(rows):
conn = DBConfig.get_db_connection() conn = DBConfig.get_db_connection()
cur = conn.cursor(dictionary=True) cur = conn.cursor()
skipped = []
try: try:
mat_created = float(mat_created or 0) for row in rows:
mat_utilized = float(mat_utilized or 0) cur.execute(
"SELECT id FROM mat_credit WHERE financial_year=%s",
balance = mat_created - mat_utilized (row["financial_year"],)
# Save / Update MAT Credit
cur.callproc(
"SaveOrUpdateMatCredit",
(year, mat_created, balance, remarks)
) )
if cur.fetchone():
skipped.append(row["financial_year"])
continue
mat_id = None cur.execute("""
for result in cur.stored_results(): INSERT INTO mat_credit (financial_year, mat_credit, balance)
mat_id = result.fetchone()["mat_id"] VALUES (%s,%s,%s)
""", (row["financial_year"], row["mat_credit"], row["balance"]))
# Save utilization only if used mat_id = cur.lastrowid
if mat_utilized > 0:
cur.callproc( for u in row["utilization"]:
"InsertMatUtilization", cur.execute("""
(mat_id, year, mat_utilized) INSERT INTO mat_utilization
) (mat_credit_id, utilized_year, utilized_amount)
VALUES (%s,%s,%s)
""", (mat_id, u["year"], u["amount"]))
conn.commit() conn.commit()
return skipped
except Exception as e: except Exception:
conn.rollback() conn.rollback()
raise e raise
finally: finally:
cur.close() cur.close()
conn.close() conn.close()
# -------------------------------------------------- # CLOSE CONNECTION
# 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): def close(self):
if self.cursor:
self.cursor.close() self.cursor.close()
if self.conn:
self.conn.close() self.conn.close()

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,12 +0,0 @@
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 5010
CMD ["gunicorn", "--bind", "0.0.0.0:5010", "main:app"]

View File

View File

@@ -1,40 +0,0 @@
version: "3.9"
services:
db:
image: mysql:8
container_name: tax-mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: tiger
MYSQL_DATABASE: income_tax_db
volumes:
- mysql_data:/var/lib/mysql
flaskapp:
build: .
container_name: tax-flask
restart: always
ports:
- "5010:5010"
depends_on:
- db
environment:
DB_HOST: db
DB_PORT: 3306
DB_USER: root
DB_PASSWORD: tiger
DB_NAME: income_tax_db
FLASK_HOST: 0.0.0.0
FLASK_PORT: 5010
FLASK_DEBUG: "false"
SECRET_KEY: secret1234
LDAP_SERVER: ldap://host.docker.internal:389 # 👈 ADD THIS
LOG_VIEW_SECRET: super-log-2026
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./logs:/app/logs
volumes:
mysql_data:

230
main.py
View File

@@ -1,18 +1,19 @@
from flask import Flask, render_template, request, redirect, url_for, flash,send_file ,jsonify, session from flask import Flask, render_template, request, redirect, url_for, send_from_directory, abort, flash,send_file ,jsonify
import os import os
from dotenv import load_dotenv from dotenv import load_dotenv
load_dotenv() load_dotenv()
import pandas as pd
from werkzeug.utils import secure_filename from werkzeug.utils import secure_filename
from datetime import date
from AppCode.Config import DBConfig from AppCode.Config import DBConfig
from AppCode.LoginAuth import LoginAuth
from AppCode.FileHandler import FileHandler from AppCode.FileHandler import FileHandler
from AppCode.YearGet import YearGet
from AppCode.DocumentHandler import DocumentHandler from AppCode.DocumentHandler import DocumentHandler
from AppCode.ITRHandler import ITRHandler from AppCode.ITRHandler import ITRHandler
from AppCode.AOHandler import AOHandler from AppCode.AOHandler import AOHandler
from AppCode.CITHandler import CITHandler from AppCode.CITHandler import CITHandler
from AppCode.ITATHandler import ITATHandler from AppCode.ITATHandler import ITATHandler
from AppCode.YearGet import YearGet
from AppCode.LoginAuth import LoginAuth
from AppCode.MatCreditHandler import MatCreditHandler from AppCode.MatCreditHandler import MatCreditHandler
@@ -21,51 +22,10 @@ from AppCode.MatCreditHandler import MatCreditHandler
app = Flask(__name__) app = Flask(__name__)
app.secret_key=os.getenv("SECRET_KEY") app.secret_key=os.getenv("SECRET_KEY")
import logging
import sys
# Remove default handlers
if not os.path.exists("logs"):
os.mkdir("logs")
file_handler = logging.FileHandler("logs/app.log")
file_handler.setLevel(logging.INFO)
stream_handler = logging.StreamHandler()
stream_handler.setLevel(logging.INFO)
formatter = logging.Formatter(
"%(asctime)s | %(levelname)s | User:%(user)s | %(message)s"
)
file_handler.setFormatter(formatter)
stream_handler.setFormatter(formatter)
app.logger.setLevel(logging.INFO)
app.logger.addHandler(file_handler)
app.logger.addHandler(stream_handler)
auth = LoginAuth() auth = LoginAuth()
app.register_blueprint(auth.bp) app.register_blueprint(auth.bp)
@app.before_request
def log_user_activity():
if request.endpoint and "static" not in request.endpoint:
user = session.get("user", "Anonymous")
ip = request.remote_addr
app.logger.info(
f"Accessed: {request.method} {request.path}",
extra={"user": user}
)
# welcome page # welcome page
@app.route('/') @app.route('/')
@auth.login_required @auth.login_required
@@ -99,6 +59,7 @@ def view_documents():
docHandler.View(request=request) docHandler.View(request=request)
return render_template('view_docs.html', documents=docHandler.documents, years=docHandler.years) return render_template('view_docs.html', documents=docHandler.documents, years=docHandler.years)
# Upload file documents # Upload file documents
@app.route('/uploads/<filename>') @app.route('/uploads/<filename>')
@auth.login_required @auth.login_required
@@ -107,26 +68,20 @@ def uploaded_file(filename):
filepath = os.path.join(FileHandler.UPLOAD_FOLDER, secure_filename(filename)) filepath = os.path.join(FileHandler.UPLOAD_FOLDER, secure_filename(filename))
if not os.path.exists(filepath): if not os.path.exists(filepath):
flash("Unsupported file type for viewing", "warning") abort(404)
return redirect(url_for('view_documents'))
file_ext = filename.rsplit('.', 1)[-1].lower() file_ext = filename.rsplit('.', 1)[-1].lower()
# --- View Mode --- # --- View Mode ---
if mode == 'view': if mode == 'view':
# pdf
if file_ext == 'pdf': if file_ext == 'pdf':
return send_file(filepath, mimetype='application/pdf') return send_file(filepath, mimetype='application/pdf')
# Word
elif file_ext in ['doc', 'docx']:
return send_file(filepath, as_attachment=True)
# Excel
elif file_ext in ['xls', 'xlsx']: elif file_ext in ['xls', 'xlsx']:
# Excel cannot be rendered in-browser by Flask; trigger download instead
return send_file(filepath, as_attachment=False, download_name=filename, mimetype='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') return send_file(filepath, as_attachment=False, download_name=filename, mimetype='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
else: else:
flash("Unsupported file type for viewing", "warning") return abort(415) # Unsupported type for viewing
return redirect(url_for('view_documents'))
return send_file(filepath, as_attachment=True, download_name=filename) return send_file(filepath, as_attachment=True)
@@ -150,28 +105,14 @@ def display_itr():
def add_itr(): def add_itr():
if request.method == 'POST': if request.method == 'POST':
itr = ITRHandler() itr = ITRHandler()
mat = MatCreditHandler()
itr.add_itr(request.form) itr.add_itr(request.form)
itr.close() itr.close()
if 'documents' in request.files: flash("ITR record added successfully!", "success")
doc = DocumentHandler()
doc.Upload(request)
# AUTO SAVE MAT FROM ITR
mat.save_from_itr(
year=request.form["year"],
mat_created=float(request.form.get("mat_credit_created", 0)),
mat_utilized=float(request.form.get("mat_credit_utilized", 0)),
remarks="Created via ITR"
)
# flash("ITR record added successfully!", "success")
flash("ITR record and documents uploaded successfully!", "success")
return redirect(url_for('display_itr')) return redirect(url_for('display_itr'))
return render_template('add_itr.html',current_date=date.today().isoformat()) return render_template('add_itr.html')
## 4. DELETE an ITR records ## 4. DELETE an ITR record
@app.route('/itr/delete/<int:id>', methods=['POST']) @app.route('/itr/delete/<int:id>', methods=['POST'])
@auth.login_required @auth.login_required
def delete_itr(id): def delete_itr(id):
@@ -187,14 +128,14 @@ def update_itr(id):
itr = ITRHandler() itr = ITRHandler()
if request.method == 'POST': if request.method == 'POST':
data = {k: request.form.get(k, 0) for k in request.form} # data = {k: request.form.get(k, 0) for k in request.form}
itr.update(id, data) itr.update(id, request.form)
itr.close() itr.close()
return redirect(url_for('display_itr')) return redirect(url_for('display_itr'))
record = itr.get_itr_by_id(id) record = itr.get_itr_by_id(id)
itr.close() itr.close()
return render_template('update_itr.html', record=record, current_date=date.today().isoformat()) return render_template('update_itr.html', record=record)
@@ -219,25 +160,11 @@ def display_ao():
def add_ao(): def add_ao():
if request.method == 'POST': if request.method == 'POST':
ao = AOHandler() ao = AOHandler()
mat = MatCreditHandler()
ao.add_ao(request.form) ao.add_ao(request.form)
ao.close() ao.close()
if 'documents' in request.files:
doc = DocumentHandler()
doc.Upload(request)
# AUTO SAVE MAT FROM ITR
mat.save_from_itr(
year=request.form["year"],
mat_created=float(request.form.get("mat_credit_created", 0)),
mat_utilized=float(request.form.get("mat_credit_utilized", 0)),
remarks="Created via ao"
)
flash("AO record added successfully!", "success") flash("AO record added successfully!", "success")
return redirect(url_for('display_ao')) return redirect(url_for('display_ao'))
return render_template('add_ao.html',current_date=date.today().isoformat()) return render_template('add_ao.html')
# 3. UPDATE AO record # 3. UPDATE AO record
@app.route('/ao/update/<int:id>', methods=['GET', 'POST']) @app.route('/ao/update/<int:id>', methods=['GET', 'POST'])
@@ -291,25 +218,12 @@ def display_cit():
def add_cit(): def add_cit():
if request.method == 'POST': if request.method == 'POST':
cit = CITHandler() cit = CITHandler()
mat = MatCreditHandler()
cit.add_cit(request.form) cit.add_cit(request.form)
cit.close() cit.close()
if 'documents' in request.files:
doc = DocumentHandler()
doc.Upload(request)
# AUTO SAVE MAT FROM ITR
mat.save_from_itr(
year=request.form["year"],
mat_created=float(request.form.get("mat_credit_created", 0)),
mat_utilized=float(request.form.get("mat_credit_utilized", 0)),
remarks="Created via cit"
)
flash("CIT record added successfully!", "success") flash("CIT record added successfully!", "success")
return redirect(url_for('display_cit')) return redirect(url_for('display_cit'))
return render_template('add_cit.html', current_date=date.today().isoformat()) return render_template('add_cit.html')
# 3 delete CIT records by id # 3 delete CIT records by id
@app.route('/cit/delete/<int:id>', methods=['POST']) @app.route('/cit/delete/<int:id>', methods=['POST'])
@@ -333,8 +247,8 @@ def update_cit(id):
return "CIT record not found", 404 return "CIT record not found", 404
if request.method == 'POST': if request.method == 'POST':
data = {k: request.form.get(k, 0) for k in request.form} # data = {k: request.form.get(k, 0) for k in request.form}
cit.update_cit(id, data) cit.update_cit(id, request.form)
cit.close() cit.close()
return redirect(url_for('display_cit')) return redirect(url_for('display_cit'))
@@ -361,27 +275,13 @@ def display_itat():
def add_itat(): def add_itat():
if request.method == 'POST': if request.method == 'POST':
itat = ITATHandler() itat = ITATHandler()
mat = MatCreditHandler() # data = {k: request.form.get(k, 0) for k in request.form}
data = {k: request.form.get(k, 0) for k in request.form} itat.add_itat(request.form)
itat.add_itat(data)
itat.close() itat.close()
if 'documents' in request.files:
doc = DocumentHandler()
doc.Upload(request)
# AUTO SAVE MAT FROM ITR
mat.save_from_itr(
year=request.form["year"],
mat_created=float(request.form.get("mat_credit_created", 0)),
mat_utilized=float(request.form.get("mat_credit_utilized", 0)),
remarks="Created via ITR"
)
flash("ITAT record added successfully!", "success") flash("ITAT record added successfully!", "success")
return redirect(url_for('display_itat')) return redirect(url_for('display_itat'))
return render_template('add_itat.html',current_date=date.today().isoformat()) return render_template('add_itat.html')
# 3.Update ITAT records by id # 3.Update ITAT records by id
@app.route('/itat/update/<int:id>', methods=['GET', 'POST']) @app.route('/itat/update/<int:id>', methods=['GET', 'POST'])
@@ -543,17 +443,6 @@ def summary_report():
docHandler = DocumentHandler() docHandler = DocumentHandler()
return docHandler.Summary_report(request=request) return docHandler.Summary_report(request=request)
@app.route('/summary/download', methods=['GET'])
@auth.login_required
def download_summary():
year_raw = request.args.get('year')
if not year_raw:
return "Year parameter is required", 400
docHandler = DocumentHandler()
# reuse your existing Summary_report method
return docHandler.Summary_report(request=request)
# check year in table existe or not by using ajax calling. # check year in table existe or not by using ajax calling.
# @app.route('/check_year', methods=['POST']) # @app.route('/check_year', methods=['POST'])
@@ -566,33 +455,15 @@ def download_summary():
# check_year_obj = YearGet() # check_year_obj = YearGet()
# result = check_year_obj.CheckYearExists(table_name, year) # result = check_year_obj.CheckYearExists(table_name, year)
# check_year_obj.close() # check_year_obj.close()
# return result
@app.route('/check_year', methods=['POST'])
def check_year():
table_name = request.json.get("table")
year = request.json.get("year")
conn = DBConfig.get_db_connection()
cursor = conn.cursor()
sqlstr = f"SELECT COUNT(*) FROM {table_name} WHERE year = %s"
cursor.execute(sqlstr, (year,))
result = cursor.fetchone()[0]
cursor.close()
conn.close()
return {"exists": result > 0}
# Mat credit from # Mat credit from
@app.route("/mat_credit", methods=["GET"]) @app.route("/mat_credit", methods=["GET"])
@auth.login_required @auth.login_required
def mat_credit(): def mat_credit():
mat = MatCreditHandler()
try: mat= MatCreditHandler()
mat_rows, utilization_rows = mat.fetch_all() mat_rows, utilization_rows = mat.fetch_all()
finally:
mat.close() mat.close()
utilization_map = {} utilization_map = {}
@@ -615,53 +486,24 @@ def mat_credit():
@app.route("/save_mat_row", methods=["POST"]) @app.route("/save_mat_row", methods=["POST"])
@auth.login_required @auth.login_required
def save_mat_row(): def save_mat_row():
mat = MatCreditHandler() mat= MatCreditHandler()
try: try:
mat.save_single(request.json) mat.save_single(request.json)
return jsonify({"message": "Row saved successfully"}) return jsonify({"message": "Row saved successfully"})
except Exception as e: except Exception as e:
return jsonify({"error": str(e)}), 500 return jsonify({"error": str(e)}), 500
finally:
mat.close()
@app.route("/summary/preview")
def summary_preview_route():
handler = DocumentHandler()
return handler.Summary_preview(request)
@app.route("/view_logs", methods=["GET", "POST"])
@auth.login_required
def view_logs():
secret = os.getenv("LOG_VIEW_SECRET")
if request.method == "POST":
entered = request.form.get("secret")
if entered != secret:
flash("Invalid secret!", "danger")
return render_template("view_logs_auth.html")
try:
with open("logs/app.log", "r") as f:
logs = f.readlines()
except FileNotFoundError:
logs = ["Log file not found"]
return render_template("view_logs.html", logs=logs)
return render_template("view_logs_auth.html")
# save mat credit bulk data # save mat credit bulk data
# @app.route("/save_mat_all", methods=["POST"]) @app.route("/save_mat_all", methods=["POST"])
# @auth.login_required @auth.login_required
# def save_mat_all(): def save_mat_all():
# mat= MatCreditHandler() mat= MatCreditHandler()
# try: try:
# skipped = mat.save_bulk(request.json) skipped = mat.save_bulk(request.json)
# return jsonify({"message": "Saved successfully", "skipped": skipped}) return jsonify({"message": "Saved successfully", "skipped": skipped})
# except Exception as e: except Exception as e:
# return jsonify({"error": str(e)}), 500 return jsonify({"error": str(e)}), 500
# run server # run server
if __name__ == '__main__': if __name__ == '__main__':

View File

@@ -1,15 +0,0 @@
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
ldap3

297
static/css/add_ao.css Normal file
View File

@@ -0,0 +1,297 @@
/* ================= GLOBAL ================= */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Segoe UI", sans-serif;
}
body {
background-color: #f0f4ff;
/* very light blue background */
display: flex;
}
a {
text-decoration: none !important;
}
/* ================= NAVBAR ================= */
.navbar {
width: 100%;
height: 60px;
background-color: #007bff;
/* primary blue */
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);
gap: 10px;
}
.nav-left {
display: flex;
align-items: center;
gap: 15px;
}
.nav-logo {
height: 80px;
filter: brightness(0) invert(1);
}
.toggle-btn {
font-size: 26px;
cursor: pointer;
}
/* ================= 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 #e0e0e0;
display: flex;
flex-direction: column;
z-index: 0;
transition: 0.3s;
}
.sidebar.hide {
left: -250px;
}
.sidebar h2 {
color: #007bff;
text-align: center;
margin-bottom: 20px;
font-size: 22px;
}
.menu-btn {
padding: 14px 20px;
font-size: 17px;
color: #007bff;
cursor: pointer;
border-bottom: 1px solid #e0e0e0;
transition: 0.2s;
}
.menu-btn:hover {
background: #cce5ff;
color: #0056b3;
}
.submenu {
display: none;
background: #f0f8ff;
}
.submenu a {
display: block;
padding: 12px 35px;
color: #007bff;
border-bottom: 1px solid #e0e0e0;
transition: 0.2s;
}
.submenu a:hover {
background: #cce5ff;
color: #004085;
}
.sidebar-logout {
margin-top: auto;
padding: 10px 16px;
background: #007bff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6px;
text-decoration: none;
color: white;
}
.sidebar-logout:hover {
background: #a2cdfa;
}
.logout-icon {
width: 22px;
height: 22px;
}
/* ================= MAIN CONTENT ================= */
.main {
margin-left: 260px;
width: calc(100% - 260px);
padding: 30px;
margin-top: 80px;
transition: 0.3s;
}
/* ================= CONTAINER ================= */
.container {
background: white;
padding: 30px;
width: 95%;
margin: auto;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
/* ================= BACK BUTTON ================= */
.back-btn {
background: #007bff;
padding: 10px 16px;
color: white;
display: inline-block;
border-radius: 6px;
margin-bottom: 20px;
transition: background 0.3s ease;
}
.back-btn:hover {
background: #0056b3;
}
/* ================= FORM ================= */
.form-group {
margin-bottom: 15px;
font-weight: bold;
}
form input,
form select {
padding: 10px;
width: 100%;
margin-top: 5px;
border: 1px solid #ccc;
border-radius: 6px;
background-color: #f8f9ff;
/* subtle input background */
outline: none;
}
input:focus,
select:focus {
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
/* blue glow on focus */
}
.auto {
padding: 10px 12px;
border: 1px solid #ccd1d9;
border-radius: 6px;
font-size: 15px;
background-color: #d5edd7;
transition: all 0.25s ease-in-out;
}
/* ================= SUBMIT BUTTON (GREEN) ================= */
button {
width: 60%;
margin-top: 20px;
margin-left: 20%;
padding: 12px 20px;
background-color: #28a745;
/* Bootstrap green */
color: #ffffff;
border: none;
cursor: pointer;
border-radius: 6px;
font-weight: 600;
font-size: 15px;
transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
button:hover {
background-color: #218838;
/* Darker green on hover */
box-shadow: 0 4px 10px rgba(40, 167, 69, 0.35);
}
button:active {
background-color: #1e7e34;
}
button:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.35);
}
/* ================= TABLE ================= */
.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: #007bff;
color: white;
text-align: center;
}
tr:nth-child(even) {
background-color: #f0f8ff;
}
td:first-child,
th:first-child {
text-align: left;
}
.action-cell form {
display: inline-block;
margin-left: 5px;
}
/* Full width rows (span 2 columns) */
.form-group {
display: flex;
flex-direction: column;
}
.form-group.full-width {
grid-column: span 2;
}
/* Special case: two inputs inside one form-group */
.form-group.inline-2 {
flex-direction: row;
gap: 15px;
}
.form-group.inline-2>div {
flex: 1;
}

155
static/css/add_cit.css Normal file
View File

@@ -0,0 +1,155 @@
/* ================= RESET ================= */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Segoe UI", sans-serif;
}
body {
background-color: #f0f4ff;
/* very light blue background */
}
/* ================= CONTAINER ================= */
.container {
max-width: 90%;
margin: 20px 20px 20px 20px;
/* top margin to clear navbar */
background: white;
padding: 10%;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.no-record {
text-align: center;
font-size: 18px;
margin-top: 20px;
color: #555;
padding: 15px;
background: #f9f9f9;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
/* ================= FORM ================= */
form label {
display: block;
margin-top: 10px;
font-weight: bold;
color: #000000;
/* dark blue text */
}
form input,
form select {
width: 100%;
padding: 10px;
margin-top: 6px;
border: 1px solid #ccc;
border-radius: 6px;
outline: none;
}
form input:focus,
form select:focus {
border-color: #0056b3;
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}
.auto {
padding: 10px 12px;
border: 1px solid #ccd1d9;
border-radius: 6px;
font-size: 15px;
background-color: #d5edd7;
transition: all 0.25s ease-in-out;
}
/* ================= SUBMIT BUTTON (GREEN) ================= */
button {
width: 60%;
margin-top: 20px;
margin-left: 20%;
padding: 12px 20px;
background-color: #28a745;
/* Bootstrap green */
color: #ffffff;
border: none;
cursor: pointer;
border-radius: 6px;
font-weight: 600;
font-size: 15px;
transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
button:hover {
background-color: #218838;
/* Darker green on hover */
box-shadow: 0 4px 10px rgba(40, 167, 69, 0.35);
}
button:active {
background-color: #1e7e34;
}
button:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.35);
}
/* ================= TABLE (if used in this page) ================= */
.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: #007bff;
color: white;
text-align: center;
}
tr:nth-child(even) {
background-color: #f0f8ff;
}
td:first-child,
th:first-child {
text-align: left;
}
/* Full width rows (span 2 columns) */
.form-group {
display: flex;
flex-direction: column;
}
.form-group.full-width {
grid-column: span 2;
}
/* Special case: two inputs inside one form-group */
.form-group.inline-2 {
flex-direction: row;
gap: 15px;
}
.form-group.inline-2>div {
flex: 1;
}

214
static/css/add_itat.css Normal file
View File

@@ -0,0 +1,214 @@
/* ================= GLOBAL ================= */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Segoe UI", sans-serif;
}
body {
background-color: #f0f4ff;
/* very light blue background */
display: flex;
}
a {
text-decoration: none !important;
}
/* ================= 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);
gap: 10px;
}
.nav-left {
display: flex;
align-items: center;
gap: 15px;
}
.nav-logo {
height: 80px;
filter: brightness(0) invert(1);
}
.toggle-btn {
font-size: 26px;
cursor: pointer;
}
/* ================= 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 #e0e0e0;
display: flex;
flex-direction: column;
z-index: 0;
transition: 0.3s;
}
.sidebar.hide {
left: -250px;
}
.sidebar h2 {
color: #007bff;
text-align: center;
margin-bottom: 20px;
font-size: 22px;
}
.menu-btn {
padding: 14px 20px;
font-size: 17px;
color: #007bff;
cursor: pointer;
border-bottom: 1px solid #e0e0e0;
transition: 0.2s;
}
.menu-btn:hover {
background: #cce5ff;
color: #0056b3;
}
.submenu {
display: none;
background: #f0f8ff;
}
.submenu a {
display: block;
padding: 12px 35px;
color: #007bff;
border-bottom: 1px solid #e0e0e0;
transition: 0.2s;
}
.submenu a:hover {
background: #cce5ff;
color: #004085;
}
/* ================= LOGOUT ================= */
.sidebar-logout {
margin-top: auto;
padding: 10px 16px;
background: #007bff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6px;
text-decoration: none;
color: white;
}
.sidebar-logout:hover {
background: #a2cdfa;
}
.logout-icon {
width: 22px;
height: 22px;
}
/* ================= MAIN CONTENT ================= */
.main {
margin-left: 260px;
width: calc(100% - 260px);
padding: 30px;
margin-top: 80px;
transition: 0.3s;
}
/* ================= CONTAINER ================= */
.container {
background: white;
padding: 30px;
width: 95%;
max-width: 700px;
margin: auto;
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
/* ================= FORM ================= */
.form-group {
margin-bottom: 15px;
}
form label {
display: block;
margin-bottom: 6px;
font-weight: bold;
}
form input,
form select {
padding: 10px;
width: 100%;
border: 1px solid #ccc;
border-radius: 6px;
background-color: #f8f9ff;
outline: none;
transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
input:focus,
select:focus {
border-color: #007bff;
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}
/* ================= SUBMIT BUTTON (GREEN) ================= */
button {
width: 60%;
margin-top: 20px;
margin-left: 20%;
padding: 12px 20px;
background-color: #28a745;
/* Bootstrap green */
color: #ffffff;
border: none;
cursor: pointer;
border-radius: 6px;
font-weight: 600;
font-size: 15px;
transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
button:hover {
background-color: #218838;
/* Darker green on hover */
box-shadow: 0 4px 10px rgba(40, 167, 69, 0.35);
}
button:active {
background-color: #1e7e34;
}
button:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.35);
}

155
static/css/add_itr.css Normal file
View File

@@ -0,0 +1,155 @@
/* ================= RESET ================= */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Segoe UI", sans-serif;
}
body {
background-color: #f0f4ff;
/* very light blue background */
}
/* ================= CONTAINER ================= */
.container {
max-width: 90%;
margin: 20px 20px 20px 20px;
/* top margin to clear navbar */
background: white;
padding: 10%;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.no-record {
text-align: center;
font-size: 18px;
margin-top: 20px;
color: #555;
padding: 15px;
background: #f9f9f9;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
/* ================= FORM ================= */
form label {
display: block;
margin-top: 10px;
font-weight: bold;
color: #000000;
/* dark blue text */
}
form input,
form select {
width: 100%;
padding: 10px;
margin-top: 6px;
border: 1px solid #ccc;
border-radius: 6px;
outline: none;
}
form input:focus,
form select:focus {
border-color: #0056b3;
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}
.auto {
padding: 10px 12px;
border: 1px solid #ccd1d9;
border-radius: 6px;
font-size: 15px;
background-color: #d5edd7;
transition: all 0.25s ease-in-out;
}
/* ================= SUBMIT BUTTON (GREEN) ================= */
button {
width: 60%;
margin-top: 20px;
margin-left: 20%;
padding: 12px 20px;
background-color: #28a745;
/* Bootstrap green */
color: #ffffff;
border: none;
cursor: pointer;
border-radius: 6px;
font-weight: 600;
font-size: 15px;
transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
button:hover {
background-color: #218838;
/* Darker green on hover */
box-shadow: 0 4px 10px rgba(40, 167, 69, 0.35);
}
button:active {
background-color: #1e7e34;
}
button:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.35);
}
/* ================= TABLE (if used in this page) ================= */
.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: #007bff;
color: white;
text-align: center;
}
tr:nth-child(even) {
background-color: #f0f8ff;
}
td:first-child,
th:first-child {
text-align: left;
}
/* Full width rows (span 2 columns) */
.form-group {
display: flex;
flex-direction: column;
}
.form-group.full-width {
grid-column: span 2;
}
/* Special case: two inputs inside one form-group */
.form-group.inline-2 {
flex-direction: row;
gap: 15px;
}
.form-group.inline-2>div {
flex: 1;
}

View File

@@ -1,151 +0,0 @@
/* ================= 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

@@ -1,20 +1,12 @@
/* ================= RESET ================= */ /* ================= GLOBAL ================= */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
/* ================= BODY ================= */
body { body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background-color: #f4f7f9; background-color: #f4f7f9;
height: 100vh; margin: 0;
overflow: hidden; padding: 0;
/* no scroll desktop */ display: flex;
} }
/* ================= LINKS ================= */
a { a {
text-decoration: none !important; text-decoration: none !important;
color: #007bff; color: #007bff;
@@ -44,7 +36,7 @@ a {
} }
.nav-logo { .nav-logo {
height: 70px; height: 80px;
filter: brightness(0) invert(1); filter: brightness(0) invert(1);
} }
@@ -62,6 +54,7 @@ a {
top: 60px; top: 60px;
left: 0; left: 0;
padding-top: 20px; padding-top: 20px;
overflow-y: auto;
border-right: 1px solid #d6d6d6; border-right: 1px solid #d6d6d6;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -75,15 +68,17 @@ a {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding-bottom: 20px;
} }
.menu-btn { .menu-btn {
padding: 14px 20px; padding: 14px 20px;
font-size: 16px; font-size: 17px;
color: #007bff; color: #007bff;
font-weight: 600;
cursor: pointer; cursor: pointer;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
transition: 0.2s;
font-weight: 600;
} }
.menu-btn:hover { .menu-btn:hover {
@@ -96,142 +91,117 @@ a {
} }
.submenu a { .submenu a {
padding: 12px 35px;
display: block; display: block;
padding: 12px 35px;
color: #0056b3; color: #0056b3;
border-bottom: 1px solid #e2eaff;
transition: 0.2s;
}
.submenu a:hover {
background: #e9f3ff;
}
.sidebar-logout {
margin-top: auto;
padding: 10px 16px;
background: #007bff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6px;
color: white;
cursor: pointer;
transition: 0.2s;
}
.sidebar-logout:hover {
background: #006ae6;
}
.logout-icon {
width: 22px;
height: 22px;
} }
/* ================= MAIN ================= */ /* ================= MAIN ================= */
.main { .main {
margin-left: 250px; margin-left: 260px;
margin-top: 60px; margin-top: 80px;
width: calc(100% - 250px);
height: calc(100vh - 60px);
display: flex;
align-items: center;
/* ✅ vertical center */
justify-content: center;
/* ✅ horizontal center */
padding: 30px; padding: 30px;
width: calc(100% - 260px);
} }
/* ================= CONTAINER ================= */
.container { .container {
width: 100%; max-width: 600px;
max-width: 680px; margin: auto;
/* 🔥 laptop & desktop size */ background: #fff;
background: #ffffff; padding: 35px 40px;
padding: 45px 55px; border-radius: 10px;
border-radius: 14px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
text-align: center; text-align: center;
} }
/* ================= HEADING ================= */ h2 {
.container h2 { color: #2c3e50;
font-size: 28px;
font-weight: 700;
color: #1f2d3d;
margin-bottom: 25px; margin-bottom: 25px;
} font-weight: 600;
/* ================= FORM ================= */
form {
display: flex;
flex-direction: column;
align-items: center;
} }
/* ================= FORM ELEMENTS ================= */ /* ================= FORM ELEMENTS ================= */
label { label {
font-weight: 600; font-weight: 600;
margin-bottom: 6px; display: block;
margin-top: 10px;
color: #333; color: #333;
} }
select { select {
width: 100%; padding: 10px 14px;
max-width: 320px;
padding: 12px 14px;
border-radius: 8px;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 6px;
width: 100%;
max-width: 250px;
margin-top: 8px;
font-size: 16px; font-size: 16px;
color: #333;
cursor: pointer;
transition: 0.2s;
} }
select:focus { select:focus {
border-color: #007bff; border-color: #007bff;
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
outline: none; outline: none;
box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.18);
} }
/* ================= BUTTON ================= */ /* ================= BUTTONS ================= */
button { button {
margin-top: 22px; margin-top: 25px;
width: 100%; padding: 12px 25px;
max-width: 320px;
padding: 13px;
font-size: 16px;
font-weight: 600;
background-color: #007bff; background-color: #007bff;
color: white; color: white;
border: none; border: none;
border-radius: 8px; border-radius: 6px;
cursor: pointer; cursor: pointer;
font-size: 16px;
font-weight: 600;
transition: 0.2s;
} }
button:hover { button:hover {
background-color: #0069d9; background-color: #0069d9;
} }
/* ================= LAPTOP ================= */ /* Optional: responsive adjustments */
@media (max-width: 1400px) { @media (max-width: 768px) {
.container {
max-width: 620px;
padding: 40px 48px;
}
}
/* ================= TABLET ================= */
@media (max-width: 992px) {
body {
overflow-y: auto;
}
.main { .main {
margin-left: 0; margin-left: 0;
width: 100%; width: 100%;
height: auto; padding: 20px;
padding: 40px 20px;
} }
.container { select {
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%; max-width: 100%;
} }
} }

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

@@ -0,0 +1,207 @@
/* ================= GLOBAL ================= */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background-color: #f4f7f9;
margin: 0;
padding: 0;
display: flex;
}
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: 80px;
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;
overflow-y: auto;
border-right: 1px solid #d6d6d6;
display: flex;
flex-direction: column;
}
.sidebar.hide {
left: -250px;
}
.menu-items {
flex: 1;
display: flex;
flex-direction: column;
padding-bottom: 20px;
}
.menu-btn {
padding: 14px 20px;
font-size: 17px;
color: #007bff;
cursor: pointer;
border-bottom: 1px solid #e5e5e5;
transition: 0.2s;
font-weight: 600;
}
.menu-btn:hover {
background: #e9f3ff;
}
.submenu {
display: none;
background: #f4faff;
}
.submenu a {
display: block;
padding: 12px 35px;
color: #0056b3;
border-bottom: 1px solid #e2eaff;
transition: 0.2s;
}
.submenu a:hover {
background: #e9f3ff;
}
.sidebar-logout {
margin-top: auto;
padding: 10px 16px;
background: #007bff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6px;
color: white;
cursor: pointer;
transition: 0.2s;
}
.sidebar-logout:hover {
background: #006ae6;
}
.logout-icon {
width: 22px;
height: 22px;
}
/* ================= MAIN ================= */
.main {
margin-left: 260px;
margin-top: 80px;
padding: 30px;
width: calc(100% - 260px);
}
.container {
max-width: 600px;
margin: auto;
background: #fff;
padding: 35px 40px;
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
text-align: center;
}
h2 {
color: #2c3e50;
margin-bottom: 25px;
font-weight: 600;
}
/* ================= FORM ELEMENTS ================= */
label {
font-weight: 600;
display: block;
margin-top: 10px;
color: #333;
}
select {
padding: 10px 14px;
border: 1px solid #ccc;
border-radius: 6px;
width: 100%;
max-width: 250px;
margin-top: 8px;
font-size: 16px;
color: #333;
cursor: pointer;
transition: 0.2s;
}
select:focus {
border-color: #007bff;
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
outline: none;
}
/* ================= BUTTONS ================= */
button {
margin-top: 25px;
padding: 12px 25px;
background-color: #007bff;
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 16px;
font-weight: 600;
transition: 0.2s;
}
button:hover {
background-color: #0069d9;
}
/* Optional: responsive adjustments */
@media (max-width: 768px) {
.main {
margin-left: 0;
width: 100%;
padding: 20px;
}
select {
max-width: 100%;
}
}

255
static/css/display_ao.css Normal file
View File

@@ -0,0 +1,255 @@
/* ================= 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; /* primary blue */
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);
gap: 10px;
}
.nav-logo {
height: 80px;
width: auto;
filter: brightness(0) invert(1);
}
.toggle-btn {
font-size: 26px;
cursor: pointer;
}
.nav-left {
display: flex;
align-items: center;
gap: 15px;
}
/* ================= 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 #e0e0e0;
display: flex;
flex-direction: column;
z-index: 0;
transition: 0.3s;
}
.sidebar.hide {
left: -250px;
}
.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 #e0e0e0;
transition: 0.2s;
}
.menu-btn:hover {
background: #cce5ff;
color: #0056b3;
}
.submenu {
display: none;
background: #f0f8ff;
}
.submenu a {
display: block;
padding: 12px 35px;
color: #007bff;
text-decoration: none;
border-bottom: 1px solid #e0e0e0;
transition: 0.2s;
}
.submenu a:hover {
background: #cce5ff;
color: #004085;
}
.no-record {
text-align: center;
font-size: 18px;
margin-top: 20px;
color: #555;
padding: 15px;
background: #f9f9f9;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
/* ================= LOGOUT ================= */
.sidebar-logout {
margin-top: auto;
padding: 10px 16px;
background: #007bff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6px;
text-decoration: none;
color: white;
}
.sidebar-logout:hover {
background: #a2cdfa;
}
.logout-icon {
width: 22px;
height: 22px;
}
/* ================= MAIN CONTENT ================= */
.main {
margin-left: 260px;
padding: 30px;
width: calc(100% - 260px);
margin-top: 80px;
position: relative;
z-index: 1;
transition: 0.3s;
}
a {
text-decoration: none;
}
/* ================= CONTAINER ================= */
.container {
max-width: 95%;
margin: auto;
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
position: relative;
z-index: 2;
}
/* ================= BUTTONS ================= */
.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;
position: absolute; /* Pins button to the right side */
right: 0;
}
.btn-update {
background-color: #007bff;
}
.btn-delete {
background-color: #dc3545;
}
/* ================= TABLE ================= */
.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: #007bff;
color: white;
text-align: center;
}
tr:nth-child(even) {
background-color: #f0f8ff;
}
td:first-child,
th:first-child {
text-align: left;
}
.action-cell form {
display: inline-block;
margin-left: 5px;
}
/* ================= BACK BUTTON ================= */
.back-btn {
display: inline-block;
margin-bottom: 20px;
padding: 10px 18px;
background: #007bff;
color: white;
font-size: 15px;
font-weight: 600;
border-radius: 6px;
text-decoration: none;
transition: background 0.3s ease;
}
.back-btn:hover {
background: #0056b3;
}

251
static/css/display_cit.css Normal file
View File

@@ -0,0 +1,251 @@
/* ================= 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; /* primary blue */
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);
gap: 10px;
}
.nav-logo {
height: 80px;
width: auto;
filter: brightness(0) invert(1);
}
.toggle-btn {
font-size: 26px;
cursor: pointer;
}
.nav-left {
display: flex;
align-items: center;
gap: 15px;
}
/* ================= 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 #e0e0e0;
display: flex;
flex-direction: column;
z-index: 0;
transition: 0.3s;
}
.sidebar.hide {
left: -250px;
}
.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 #e0e0e0;
transition: 0.2s;
}
.menu-btn:hover {
background: #cce5ff;
color: #0056b3;
}
.submenu {
display: none;
background: #f0f8ff;
}
.submenu a {
display: block;
padding: 12px 35px;
color: #007bff;
text-decoration: none;
border-bottom: 1px solid #e0e0e0;
transition: 0.2s;
}
.submenu a:hover {
background: #cce5ff;
color: #004085;
}
.no-record {
text-align: center;
font-size: 18px;
margin-top: 20px;
color: #555;
padding: 15px;
background: #f9f9f9;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
/* ================= LOGOUT ================= */
.sidebar-logout {
margin-top: auto;
padding: 10px 16px;
background: #007bff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6px;
text-decoration: none;
color: white;
}
.sidebar-logout:hover {
background: #a2cdfa;
}
.logout-icon {
width: 22px;
height: 22px;
}
/* ================= MAIN CONTENT ================= */
.main {
margin-left: 20px;
padding: 8px;
width: calc(100% - 50px);
margin-top: 50px;
position: relative;
z-index: 5;
transition: 0.3s;
}
a {
text-decoration: none;
}
/* ================= CONTAINER ================= */
.container {
max-width: 95%;
margin: auto;
background: white;
padding: 8px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
position: relative;
z-index: 2;
}
/* ================= BUTTONS ================= */
.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;
}
/* ================= TABLE ================= */
.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: #007bff;
color: white;
text-align: center;
}
tr:nth-child(even) {
background-color: #f0f8ff;
}
td:first-child,
th:first-child {
text-align: left;
}
.action-cell form {
display: inline-block;
margin-left: 5px;
}
/* ================= BACK BUTTON ================= */
.back-btn {
display: inline-block;
margin-bottom: 20px;
padding: 10px 18px;
background: #007bff;
color: white;
font-size: 15px;
font-weight: 600;
border-radius: 6px;
text-decoration: none;
transition: background 0.3s ease;
}
.back-btn:hover {
background: #0056b3;
}

254
static/css/display_itat.css Normal file
View File

@@ -0,0 +1,254 @@
/* ================= 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; /* primary blue */
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);
gap: 10px;
}
.nav-logo {
height: 80px;
width: auto;
filter: brightness(0) invert(1);
}
.toggle-btn {
font-size: 26px;
cursor: pointer;
}
.nav-left {
display: flex;
align-items: center;
gap: 15px;
}
/* ================= 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 #e0e0e0;
display: flex;
flex-direction: column;
z-index: 0;
transition: 0.3s;
}
.sidebar.hide {
left: -250px;
}
.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 #e0e0e0;
transition: 0.2s;
}
.menu-btn:hover {
background: #cce5ff;
color: #0056b3;
}
.submenu {
display: none;
background: #f0f8ff;
}
.submenu a {
display: block;
padding: 12px 35px;
color: #007bff;
text-decoration: none;
border-bottom: 1px solid #e0e0e0;
transition: 0.2s;
}
.submenu a:hover {
background: #cce5ff;
color: #004085;
}
.no-record {
text-align: center;
font-size: 18px;
margin-top: 20px;
color: #555;
padding: 15px;
background: #f9f9f9;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
/* ================= LOGOUT ================= */
.sidebar-logout {
margin-top: auto;
padding: 10px 16px;
background: #007bff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6px;
text-decoration: none;
color: white;
}
.sidebar-logout:hover {
background: #a2cdfa;
}
.logout-icon {
width: 22px;
height: 22px;
}
/* ================= MAIN CONTENT ================= */
.main {
margin-left: 20px;
padding: 8px;
width: calc(100% - 50px);
margin-top: 50px;
position: relative;
z-index: 5;
transition: 0.3s;
}
a {
text-decoration: none;
}
/* ================= CONTAINER ================= */
.container {
max-width: 95%;
margin: auto;
background: white ;
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
position: relative;
z-index: 2;
}
/* ================= BUTTONS ================= */
.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;
}
/* ================= TABLE ================= */
.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: #007bff;
color: white;
text-align: center;
}
tr:nth-child(even) {
background-color: #f0f8ff;
}
td:first-child,
th:first-child {
text-align: left;
}
.action-cell form {
display: inline-block;
margin-left: 5px;
}
/* ================= BACK BUTTON ================= */
.back-btn {
display: inline-block;
margin-bottom: 20px;
padding: 10px 18px;
background: #007bff;
color: white;
font-size: 15px;
font-weight: 600;
border-radius: 6px;
text-decoration: none;
transition: background 0.3s ease;
}
.back-btn:hover {
background: #0056b3;
}

251
static/css/display_itr.css Normal file
View File

@@ -0,0 +1,251 @@
/* ================= 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; /* primary blue */
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);
gap: 10px;
}
.nav-logo {
height: 80px;
width: auto;
filter: brightness(0) invert(1);
}
.toggle-btn {
font-size: 26px;
cursor: pointer;
}
.nav-left {
display: flex;
align-items: center;
gap: 15px;
}
/* ================= 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 #e0e0e0;
display: flex;
flex-direction: column;
z-index: 0;
transition: 0.3s;
}
.sidebar.hide {
left: -250px;
}
.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 #e0e0e0;
transition: 0.2s;
}
.menu-btn:hover {
background: #cce5ff;
color: #0056b3;
}
.submenu {
display: none;
background: #f0f8ff;
}
.submenu a {
display: block;
padding: 12px 35px;
color: #007bff;
text-decoration: none;
border-bottom: 1px solid #e0e0e0;
transition: 0.2s;
}
.submenu a:hover {
background: #cce5ff;
color: #004085;
}
.no-record {
text-align: center;
font-size: 18px;
margin-top: 20px;
color: #555;
padding: 15px;
background: #f9f9f9;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
/* ================= LOGOUT ================= */
.sidebar-logout {
margin-top: auto;
padding: 10px 16px;
background: #007bff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6px;
text-decoration: none;
color: white;
}
.sidebar-logout:hover {
background: #a2cdfa;
}
.logout-icon {
width: 22px;
height: 22px;
}
/* ================= MAIN CONTENT ================= */
.main {
margin-left: 260px;
padding: 30px;
width: calc(100% - 260px);
margin-top: 80px;
position: relative;
z-index: 1;
transition: 0.3s;
}
a {
text-decoration: none;
}
/* ================= CONTAINER ================= */
.container {
max-width: 95%;
margin: auto;
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
position: relative;
z-index: 2;
}
/* ================= BUTTONS ================= */
.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;
}
/* ================= TABLE ================= */
.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: #007bff;
color: white;
text-align: center;
}
tr:nth-child(even) {
background-color: #f0f8ff;
}
td:first-child,
th:first-child {
text-align: left;
}
.action-cell form {
display: inline-block;
margin-left: 5px;
}
/* ================= BACK BUTTON ================= */
.back-btn {
display: inline-block;
margin-bottom: 20px;
padding: 10px 18px;
background: #007bff;
color: white;
font-size: 15px;
font-weight: 600;
border-radius: 6px;
text-decoration: none;
transition: background 0.3s ease;
}
.back-btn:hover {
background: #0056b3;
}

View File

@@ -1,189 +0,0 @@
/* ================= 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;
}
}

View File

@@ -2,24 +2,16 @@
body { body {
background-color: #f4f6f9; background-color: #f4f6f9;
font-family: "Segoe UI", Arial, sans-serif; font-family: "Segoe UI", Arial, sans-serif;
margin: 0;
padding: 0;
overflow-x: hidden;
/* prevent horizontal scroll for page */
} }
/* ================= MAIN CONTENT ================= */ /* ================= MAIN CONTENT FIX ================= */
/* base.html usually gives sidebar width ~250px */
.main { .main {
margin-left: 260px; margin-left: 260px;
/* sidebar width */ padding: 40px 30px;
padding: 70px 30px 40px 30px;
/* top padding for navbar */
overflow-x: hidden;
/* prevent horizontal scroll */
transition: margin-left 0.3s ease;
} }
/* ================= CONTAINER ================= */ /* ================= CARD / CONTAINER ================= */
.container { .container {
max-width: 1100px; max-width: 1100px;
margin: 0 auto; margin: 0 auto;
@@ -27,8 +19,6 @@ body {
padding: 35px 40px; padding: 35px 40px;
border-radius: 12px; border-radius: 12px;
box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
overflow-x: hidden;
/* prevent horizontal scroll */
} }
/* ================= HEADING ================= */ /* ================= HEADING ================= */
@@ -62,6 +52,7 @@ form select {
font-size: 14px; font-size: 14px;
} }
/* APPLY BUTTON (GREEN) */
form button { form button {
background-color: #28a745; background-color: #28a745;
color: #ffffff; color: #ffffff;
@@ -71,32 +62,19 @@ form button {
font-size: 15px; font-size: 15px;
font-weight: 600; font-weight: 600;
cursor: pointer; cursor: pointer;
transition: background 0.3s ease;
} }
form button:hover { form button:hover {
background-color: #218838; 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 ================= */
table { table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
font-size: 14px; font-size: 14px;
min-width: 700px;
/* ensures horizontal scroll on small screens */
} }
/* Table Head */
thead { thead {
background-color: #0d6efd; background-color: #0d6efd;
color: #ffffff; color: #ffffff;
@@ -108,7 +86,6 @@ thead th {
font-weight: 600; font-weight: 600;
} }
/* Table Body */
tbody td { tbody td {
padding: 12px; padding: 12px;
text-align: center; text-align: center;
@@ -123,7 +100,7 @@ tbody tr:hover {
background-color: #eef4ff; background-color: #eef4ff;
} }
/* Table action buttons */ /* ================= ACTION LINKS ================= */
table a { table a {
text-decoration: none; text-decoration: none;
color: #ffffff; color: #ffffff;
@@ -131,9 +108,9 @@ table a {
border-radius: 6px; border-radius: 6px;
font-size: 13px; font-size: 13px;
display: inline-block; display: inline-block;
transition: background 0.3s ease;
} }
/* Download button */
table a[href*="download"] { table a[href*="download"] {
background-color: #17a2b8; background-color: #17a2b8;
} }
@@ -142,6 +119,7 @@ table a[href*="download"]:hover {
background-color: #138496; background-color: #138496;
} }
/* View button */
table a[href*="view"] { table a[href*="view"] {
background-color: #20c997; background-color: #20c997;
} }
@@ -151,12 +129,10 @@ table a[href*="view"]:hover {
} }
/* ================= RESPONSIVE ================= */ /* ================= RESPONSIVE ================= */
/* Medium screens: tablets */
@media (max-width: 992px) { @media (max-width: 992px) {
.main { .main {
margin-left: 0; margin-left: 0;
padding: 50px 20px 20px 20px; padding: 20px;
} }
form { form {
@@ -169,39 +145,3 @@ table a[href*="view"]:hover {
width: 100%; 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;
}
}

View File

@@ -1,4 +1,4 @@
/* ================= RESET ================= */ /* RESET */
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
@@ -11,12 +11,13 @@ body {
display: flex; display: flex;
} }
/* ================= NAVBAR ================= */ /* NAVBAR */
.navbar { .navbar {
width: 100%; width: 100%;
height: 60px; height: 60px;
background-color: #007bff; background-color: #007bff;
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
padding: 0 20px; padding: 0 20px;
position: fixed; position: fixed;
@@ -25,6 +26,18 @@ body {
color: white; color: white;
z-index: 1000; z-index: 1000;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
gap: 10px;
}
.nav-logo {
height: 80px;
width: auto;
filter: brightness(0) invert(1);
}
.toggle-btn {
font-size: 26px;
cursor: pointer;
} }
.nav-left { .nav-left {
@@ -33,19 +46,7 @@ body {
gap: 15px; gap: 15px;
} }
.nav-logo { /* SIDEBAR */
height: 46px;
filter: brightness(0) invert(1);
}
.toggle-btn {
font-size: 26px;
cursor: pointer;
display: none;
/* hidden on desktop */
}
/* ================= SIDEBAR ================= */
.sidebar { .sidebar {
width: 250px; width: 250px;
background: #ffffff; background: #ffffff;
@@ -57,10 +58,15 @@ body {
overflow-y: auto; overflow-y: auto;
border-right: 1px solid #e5d1be; border-right: 1px solid #e5d1be;
transition: 0.3s; transition: 0.3s;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.sidebar.hide {
left: -250px;
}
.sidebar h2 { .sidebar h2 {
color: #007bff; color: #007bff;
text-align: center; text-align: center;
@@ -82,7 +88,6 @@ body {
background: #88ccfa; background: #88ccfa;
} }
/* Submenu */
.submenu { .submenu {
display: none; display: none;
background: #ffffff; background: #ffffff;
@@ -99,16 +104,19 @@ body {
.submenu a:hover { .submenu a:hover {
background: #b3dbf7; background: #b3dbf7;
color: #007bff;
} }
/* Logout */ /* Logout */
.sidebar-logout { .sidebar-logout {
margin-top: auto; margin-top: auto;
padding: 12px; padding: 10px 16px;
background: #007bff; background: #007bff;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center;
border-radius: 6px; border-radius: 6px;
text-decoration: none;
} }
.sidebar-logout:hover { .sidebar-logout:hover {
@@ -120,12 +128,18 @@ body {
height: 22px; height: 22px;
} }
/* ================= MAIN ================= */ /* MAIN CONTENT */
.main { .main {
margin-left: 250px; margin-left: 260px;
margin-top: 60px;
padding: 30px; padding: 30px;
width: calc(100% - 250px); width: calc(100% - 260px);
margin-top: 80px;
transition: 0.3s;
}
.main.collapsed {
margin-left: 20px;
width: calc(100% - 40px);
} }
/* Container */ /* Container */
@@ -133,87 +147,19 @@ body {
background: white; background: white;
padding: 40px; padding: 40px;
border-radius: 12px; border-radius: 12px;
max-width: 900px; max-width: 800px;
margin: auto; margin: auto;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
} }
/* ================= TABLET ================= */ .header {
@media (max-width: 992px) { font-size: 32px;
.nav-left h3 { color: #2c3e50;
font-size: 16px; text-align: center;
max-width: 200px; margin-bottom: 20px;
white-space: nowrap; font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
}
.nav-logo {
height: 40px;
}
/* sidebar still visible */
.sidebar {
width: 220px;
}
.main {
margin-left: 220px;
width: calc(100% - 220px);
}
} }
/* ================= MOBILE ================= */ a {
@media (max-width: 768px) { text-decoration: none;
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;
}
} }

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

@@ -0,0 +1,207 @@
/* ================= GLOBAL ================= */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background-color: #f4f7f9;
margin: 0;
padding: 0;
display: flex;
}
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: 80px;
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;
overflow-y: auto;
border-right: 1px solid #d6d6d6;
display: flex;
flex-direction: column;
}
.sidebar.hide {
left: -250px;
}
.menu-items {
flex: 1;
display: flex;
flex-direction: column;
padding-bottom: 20px;
}
.menu-btn {
padding: 14px 20px;
font-size: 17px;
color: #007bff;
cursor: pointer;
border-bottom: 1px solid #e5e5e5;
transition: 0.2s;
font-weight: 600;
}
.menu-btn:hover {
background: #e9f3ff;
}
.submenu {
display: none;
background: #f4faff;
}
.submenu a {
display: block;
padding: 12px 35px;
color: #0056b3;
border-bottom: 1px solid #e2eaff;
transition: 0.2s;
}
.submenu a:hover {
background: #e9f3ff;
}
.sidebar-logout {
margin-top: auto;
padding: 10px 16px;
background: #007bff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6px;
color: white;
cursor: pointer;
transition: 0.2s;
}
.sidebar-logout:hover {
background: #006ae6;
}
.logout-icon {
width: 22px;
height: 22px;
}
/* ================= MAIN ================= */
.main {
margin-left: 260px;
margin-top: 80px;
padding: 30px;
width: calc(100% - 260px);
}
.container {
max-width: 600px;
margin: auto;
background: #fff;
padding: 35px 40px;
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
text-align: center;
}
h2 {
color: #2c3e50;
margin-bottom: 25px;
font-weight: 600;
}
/* ================= FORM ELEMENTS ================= */
label {
font-weight: 600;
display: block;
margin-top: 10px;
color: #333;
}
select {
padding: 10px 14px;
border: 1px solid #ccc;
border-radius: 6px;
width: 100%;
max-width: 250px;
margin-top: 8px;
font-size: 16px;
color: #333;
cursor: pointer;
transition: 0.2s;
}
select:focus {
border-color: #007bff;
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
outline: none;
}
/* ================= BUTTONS ================= */
button {
margin-top: 25px;
padding: 12px 25px;
background-color: #007bff;
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 16px;
font-weight: 600;
transition: 0.2s;
}
button:hover {
background-color: #0069d9;
}
/* Optional: responsive adjustments */
@media (max-width: 768px) {
.main {
margin-left: 0;
width: 100%;
padding: 20px;
}
select {
max-width: 100%;
}
}

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

@@ -0,0 +1,207 @@
/* ================= GLOBAL ================= */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background-color: #f4f7f9;
margin: 0;
padding: 0;
display: flex;
}
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: 80px;
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;
overflow-y: auto;
border-right: 1px solid #d6d6d6;
display: flex;
flex-direction: column;
}
.sidebar.hide {
left: -250px;
}
.menu-items {
flex: 1;
display: flex;
flex-direction: column;
padding-bottom: 20px;
}
.menu-btn {
padding: 14px 20px;
font-size: 17px;
color: #007bff;
cursor: pointer;
border-bottom: 1px solid #e5e5e5;
transition: 0.2s;
font-weight: 600;
}
.menu-btn:hover {
background: #e9f3ff;
}
.submenu {
display: none;
background: #f4faff;
}
.submenu a {
display: block;
padding: 12px 35px;
color: #0056b3;
border-bottom: 1px solid #e2eaff;
transition: 0.2s;
}
.submenu a:hover {
background: #e9f3ff;
}
.sidebar-logout {
margin-top: auto;
padding: 10px 16px;
background: #007bff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6px;
color: white;
cursor: pointer;
transition: 0.2s;
}
.sidebar-logout:hover {
background: #006ae6;
}
.logout-icon {
width: 22px;
height: 22px;
}
/* ================= MAIN ================= */
.main {
margin-left: 260px;
margin-top: 80px;
padding: 30px;
width: calc(100% - 260px);
}
.container {
max-width: 600px;
margin: auto;
background: #fff;
padding: 35px 40px;
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
text-align: center;
}
h2 {
color: #2c3e50;
margin-bottom: 25px;
font-weight: 600;
}
/* ================= FORM ELEMENTS ================= */
label {
font-weight: 600;
display: block;
margin-top: 10px;
color: #333;
}
select {
padding: 10px 14px;
border: 1px solid #ccc;
border-radius: 6px;
width: 100%;
max-width: 250px;
margin-top: 8px;
font-size: 16px;
color: #333;
cursor: pointer;
transition: 0.2s;
}
select:focus {
border-color: #007bff;
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
outline: none;
}
/* ================= BUTTONS ================= */
button {
margin-top: 25px;
padding: 12px 25px;
background-color: #007bff;
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 16px;
font-weight: 600;
transition: 0.2s;
}
button:hover {
background-color: #0069d9;
}
/* Optional: responsive adjustments */
@media (max-width: 768px) {
.main {
margin-left: 0;
width: 100%;
padding: 20px;
}
select {
max-width: 100%;
}
}

View File

@@ -1,169 +0,0 @@
/* ================= 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;
}
}

View File

@@ -1,7 +1,5 @@
/* ========================= /* ===== CONTAINER ===== */
CONTAINER .container {
========================= */
.mat-container {
max-width: 1200px; max-width: 1200px;
margin: 30px auto; margin: 30px auto;
padding: 25px; padding: 25px;
@@ -10,94 +8,41 @@
box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
} }
.page-title { /* ===== TABLE ===== */
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 { #matTable {
width: 100%; width: 100%;
min-width: 900px;
border-collapse: collapse; border-collapse: collapse;
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
} }
/* ========================= /* ===== HEADER ===== */
HEADER
========================= */
#matTable thead th { #matTable thead th {
background: linear-gradient(135deg, #0d6efd, #0a58ca); background: linear-gradient(135deg, #0d6efd, #0a58ca);
color: #ffffff; color: #ffffff;
padding: 12px 8px; padding: 12px 8px;
border: 1px solid #0a58ca; border: 1px solid #0a58ca;
font-weight: 600;
white-space: nowrap; white-space: nowrap;
} }
/* ========================= /* ===== BODY CELLS ===== */
BODY CELLS
========================= */
#matTable tbody td { #matTable tbody td {
padding: 8px; padding: 8px;
border: 1px solid #dcdcdc; border: 1px solid #dcdcdc;
background-color: #ffffff; background-color: #ffffff;
} }
/* ===== FY COLUMN ===== */
#matTable tbody td:first-child { #matTable tbody td:first-child {
font-weight: 600; font-weight: 600;
background-color: #f5f8ff; background-color: #f5f8ff;
} }
/* ========================= /* ===== INPUT FIELDS ===== */
INPUTS
========================= */
#matTable input { #matTable input {
width: 100%; width: 100%;
padding: 6px; padding: 6px 6px;
border: 1px solid #cfd8dc; border: 1px solid #cfd8dc;
border-radius: 4px; border-radius: 4px;
font-size: 13px; font-size: 13px;
@@ -105,15 +50,19 @@
box-sizing: border-box; box-sizing: border-box;
} }
/* TEXT INPUT (Unutilized) */
#matTable input[type="text"] {
text-align: center;
}
/* INPUT FOCUS */
#matTable input:focus { #matTable input:focus {
border-color: #0d6efd; border-color: #0d6efd;
box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15); box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
outline: none; outline: none;
} }
/* ========================= /* ===== ACTION BUTTON ===== */
BUTTONS
========================= */
#matTable button { #matTable button {
background-color: #198754; background-color: #198754;
border: none; border: none;
@@ -122,88 +71,76 @@
border-radius: 4px; border-radius: 4px;
cursor: pointer; cursor: pointer;
font-size: 13px; font-size: 13px;
transition: 0.2s;
} }
#matTable button:hover { #matTable button:hover {
background-color: #157347; background-color: #157347;
} }
.add-row-btn { /* ===== SAVE ALL BUTTON ===== */
background-color: #0d6efd; button[onclick="saveAll()"] {
display: block;
width: 300px;
margin: 25px auto 0;
background-color: #28a745;
color: #fff; color: #fff;
font-size: 16px;
font-weight: 600;
padding: 12px;
border-radius: 8px;
border: none; border: none;
padding: 8px 18px;
border-radius: 6px;
cursor: pointer; cursor: pointer;
} }
.add-row-btn:hover { button[onclick="saveAll()"]:hover {
background-color: #0b5ed7; background-color: #218838;
} }
/* ========================= /* ===== ROW HOVER ===== */
ROW STATES
========================= */
#matTable tbody tr:hover { #matTable tbody tr:hover {
background-color: #f1f6ff; background-color: #f1f6ff;
} }
/* ===== ERROR HIGHLIGHT ===== */
.input-error { .input-error {
border-color: #dc3545 !important; border-color: #dc3545 !important;
background-color: #fff5f5; background-color: #fff5f5;
} }
/* ===== SUCCESS HIGHLIGHT ===== */
.row-saved { .row-saved {
background-color: #e9f7ef !important; background-color: #e9f7ef !important;
} }
/* ========================= /* ===== RESPONSIVE ===== */
ACTION FOOTER
========================= */
.action-footer {
margin-top: 15px;
}
/* =========================
MOBILE ONLY FIXES
(DOES NOT AFFECT DESKTOP)
========================= */
@media (max-width: 768px) { @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 { #matTable {
font-size: 12px; font-size: 12px;
min-width: 800px;
} }
#matTable input { #matTable thead {
font-size: 12px; display: none;
} }
#matTable button { #matTable tbody tr {
font-size: 12px; display: block;
padding: 5px 10px; margin-bottom: 15px;
border: 1px solid #ccc;
border-radius: 6px;
padding: 10px;
} }
/* ADD ROW BUTTON FULL WIDTH */ #matTable tbody td {
.add-row-btn { display: flex;
width: 50%; justify-content: space-between;
padding: 6px 8px;
border: none;
}
#matTable tbody td::before {
content: attr(data-label);
font-weight: 600;
color: #0d6efd;
} }
} }

View File

@@ -1,162 +1,76 @@
/* ================= RESET ================= */ /* ================= GLOBAL ================= */
* { * {
box-sizing: border-box;
margin: 0; margin: 0;
padding: 0; padding: 0;
box-sizing: border-box;
font-family: "Segoe UI", sans-serif;
} }
/* ================= BODY ================= */
body { body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f4f7f6;
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; display: flex;
align-items: center;
justify-content: center;
} }
/* ================= CONTAINER ================= */ a {
text-decoration: none !important;
color: #007bff;
}
/* ================= MAIN CONTENT ================= */
.main {
margin-left: 20px;
padding: 8px;
width: calc(100% - 50px);
margin-top: 50px;
position: relative;
z-index: 5;
transition: 0.3s;
}
.container { .container {
max-width: 900px; background: white;
width: 100%; padding: 30px;
background: #ffffff; width: 95%;
padding: 45px 55px; margin: auto;
border-radius: 16px; border-radius: 8px;
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
/* ⬇️ MOVE UP & LEFT */
transform: translate(-40px, -30px);
} }
/* ================= HEADING ================= */ h2 {
.container h2 { text-align: center;
font-size: 28px; margin-bottom: 20px;
font-weight: 700; color: #007bff;
color: #1f2d3d; }
margin-bottom: 32px;
ul {
list-style: none;
padding-left: 0;
margin-top: 20px;
text-align: center; text-align: center;
} }
/* ================= REPORT LIST ================= */ ul li {
ul { margin: 14px 0;
list-style: none;
display: grid;
grid-template-columns: 1fr;
gap: 18px;
} }
/* ================= REPORT BUTTONS ================= */
ul li a { ul li a {
display: flex; color: #007bff;
align-items: center; font-size: 18px;
justify-content: center;
padding: 20px;
background: linear-gradient(135deg, #f1f7ff, #e9f2ff);
border-radius: 12px;
color: #0056ff;
font-size: 17px;
font-weight: 600; font-weight: 600;
text-decoration: none; transition: 0.2s;
transition: all 0.3s ease;
border: 1px solid #e1ecff;
} }
ul li a:hover { ul li a:hover {
background: linear-gradient(135deg, #e3efff, #dbe9ff); color: #0056b3;
transform: translateY(-3px); text-decoration: underline;
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;
}
/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
.main { .main {
margin-left: 0; margin-left: 0;
width: 100%; width: 100%;
height: auto; padding: 20px;
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;
} }
} }

View File

@@ -1,157 +1,13 @@
/* ================= PAGE WRAPPER ================= */ /* ================= FORM ELEMENTS ================= */
.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 { form label {
display: block; display: block;
margin-top: 10px; margin-top: 10px;
font-weight: 600; font-weight: bold;
color: #333; 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 { select {
width: 100%; width: 100%;
max-width: 300px;
padding: 10px 12px; padding: 10px 12px;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 6px; border-radius: 6px;
@@ -164,115 +20,53 @@ select {
select:focus { select:focus {
border-color: #007bff; border-color: #007bff;
box-shadow: 0 0 5px rgba(0,123,255,0.5); box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
outline: none; outline: none;
} }
/* ================= DOWNLOAD BUTTON ================= */ /* ================= BUTTONS ================= */
#downloadBtn { button {
display: none; margin-top: 20px;
padding: 10px 20px; padding: 10px 18px;
font-size: 16px; background-color: #007bff;
background-color: #28a745; color: white;
color: #fff; border: none;
text-decoration: none; cursor: pointer;
border-radius: 4px; border-radius: 6px;
white-space: nowrap; font-size: 15px;
font-weight: 600;
transition: 0.3s; transition: 0.3s;
} }
#downloadBtn:hover { button:hover {
background-color: #218838; background-color: #0069d9;
} }
/* ================= TABLE PREVIEW ================= */
#previewContent {
max-height: 60vh;
overflow-y: auto;
overflow-x: auto;
width: 100%;
margin-top: 15px;
}
#previewContent table { .main {
width: 100%; margin-left: 20px;
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; padding: 8px;
} width: calc(100% - 50px);
margin-top: 50px;
position: relative;
z-index: 5;
transition: 0.3s;
} }
@media (max-width: 420px) { /* ================= BACK BUTTON ================= */
form input, .back-btn {
form select { display: inline-block;
font-size: 13px; margin-bottom: 20px;
padding: 9px; padding: 10px 18px;
} background-color: #007bff;
color: white;
font-size: 15px;
font-weight: 600;
border-radius: 6px;
text-decoration: none;
transition: 0.3s;
}
.back-btn:hover {
background-color: #006ae6;
} }

View File

@@ -1,101 +1,202 @@
/* ===== RESET ===== */ /* ================= GLOBAL ================= */
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
box-sizing: border-box; box-sizing: border-box;
font-family: "Segoe UI", Arial, sans-serif; font-family: "Segoe UI", sans-serif;
} }
/* ===== BODY ===== */
body { body {
background-color: #f4f7f6; background: #f4f7f6;
overflow: hidden;
/* NO SCROLL */
}
/* ===== MAIN AREA (NAVBAR ALREADY EXISTS) ===== */
.main {
margin-top: 70px;
/* height of navbar */
height: calc(100vh - 70px);
display: flex; display: flex;
justify-content: flex-start;
/* LEFT */
align-items: flex-start;
/* TOP */
padding: 20px;
} }
/* ===== FORM CONTAINER ===== */ a {
.container { text-decoration: none !important;
}
/* ================= NAVBAR ================= */
.navbar {
width: 100%; width: 100%;
max-width: 520px; height: 60px;
background: #ffffff; background-color: #007bff;
padding: 28px 30px; display: flex;
border-radius: 12px; justify-content: space-between;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12); align-items: center;
} padding: 0 20px;
position: fixed;
/* ===== HEADING ===== */ top: 0;
.container h2 { left: 0;
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; color: white;
border: none; z-index: 1000;
border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
font-size: 16px; }
font-weight: 600;
.nav-left {
display: flex;
align-items: center;
gap: 15px;
}
.nav-logo {
height: 80px;
filter: brightness(0) invert(1);
}
.toggle-btn {
font-size: 26px;
cursor: pointer; cursor: pointer;
} }
button:hover { /* ================= SIDEBAR ================= */
background-color: #0b5ed7; .sidebar {
} width: 250px;
background: white; /* ← clean white sidebar */
/* ===== MOBILE VIEW ===== */
@media (max-width: 768px) {
.main {
margin-top: 60px;
height: calc(100vh - 60px); height: calc(100vh - 60px);
padding: 12px; position: fixed;
} top: 60px;
left: 0;
.container { padding-top: 20px;
max-width: 100%; overflow-y: auto;
padding: 22px; border-right: 1px solid #d6d6d6;
} display: flex;
flex-direction: column;
.container h2 { z-index: 0;
font-size: 18px; }
}
.sidebar.hide {
left: -250px;
}
.menu-items {
flex: 1;
display: flex;
flex-direction: column;
padding-bottom: 20px;
}
.menu-btn {
padding: 14px 20px;
font-size: 17px;
color: #007bff; /* blue text */
cursor: pointer;
border-bottom: 1px solid #e5e5e5;
transition: 0.2s;
font-weight: 600;
}
.menu-btn:hover {
background: #e9f3ff; /* light blue hover */
}
.submenu {
display: none;
background: #f4faff; /* very light blue */
}
.submenu a {
display: block;
padding: 12px 35px;
color: #0056b3;
border-bottom: 1px solid #e2eaff;
transition: 0.2s;
}
.submenu a:hover {
background: #e9f3ff;
}
.sidebar-logout {
margin-top: auto;
padding: 10px 16px;
background: #007bff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 6px;
color: white;
}
.sidebar-logout:hover {
background: #006ae6;
}
.logout-icon {
width: 22px;
height: 22px;
}
/* ================= MAIN CONTENT ================= */
.main {
margin-left: 20px;
padding: 8px;
width: calc(100% - 50px);
margin-top: 50px;
position: relative;
z-index: 5;
transition: 0.3s;
}
/* ================= FORM CONTAINER ================= */
.container {
background: white;
padding: 30px;
width: 95%;
margin: auto;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
h2 {
text-align: center;
margin-bottom: 20px;
color: #007bff; /* blue heading */
}
form label {
display: block;
margin-top: 10px;
font-weight: bold;
color: #333;
}
form input,
select {
width: 100%;
padding: 10px;
margin-top: 6px;
border: 1px solid #ccc;
border-radius: 6px;
}
/* ================= BUTTONS ================= */
button {
margin-top: 20px;
padding: 10px 18px;
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
border-radius: 6px;
font-size: 15px;
}
button:hover {
background-color: #0069d9;
}
.back-btn {
display: inline-block;
margin-bottom: 20px;
padding: 10px 18px;
background: #007bff;
color: white;
font-size: 15px;
font-weight: 600;
border-radius: 6px;
transition: 0.3s;
}
.back-btn:hover {
background: #006ae6;
} }

View File

@@ -1,4 +1,5 @@
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
function getValue(id) { function getValue(id) {
var el = document.getElementsByName(id)[0]; var el = document.getElementsByName(id)[0];
return el ? parseFloat(el.value) || 0 : 0; return el ? parseFloat(el.value) || 0 : 0;
@@ -10,129 +11,57 @@ document.addEventListener("DOMContentLoaded", function () {
} }
window.calculate = function () { window.calculate = function () {
// --- BASIC INPUTS --- // --- BASIC INPUTS ---
var gross_total_income = getValue("gross_total_income"); var gross_total_income = getValue("gross_total_income");
var disallowance_14a = getValue("disallowance_14a"); var disallowance_14a = getValue("disallowance_14a");
var disallowance_37 = getValue("disallowance_37"); var disallowance_37 = getValue("disallowance_37");
// -- total gross income -- // -- total gross income ---
var gross_total = gross_total_income + disallowance_37 + disallowance_14a; var gross_total = gross_total_income + disallowance_37 + disallowance_14a
setValue("gti_as_per_ao", gross_total); console.log("gross_total income:: " + gross_total)
// --- DEDUCTIONS --- // --- DEDUCTIONS ---
var d80_business = getValue("deduction_80ia_business"); var d80_business = getValue("deduction_80ia_business");
var d80_misc = getValue("deduction_80ia_misc"); var d80_misc = getValue("deduction_80ia_misc");
var d80_other = getValue("deduction_80ia_other"); var d80_other = getValue("deduction_80ia_other");
var d80_sec37 = getValue("deduction_sec37_disallowance");
// -- TAX A CALCULATIONS -- var deduction_sec37 = d80_business + d80_misc + d80_other;
var per_a = getValue("per_a"); setValue("deduction_sec37_disallowance", deduction_sec37);
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"); var deduction_80g = getValue("deduction_80g");
// --- NET TAXABLE INCOME --- // --- NET TAXABLE INCOME ---
var net_taxable_income = gross_total - deduction - deduction_80g; var net_taxable_income = gross_total - deduction_sec37 - deduction_80g;
setValue("net_taxable_income", net_taxable_income); setValue("net_taxable_income", net_taxable_income);
// --- TAX (A)% AMOUNT --- // --- TAX 30% ---
var tax_a = net_taxable_income * (per_a / 100); var tax30 = net_taxable_income * 0.30;
setValue("tax_a", tax_a); setValue("tax_30_percent", tax30);
// --- 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%) --- // --- TAX PAYABLE (18.5%) ---
var tax185 = getValue("tax_book_profit_18_5"); var tax185 = getValue("tax_book_profit_18_5");
// --- Education Cess 3% --- var tax_payable = (tax30 > tax185) ? tax30 : tax185;
var tax_payable = tax_a > tax_book_profit ? tax_a : tax_book_profit;
setValue("tax_payable", tax_payable); setValue("tax_payable", tax_payable);
// --- SURCHARGE --- // --- SURCHARGE ---
var percent = getValue("persentage"); var percent = getValue("persentage");
var surcharge = tax_payable * (percent / 100); var surcharge = tax_payable * (percent / 100);
setValue("surcharge", surcharge); setValue("surcharge_12", surcharge);
// --- EDUCATION CESS --- var edu_cess = (tax_payable + surcharge) * 0.03;
var per_cess = getValue("persentage_cess"); setValue("edu_cess_3", edu_cess);
var edu_cess = (tax_payable + surcharge) * (per_cess / 100);
setValue("edu_cess", edu_cess);
// --- total tax payable --- // --- total tax payable ---
var total_tax_payable = sum_of_a > sum_of_b ? sum_of_a : sum_of_b; var total_tax_payable = tax_payable + surcharge + edu_cess;
setValue("total_tax_payable", total_tax_payable); 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 --- // --- FINAL TAX ---
var mat_credit_uti = getValue("mat_credit_utilized"); var mat_credit = getValue("mat_credit");
var interest_234c = getValue("interest_234c"); var interest_234c = getValue("interest_234c");
// var total_tax = total_tax_payable + mat_credit + 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); setValue("total_tax", total_tax);
// --- ASSESSMENT --- // --- ASSESSMENT ---

View File

@@ -45,53 +45,20 @@ document.addEventListener("DOMContentLoaded", function () {
var tax_payable = (tax30 > tax185) ? tax30 : tax185; var tax_payable = (tax30 > tax185) ? tax30 : tax185;
setValue("tax_payable", tax_payable); 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 --- // --- SURCHARGE ---
var percent = getValue("persentage"); var percent = getValue("persentage");
var surcharge = tax_payable * (percent / 100); var surcharge = tax_payable * (percent / 100);
setValue("surcharge", surcharge); setValue("surcharge_12", surcharge);
// --- EDUCATION CESS --- var edu_cess = (tax_payable + surcharge) * 0.03;
var per_cess = getValue("persentage_cess"); setValue("edu_cess_3", edu_cess);
var edu_cess = (tax_payable + surcharge) * (per_cess / 100);
setValue("edu_cess", edu_cess);
// --- total tax payable --- // --- total tax payable ---
var total_tax_payable = tax_payable + surcharge + edu_cess; var total_tax_payable = tax_payable + surcharge + edu_cess;
setValue("total_tax_payable", total_tax_payable); 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 --- // --- FINAL TAX ---
var mat_credit = getValue("mat_credit_utilized"); var mat_credit = getValue("mat_credit");
var interest_234c = getValue("interest_234c"); var interest_234c = getValue("interest_234c");
var total_tax = total_tax_payable + mat_credit + interest_234c; var total_tax = total_tax_payable + mat_credit + interest_234c;

View File

@@ -1,134 +1,78 @@
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
function getValue(name) { function getValue(id) {
var el = document.getElementsByName(name)[0]; var el = document.getElementsByName(id)[0];
return el ? parseFloat(el.value) || 0 : 0; return el ? parseFloat(el.value) || 0 : 0;
} }
function setValue(name, val) { function setValue(id, val) {
var el = document.getElementsByName(name)[0]; var el = document.getElementsByName(id)[0];
if (el) el.value = Number(val).toFixed(2); 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 () { window.calculate = function () {
// ---------------- BASIC INPUTS ---------------- // --- BASIC INPUTS ---
var gross_total_income = getValue("gross_total_income"); var gross_total_income = getValue("gross_total_income");
var disallowance_14a = getValue("disallowance_14a"); var disallowance_14a = getValue("disallowance_14a");
var disallowance_37 = getValue("disallowance_37"); var disallowance_37 = getValue("disallowance_37");
var gross_total = gross_total_income + disallowance_14a + disallowance_37; // -- total gross income --
setValue("gti_as_per_ao", gross_total); var gross_total = gross_total_income + disallowance_37 + disallowance_14a
console.log("gross_total income:: " + gross_total)
// ---------------- DEDUCTIONS ---------------- // --- DEDUCTIONS ---
var d80_business = getValue("deduction_80ia_business"); var d80_business = getValue("deduction_80ia_business");
var d80_misc = getValue("deduction_80ia_misc"); var d80_misc = getValue("deduction_80ia_misc");
var d80_other = getValue("deduction_80ia_other"); var d80_other = getValue("deduction_80ia_other");
var d80_sec37 = getValue("deduction_sec37_disallowance"); 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 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; var net_taxable_income = gross_total - deduction - deduction_80g;
setValue("net_taxable_income", net_taxable_income); setValue("net_taxable_income", net_taxable_income);
// ================= TAX (A) TWO WAY ================= // --- TAX 30% ---
var per_tax_a = getValue("per_tax_a"); var tax30 = net_taxable_income * 0.30;
var tax_a_cal = getValue("tax_a_cal"); setValue("tax_30_percent", tax30);
if (net_taxable_income > 0) { // --- TAX PAYABLE (18.5%) ---
if (lastEditedTaxA === "percentage") { var tax185 = getValue("tax_book_profit_18_5");
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 tax_payable = (tax30 > tax185) ? tax30 : tax185;
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); setValue("tax_payable", tax_payable);
var total_tax_payable = (sum_of_a > sum_of_b) ? sum_of_a : sum_of_b; // --- SURCHARGE ---
var percent = getValue("persentage");
var surcharge = tax_payable * (percent / 100);
setValue("surcharge_12", surcharge);
var edu_cess = (tax_payable + surcharge) * 0.03;
setValue("edu_cess_3", edu_cess);
// --- total tax payable ---
var total_tax_payable = tax_payable + surcharge + edu_cess;
setValue("total_tax_payable", total_tax_payable); setValue("total_tax_payable", total_tax_payable);
// ================= MAT CREDIT ================= // --- FINAL TAX ---
var mat_created = 0; var mat_credit = getValue("mat_credit");
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 interest_234c = getValue("interest_234c");
var total_tax = total_tax_payable + interest_234c - mat_utilized; var total_tax = total_tax_payable + mat_credit + interest_234c;
setValue("total_tax", total_tax); setValue("total_tax", total_tax);
// ================= ADJUSTMENTS ================= // --- ASSESSMENT ---
var adv_tax = getValue("advance_tax"); var adv_tax = getValue("advance_tax");
var tds = getValue("tds"); var tds = getValue("tds");
var tcs = getValue("tcs"); var tcs = getValue("tcs");
var tax_on_assessment = getValue("tax_on_assessment"); var tax_on_regular_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 all_tax = adv_tax + tds + tcs + tax_on_regular_assessment;
var refund = total_tax - paid_tax; var refund = total_tax - all_tax;
setValue("refund", refund); setValue("refund", refund);
var balance_receivable = (refund + interest_244a_per143) - refund_received
setValue("balance_receivable", balance_receivable);
}; };
}); });

View File

@@ -1,6 +1,11 @@
/* =====================================================
GLOBAL STATE
===================================================== */
let addedYears = []; let addedYears = [];
// INITIALIZE YEARS FROM DATABASE HEADERS /* =====================================================
INITIALIZE YEARS FROM DATABASE HEADERS
===================================================== */
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
const headers = document.querySelectorAll("#tableHeader th"); const headers = document.querySelectorAll("#tableHeader th");
@@ -14,8 +19,9 @@ document.addEventListener("DOMContentLoaded", () => {
}); });
}); });
/* =====================================================
// ADD YEAR COLUMN (DYNAMIC) ADD YEAR COLUMN (DYNAMIC)
===================================================== */
function addYearColumn() { function addYearColumn() {
const yearSelect = document.getElementById("yearSelect"); const yearSelect = document.getElementById("yearSelect");
const year = yearSelect.value; const year = yearSelect.value;
@@ -48,8 +54,9 @@ function addYearColumn() {
}); });
} }
/* =====================================================
// ADD NEW ROW ADD NEW ROW
===================================================== */
function addRow() { function addRow() {
const tbody = document.querySelector("#matTable tbody"); const tbody = document.querySelector("#matTable tbody");
const tr = document.createElement("tr"); const tr = document.createElement("tr");
@@ -72,8 +79,9 @@ function addRow() {
tbody.appendChild(tr); tbody.appendChild(tr);
} }
/* =====================================================
// SAVE SINGLE ROW SAVE SINGLE ROW
===================================================== */
function saveRow(btn) { function saveRow(btn) {
const tr = btn.closest("tr"); const tr = btn.closest("tr");
const inputs = tr.querySelectorAll("input"); const inputs = tr.querySelectorAll("input");
@@ -120,8 +128,9 @@ function saveRow(btn) {
}); });
} }
/* =====================================================
// SAVE ALL ROWS SAVE ALL ROWS
===================================================== */
function saveAll() { function saveAll() {
let rows = []; let rows = [];

View File

@@ -1,50 +0,0 @@
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));
});

View File

@@ -1,14 +1,61 @@
const sidebar = document.getElementById("sidebar");
const main = document.getElementById("main");
// Track toggle manually
let isSidebarOpen = true;
// Toggle sidebar normally
function toggleSidebar() { function toggleSidebar() {
// Toggle ONLY on mobile isSidebarOpen = !isSidebarOpen;
if (window.innerWidth <= 768) {
document.getElementById("sidebar").classList.toggle("show"); sidebar.classList.toggle("hide", !isSidebarOpen);
}
// Add temporary transition only during toggle
main.style.transition = "margin-left 0.3s ease";
sidebar.style.transition = "left 0.3s ease";
// Adjust main margin
main.style.marginLeft = isSidebarOpen ? "260px" : "20px";
// Remove transitions after animation to avoid disturbance
setTimeout(() => {
main.style.transition = "none";
sidebar.style.transition = "none";
}, 300);
} }
// Toggle submenu — also force sidebar to open if it is hidden
function toggleMenu(id) { function toggleMenu(id) {
const menu = document.getElementById(id); const menu = document.getElementById(id);
menu.style.display = (menu.style.display === "block") ? "none" : "block"; if (!menu) return;
// 👉 If sidebar is collapsed, open it automatically
if (!isSidebarOpen) {
isSidebarOpen = true;
sidebar.classList.remove("hide");
main.style.marginLeft = "260px";
}
// Close all other submenus
document.querySelectorAll(".submenu").forEach(sm => {
if (sm !== menu) sm.style.display = "none";
});
// Toggle the clicked submenu instantly
menu.style.display = menu.style.display === "block" ? "none" : "block";
} }
// Remove transition when clicking submenu links
document.querySelectorAll(".submenu a").forEach(link => {
link.addEventListener("click", () => {
main.style.transition = "none";
sidebar.style.transition = "none";
});
});
// Initialize sidebar as open when page loads
window.addEventListener("DOMContentLoaded", () => {
sidebar.classList.remove("hide");
main.style.marginLeft = "260px";
isSidebarOpen = true;
});

View File

@@ -1,41 +1,36 @@
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
const yearDropdown = document.getElementById("year"); const yearDropdown = document.getElementById("year");
const errorDiv = document.getElementById("yearError"); const errorDiv = document.getElementById("yearError");
const form = document.querySelector("form");
const tableName = form.id.toLowerCase(); // ao, cit, etc. // Get the form dynamically
const form = document.querySelector("form"); // get from id as table name
// Dynamic table name = form id
const tableName = form.id.toLowerCase();
const currentYear = new Date().getFullYear(); const currentYear = new Date().getFullYear();
const startYear = 1990; const startYear = 1990;
/* ---------- Fill Year Dropdown ---------- */ // Fill Year dropdown
for (let y = currentYear; y >= startYear; y--) { for (let y = currentYear; y >= startYear; y--) {
let nextYear = y + 1; let nextYear = y + 1;
let option = document.createElement("option"); let option = document.createElement("option");
option.value = y; // IMPORTANT option.value = y;
option.textContent = `AY ${y}-${nextYear}`; option.textContent = `AY ${y}-${nextYear}`;
yearDropdown.appendChild(option); yearDropdown.appendChild(option);
} }
/* ---------- Validate on Change ---------- */ // Validate selected year
yearDropdown.addEventListener("change", function () { yearDropdown.addEventListener("change", function () {
const selectedYear = this.value; let selectedYear = parseInt(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", { fetch("/check_year", {
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify({ body: JSON.stringify({
table: tableName, table: tableName, // dynamic table name
year: selectedYear year: selectedYear
}) })
}) })
@@ -43,27 +38,15 @@ document.addEventListener("DOMContentLoaded", function () {
.then(data => { .then(data => {
if (data.exists) { if (data.exists) {
errorDiv.style.display = "block"; errorDiv.style.display = "block";
errorDiv.innerText = `AY ${selectedYear}-${parseInt(selectedYear) + 1} already exists!`; errorDiv.innerText = `Year ${selectedYear}-${selectedYear + 1} already exists!`;
form.onsubmit = () => false;
// Block submission
form.onsubmit = function () { return false; };
} else { } else {
errorDiv.style.display = "none"; errorDiv.style.display = "none";
errorDiv.innerText = ""; form.onsubmit = null; // Allow submit
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,37 +1,29 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}Add New AO Record{% endblock %} {% block title %}Add New AO Record{% endblock %}
{% block extra_css %} {% block extra_css %}
<!-- Child page CSS --> <!-- Child page CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/add_ao.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<h2 style="text-align:center;">New AO Form</h2>
<form id="ao" method="POST" enctype="multipart/form-data"> <h2 style="text-align:center;">New Assessing Officer Form</h2>
<input type="hidden" name="stage" value="ao"> <form id="ao" method="POST">
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Assessment Year:</label> <label>Year:</label>
<select id="year" name="year" required> <select id="year" name="year" required></select>
<option value="" disabled selected>
-- Please select Assessment Year --
</option>
</select>
<div id="yearError" style="color:red; display:none; margin-bottom:10px;"></div> <div id="yearError" style="color:red; display:none; margin-bottom:10px;"></div>
</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> <div>
<label>Gross Total Income:</label> <label>Gross Total Income:</label>
<input type="number" name="gross_total_income" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="gross_total_income" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Add :Disallowance u/s 14A:</label> <label>Add :Disallowance u/s 14A:</label>
<input type="number" name="disallowance_14a" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="disallowance_14a" step="any" value="0.00" oninput="calculate()" required>
@@ -41,42 +33,36 @@
<input type="number" name="disallowance_37" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="disallowance_37" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</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>
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Less :Deduction 80IA Business Income:</label> <label>Deduction 80IA Business Income:</label>
<input type="number" name="deduction_80ia_business" step="any" value="0.00" oninput="calculate()" <input type="number" name="deduction_80ia_business" step="any" value="0.00" oninput="calculate()"
required> required>
</div> </div>
<div> <div>
<label>Less :Deduction 80IA Misc:</label> <label>Deduction 80IA Misc:</label>
<input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required>
</div> </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> </div>
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Less :Deduction Sec 37 Disallowance:</label> <label>Deduction 80IA Other Operating Revenue:</label>
<input type="number" name="deduction_80ia_other" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Deduction Sec 37 Disallowance:</label>
<input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()" <input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()"
required> required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Less: Deduction 80G: </label> <label>Less: Deduction 80G: </label>
<input type="number" name="deduction_80g" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="deduction_80g" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Net Taxable Income:</label> <label>Net Taxable Income:</label>
<input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly> <input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly>
@@ -85,77 +71,36 @@
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Enter Percentage(%) calculate: Tax(A):</label> <label>Tax @ 30% (A):</label>
<input type="number" name="per_tax_a" step="any" value="0.00" oninput="calculate()"> <input type="number" name="tax_30_percent" step="any" value="0.00" oninput="calculate()" required>
</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>
<div> <div>
<label>Tax @ 18.5% on Book Profit (B):</label> <label>Tax @ 18.5% on Book Profit (B):</label>
<input type="number" name="tax_b_cal" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="tax_book_profit_18_5" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div> </div>
<div class="form-group full-width inline-2"> <div class="form-group">
<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>
<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>
<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>
<div class="form-group full-width inline-2">
<div>
<label>Tax Payable (Higher of A or B):</label> <label>Tax Payable (Higher of A or B):</label>
<input type="number" name="tax_payable" class="auto" step="any" value="0.00" readonly> <input type="number" name="tax_payable" class="auto" step="any" value="0.00" readonly>
</div> </div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage (%) Surcharge:</label>
<input type="number" name="persentage" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Surcharge:</label>
<input type="number" name="surcharge_12" class="auto" value="0.00" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Education Cess @ 3%:</label>
<input type="number" name="edu_cess_3" class="auto" step="any" value="0.00" readonly>
</div>
<div> <div>
<label>Total tax Payable:</label> <label>Total tax Payable:</label>
<input type="number" name="total_tax_payable" class="auto" step="any" value="0.00" readonly> <input type="number" name="total_tax_payable" class="auto" step="any" value="0.00" readonly>
@@ -164,26 +109,8 @@
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Opening Balance:</label> <label>Mat Credit Utilized:</label>
<input type="number" name="opening_balance" step="any" value="0.00" oninput="calculate()"> <input type="number" name="mat_credit" step="any" value="0.00" oninput="calculate()" required>
</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>
<div> <div>
<label>Add :Interest 234c:</label> <label>Add :Interest 234c:</label>
@@ -196,13 +123,13 @@
<label>Total Tax:</label> <label>Total Tax:</label>
<input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly> <input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Advance Tax:</label> <label>Advance Tax:</label>
<input type="number" name="advance_tax" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="advance_tax" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>TDS :</label> <label>TDS :</label>
<input type="number" name="tds" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="tds" step="any" value="0.00" oninput="calculate()" required>
@@ -221,48 +148,36 @@
</div> </div>
<div> <div>
<label>Tax on Regular Assessment:</label> <label>Tax on Regular Assessment:</label>
<input type="number" name="tax_on_assessment" step="any" value="0.00" oninput="calculate()"> <input type="number" name="tax_on_assessment" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Refund:</label> <label>Refund:</label>
<input type="number" name="refund" class="auto" step="any" value="0.00" readonly> <input type="number" name="refund" class="auto" step="any" value="0.00" readonly>
</div> </div>
<div class="form-group full-width inline-2">
<div class="form-group"> <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> <label>Remarks:</label>
<input type="text" name="Remarks"> <input type="text" name="Remarks">
</div> </div>
</div>
<button type="submit">Submit</button> <button type="submit">Submit</button>
</form> </form>
</div> </div>
{% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{{ url_for('static', filename='js/itr_calc.js') }}"></script> <script src="{{ url_for('static', filename='js/ao_calc.js') }}"></script>
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script> <script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %} {% endblock %}
<script>
function showSuccessMessage() {
alert("Form submitted successfully!");
return true;
}
</script>
{% endblock %}

View File

@@ -4,34 +4,26 @@
{% block extra_css %} {% block extra_css %}
<!-- Child page CSS --> <!-- Child page CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/add_cit.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<h2 style="text-align:center;">New CIT Form </h2> <h2 style="text-align:center;">New CIT Form </h2>
<form id="cit" method="POST" enctype="multipart/form-data"> <form id="cit" method="POST">
<input type="hidden" name="stage" value="itr">
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Assessment Year:</label> <label>Year:</label>
<select id="year" name="year" required> <select id="year" name="year" required></select>
<option value="" disabled selected>
-- Please select Assessment Year --
</option>
</select>
<div id="yearError" style="color:red; display:none; margin-bottom:10px;"></div> <div id="yearError" style="color:red; display:none; margin-bottom:10px;"></div>
</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> <div>
<label>Gross Total Income:</label> <label>Gross Total Income:</label>
<input type="number" name="gross_total_income" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="gross_total_income" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Add :Disallowance u/s 14A:</label> <label>Add :Disallowance u/s 14A:</label>
<input type="number" name="disallowance_14a" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="disallowance_14a" step="any" value="0.00" oninput="calculate()" required>
@@ -42,13 +34,6 @@
</div> </div>
</div> </div>
<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>
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Deduction 80IA Business Income:</label> <label>Deduction 80IA Business Income:</label>
@@ -59,25 +44,25 @@
<label>Deduction 80IA Misc:</label> <label>Deduction 80IA Misc:</label>
<input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Deduction 80IA Other Operating Revenue:</label> <label>Deduction 80IA Other Operating Revenue:</label>
<input type="number" name="deduction_80ia_other" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="deduction_80ia_other" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Deduction Sec 37 Disallowance:</label> <label>Deduction Sec 37 Disallowance:</label>
<input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()" <input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()"
required> required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Less: Deduction 80G: </label> <label>Less: Deduction 80G: </label>
<input type="number" name="deduction_80g" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="deduction_80g" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Net Taxable Income:</label> <label>Net Taxable Income:</label>
<input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly> <input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly>
@@ -86,78 +71,36 @@
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Enter Percentage(%) calculate: Tax(A):</label> <label>Tax @ 30% (A):</label>
<input type="number" name="per_tax_a" step="any" value="0.00" oninput="calculate()"> <input type="number" name="tax_30_percent" step="any" value="0.00" oninput="calculate()" required>
</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>
<div> <div>
<label>Tax @ 18.5% on Book Profit (B):</label> <label>Tax @ 18.5% on Book Profit (B):</label>
<input type="number" name="tax_b_cal" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="tax_book_profit_18_5" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div> </div>
<div class="form-group full-width inline-2"> <div class="form-group">
<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>
<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>
<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>
<div class="form-group full-width inline-2">
<div>
<label>Tax Payable (Higher of A or B):</label> <label>Tax Payable (Higher of A or B):</label>
<input type="number" name="tax_payable" class="auto" step="any" value="0.00" readonly> <input type="number" name="tax_payable" class="auto" step="any" value="0.00" readonly>
</div> </div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage (%) Surcharge:</label>
<input type="number" name="persentage" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Surcharge:</label>
<input type="number" name="surcharge_12" class="auto" value="0.00" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Education Cess @ 3%:</label>
<input type="number" name="edu_cess_3" class="auto" step="any" value="0.00" readonly>
</div>
<div> <div>
<label>Total tax Payable:</label> <label>Total tax Payable:</label>
<input type="number" name="total_tax_payable" class="auto" step="any" value="0.00" readonly> <input type="number" name="total_tax_payable" class="auto" step="any" value="0.00" readonly>
@@ -166,25 +109,8 @@
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Opening Balance:</label> <label>Mat Credit Utilized:</label>
<input type="number" name="opening_balance" step="any" value="0.00" oninput="calculate()"> <input type="number" name="mat_credit" step="any" value="0.00" oninput="calculate()" required>
</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>
<div> <div>
<label>Add :Interest 234c:</label> <label>Add :Interest 234c:</label>
@@ -197,13 +123,13 @@
<label>Total Tax:</label> <label>Total Tax:</label>
<input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly> <input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Advance Tax:</label> <label>Advance Tax:</label>
<input type="number" name="advance_tax" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="advance_tax" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>TDS :</label> <label>TDS :</label>
<input type="number" name="tds" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="tds" step="any" value="0.00" oninput="calculate()" required>
@@ -212,6 +138,7 @@
<label>TCS :</label> <label>TCS :</label>
<input type="number" name="tcs" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="tcs" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div> </div>
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
@@ -223,38 +150,17 @@
<label>Tax on Regular Assessment:</label> <label>Tax on Regular Assessment:</label>
<input type="number" name="tax_on_assessment" step="any" value="0.00" oninput="calculate()"> <input type="number" name="tax_on_assessment" step="any" value="0.00" oninput="calculate()">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Refund:</label> <label>Refund:</label>
<input type="number" name="refund" class="auto" step="any" value="0.00" readonly> <input type="number" name="refund" class="auto" step="any" value="0.00" readonly>
</div> </div>
<div class="form-group full-width inline-2">
<div class="form-group"> <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> <label>Remarks:</label>
<input type="text" name="Remarks"> <input type="text" name="Remarks">
</div> </div>
</div>
<button type="submit">Submit</button> <button type="submit">Submit</button>
</form> </form>
@@ -262,6 +168,6 @@
{% endblock %} {% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{{ url_for('static', filename='js/itr_calc.js') }}"></script> <script src="{{ url_for('static', filename='js/cit_calc.js') }}"></script>
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script> <script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %} {% endblock %}

View File

@@ -4,35 +4,29 @@
{% block extra_css %} {% block extra_css %}
<!-- Child page CSS --> <!-- Child page CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/add_itr.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<h2 style="text-align:center;">New Income Tax Appellate Tribunal Form</h2> <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"> <form id="itat" method="POST" onsubmit="return showSuccessMessage()">
<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 class="form-group full-width inline-2">
<div>
<label>Year:</label>
<select id="year" name="year" required></select>
<div id="yearError" style="color:red; display:none; margin-bottom:10px;"></div>
</div>
<div> <div>
<label>Gross Total Income:</label> <label>Gross Total Income:</label>
<input type="number" name="gross_total_income" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="gross_total_income" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Add :Disallowance u/s 14A:</label> <label>Add :Disallowance u/s 14A:</label>
<input type="number" name="disallowance_14a" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="disallowance_14a" step="any" value="0.00" oninput="calculate()" required>
@@ -45,40 +39,33 @@
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>GTI as per AO</label> <label>Deduction 80IA Business Income:</label>
<input type="number" name="gti_as_per_ao" class="auto" step="any" value="0.00" 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="0.00" oninput="calculate()" <input type="number" name="deduction_80ia_business" step="any" value="0.00" oninput="calculate()"
required> required>
</div> </div>
<div> <div>
<label>Less :Deduction 80IA Misc:</label> <label>Deduction 80IA Misc:</label>
<input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required>
</div> </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> </div>
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Less :Deduction Sec 37 Disallowance:</label> <label>Deduction 80IA Other Operating Revenue:</label>
<input type="number" name="deduction_80ia_other" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Deduction Sec 37 Disallowance:</label>
<input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()" <input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()"
required> required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Less: Deduction 80G: </label> <label>Less: Deduction 80G: </label>
<input type="number" name="deduction_80g" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="deduction_80g" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Net Taxable Income:</label> <label>Net Taxable Income:</label>
<input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly> <input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly>
@@ -87,78 +74,36 @@
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Enter Percentage(%) calculate: Tax(A):</label> <label>Tax @ 30% (A):</label>
<input type="number" name="per_tax_a" step="any" value="0.00" oninput="calculate()"> <input type="number" name="tax_30_percent" step="any" value="0.00" oninput="calculate()" required>
</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>
<div> <div>
<label>Tax @ 18.5% on Book Profit (B):</label> <label>Tax @ 18.5% on Book Profit (B):</label>
<input type="number" name="tax_b_cal" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="tax_book_profit_18_5" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div> </div>
<div class="form-group full-width inline-2"> <div class="form-group">
<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>
<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>
<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>
<div class="form-group full-width inline-2">
<div>
<label>Tax Payable (Higher of A or B):</label> <label>Tax Payable (Higher of A or B):</label>
<input type="number" name="tax_payable" class="auto" step="any" value="0.00" readonly> <input type="number" name="tax_payable" class="auto" step="any" value="0.00" readonly>
</div> </div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage (%) Surcharge:</label>
<input type="number" name="persentage" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Surcharge:</label>
<input type="number" name="surcharge_12" class="auto" value="0.00" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Education Cess @ 3%:</label>
<input type="number" name="edu_cess_3" class="auto" step="any" value="0.00" readonly>
</div>
<div> <div>
<label>Total tax Payable:</label> <label>Total tax Payable:</label>
<input type="number" name="total_tax_payable" class="auto" step="any" value="0.00" readonly> <input type="number" name="total_tax_payable" class="auto" step="any" value="0.00" readonly>
@@ -167,26 +112,8 @@
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Opening Balance:</label> <label>Mat Credit Utilized:</label>
<input type="number" name="opening_balance" step="any" value="0.00" oninput="calculate()"> <input type="number" name="mat_credit" step="any" value="0.00" oninput="calculate()" required>
</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>
<div> <div>
<label>Add :Interest 234c:</label> <label>Add :Interest 234c:</label>
@@ -199,13 +126,13 @@
<label>Total Tax:</label> <label>Total Tax:</label>
<input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly> <input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Advance Tax:</label> <label>Advance Tax:</label>
<input type="number" name="advance_tax" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="advance_tax" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>TDS :</label> <label>TDS :</label>
<input type="number" name="tds" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="tds" step="any" value="0.00" oninput="calculate()" required>
@@ -233,32 +160,10 @@
<input type="number" name="refund" class="auto" step="any" value="0.00" readonly> <input type="number" name="refund" class="auto" step="any" value="0.00" readonly>
</div> </div>
<div class="form-group full-width inline-2">
<div class="form-group"> <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> <label>Remarks:</label>
<input type="text" name="Remarks"> <input type="text" name="Remarks">
</div> </div>
</div>
<button type="submit">Submit</button> <button type="submit">Submit</button>
</form> </form>
@@ -269,3 +174,10 @@
<script src="{{ url_for('static', filename='js/itr_calc.js') }}"></script> <script src="{{ url_for('static', filename='js/itr_calc.js') }}"></script>
<script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script> <script src="{{ url_for('static', filename='js/year_dropdown.js') }}"></script>
{% endblock %} {% endblock %}
<script>
function showSuccessMessage() {
alert("Form submitted successfully!");
return true;
}
</script>

View File

@@ -4,34 +4,27 @@
{% block extra_css %} {% block extra_css %}
<!-- Child page CSS --> <!-- Child page CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/add_itr.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<h2 style="text-align:center;">New Income Tax Return Form</h2> <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"> <form id="itr" method="POST">
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Assessment Year:</label> <label>Year:</label>
<select id="year" name="year" required> <select id="year" name="year" required></select>
<option value="" disabled selected>
-- Please select Assessment Year --
</option>
</select>
<div id="yearError" style="color:red; display:none; margin-bottom:10px;"></div> <div id="yearError" style="color:red; display:none; margin-bottom:10px;"></div>
</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> <div>
<label>Gross Total Income:</label> <label>Gross Total Income:</label>
<input type="number" name="gross_total_income" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="gross_total_income" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Add :Disallowance u/s 14A:</label> <label>Add :Disallowance u/s 14A:</label>
<input type="number" name="disallowance_14a" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="disallowance_14a" step="any" value="0.00" oninput="calculate()" required>
@@ -41,42 +34,36 @@
<input type="number" name="disallowance_37" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="disallowance_37" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</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>
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Less :Deduction 80IA Business Income:</label> <label>Deduction 80IA Business Income:</label>
<input type="number" name="deduction_80ia_business" step="any" value="0.00" oninput="calculate()" <input type="number" name="deduction_80ia_business" step="any" value="0.00" oninput="calculate()"
required> required>
</div> </div>
<div> <div>
<label>Less :Deduction 80IA Misc:</label> <label>Deduction 80IA Misc:</label>
<input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required>
</div> </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> </div>
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Less :Deduction Sec 37 Disallowance:</label> <label>Deduction 80IA Other Operating Revenue:</label>
<input type="number" name="deduction_80ia_other" step="any" value="0.00" oninput="calculate()" required>
</div>
<div>
<label>Deduction Sec 37 Disallowance:</label>
<input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()" <input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()"
required> required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Less: Deduction 80G: </label> <label>Less: Deduction 80G: </label>
<input type="number" name="deduction_80g" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="deduction_80g" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Net Taxable Income:</label> <label>Net Taxable Income:</label>
<input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly> <input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly>
@@ -85,78 +72,36 @@
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Enter Percentage(%) calculate: Tax(A):</label> <label>Tax @ 30% (A):</label>
<input type="number" name="per_tax_a" step="any" value="0.00" oninput="calculate()"> <input type="number" name="tax_30_percent" step="any" value="0.00" oninput="calculate()" required>
</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>
<div> <div>
<label>Tax @ 18.5% on Book Profit (B):</label> <label>Tax @ 18.5% on Book Profit (B):</label>
<input type="number" name="tax_b_cal" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="tax_book_profit_18_5" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div> </div>
<div class="form-group full-width inline-2"> <div class="form-group">
<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>
<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>
<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>
<div class="form-group full-width inline-2">
<div>
<label>Tax Payable (Higher of A or B):</label> <label>Tax Payable (Higher of A or B):</label>
<input type="number" name="tax_payable" class="auto" step="any" value="0.00" readonly> <input type="number" name="tax_payable" class="auto" step="any" value="0.00" readonly>
</div> </div>
<div class="form-group full-width inline-2">
<div>
<label>Enter Percentage (%) Surcharge:</label>
<input type="number" name="persentage" step="any" value="0.00" oninput="calculate()">
</div>
<div>
<label>Surcharge:</label>
<input type="number" name="surcharge_12" class="auto" value="0.00" readonly>
</div>
</div>
<div class="form-group full-width inline-2">
<div>
<label>Education Cess @ 3%:</label>
<input type="number" name="edu_cess_3" class="auto" step="any" value="0.00" readonly>
</div>
<div> <div>
<label>Total tax Payable:</label> <label>Total tax Payable:</label>
<input type="number" name="total_tax_payable" class="auto" step="any" value="0.00" readonly> <input type="number" name="total_tax_payable" class="auto" step="any" value="0.00" readonly>
@@ -165,26 +110,8 @@
<div class="form-group full-width inline-2"> <div class="form-group full-width inline-2">
<div> <div>
<label>Opening Balance:</label> <label>Mat Credit Utilized:</label>
<input type="number" name="opening_balance" step="any" value="0.00" oninput="calculate()"> <input type="number" name="mat_credit" step="any" value="0.00" oninput="calculate()" required>
</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>
<div> <div>
<label>Add :Interest 234c:</label> <label>Add :Interest 234c:</label>
@@ -197,13 +124,13 @@
<label>Total Tax:</label> <label>Total Tax:</label>
<input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly> <input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>Advance Tax:</label> <label>Advance Tax:</label>
<input type="number" name="advance_tax" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="advance_tax" step="any" value="0.00" oninput="calculate()" required>
</div> </div>
</div>
<div class="form-group full-width inline-2">
<div> <div>
<label>TDS :</label> <label>TDS :</label>
<input type="number" name="tds" step="any" value="0.00" oninput="calculate()" required> <input type="number" name="tds" step="any" value="0.00" oninput="calculate()" required>
@@ -226,40 +153,15 @@
</div> </div>
</div> </div>
<div class="form-group full-width inline-2">
<div class="form-group"> <div class="form-group">
<label>Refund:</label> <label>Refund:</label>
<input type="number" name="refund" class="auto" step="any" value="0.00"> <input type="number" name="refund" class="auto" step="any" value="0.00" readonly>
</div>
</div> </div>
<div class="form-group full-width inline-2">
<div class="form-group"> <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> <label>Remarks:</label>
<input type="text" name="Remarks"> <input type="text" name="Remarks">
</div> </div>
</div>
<button type="submit">Submit</button> <button type="submit">Submit</button>
</form> </form>

View File

@@ -3,22 +3,33 @@
{% block title %}Download AO Report{% endblock %} {% block title %}Download AO Report{% endblock %}
{% block extra_css %} {% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/report_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/ao_report.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="main">
<div class="container">
<h2>Download AO Report</h2> <h2>Download AO Report</h2>
<form method="GET" action="{{ url_for('ao_report') }}" target="_blank"> <form method="GET" action="{{ url_for('ao_report') }}" target="_blank">
<label for="year">Select Year:</label><br> <label for="year">Select Year:</label><br>
<select name="year" id="year" required> <select name="year" id="year" required>
<option value="">-- Select Year --</option> <option value="">-- Select Year --</option>
{% for y in years %} {% for y in years %}
<option value="{{ y }}">AY {{ y }} - {{ y + 1 }}</option> <option value="{{ y }}">AY {{ y }} - {{ y + 1 }}</option>
{% endfor %} {% endfor %}
</select> </select>
<br> <br>
<button type="submit">Download Excel</button> <button type="submit">Download Excel</button>
</form> </form>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -4,70 +4,60 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>{% block title %}Income Tax Utilities{% endblock %}</title> <title>{% block title %}Income Tax Utilities{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Main CSS --> <!-- Shared CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/index.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/index.css') }}">
<!-- Extra CSS for child pages -->
{% block extra_css %}{% endblock %} {% block extra_css %}{% endblock %}
</head> </head>
<body> <body>
<!-- NAVBAR -->
<!-- ================= NAVBAR ================= -->
<div class="navbar"> <div class="navbar">
<div class="nav-left"> <div class="nav-left">
<!-- ☰ visible ONLY on mobile via CSS -->
<span class="toggle-btn" onclick="toggleSidebar()"></span> <span class="toggle-btn" onclick="toggleSidebar()"></span>
<img src="{{ url_for('static', filename='images/lcepllogo.png') }}" class="nav-logo" alt="Logo" />
<img src="{{ url_for('static', filename='images/lcepllogo.png') }}" class="nav-logo" alt="LCEPL Logo">
<h3>LAXMI CIVIL ENGINEERING SERVICES PVT. LTD.</h3> <h3>LAXMI CIVIL ENGINEERING SERVICES PVT. LTD.</h3>
</div> </div>
</div> </div>
<!-- ================= SIDEBAR ================= --> <!-- SIDEBAR -->
<div class="sidebar" id="sidebar"> <div class="sidebar hide" id="sidebar">
<a href="{{ url_for('index') }}"> <a href="{{ url_for('index') }}">
<h2>Dashboard</h2> <h2>Dashboard</h2>
</a> </a>
<!-- ITR model -->
<!-- ITR -->
<div class="menu-btn" onclick="toggleMenu('itrMenu')">ITR ▼</div> <div class="menu-btn" onclick="toggleMenu('itrMenu')">ITR ▼</div>
<div class="submenu" id="itrMenu"> <div class="submenu" id="itrMenu">
<a href="{{ url_for('add_itr') }}"> Add ITR</a> <a href="{{ url_for('add_itr') }}"> Add ITR</a>
<a href="{{ url_for('display_itr') }}">🧾 ITR Records</a> <a href="{{ url_for('display_itr') }}">🧾 ITR Records</a>
</div> </div>
<!-- AO model -->
<!-- AO -->
<div class="menu-btn" onclick="toggleMenu('aoMenu')">AO ▼</div> <div class="menu-btn" onclick="toggleMenu('aoMenu')">AO ▼</div>
<div class="submenu" id="aoMenu"> <div class="submenu" id="aoMenu">
<a href="{{ url_for('add_ao') }}"> Add AO</a> <a href="{{ url_for('add_ao') }}"> Add AO</a>
<a href="{{ url_for('display_ao') }}">🧾 AO Records</a> <a href="{{ url_for('display_ao') }}">🧾 AO Records</a>
</div> </div>
<!-- CIT model -->
<!-- CIT -->
<div class="menu-btn" onclick="toggleMenu('citMenu')">CIT ▼</div> <div class="menu-btn" onclick="toggleMenu('citMenu')">CIT ▼</div>
<div class="submenu" id="citMenu"> <div class="submenu" id="citMenu">
<a href="{{ url_for('add_cit') }}"> Add CIT</a> <a href="{{ url_for('add_cit') }}"> Add CIT</a>
<a href="{{ url_for('display_cit') }}">🧾 CIT Records</a> <a href="{{ url_for('display_cit') }}">🧾 CIT Records</a>
</div> </div>
<!-- ITAT model -->
<!-- ITAT -->
<div class="menu-btn" onclick="toggleMenu('itatMenu')">ITAT ▼</div> <div class="menu-btn" onclick="toggleMenu('itatMenu')">ITAT ▼</div>
<div class="submenu" id="itatMenu"> <div class="submenu" id="itatMenu">
<a href="{{ url_for('add_itat') }}"> Add ITAT</a> <a href="{{ url_for('add_itat') }}"> Add ITAT</a>
<a href="{{ url_for('display_itat') }}">🧾 ITAT Records</a> <a href="{{ url_for('display_itat') }}">🧾 ITAT Records</a>
</div> </div>
<!-- MAT credit model -->
<!-- MAT CREDIT --> <div class="menu-btn" onclick="toggleMenu('matCredit')">Mat Credit ▼</div>
<div class="menu-btn" onclick="toggleMenu('matMenu')">MAT Credit ▼</div> <div class="submenu" id="matCredit">
<div class="submenu" id="matMenu"> <a href="{{ url_for('mat_credit') }}">📄 Mat Credit from</a>
<a href="{{ url_for('mat_credit') }}">📄 MAT Credit Form</a>
</div> </div>
<!-- DOCUMENTS --> <!-- Documents & Reports -->
<div class="menu-btn" onclick="toggleMenu('docMenu')">Documents & Reports ▼</div> <div class="menu-btn" onclick="toggleMenu('docMenu')">Documents & Reports ▼</div>
<div class="submenu" id="docMenu"> <div class="submenu" id="docMenu">
<a href="{{ url_for('upload_file') }}">📂 Upload</a> <a href="{{ url_for('upload_file') }}">📂 Upload</a>
@@ -76,21 +66,21 @@
<a href="{{ url_for('summary_report') }}">📝 Summary Report</a> <a href="{{ url_for('summary_report') }}">📝 Summary Report</a>
</div> </div>
<!-- LOGOUT --> <!-- Logout at bottom -->
<a href="{{ url_for('auth.logout') }}" class="sidebar-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"> <img src="{{ url_for('static', filename='images/logout_icon.png') }}" class="logout-icon" alt="Logout" />
</a> </a>
</div> </div>
<!-- ================= MAIN CONTENT ================= --> <!-- MAIN CONTENT -->
<div class="main" id="main"> <div class="main" id="main">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
<!-- JS --> <!-- Shared JS -->
<script src="{{ url_for('static', filename='js/toggle.js') }}"></script> <script src="{{ url_for('static', filename='js/toggle.js') }}"></script>
<!-- Extra JS for child pages -->
{% block extra_js %}{% endblock %} {% block extra_js %}{% endblock %}
</body> </body>

View File

@@ -3,22 +3,32 @@
{% block title %}Download CIT Report{% endblock %} {% block title %}Download CIT Report{% endblock %}
{% block extra_css %} {% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/report_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/cit_report.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="main">
<div class="container">
<h2>Download CIT Report</h2> <h2>Download CIT Report</h2>
<form method="GET" action="{{ url_for('cit_report') }}" target="_blank"> <form method="GET" action="{{ url_for('cit_report') }}" target="_blank">
<label for="year">Select Year:</label><br> <label for="year">Select Year:</label><br>
<select name="year" id="year" required> <select name="year" id="year" required>
<option value="">-- Select Year --</option> <option value="">-- Select Year --</option>
{% for y in years %} {% for y in years %}
<option value="{{ y }}">AY {{ y }} - {{ y + 1 }}</option> <option value="{{ y }}">AY {{ y }} - {{ y + 1 }}</option>
{% endfor %} {% endfor %}
</select> </select>
<br> <br>
<button type="submit">Download Excel</button> <button type="submit">Download Excel</button>
</form> </form>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -1,13 +1,15 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}AO Records{% endblock %} {% block title %}AO Records{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/display_model.css') }}">
{% endblock %}
{% block content %} {% block content %}
<!-- Load only display_itr CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/display_itr.css') }}">
<div class="container"> <div class="container">
<h2 style="text-align: center;">Assessing Officer Records 👨‍💼</h2> <h2 style="text-align: center;">Assessing Officer Records 👨‍💼</h2>
<!-- Add AO Record Button --> <!-- Add AO Record Button -->
<div style="text-align: right; margin-bottom: 10px;"> <div style="text-align: right; margin-bottom: 10px;">
<a href="{{ url_for('add_ao') }}" class="btn btn-add"> Add AO Record</a> <a href="{{ url_for('add_ao') }}" class="btn btn-add"> Add AO Record</a>
@@ -22,8 +24,6 @@
<th>Gross Total Income</th> <th>Gross Total Income</th>
<th>Net Taxable Income</th> <th>Net Taxable Income</th>
<th>Total Tax</th> <th>Total Tax</th>
<th>Refund</th>
<th>Created Record Date</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
@@ -33,9 +33,7 @@
<td>AY {{ ao.year }}-{{ ao.year+1 }}</td> <td>AY {{ ao.year }}-{{ ao.year+1 }}</td>
<td>{{ ao.gross_total_income }}</td> <td>{{ ao.gross_total_income }}</td>
<td>{{ ao.net_taxable_income }}</td> <td>{{ ao.net_taxable_income }}</td>
<td>{{ ao.total_tax_payable }}</td> <td>{{ ao.total_tax }}</td>
<td>{{ "{:,.2f}".format(ao.refund) }}</td>
<td>{{ ao.created_at.strftime('%Y-%m-%d') }}</td>
<td> <td>
<a href="{{ url_for('update_ao', id=ao.id) }}" class="btn btn-update">Edit</a> <a href="{{ url_for('update_ao', id=ao.id) }}" class="btn btn-update">Edit</a>
@@ -49,9 +47,7 @@
</table> </table>
</div> </div>
{% else %} {% else %}
<p style="text-align: center; margin-top: 20px" class="no-record"> <p style="text-align: center; margin-top: 20px;" class="no-record">No AO records found.</p>
No records found. Click the button above to add one!
</p>
{% endif %} {% endif %}
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -1,13 +1,14 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}CIT Records{% endblock %} {% block title %}CIT Records{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/display_model.css') }}">
{% endblock %}
{% block content %} {% block content %}
<!-- Load only display_itr CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/display_cit.css') }}">
<div class="main">
<div class="container">
<div class="container">
<h2 style="text-align: center;">CIT Records🧾</h2> <h2 style="text-align: center;">CIT Records🧾</h2>
<div style="text-align: right; margin-bottom: 10px;"> <div style="text-align: right; margin-bottom: 10px;">
<a href="{{ url_for('add_cit') }}" class="btn btn-add"> Add New Record</a> <a href="{{ url_for('add_cit') }}" class="btn btn-add"> Add New Record</a>
@@ -22,7 +23,6 @@
<th>Net Taxable Income</th> <th>Net Taxable Income</th>
<th>Total Tax Payable</th> <th>Total Tax Payable</th>
<th>Refund</th> <th>Refund</th>
<th>Created Record Date</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
@@ -34,7 +34,6 @@
<td>{{ "{:,.2f}".format(record.net_taxable_income) }}</td> <td>{{ "{:,.2f}".format(record.net_taxable_income) }}</td>
<td>{{ "{:,.2f}".format(record.total_tax_payable) }}</td> <td>{{ "{:,.2f}".format(record.total_tax_payable) }}</td>
<td>{{ "{:,.2f}".format(record.refund) }}</td> <td>{{ "{:,.2f}".format(record.refund) }}</td>
<td>{{ record.created_at.strftime('%Y-%m-%d') }}</td>
<td class="action-cell"> <td class="action-cell">
<a href="{{ url_for('update_cit', id=record.id) }}" class="btn btn-update">Edit</a> <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" <form action="{{ url_for('delete_cit', id=record.id) }}" method="post"
@@ -53,6 +52,6 @@
No records found. Click the button above to add one! No records found. Click the button above to add one!
</p> </p>
{% endif %} {% endif %}
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -2,17 +2,29 @@
{% block title %}ITAT Records{% endblock %} {% block title %}ITAT Records{% endblock %}
<!-- Load page-specific CSS -->
{% block extra_css %} {% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/display_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/display_itat.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="main">
<div class="container">
<h2 style="text-align: center;">Income Tax Appellate Tribunal Records 📄</h2> <h2 style="text-align: center;">Income Tax Appellate Tribunal Records 📄</h2>
<div style="text-align: right; margin-bottom: 10px;"> <div style="text-align: right; margin-bottom: 10px;">
<a href="{{ url_for('add_itat') }}" class="btn btn-add"> Add New Record</a> <a href="{{ url_for('add_itat') }}" class="btn btn-add"> Add New Record</a>
<!-- 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 %}
<!-- TABLE --> <!-- TABLE -->
{% if records %} {% if records %}
<div class="table-wrapper"> <div class="table-wrapper">
@@ -20,11 +32,10 @@
<thead> <thead>
<tr> <tr>
<th>Year</th> <th>Year</th>
<th>Gross Total Income</th> <th>MAT Tax Credit</th>
<th>Net Taxable Income</th> <th>Surcharge</th>
<th>Total Tax Payable</th> <th>Cess</th>
<th>Refund</th> <th>Total Credit</th>
<th>Created Record Date</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
@@ -36,7 +47,7 @@
<td>{{ "{:,.2f}".format(record.net_taxable_income) }}</td> <td>{{ "{:,.2f}".format(record.net_taxable_income) }}</td>
<td>{{ "{:,.2f}".format(record.total_tax_payable) }}</td> <td>{{ "{:,.2f}".format(record.total_tax_payable) }}</td>
<td>{{ "{:,.2f}".format(record.refund) }}</td> <td>{{ "{:,.2f}".format(record.refund) }}</td>
<td>{{ record.created_at.strftime('%Y-%m-%d') }}</td>
<td class="action-cell"> <td class="action-cell">
<a href="{{ url_for('update_itat', id=record.id) }}" class="btn btn-update">Edit</a> <a href="{{ url_for('update_itat', id=record.id) }}" class="btn btn-update">Edit</a>
@@ -52,9 +63,10 @@
</div> </div>
{% else %} {% else %}
<p class="no-record">No records found. Click the button above to add one!</p> <p class="no-record">No ITAT records found. Click the button above to add one!</p>
{% endif %} {% endif %}
</div> </div>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -1,12 +1,14 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}ITR Records{% endblock %} {% block title %}ITR Records{% endblock %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/display_model.css') }}">
{% endblock %}
{% block content %} {% block content %}
<!-- Load only display_itr CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/display_itr.css') }}">
<div class="container"> <div class="container">
<h2>Income Tax Return Records 🧾</h2> <h2>Income Tax Return Records 🧾</h2>
<div style="text-align: right; margin-bottom: 10px;"> <div style="text-align: right; margin-bottom: 10px;">
<a href="{{ url_for('add_itr') }}" class="btn btn-add"> Add New Record</a> <a href="{{ url_for('add_itr') }}" class="btn btn-add"> Add New Record</a>
@@ -22,7 +24,6 @@
<th>Net Taxable Income</th> <th>Net Taxable Income</th>
<th>Total Tax Payable</th> <th>Total Tax Payable</th>
<th>Refund</th> <th>Refund</th>
<th>Created Record Date</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
@@ -34,7 +35,6 @@
<td>{{ "{:,.2f}".format(record.net_taxable_income) }}</td> <td>{{ "{:,.2f}".format(record.net_taxable_income) }}</td>
<td>{{ "{:,.2f}".format(record.total_tax_payable) }}</td> <td>{{ "{:,.2f}".format(record.total_tax_payable) }}</td>
<td>{{ "{:,.2f}".format(record.refund) }}</td> <td>{{ "{:,.2f}".format(record.refund) }}</td>
<td>{{ record.created_at.strftime('%Y-%m-%d') }}</td>
<td class="action-cell"> <td class="action-cell">
<a href="{{ url_for('update_itr', id=record.id) }}" class="btn btn-update">Edit</a> <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" <form action="{{ url_for('delete_itr', id=record.id) }}" method="post"

View File

@@ -5,7 +5,7 @@
{% block content %} {% block content %}
<div class="container"> <div class="container">
<h2 class="header">Dashboard 🏛️</h2> <h2 class="header">Dashboard 🏛️</h2>
<p> <p style="text-align: center; font-size: 20px;">
Welcome to Income Tax Utilities Dashboard Welcome to Income Tax Utilities Dashboard
</p> </p>
</div> </div>

View File

@@ -3,13 +3,16 @@
{% block title %}Download ITAT Report{% endblock %} {% block title %}Download ITAT Report{% endblock %}
{% block extra_css %} {% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/report_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/itat_report.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="main">
<div class="container">
<h2>Download ITAT Report</h2> <h2>Download ITAT Report</h2>
<form method="GET" action="{{ url_for('itat_report') }}" target="_blank"> <form method="GET" action="{{ url_for('itat_report') }}" target="_blank">
<label for="year">Select Year:</label><br> <label for="year">Select Year:</label><br>
<select name="year" id="year" required> <select name="year" id="year" required>
<option value="">-- Select Year --</option> <option value="">-- Select Year --</option>
@@ -19,6 +22,10 @@
</select> </select>
<br> <br>
<button type="submit">Download Excel</button> <button type="submit">Download Excel</button>
</form> </form>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -3,13 +3,16 @@
{% block title %}Download ITR Report{% endblock %} {% block title %}Download ITR Report{% endblock %}
{% block extra_css %} {% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/report_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/itr_report.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="main">
<div class="container">
<h2>Download ITR Report</h2> <h2>Download ITR Report</h2>
<form method="GET" action="{{ url_for('itr_report') }}" target="_blank"> <form method="GET" action="{{ url_for('itr_report') }}" target="_blank">
<label for="year">Select Year:</label><br> <label for="year">Select Year:</label><br>
<select name="year" id="year" required> <select name="year" id="year" required>
<option value="">-- Select Year --</option> <option value="">-- Select Year --</option>
@@ -17,8 +20,14 @@
<option value="{{ y }}">AY {{ y }} - {{ y + 1 }}</option> <option value="{{ y }}">AY {{ y }} - {{ y + 1 }}</option>
{% endfor %} {% endfor %}
</select> </select>
<br> <br>
<button type="submit">Download Excel</button> <button type="submit">
Download Excel
</button>
</form> </form>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -4,14 +4,68 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>LCEPL Income Tax</title> <title>LCEPL Income Tax</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
<link rel="stylesheet" href="{{ url_for('static', filename='css/login.css') }}"> body {
font-family: Arial, sans-serif;
background: #f3f3f3;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.login-container {
background: white;
padding: 2rem;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
width: 300px;
}
h2 {
text-align: center;
margin-bottom: 1.5rem;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 0.5rem;
margin-bottom: 1rem;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
width: 100%;
padding: 0.5rem;
background: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.flash {
color: red;
text-align: center;
margin-bottom: 1rem;
}
.title {
text-align: center;
color: #007bff;
}
.subtitle {
text-align: center;
}
</style>
</head> </head>
<body> <body>
<div class="login-container"> <div class="login-container">
<h1 class="title">Laxmi Civil Engineering Services</h1> <h1 class="title">Laxmi Civil Engineering Services</h1>
<h2 class="sub-title">Income Tax Software</h2>
<h4 class="subtitle">LOGIN</h4> <h4 class="subtitle">LOGIN</h4>
{% with messages = get_flashed_messages(with_categories=true) %} {% if {% with messages = get_flashed_messages(with_categories=true) %} {% if

View File

@@ -7,9 +7,8 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container mat-container"> <div class="container">
<div class="container">
<h2 class="page-title">MAT Credit and Utilization Records</h2>
<!-- YEAR ADD CONTROLS --> <!-- YEAR ADD CONTROLS -->
<div class="year-controls"> <div class="year-controls">
@@ -19,10 +18,10 @@
<option value="{{ y }}-{{ y+1 }}">{{ y }}-{{ y+1 }}</option> <option value="{{ y }}-{{ y+1 }}">{{ y }}-{{ y+1 }}</option>
{% endfor %} {% endfor %}
</select> </select>
<button onclick="addYearColumn()"> Add Utilized Year</button> <button onclick="addYearColumn()"> Add Year</button>
</div> </div>
<!-- TABLE WRAPPER --> <!-- SCROLL WRAPPER -->
<div class="table-wrapper"> <div class="table-wrapper">
<table id="matTable"> <table id="matTable">
<thead> <thead>
@@ -42,7 +41,7 @@
<tbody> <tbody>
{% for row in mat_rows %} {% for row in mat_rows %}
<tr> <tr>
<td contenteditable="false">{{ row.financial_year }}-{{ row.financial_year | int + 1 }}</td> <td contenteditable="true">{{ row.financial_year }}</td>
<td><input value="{{ row.mat_credit }}"></td> <td><input value="{{ row.mat_credit }}"></td>
{% for y in added_years %} {% for y in added_years %}
@@ -55,17 +54,21 @@
<td><button onclick="saveRow(this)">Save</button></td> <td><button onclick="saveRow(this)">Save</button></td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="action-footer"> <br>
<button class="add-row-btn" onclick="addRow()"> Add New Row</button> <button onclick="addRow()"> Add Row</button>
<!-- <button onclick="saveAll()">💾 Save All</button> -->
</div> </div>
</div> </div>
{% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{{ url_for('static', filename='js/mat_credit.js') }}"></script> <script src="{{ url_for('static', filename='js/mat_credit.js') }}"></script>
{% endblock %} {% endblock %}
{% endblock %}

View File

@@ -5,7 +5,8 @@
<link rel="stylesheet" href="{{ url_for('static', filename='css/report.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/report.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="main">
<div class="container">
<h2>Reports</h2> <h2>Reports</h2>
<ul> <ul>
<li><a href="{{ url_for('itr_report') }}">→ View ITR Reports</a></li> <li><a href="{{ url_for('itr_report') }}">→ View ITR Reports</a></li>
@@ -13,5 +14,6 @@
<li><a href="{{ url_for('cit_report') }}">→ View CIT 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> <li><a href="{{ url_for('itat_report') }}">→ View ITAT Reports</a></li>
</ul> </ul>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -1,17 +1,23 @@
{% extends "base.html" %} {% block title %}Download Summary Report{% endblock %} {% extends "base.html" %}
{% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/summary.css') }}" />
{% endblock %} {% block content %} {% block title %}Download Summary Report{% endblock %}
<div class="container">
<div class="head"> {% block extra_css %}
<!-- Optional: Add page-specific CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/summary.css') }}">
{% endblock %}
{% block content %}
<div class="main">
<div class="container">
<h2>Download Year-wise Summary Report</h2> <h2>Download Year-wise Summary Report</h2>
{% if message %} {% if message %}
<p class="message">{{ message }}</p> <p class="message">{{ message }}</p>
{% endif %} {% endif %}
<div class="select-download-wrapper"> <form method="GET" action="{{ url_for('summary_report') }}">
<label>Select Year:</label>
<select name="year" id="year" required> <select name="year" id="year" required>
<option value="">-- Select Year --</option> <option value="">-- Select Year --</option>
{% for year in years %} {% for year in years %}
@@ -19,17 +25,11 @@
{% endfor %} {% endfor %}
</select> </select>
<a id="downloadBtn" href="#">Download Summary Report</a> <button type="submit">Download Summary Report</button>
</div> </form>
</div>
<!-- Preview Section -->
<div id="preview" style="display: none">
<h3>Summary Preview</h3>
<div id="previewContent"></div>
</div> </div>
</div> </div>
{% endblock %} {% block extra_js %}
<script src="{{ url_for('static', filename='js/summary_preview.js') }}"></script>
{% endblock %} {% endblock %}

View File

@@ -3,283 +3,32 @@
{% block title %}Update AO Record{% endblock %} {% block title %}Update AO Record{% endblock %}
{% block extra_css %} {% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/add_ao.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="main">
<h2>Update AO Record for Year {{ record.year }} - {{ record.year + 1 }}</h2> <div class="container">
<h2>Update AO Record for Year {{ record.year }}</h2>
<form method="POST" action="{{ url_for('update_ao', id=record.id) }}"> <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"> <label for="year">Year:</label>
<div> <input type="text" id="year" name="year" value="{{ record.year }}" readonly class="readonly-field">
<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"> {% for field in record.keys() if field not in ['id', 'year', 'remarks'] %}
<div> <label for="{{ field }}">{{ field.replace("_", " ").title() }}:</label>
<label>GTI as per AO</label> <input type="number" id="{{ field }}" name="{{ field }}" step="any" value="{{ record[field] }}" required>
<input type="number" name="gti_as_per_ao" class="auto" step="any" {% endfor %}
value="{{ record.gross_total_income + record.disallowance_37 + record.disallowance_14a }}"
readonly>
</div>
</div>
<div class="form-group full-width inline-2"> <label for="Remarks">Remarks:</label>
<div> <input type="text" id="Remarks" name="Remarks" value="{{ record.remarks}}">
<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> <button type="submit">Update Record</button>
</form> </form>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -3,278 +3,31 @@
{% block title %}Update CIT Record{% endblock %} {% block title %}Update CIT Record{% endblock %}
{% block extra_css %} {% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/add_cit.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<h2>Update CIT Record for AY {{ record.year }}</h2> <h2>Update CIT Record for AY {{ record.year }}</h2>
<form method="POST" action="{{ url_for('update_cit', id=record.id) }}"> <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"> <label for="year">Year:</label>
<div> <input type="text" id="year" name="year" value="{{ record.year }}" readonly class="readonly-field">
<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"> {% for field in record.keys() if field not in ['id', 'year','Remarks'] %}
<div> <label for="{{ field }}">{{ field.replace("_", " ").title() }}:</label>
<label>Less :Deduction 80IA Business Income:</label> <input type="number" id="{{ field }}" name="{{ field }}" step="any" value="{{ record[field] }}" required>
<input type="number" name="deduction_80ia_business" step="any" {% endfor %}
value="{{ record.deduction_80ia_business}}" oninput="calculate()" required> <label for="Remarks">Remarks:</label>
</div> <input type="text" id="Remarks" name="Remarks" value="{{ record.Remarks }}">
<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> <button type="submit">Update Record</button>
</form> </form>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -2,283 +2,30 @@
{% block title %}Update ITAT Record{% endblock %} {% block title %}Update ITAT Record{% endblock %}
{% block extra_css %} {% block extra_css %}
<!-- Child page CSS --> <!-- Child page CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/add_itat.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<h2>Update ITAT Record for Year {{ record.year }}</h2> <h2>Update ITAT Record for Year {{ record.year }}</h2>
<form method="POST" action="{{ url_for('update_itat', id=record.id) }}"> <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>
<div class="form-group full-width inline-2"> <label for="year">Year:</label>
<div> <input type="text" id="year" name="year" value="{{ record.year }}" readonly class="readonly-field">
<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"> {% for field in record.keys() if field not in ['id', 'year', 'Remarks'] %}
<div> <label for="{{ field }}">{{ field.replace("_", " ").title() }}:</label>
<label>GTI as per AO</label> <input type="number" id="{{ field }}" name="{{ field }}" step="any" value="{{ record[field] }}" required>
<input type="number" name="gti_as_per_ao" class="auto" step="any" {% endfor %}
value="{{ record.gross_total_income + record.disallowance_37 + record.disallowance_14a }}"
readonly>
</div>
</div>
<div class="form-group full-width inline-2"> <label for="Remarks">Remarks:</label>
<div> <input type="text" id="Remarks" name="Remarks" value="{{ record.Remarks }}">
<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 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> <button type="submit">Update Record</button>
</form> </form>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -3,286 +3,32 @@
{% block title %}Update ITR Record{% endblock %} {% block title %}Update ITR Record{% endblock %}
{% block extra_css %} {% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/add_itr.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="main">
<h2>Update ITR Record for Year {{record.year}} - {{record.year+1}}</h2> <div class="container">
<h2>Update ITR Record for Year {{ record.year }}</h2>
<form method="POST" action="{{ url_for('update_itr', id=record.id) }}"> <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"> <label for="year">Year:</label>
<div> <input type="text" id="year" name="year" value="{{ record.year }}" readonly class="readonly-field">
<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"> {% for field in record.keys() if field not in ['id', 'year', 'Remarks'] %}
<div> <label for="{{ field }}">{{ field.replace("_", " ").title() }}:</label>
<label>GTI as per AO</label> <input type="number" id="{{ field }}" name="{{ field }}" step="any" value="{{ record[field] }}" required>
<input type="number" name="gti_as_per_ao" class="auto" step="any" {% endfor %}
value="{{ record.gross_total_income + record.disallowance_37 + record.disallowance_14a }}"
readonly>
</div>
</div>
<div class="form-group full-width inline-2"> <label for="Remarks">Remarks:</label>
<div> <input type="text" id="Remarks" name="Remarks" value="{{ record.Remarks }}">
<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> <button type="submit">Update Record</button>
</form>
</div>
{% endblock %} </form>
{% block extra_js %}
<script src="{{ url_for('static', filename='js/itr_calc.js') }}"></script> </div>
</div>
{% endblock %} {% endblock %}

View File

@@ -7,12 +7,18 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="main">
<div class="container">
<h2>Upload Income Tax Documents</h2> <h2>Upload Income Tax Documents</h2>
<form id="documents" method="POST" enctype="multipart/form-data">
<form id="income_tax_documents" method="POST" enctype="multipart/form-data">
<label>Year:</label> <label>Year:</label>
<select id="year" name="year" required></select> <select id="year" name="year" required></select>
<div id="yearError" style="color: red; display: none; margin-bottom: 10px;"></div> <div id="yearError" style="color: red; display: none; margin-bottom: 10px;"></div>
<label>Stage:</label> <label>Stage:</label>
<select name="stage" required> <select name="stage" required>
<option value="ITR">ITR</option> <option value="ITR">ITR</option>
@@ -20,11 +26,14 @@
<option value="CIT">CIT</option> <option value="CIT">CIT</option>
<option value="ITAT">ITAT</option> <option value="ITAT">ITAT</option>
</select> </select>
<label>Select Documents:</label> <label>Select Documents:</label>
<input type="file" name="documents" multiple required> <input type="file" name="documents" multiple required>
<button type="submit">Upload</button> <button type="submit">Upload</button>
</form> </form>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -1,12 +1,18 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}Document Records{% endblock %} {% block title %}Document Records{% endblock %}
{% block extra_css %} {% block extra_css %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/documents.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/documents.css') }}">
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="main">
<div class="container">
<h2>Document Records</h2> <h2>Document Records</h2>
<!-- FILTER FORM --> <!-- FILTER FORM -->
<form method="GET"> <form method="GET">
<label for="year">Filter by Year:</label> <label for="year">Filter by Year:</label>
@@ -20,20 +26,16 @@
<label for="stage">Filter by Stage:</label> <label for="stage">Filter by Stage:</label>
<select name="stage"> <select name="stage">
<option value="">All</option> <option value="">All</option>
{% set stages = ['ITR','AO','CIT','ITAT'] %} <option value="ITR">ITR</option>
{% for stage in stages %} <option value="AO">AO</option>
<option value="{{stage}}">{{stage}}</option> <option value="CIT">CIT</option>
{% endfor %} <option value="ITAT">ITAT</option>
</select> </select>
<button type="submit">Apply</button> <button type="submit">Apply</button>
</form> </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 --> <!-- DOCUMENT TABLE -->
<div class="table-responsive">
<table> <table>
<thead> <thead>
<tr> <tr>
@@ -56,15 +58,23 @@
<td>AY {{ doc.year }}-{{ doc.year +1 }}</td> <td>AY {{ doc.year }}-{{ doc.year +1 }}</td>
<td>{{ doc.uploaded_at }}</td> <td>{{ doc.uploaded_at }}</td>
<td> <a href="{{ url_for('uploaded_file', filename=doc.filename) }}?mode=download">Download</a> <td>
<a href="{{ url_for('uploaded_file', filename=doc.filename) }}?mode=download">
Download
</a>
</td> </td>
<td><a href="{{ url_for('uploaded_file', filename=doc.filename) }}?mode=view" <td>
target="_blank">View</a></td> <a href="{{ url_for('uploaded_file', filename=doc.filename) }}?mode=view" target="_blank">
View
</a>
</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -1,24 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
body {
background: black;
color: #00ff00;
font-family: monospace;
}
.log-box {
white-space: pre-wrap;
height: 90vh;
overflow-y: scroll;
}
</style>
</head>
<body>
<h2>Application Logs</h2>
<div class="log-box">{% for line in logs %} {{ line }} {% endfor %}</div>
</body>
</html>

View File

@@ -1,90 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>View Logs - Authorization</title>
<style>
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
background: linear-gradient(135deg, #0d47a1, #1976d2);
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
background: #ffffff;
padding: 40px;
width: 350px;
border-radius: 12px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
text-align: center;
}
h2 {
margin-bottom: 25px;
color: #0d47a1;
}
input[type="password"] {
width: 100%;
padding: 12px;
margin-bottom: 20px;
border-radius: 6px;
border: 1px solid #ccc;
font-size: 14px;
outline: none;
transition: border 0.3s;
}
input[type="password"]:focus {
border: 1px solid #1976d2;
}
button {
width: 100%;
padding: 12px;
background-color: #1976d2;
color: white;
border: none;
border-radius: 6px;
font-size: 15px;
cursor: pointer;
transition: background 0.3s ease;
}
button:hover {
background-color: #0d47a1;
}
.flash-message {
margin-top: 15px;
font-size: 14px;
color: red;
}
</style>
</head>
<body>
<div class="container">
<h2>Enter Secret to View Logs</h2>
<form method="POST">
<input type="password" name="secret" placeholder="Enter Secret Password" required>
<button type="submit">Open Logs</button>
</form>
{% with messages = get_flashed_messages(with_categories=true) %}
{% for category, message in messages %}
<div class="flash-message">{{ message }}</div>
{% endfor %}
{% endwith %}
</div>
</body>
</html>