Compare commits
8 Commits
a8e47af61c
...
32b6ab9b10
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32b6ab9b10 | ||
|
|
b8d540263b | ||
| 9b1b8732ef | |||
| ded8d1f3b2 | |||
| 1819c49433 | |||
| aaab008a9d | |||
| a9af2cde8a | |||
| a0f4568ba2 |
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
||||
__pycache__/
|
||||
*.pyc
|
||||
.git
|
||||
.idea
|
||||
venv
|
||||
25
.env
Normal file
25
.env
Normal file
@@ -0,0 +1,25 @@
|
||||
# -----------------------------
|
||||
# Flask App Configuration
|
||||
# -----------------------------
|
||||
FLASK_ENV=development
|
||||
FLASK_DEBUG=true
|
||||
FLASK_HOST=0.0.0.0
|
||||
FLASK_PORT=5010
|
||||
|
||||
# -----------------------------
|
||||
# Security
|
||||
# -----------------------------
|
||||
SECRET_KEY=secret1234
|
||||
|
||||
# -----------------------------
|
||||
# Database Configuration
|
||||
# -----------------------------
|
||||
DB_DIALECT=mysql
|
||||
# DB_DRIVER=pymysql
|
||||
DB_HOST=127.0.0.1
|
||||
# DB_HOST=db # this is production for use docker
|
||||
DB_PORT=3306
|
||||
DB_NAME=test_income_taxdb
|
||||
DB_USER=root
|
||||
DB_PASSWORD=tiger
|
||||
|
||||
@@ -3,7 +3,6 @@ import mysql.connector
|
||||
import pandas as pd
|
||||
import io
|
||||
|
||||
|
||||
class AOHandler:
|
||||
|
||||
def __init__(self):
|
||||
@@ -33,6 +32,8 @@ class AOHandler:
|
||||
|
||||
# Add AO record
|
||||
def add_ao(self, data):
|
||||
|
||||
try:
|
||||
fields = [
|
||||
'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
|
||||
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
|
||||
@@ -41,15 +42,19 @@ class AOHandler:
|
||||
'tax_payable', 'surcharge', 'edu_cess',
|
||||
'total_tax_payable', 'mat_credit_created', 'mat_credit_utilized',
|
||||
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs',
|
||||
'sat', 'tax_on_assessment', 'refund', 'Remarks'
|
||||
'sat', 'tax_on_assessment', 'refund', 'Remarks','created_at'
|
||||
]
|
||||
|
||||
values = [data.get(f, 0) for f in fields]
|
||||
|
||||
self.cursor.callproc("InsertAO", values)
|
||||
self.conn.commit()
|
||||
except Exception as e:
|
||||
self.conn.rollback()
|
||||
raise e
|
||||
finally:
|
||||
self.cursor.close()
|
||||
self.conn.close()
|
||||
|
||||
|
||||
# UPDATE AO RECORD by AO id
|
||||
def update_ao(self, id, data):
|
||||
fields = [
|
||||
@@ -193,8 +198,6 @@ class AOHandler:
|
||||
print("MySQL Error →", e)
|
||||
return None
|
||||
|
||||
|
||||
|
||||
# CLOSE CONNECTION
|
||||
def close(self):
|
||||
self.cursor.close()
|
||||
|
||||
@@ -3,7 +3,6 @@ import mysql.connector
|
||||
import pandas as pd
|
||||
import io
|
||||
|
||||
|
||||
class CITHandler:
|
||||
|
||||
def __init__(self):
|
||||
@@ -44,7 +43,7 @@ class CITHandler:
|
||||
'tax_payable', 'surcharge', 'edu_cess',
|
||||
'total_tax_payable', 'mat_credit_created', 'mat_credit_utilized',
|
||||
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs',
|
||||
'sat', 'tax_on_assessment', 'refund', 'Remarks'
|
||||
'sat', 'tax_on_assessment', 'refund', 'Remarks','created_at'
|
||||
]
|
||||
|
||||
values = [data.get(col, 0) for col in columns]
|
||||
|
||||
@@ -1,21 +1,43 @@
|
||||
# import mysql.connector
|
||||
# import os
|
||||
|
||||
# # Database Config
|
||||
# class DBConfig:
|
||||
# MYSQL_HOST = os.getenv("DB_HOST")
|
||||
# MYSQL_USER = os.getenv("DB_USER")
|
||||
# MYSQL_PASSWORD = os.getenv("DB_PASSWORD")
|
||||
# MYSQL_DB = os.getenv("DB_NAME")
|
||||
|
||||
# @staticmethod
|
||||
# def get_db_connection():
|
||||
# """
|
||||
# Returns a MySQL connection object.
|
||||
# """
|
||||
# return mysql.connector.connect(
|
||||
# host=DBConfig.MYSQL_HOST,
|
||||
# user=DBConfig.MYSQL_USER,
|
||||
# password=DBConfig.MYSQL_PASSWORD,
|
||||
# database=DBConfig.MYSQL_DB
|
||||
# )
|
||||
|
||||
|
||||
import mysql.connector
|
||||
import os
|
||||
|
||||
# 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")
|
||||
|
||||
class DBConfig:
|
||||
@staticmethod
|
||||
def get_db_connection():
|
||||
"""
|
||||
Returns a MySQL connection object.
|
||||
Create and return a MySQL database connection
|
||||
using environment variables.
|
||||
"""
|
||||
|
||||
return mysql.connector.connect(
|
||||
host=DBConfig.MYSQL_HOST,
|
||||
user=DBConfig.MYSQL_USER,
|
||||
password=DBConfig.MYSQL_PASSWORD,
|
||||
database=DBConfig.MYSQL_DB
|
||||
host=os.getenv("DB_HOST", "db"), # Docker service name
|
||||
port=int(os.getenv("DB_PORT", 3306)),
|
||||
user=os.getenv("DB_USER", "root"),
|
||||
password=os.getenv("DB_PASSWORD", "root"),
|
||||
database=os.getenv("DB_NAME", "test_income_taxdb"),
|
||||
autocommit=False
|
||||
)
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import mysql.connector
|
||||
import pandas as pd
|
||||
import pymysql
|
||||
import io
|
||||
from flask import send_file, render_template, request
|
||||
|
||||
from AppCode.Config import DBConfig
|
||||
from AppCode.YearGet import YearGet
|
||||
|
||||
|
||||
class ITRHandler:
|
||||
@@ -14,7 +12,6 @@ class ITRHandler:
|
||||
self.conn = DBConfig.get_db_connection()
|
||||
self.cursor = self.conn.cursor(dictionary=True)
|
||||
|
||||
|
||||
# GET ALL ITR RECORDS using stored procedure "GetAllItr"
|
||||
def get_all_itr(self):
|
||||
self.cursor.callproc("GetAllItr")
|
||||
@@ -44,21 +41,29 @@ class ITRHandler:
|
||||
# INSERT ITR RECORD using procedure "add_itr"
|
||||
def add_itr(self, data):
|
||||
|
||||
columns = [
|
||||
'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
|
||||
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
|
||||
'deduction_sec37_disallowance', 'deduction_80g',
|
||||
'net_taxable_income', 'tax_30_percent', 'tax_book_profit_18_5',
|
||||
'tax_payable', 'surcharge', 'edu_cess',
|
||||
'total_tax_payable', 'mat_credit_created', 'mat_credit_utilized',
|
||||
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs',
|
||||
'sat', 'tax_on_assessment', 'refund', 'Remarks'
|
||||
]
|
||||
values = [data.get(col, 0) for col in columns]
|
||||
try:
|
||||
columns = [
|
||||
'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
|
||||
'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
|
||||
'deduction_sec37_disallowance', 'deduction_80g',
|
||||
'net_taxable_income', 'tax_30_percent', 'tax_book_profit_18_5',
|
||||
'tax_payable', 'surcharge', 'edu_cess',
|
||||
'total_tax_payable', 'mat_credit_created', 'mat_credit_utilized',
|
||||
'interest_234c', 'total_tax', 'advance_tax', 'tds', 'tcs',
|
||||
'sat', 'tax_on_assessment', 'refund', 'Remarks','created_at'
|
||||
]
|
||||
values = [data.get(col, 0) for col in columns]
|
||||
|
||||
# Call your stored procedure
|
||||
self.cursor.callproc("InsertITR", values)
|
||||
self.conn.commit()
|
||||
except Exception as e:
|
||||
self.conn.rollback()
|
||||
raise e
|
||||
finally:
|
||||
self.cursor.close()
|
||||
self.conn.close()
|
||||
|
||||
# Call your stored procedure
|
||||
self.cursor.callproc("InsertITR", values)
|
||||
self.conn.commit()
|
||||
|
||||
# update itr by id
|
||||
def update(self, id, data):
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
from AppCode.Config import DBConfig
|
||||
import mysql.connector
|
||||
|
||||
|
||||
class MatCreditHandler:
|
||||
|
||||
def __init__(self):
|
||||
# db = DBConfig()
|
||||
self.conn = DBConfig.get_db_connection()
|
||||
self.cursor = self.conn.cursor(dictionary=True)
|
||||
|
||||
# get all Mat credit data
|
||||
# --------------------------------------------------
|
||||
# FETCH ALL MAT CREDIT + UTILIZATION (For UI Display)
|
||||
# --------------------------------------------------
|
||||
def fetch_all(self):
|
||||
try:
|
||||
|
||||
self.cursor.callproc("GetMatCedit")
|
||||
result_sets = self.cursor.stored_results()
|
||||
mat_rows = next(result_sets).fetchall()
|
||||
@@ -19,30 +21,78 @@ class MatCreditHandler:
|
||||
return mat_rows, utilization_rows
|
||||
finally:
|
||||
self.cursor.close()
|
||||
self.conn.close()
|
||||
|
||||
# Save Mat credit data single row
|
||||
# --------------------------------------------------
|
||||
# SAVE / UPDATE SINGLE MAT ROW (FROM MANUAL UI)
|
||||
# --------------------------------------------------
|
||||
@staticmethod
|
||||
def save_single(data):
|
||||
conn = DBConfig.get_db_connection()
|
||||
cur = conn.cursor(dictionary=True)
|
||||
|
||||
try:
|
||||
# Save / Update MAT Credit
|
||||
cur.callproc(
|
||||
"SaveOrUpdateMatCredit",
|
||||
(
|
||||
data["financial_year"],
|
||||
data["mat_credit"],
|
||||
data["balance"],
|
||||
data.get("remarks", "")
|
||||
)
|
||||
)
|
||||
|
||||
cur.callproc("SaveOrUpdateMatCredit",(
|
||||
data["financial_year"],
|
||||
data["mat_credit"],
|
||||
data["balance"]
|
||||
))
|
||||
|
||||
result = next(cur.stored_results()).fetchone()
|
||||
mat_id = result["mat_id"]
|
||||
|
||||
if not mat_id:
|
||||
raise Exception("mat_id not returned from procedure")
|
||||
mat_id = None
|
||||
for result in cur.stored_results():
|
||||
mat_id = result.fetchone()["mat_id"]
|
||||
|
||||
# Save utilization rows
|
||||
for u in data.get("utilization", []):
|
||||
if float(u["amount"]) > 0:
|
||||
cur.callproc(
|
||||
"InsertMatUtilization",
|
||||
(mat_id, u["year"], u["amount"])
|
||||
)
|
||||
|
||||
conn.commit()
|
||||
|
||||
except Exception as e:
|
||||
conn.rollback()
|
||||
raise e
|
||||
finally:
|
||||
cur.close()
|
||||
conn.close()
|
||||
|
||||
# --------------------------------------------------
|
||||
# AUTO SAVE MAT FROM ITR (MAIN LOGIC)
|
||||
# --------------------------------------------------
|
||||
@staticmethod
|
||||
def save_from_itr(year, mat_created, mat_utilized, remarks="Auto from"):
|
||||
conn = DBConfig.get_db_connection()
|
||||
cur = conn.cursor(dictionary=True)
|
||||
|
||||
try:
|
||||
mat_created = float(mat_created or 0)
|
||||
mat_utilized = float(mat_utilized or 0)
|
||||
|
||||
balance = mat_created - mat_utilized
|
||||
|
||||
# Save / Update MAT Credit
|
||||
cur.callproc(
|
||||
"SaveOrUpdateMatCredit",
|
||||
(year, mat_created, balance, remarks)
|
||||
)
|
||||
|
||||
mat_id = None
|
||||
for result in cur.stored_results():
|
||||
mat_id = result.fetchone()["mat_id"]
|
||||
|
||||
# Save utilization only if used
|
||||
if mat_utilized > 0:
|
||||
cur.callproc(
|
||||
"InsertMatUtilization",
|
||||
(mat_id, u["year"], u["amount"])
|
||||
(mat_id, year, mat_utilized)
|
||||
)
|
||||
|
||||
conn.commit()
|
||||
@@ -50,56 +100,29 @@ class MatCreditHandler:
|
||||
except Exception as e:
|
||||
conn.rollback()
|
||||
raise e
|
||||
|
||||
finally:
|
||||
cur.close()
|
||||
conn.close()
|
||||
|
||||
# save all Mat credit data
|
||||
# @staticmethod
|
||||
# def save_bulk(rows):
|
||||
# conn = DBConfig.get_db_connection()
|
||||
# cur = conn.cursor()
|
||||
# skipped = []
|
||||
|
||||
# try:
|
||||
# for row in rows:
|
||||
# cur.execute(
|
||||
# "SELECT id FROM mat_credit WHERE financial_year=%s",
|
||||
# (row["financial_year"],)
|
||||
# )
|
||||
# if cur.fetchone():
|
||||
# skipped.append(row["financial_year"])
|
||||
# continue
|
||||
# --------------------------------------------------
|
||||
# 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()
|
||||
|
||||
# cur.execute("""
|
||||
# INSERT INTO mat_credit (financial_year, mat_credit, balance)
|
||||
# VALUES (%s,%s,%s)
|
||||
# """, (row["financial_year"], row["mat_credit"], row["balance"]))
|
||||
|
||||
# mat_id = cur.lastrowid
|
||||
|
||||
# for u in row["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()
|
||||
# return skipped
|
||||
|
||||
# except Exception:
|
||||
# conn.rollback()
|
||||
# raise
|
||||
|
||||
# finally:
|
||||
# cur.close()
|
||||
# conn.close()
|
||||
|
||||
# CLOSE CONNECTION
|
||||
# --------------------------------------------------
|
||||
# CLOSE CONNECTION (MANUAL USE)
|
||||
# --------------------------------------------------
|
||||
def close(self):
|
||||
self.cursor.close()
|
||||
self.conn.close()
|
||||
|
||||
|
||||
if self.cursor:
|
||||
self.cursor.close()
|
||||
if self.conn:
|
||||
self.conn.close()
|
||||
|
||||
BIN
AppCode/__pycache__/AOHandler.cpython-313.pyc
Normal file
BIN
AppCode/__pycache__/AOHandler.cpython-313.pyc
Normal file
Binary file not shown.
BIN
AppCode/__pycache__/CITHandler.cpython-313.pyc
Normal file
BIN
AppCode/__pycache__/CITHandler.cpython-313.pyc
Normal file
Binary file not shown.
BIN
AppCode/__pycache__/Config.cpython-313.pyc
Normal file
BIN
AppCode/__pycache__/Config.cpython-313.pyc
Normal file
Binary file not shown.
BIN
AppCode/__pycache__/DocumentHandler.cpython-313.pyc
Normal file
BIN
AppCode/__pycache__/DocumentHandler.cpython-313.pyc
Normal file
Binary file not shown.
BIN
AppCode/__pycache__/ITRHandler.cpython-313.pyc
Normal file
BIN
AppCode/__pycache__/ITRHandler.cpython-313.pyc
Normal file
Binary file not shown.
BIN
AppCode/__pycache__/LoginAuth.cpython-313.pyc
Normal file
BIN
AppCode/__pycache__/LoginAuth.cpython-313.pyc
Normal file
Binary file not shown.
22
Dockerfile
Normal file
22
Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Prevent Python buffering
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system deps (if needed later)
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
CMD ["python", "main.py"]
|
||||
|
||||
0
db/income_tax.sql
Normal file
0
db/income_tax.sql
Normal file
29
docker-compose.yml
Normal file
29
docker-compose.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
db:
|
||||
image: mysql:8.0
|
||||
container_name: income_tax_db
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: test_income_taxdb
|
||||
ports:
|
||||
- "3307:3306"
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
- ./db/income_tax.sql:/docker-entrypoint-initdb.d/income_tax.sql
|
||||
|
||||
web:
|
||||
build: .
|
||||
container_name: income_tax_web
|
||||
restart: always
|
||||
ports:
|
||||
- "5010:5010"
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
87
main.py
87
main.py
@@ -4,7 +4,7 @@ from dotenv import load_dotenv
|
||||
load_dotenv()
|
||||
import pandas as pd
|
||||
from werkzeug.utils import secure_filename
|
||||
|
||||
from datetime import date
|
||||
from AppCode.Config import DBConfig
|
||||
from AppCode.LoginAuth import LoginAuth
|
||||
from AppCode.FileHandler import FileHandler
|
||||
@@ -15,6 +15,7 @@ from AppCode.AOHandler import AOHandler
|
||||
from AppCode.CITHandler import CITHandler
|
||||
from AppCode.ITATHandler import ITATHandler
|
||||
from AppCode.MatCreditHandler import MatCreditHandler
|
||||
import subprocess
|
||||
|
||||
|
||||
|
||||
@@ -59,7 +60,6 @@ def view_documents():
|
||||
docHandler.View(request=request)
|
||||
return render_template('view_docs.html', documents=docHandler.documents, years=docHandler.years)
|
||||
|
||||
|
||||
# Upload file documents
|
||||
@app.route('/uploads/<filename>')
|
||||
@auth.login_required
|
||||
@@ -68,20 +68,26 @@ def uploaded_file(filename):
|
||||
filepath = os.path.join(FileHandler.UPLOAD_FOLDER, secure_filename(filename))
|
||||
|
||||
if not os.path.exists(filepath):
|
||||
abort(404)
|
||||
flash("Unsupported file type for viewing", "warning")
|
||||
return redirect(url_for('view_documents'))
|
||||
|
||||
file_ext = filename.rsplit('.', 1)[-1].lower()
|
||||
# --- View Mode ---
|
||||
if mode == 'view':
|
||||
# pdf
|
||||
if file_ext == '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']:
|
||||
# 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')
|
||||
else:
|
||||
return abort(415) # Unsupported type for viewing
|
||||
flash("Unsupported file type for viewing", "warning")
|
||||
return redirect(url_for('view_documents'))
|
||||
|
||||
return send_file(filepath, as_attachment=True)
|
||||
return send_file(filepath, as_attachment=True, download_name=filename)
|
||||
|
||||
|
||||
|
||||
@@ -105,14 +111,28 @@ def display_itr():
|
||||
def add_itr():
|
||||
if request.method == 'POST':
|
||||
itr = ITRHandler()
|
||||
mat = MatCreditHandler()
|
||||
itr.add_itr(request.form)
|
||||
itr.close()
|
||||
flash("ITR record added successfully!", "success")
|
||||
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("ITR record added successfully!", "success")
|
||||
flash("ITR record and documents uploaded successfully!", "success")
|
||||
return redirect(url_for('display_itr'))
|
||||
|
||||
return render_template('add_itr.html')
|
||||
return render_template('add_itr.html',current_date=date.today().isoformat())
|
||||
|
||||
## 4. DELETE an ITR record
|
||||
## 4. DELETE an ITR records
|
||||
@app.route('/itr/delete/<int:id>', methods=['POST'])
|
||||
@auth.login_required
|
||||
def delete_itr(id):
|
||||
@@ -135,7 +155,7 @@ def update_itr(id):
|
||||
|
||||
record = itr.get_itr_by_id(id)
|
||||
itr.close()
|
||||
return render_template('update_itr.html', record=record)
|
||||
return render_template('update_itr.html', record=record, current_date=date.today().isoformat())
|
||||
|
||||
|
||||
|
||||
@@ -160,11 +180,25 @@ def display_ao():
|
||||
def add_ao():
|
||||
if request.method == 'POST':
|
||||
ao = AOHandler()
|
||||
mat = MatCreditHandler()
|
||||
ao.add_ao(request.form)
|
||||
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")
|
||||
return redirect(url_for('display_ao'))
|
||||
return render_template('add_ao.html')
|
||||
return render_template('add_ao.html',current_date=date.today().isoformat())
|
||||
|
||||
# 3. UPDATE AO record
|
||||
@app.route('/ao/update/<int:id>', methods=['GET', 'POST'])
|
||||
@@ -218,12 +252,25 @@ def display_cit():
|
||||
def add_cit():
|
||||
if request.method == 'POST':
|
||||
cit = CITHandler()
|
||||
mat = MatCreditHandler()
|
||||
cit.add_cit(request.form)
|
||||
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")
|
||||
return redirect(url_for('display_cit'))
|
||||
|
||||
return render_template('add_cit.html')
|
||||
return render_template('add_cit.html', current_date=date.today().isoformat())
|
||||
|
||||
# 3 delete CIT records by id
|
||||
@app.route('/cit/delete/<int:id>', methods=['POST'])
|
||||
@@ -275,13 +322,27 @@ def display_itat():
|
||||
def add_itat():
|
||||
if request.method == 'POST':
|
||||
itat = ITATHandler()
|
||||
mat = MatCreditHandler()
|
||||
data = {k: request.form.get(k, 0) for k in request.form}
|
||||
itat.add_itat(data)
|
||||
itat.close()
|
||||
|
||||
if 'documents' in request.files:
|
||||
doc = DocumentHandler()
|
||||
doc.Upload(request)
|
||||
|
||||
# AUTO SAVE MAT FROM ITR
|
||||
mat.save_from_itr(
|
||||
year=request.form["year"],
|
||||
mat_created=float(request.form.get("mat_credit_created", 0)),
|
||||
mat_utilized=float(request.form.get("mat_credit_utilized", 0)),
|
||||
remarks="Created via ITR"
|
||||
)
|
||||
|
||||
flash("ITAT record added successfully!", "success")
|
||||
return redirect(url_for('display_itat'))
|
||||
|
||||
return render_template('add_itat.html')
|
||||
return render_template('add_itat.html',current_date=date.today().isoformat())
|
||||
|
||||
# 3.Update ITAT records by id
|
||||
@app.route('/itat/update/<int:id>', methods=['GET', 'POST'])
|
||||
|
||||
13
requirements.txt
Normal file
13
requirements.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
Flask==3.0.1
|
||||
python-dotenv==1.0.1
|
||||
pandas==2.2.0
|
||||
Werkzeug==3.0.1
|
||||
|
||||
mysql-connector-python==8.3.0
|
||||
|
||||
Flask-HTTPAuth==4.8.0
|
||||
|
||||
openpyxl==3.1.2
|
||||
xlrd==2.0.1
|
||||
|
||||
gunicorn==21.2.0
|
||||
@@ -1,91 +1,150 @@
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
function getValue(id) {
|
||||
var el = document.getElementsByName(id)[0];
|
||||
return el ? parseFloat(el.value) || 0 : 0;
|
||||
}
|
||||
|
||||
function getValue(id) {
|
||||
var el = document.getElementsByName(id)[0];
|
||||
return el ? parseFloat(el.value) || 0 : 0;
|
||||
function setValue(id, val) {
|
||||
var el = document.getElementsByName(id)[0];
|
||||
if (el) el.value = Number(val).toFixed(2);
|
||||
}
|
||||
|
||||
window.calculate = function () {
|
||||
// --- BASIC INPUTS ---
|
||||
var gross_total_income = getValue("gross_total_income");
|
||||
var disallowance_14a = getValue("disallowance_14a");
|
||||
var disallowance_37 = getValue("disallowance_37");
|
||||
|
||||
// -- total gross income --
|
||||
var gross_total = gross_total_income + disallowance_37 + disallowance_14a;
|
||||
setValue("gti_as_per_ao", gross_total);
|
||||
// console.log("gross_total income:: " + gross_total)
|
||||
|
||||
// --- DEDUCTIONS ---
|
||||
var d80_business = getValue("deduction_80ia_business");
|
||||
var d80_misc = getValue("deduction_80ia_misc");
|
||||
var d80_other = getValue("deduction_80ia_other");
|
||||
var d80_sec37 = getValue("deduction_sec37_disallowance");
|
||||
|
||||
// -- TAX A CALCULATIONS --
|
||||
var per_a = getValue("per_a");
|
||||
var tax_a = getValue("tax_a");
|
||||
var per_surcharge_a = getValue("per_surcharge_a");
|
||||
var surcharge_a = getValue("surcharge_a");
|
||||
var per_cess_a = getValue("per_cess_a");
|
||||
var edu_cess_a = getValue("edu_cess_a");
|
||||
|
||||
// -- TAX b CALCULATIONS --
|
||||
|
||||
var tax_book_profit = getValue("tax_book_profit");
|
||||
console.log(tax_book_profit);
|
||||
|
||||
var per_surcharge_b = getValue("per_surcharge_b");
|
||||
var surcharge_b = getValue("surcharge_b");
|
||||
var per_cess_b = getValue("per_cess_b");
|
||||
var edu_cess_b = getValue("edu_cess_b");
|
||||
|
||||
var deduction = d80_business + d80_misc + d80_other + d80_sec37 - 1.35;
|
||||
|
||||
var deduction_80g = getValue("deduction_80g");
|
||||
|
||||
// --- NET TAXABLE INCOME ---
|
||||
var net_taxable_income = gross_total - deduction - deduction_80g;
|
||||
setValue("net_taxable_income", net_taxable_income);
|
||||
|
||||
// --- TAX (A)% AMOUNT ---
|
||||
var tax_a = net_taxable_income * (per_a / 100);
|
||||
setValue("tax_a", tax_a);
|
||||
|
||||
// --- SURCHARGE (A)% AMOUNT ---
|
||||
var surcharge_a = tax_a * (per_surcharge_a / 100);
|
||||
setValue("surcharge_a", surcharge_a);
|
||||
|
||||
// --- CESS (A)% AMOUNT ---
|
||||
var edu_cess_a = (surcharge_a + tax_a) * (per_cess_a / 100);
|
||||
setValue("edu_cess_a", edu_cess_a);
|
||||
|
||||
//SUM OF (A)%
|
||||
var sum_of_a = tax_a + surcharge_a + edu_cess_a;
|
||||
|
||||
setValue("sum_of_a", sum_of_a);
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------------------------------------
|
||||
|
||||
// --- SURCHARGE (B)% AMOUNT ---
|
||||
var surcharge_b = tax_book_profit * (per_surcharge_b / 100);
|
||||
setValue("surcharge_b", surcharge_b);
|
||||
|
||||
// --- CESS (B)% AMOUNT ---
|
||||
var edu_cess_b = (surcharge_b + tax_book_profit) * (per_cess_b / 100);
|
||||
setValue("edu_cess_b", edu_cess_b);
|
||||
|
||||
//SUM OF (B)%
|
||||
var sum_of_b = tax_book_profit + surcharge_b + edu_cess_b;
|
||||
|
||||
setValue("sum_of_b", sum_of_b);
|
||||
|
||||
// --- TAX PAYABLE (18.5%) ---
|
||||
var tax185 = getValue("tax_book_profit_18_5");
|
||||
|
||||
// --- Education Cess 3% ---
|
||||
var tax_payable = tax_a > tax_book_profit ? tax_a : tax_book_profit;
|
||||
setValue("tax_payable", tax_payable);
|
||||
|
||||
// --- SURCHARGE ---
|
||||
var percent = getValue("persentage");
|
||||
var surcharge = tax_payable * (percent / 100);
|
||||
setValue("surcharge", surcharge);
|
||||
|
||||
// --- EDUCATION CESS ---
|
||||
var per_cess = getValue("persentage_cess");
|
||||
var edu_cess = (tax_payable + surcharge) * (per_cess / 100);
|
||||
setValue("edu_cess", edu_cess);
|
||||
|
||||
// --- total tax payable ---
|
||||
var total_tax_payable = sum_of_a > sum_of_b ? sum_of_a : sum_of_b;
|
||||
setValue("total_tax_payable", total_tax_payable);
|
||||
|
||||
// // --- mat_credit_created --- new
|
||||
// setValue("mat_credit_created", Math.max(tax185 - total_tax_payable, 0));
|
||||
// // --- mat credit_utilized --- new
|
||||
// setValue("mat_credit_utilized", Math.max(total_tax_payable - tax185, 0));
|
||||
|
||||
// --- MAT credit and utilized ---
|
||||
var a = sum_of_a;
|
||||
var b = sum_of_b;
|
||||
var result = 0;
|
||||
var zero = 0;
|
||||
if (b > a) {
|
||||
result = a - b;
|
||||
setValue("mat_credit_created", result);
|
||||
setValue("mat_credit_utilized", zero);
|
||||
}
|
||||
|
||||
function setValue(id, val) {
|
||||
var el = document.getElementsByName(id)[0];
|
||||
if (el) el.value = Number(val).toFixed(2);
|
||||
if (a > b) {
|
||||
result = b - a;
|
||||
setValue("mat_credit_utilized", result);
|
||||
setValue("mat_credit_created", zero);
|
||||
}
|
||||
|
||||
window.calculate = function () {
|
||||
// --- FINAL TAX ---
|
||||
var mat_credit_uti = getValue("mat_credit_utilized");
|
||||
var interest_234c = getValue("interest_234c");
|
||||
|
||||
// --- BASIC INPUTS ---
|
||||
var gross_total_income = getValue("gross_total_income");
|
||||
var disallowance_14a = getValue("disallowance_14a");
|
||||
var disallowance_37 = getValue("disallowance_37");
|
||||
// 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);
|
||||
|
||||
// -- total gross income --
|
||||
var gross_total = gross_total_income + disallowance_37 + disallowance_14a
|
||||
// console.log("gross_total income:: " + gross_total)
|
||||
// --- ASSESSMENT ---
|
||||
var adv_tax = getValue("advance_tax");
|
||||
var tds = getValue("tds");
|
||||
var tcs = getValue("tcs");
|
||||
var tax_on_regular_assessment = getValue("tax_on_assessment");
|
||||
|
||||
// --- DEDUCTIONS ---
|
||||
var d80_business = getValue("deduction_80ia_business");
|
||||
var d80_misc = getValue("deduction_80ia_misc");
|
||||
var d80_other = getValue("deduction_80ia_other");
|
||||
var d80_sec37 = getValue("deduction_sec37_disallowance");
|
||||
var all_tax = adv_tax + tds + tcs + tax_on_regular_assessment;
|
||||
|
||||
var deduction = d80_business + d80_misc + d80_other + d80_sec37 - 1.35;
|
||||
|
||||
var deduction_80g = getValue("deduction_80g");
|
||||
|
||||
// --- NET TAXABLE INCOME ---
|
||||
var net_taxable_income = gross_total - deduction - deduction_80g;
|
||||
setValue("net_taxable_income", net_taxable_income);
|
||||
|
||||
// --- TAX 30% ---
|
||||
var tax30 = net_taxable_income * 0.30;
|
||||
setValue("tax_30_percent", tax30);
|
||||
|
||||
// --- TAX PAYABLE (18.5%) ---
|
||||
var tax185 = getValue("tax_book_profit_18_5");
|
||||
|
||||
// --- Education Cess 3% ---
|
||||
var tax_payable = (tax30 > tax185) ? tax30 : tax185;
|
||||
setValue("tax_payable", tax_payable);
|
||||
|
||||
// // --- SURCHARGE ---
|
||||
// var percent = getValue("persentage");
|
||||
// var surcharge = tax_payable * (percent / 100);
|
||||
// setValue("surcharge", surcharge);
|
||||
|
||||
// // --- edu_cess ---
|
||||
// var per_cess = getValue("persentage_cess")
|
||||
// var edu_cess = (tax_payable + surcharge) * (per_cess / 100);
|
||||
// setValue("edu_cess", edu_cess);
|
||||
|
||||
// --- SURCHARGE ---
|
||||
var percent = getValue("persentage");
|
||||
var surcharge = tax_payable * (percent / 100);
|
||||
setValue("surcharge", surcharge);
|
||||
|
||||
// --- EDUCATION CESS ---
|
||||
var per_cess = getValue("persentage_cess");
|
||||
var edu_cess = (tax_payable + surcharge) * (per_cess / 100);
|
||||
setValue("edu_cess", edu_cess);
|
||||
|
||||
// --- total tax payable ---
|
||||
var total_tax_payable = tax_payable + surcharge + edu_cess;
|
||||
setValue("total_tax_payable", total_tax_payable);
|
||||
|
||||
// --- FINAL TAX ---
|
||||
var mat_credit = getValue("mat_credit_utilized");
|
||||
var interest_234c = getValue("interest_234c");
|
||||
|
||||
var total_tax = total_tax_payable + mat_credit + interest_234c;
|
||||
setValue("total_tax", total_tax);
|
||||
|
||||
// --- ASSESSMENT ---
|
||||
var adv_tax = getValue("advance_tax");
|
||||
var tds = getValue("tds");
|
||||
var tcs = getValue("tcs");
|
||||
var tax_on_regular_assessment = getValue("tax_on_assessment");
|
||||
|
||||
var all_tax = adv_tax + tds + tcs + tax_on_regular_assessment;
|
||||
|
||||
var refund = total_tax - all_tax;
|
||||
setValue("refund", refund);
|
||||
};
|
||||
var refund = total_tax - all_tax;
|
||||
setValue("refund", refund);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -68,6 +68,28 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
var total_tax_payable = tax_payable + surcharge + edu_cess;
|
||||
setValue("total_tax_payable", total_tax_payable);
|
||||
|
||||
|
||||
// --- mat credit_utilized ---
|
||||
var a = tax185
|
||||
var b = total_tax_payable
|
||||
var result = 0
|
||||
if (a > b) {
|
||||
result = a - b
|
||||
setValue("mat_credit_created", result);
|
||||
}
|
||||
else {
|
||||
setValue("mat_credit_created", result);
|
||||
}
|
||||
|
||||
if (b > a) {
|
||||
result = b - a
|
||||
setValue("mat_credit_utilized", result);
|
||||
}
|
||||
else {
|
||||
setValue("mat_credit_utilized", result);
|
||||
}
|
||||
|
||||
|
||||
// --- FINAL TAX ---
|
||||
var mat_credit = getValue("mat_credit_utilized");
|
||||
var interest_234c = getValue("interest_234c");
|
||||
|
||||
@@ -46,16 +46,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
var tax_payable = (tax30 > tax185) ? tax30 : tax185;
|
||||
setValue("tax_payable", tax_payable);
|
||||
|
||||
// // --- SURCHARGE ---
|
||||
// var percent = getValue("persentage");
|
||||
// var surcharge = tax_payable * (percent / 100);
|
||||
// setValue("surcharge", surcharge);
|
||||
|
||||
// // --- edu_cess ---
|
||||
// var per_cess = getValue("persentage_cess")
|
||||
// var edu_cess = (tax_payable + surcharge) * (per_cess / 100);
|
||||
// setValue("edu_cess", edu_cess);
|
||||
|
||||
// --- SURCHARGE ---
|
||||
var percent = getValue("persentage");
|
||||
var surcharge = tax_payable * (percent / 100);
|
||||
@@ -70,11 +60,37 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
var total_tax_payable = tax_payable + surcharge + edu_cess;
|
||||
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_utilized ---
|
||||
var a = tax185
|
||||
var b = total_tax_payable
|
||||
var result = 0
|
||||
if (a > b) {
|
||||
result = a - b
|
||||
setValue("mat_credit_created", result);
|
||||
}
|
||||
else {
|
||||
setValue("mat_credit_created", result);
|
||||
}
|
||||
|
||||
if (b > a) {
|
||||
result = b - a
|
||||
setValue("mat_credit_utilized", result);
|
||||
}
|
||||
else {
|
||||
setValue("mat_credit_utilized", result);
|
||||
}
|
||||
|
||||
// --- FINAL TAX ---
|
||||
var mat_credit = getValue("mat_credit_utilized");
|
||||
var interest_234c = getValue("interest_234c");
|
||||
|
||||
var total_tax = total_tax_payable + mat_credit + interest_234c;
|
||||
// var total_tax = total_tax_payable + mat_credit + interest_234c;
|
||||
var total_tax = total_tax_payable + interest_234c;
|
||||
setValue("total_tax", total_tax);
|
||||
|
||||
// --- ASSESSMENT ---
|
||||
|
||||
@@ -45,11 +45,14 @@ document.getElementById("year").addEventListener("change", function () {
|
||||
|
||||
// Show preview
|
||||
previewDiv.style.display = "block";
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
>>>>>>> a8e47af61c86ea9e13f18c0133e8c687573bf392
|
||||
})
|
||||
.catch(err => console.error("Preview load error:", err));
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Add New AO Record{% endblock %}
|
||||
|
||||
{% block extra_css %}
|
||||
<!-- Child page CSS -->
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/add_model.css') }}">
|
||||
@@ -8,9 +9,9 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
|
||||
<h2 style="text-align:center;">New Assessing Officer Form</h2>
|
||||
<form id="ao" method="POST">
|
||||
<h2 style="text-align:center;">New AO Form</h2>
|
||||
<form id="ao" method="POST" enctype="multipart/form-data">
|
||||
<input type="hidden" name="stage" value="ao">
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Assessment Year:</label>
|
||||
@@ -19,13 +20,13 @@
|
||||
-- Please select Assessment Year --
|
||||
</option>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<div id="yearError" style="color:red; display:none; margin-bottom:10px;"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label>Record Created Date:</label>
|
||||
<input type="date" name="created_at" value="{{ current_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Gross Total Income:</label>
|
||||
@@ -40,6 +41,12 @@
|
||||
<input type="number" name="disallowance_37" step="any" value="0.00" oninput="calculate()" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>GTI as per AO</label>
|
||||
<input type="number" name="gti_as_per_ao" class="auto" step="any" value="0.00" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
@@ -52,13 +59,12 @@
|
||||
<input type="number" name="deduction_80ia_misc" step="any" value="0.00" oninput="calculate()" required>
|
||||
</div>
|
||||
<div>
|
||||
<label>Less :Deduction 80IA Other Operating Revenue:</label>
|
||||
<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 class="form-group full-width inline-2">
|
||||
|
||||
<div>
|
||||
<label>Less :Deduction Sec 37 Disallowance:</label>
|
||||
<input type="number" name="deduction_sec37_disallowance" step="any" value="0.00" oninput="calculate()"
|
||||
@@ -68,50 +74,92 @@
|
||||
<label>Less: Deduction 80G: </label>
|
||||
<input type="number" name="deduction_80g" step="any" value="0.00" 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="0.00" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Tax @ 30% (A):</label>
|
||||
<input type="number" name="tax_30_percent" step="any" value="0.00" oninput="calculate()" required>
|
||||
<label>Net Taxable Income:</label>
|
||||
<input type="number" name="net_taxable_income" class="auto" step="any" value="0.00" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Enter Percentage(%) calculate: Tax(A):</label>
|
||||
<input type="number" name="per_a" step="any" value="0.00" oninput="calculate()">
|
||||
</div>
|
||||
<div>
|
||||
<label>Tax @ 18.5% on Book Profit (B):</label>
|
||||
<input type="number" name="tax_book_profit_18_5" step="any" value="0.00" oninput="calculate()" required>
|
||||
<label>Tax @(A):</label>
|
||||
<input type="number" name="tax_a" class="auto" step="any" value="0.00" oninput="calculate()"
|
||||
readonly>
|
||||
</div>
|
||||
<div>
|
||||
<label>Enter Percentage(%) calculate: Tax(B): readonly</label>
|
||||
<input type="number" name="per_b" step="any" value="0.00" placeholder="Field Currently Unavailable" oninput="calculate()">
|
||||
</div>
|
||||
<div>
|
||||
<label>Tax @ on Book Profit(B):</label>
|
||||
<input type="number" name="tax_book_profit" step="any" value="0.00" 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="0.00" oninput="calculate()">
|
||||
</div>
|
||||
<div>
|
||||
<label>Surcharge on Tax(A):</label>
|
||||
<input type="number" name="surcharge_a" 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" 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" 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" 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>
|
||||
<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" class="auto" value="0.00" readonly>
|
||||
</div>
|
||||
<div>
|
||||
<label>Enter Percentage (%) Cess:</label>
|
||||
<input type="number" name="persentage_cess" step="any" value="0.00" oninput="calculate()">
|
||||
</div>
|
||||
<div>
|
||||
<label>Education Cess:</label>
|
||||
<input type="number" name="edu_cess" class="auto" step="any" value="0.00" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Total tax Payable:</label>
|
||||
@@ -132,9 +180,12 @@
|
||||
<input type="number" name="interest_234c" step="any" value="0.00" oninput="calculate()" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Total Tax:</label>
|
||||
<input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly>
|
||||
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Total Tax:</label>
|
||||
<input type="number" name="total_tax" step="any" class="auto" value="0.00" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group full-width inline-2">
|
||||
@@ -160,26 +211,29 @@
|
||||
</div>
|
||||
<div>
|
||||
<label>Tax on Regular Assessment:</label>
|
||||
<input type="number" name="tax_on_assessment" step="any" value="0.00" oninput="calculate()" required>
|
||||
<input type="number" name="tax_on_assessment" step="any" value="0.00" oninput="calculate()">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Refund:</label>
|
||||
<input type="number" name="refund" class="auto" step="any" value="0.00" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Remarks:</label>
|
||||
<input type="text" name="Remarks">
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Select Documents:</label>
|
||||
<input type="file" name="documents" multiple>
|
||||
</div>
|
||||
<div>
|
||||
<label>Remarks:</label>
|
||||
<input type="text" name="Remarks">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_js %}
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h2 style="text-align:center;">New CIT Form </h2>
|
||||
<form id="cit" method="POST">
|
||||
<form id="cit" method="POST" enctype="multipart/form-data">
|
||||
<input type="hidden" name="stage" value="cit">
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Assessment Year:</label>
|
||||
@@ -20,6 +21,10 @@
|
||||
</select>
|
||||
<div id="yearError" style="color:red; display:none; margin-bottom:10px;"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label>Record Created Date:</label>
|
||||
<input type="date" name="created_at" value="{{ current_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group full-width inline-2">
|
||||
@@ -166,9 +171,15 @@
|
||||
<input type="number" name="refund" class="auto" step="any" value="0.00" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Remarks:</label>
|
||||
<input type="text" name="Remarks">
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Select Documents:</label>
|
||||
<input type="file" name="documents" multiple>
|
||||
</div>
|
||||
<div>
|
||||
<label>Remarks:</label>
|
||||
<input type="text" name="Remarks">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit">Submit</button>
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h2 style="text-align:center;">New Income Tax Appellate Tribunal Form</h2>
|
||||
<form id="itat" method="POST" onsubmit="return showSuccessMessage()">
|
||||
|
||||
<form id="itat" method="POST" enctype="multipart/form-data" onsubmit="return showSuccessMessage()">
|
||||
<input type="hidden" name="stage" value="itr">
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Assessment Year:</label>
|
||||
@@ -22,6 +22,10 @@
|
||||
</select>
|
||||
<div id="yearError" style="color:red; display:none; margin-bottom:10px;"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label>Record Created Date:</label>
|
||||
<input type="date" name="created_at" value="{{ current_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group full-width inline-2">
|
||||
@@ -172,9 +176,15 @@
|
||||
<input type="number" name="refund" class="auto" step="any" value="0.00" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Remarks:</label>
|
||||
<input type="text" name="Remarks">
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Select Documents:</label>
|
||||
<input type="file" name="documents" multiple>
|
||||
</div>
|
||||
<div>
|
||||
<label>Remarks:</label>
|
||||
<input type="text" name="Remarks">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit">Submit</button>
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h2 style="text-align:center;">New Income Tax Return Form</h2>
|
||||
<form id="itr" method="POST">
|
||||
<form id="itr" method="POST" enctype="multipart/form-data">
|
||||
<input type="hidden" name="stage" value="itr">
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Assessment Year:</label>
|
||||
@@ -21,6 +22,10 @@
|
||||
</select>
|
||||
<div id="yearError" style="color:red; display:none; margin-bottom:10px;"></div>
|
||||
</div>
|
||||
<div>
|
||||
<label>Record Created Date:</label>
|
||||
<input type="date" name="created_at" value="{{ current_date }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
@@ -166,9 +171,15 @@
|
||||
<input type="number" name="refund" class="auto" step="any" value="0.00" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Remarks:</label>
|
||||
<input type="text" name="Remarks">
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
<label>Select Documents:</label>
|
||||
<input type="file" name="documents" multiple>
|
||||
</div>
|
||||
<div>
|
||||
<label>Remarks:</label>
|
||||
<input type="text" name="Remarks">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit">Submit</button>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<th>Gross Total Income</th>
|
||||
<th>Net Taxable Income</th>
|
||||
<th>Total Tax</th>
|
||||
<th>Created Record Date</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -32,6 +33,7 @@
|
||||
<td>{{ ao.gross_total_income }}</td>
|
||||
<td>{{ ao.net_taxable_income }}</td>
|
||||
<td>{{ ao.total_tax }}</td>
|
||||
<td>{{ ao.created_at.strftime('%Y-%m-%d') }}</td>
|
||||
<td>
|
||||
<a href="{{ url_for('update_ao', id=ao.id) }}" class="btn btn-update">Edit</a>
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<th>Net Taxable Income</th>
|
||||
<th>Total Tax Payable</th>
|
||||
<th>Refund</th>
|
||||
<th>Created Record Date</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -33,6 +34,7 @@
|
||||
<td>{{ "{:,.2f}".format(record.net_taxable_income) }}</td>
|
||||
<td>{{ "{:,.2f}".format(record.total_tax_payable) }}</td>
|
||||
<td>{{ "{:,.2f}".format(record.refund) }}</td>
|
||||
<td>{{ record.created_at.strftime('%Y-%m-%d') }}</td>
|
||||
<td class="action-cell">
|
||||
<a href="{{ url_for('update_itr', id=record.id) }}" class="btn btn-update">Edit</a>
|
||||
<form action="{{ url_for('delete_itr', id=record.id) }}" method="post"
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<tbody>
|
||||
{% for row in mat_rows %}
|
||||
<tr>
|
||||
<td contenteditable="true">{{ row.financial_year }}</td>
|
||||
<td contenteditable="false">{{ row.financial_year }}-{{ row.financial_year | int + 1 }}</td>
|
||||
<td><input value="{{ row.mat_credit }}"></td>
|
||||
|
||||
{% for y in added_years %}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
{% extends "base.html" %} {% block title %}Download Summary Report{% endblock %}
|
||||
{% block extra_css %}
|
||||
<<<<<<< HEAD
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/summary.css') }}" />
|
||||
=======
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ url_for('static', filename='css/summary.css') }}"
|
||||
/>
|
||||
>>>>>>> a8e47af61c86ea9e13f18c0133e8c687573bf392
|
||||
{% endblock %} {% block content %}
|
||||
<div class="container">
|
||||
<div class="head">
|
||||
@@ -34,4 +38,8 @@
|
||||
</div>
|
||||
{% endblock %} {% block extra_js %}
|
||||
<script src="{{ url_for('static', filename='js/summary_preview.js') }}"></script>
|
||||
<<<<<<< HEAD
|
||||
{% endblock %}
|
||||
=======
|
||||
{% endblock %}
|
||||
>>>>>>> a8e47af61c86ea9e13f18c0133e8c687573bf392
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h2>Update AO Record for Year {{ record.year }}--{{ record.year + 1 }}</h2>
|
||||
<h2>Update AO Record for Year {{ record.year }} - {{ record.year + 1 }}</h2>
|
||||
<form method="POST" action="{{ url_for('update_ao', id=record.id) }}">
|
||||
<div class="form-group full-width inline-2">
|
||||
<div>
|
||||
@@ -169,6 +169,23 @@
|
||||
<input type="text" name="Remarks" value="{{ record.remarks}}">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group full-width inline-2">
|
||||
<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 }}"
|
||||
readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit">Update Record</button>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -169,6 +169,22 @@
|
||||
<label>Remarks:</label>
|
||||
<input type="text" name="Remarks" value="{{ record.Remarks }}">
|
||||
</div>
|
||||
<div class="form-group full-width inline-2">
|
||||
<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 }}"
|
||||
readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit">Update Record</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,11 @@
|
||||
</select>
|
||||
<button type="submit">Apply</button>
|
||||
</form>
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% for category, message in messages %}
|
||||
<div class="alert alert-{{ category }}">{{ message }}</div>
|
||||
{% endfor %}
|
||||
{% endwith %}
|
||||
<!-- DOCUMENT TABLE -->
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
|
||||
Reference in New Issue
Block a user