AO model code commit

This commit is contained in:
2025-11-30 20:38:41 +05:30
parent 0f3c596854
commit 0d6c873515
7 changed files with 114 additions and 296 deletions

View File

@@ -32,34 +32,38 @@ class AOHandler:
records = result.fetchall()
if records:
print(records[0])
return records[0] # return single record
return None
""" variable of AO model
year, gross_total_income, disallowance_14a, disallowance_37,
deduction_80ia_business, deduction_sec37_disallowance, deduction_80g,
net_taxable_income, tax_30_percent, tax_book_profit_18_5,
surcharge_12, edu_cess_3, total_tax_payable, mat_credit,
interest_234c, total_tax, advance_tax, tds, tcs,
tax_on_assessment, refund
"""
def add_ao(self, data):
fields = [
"year","gross_total_income", "disallowance_14a", "disallowance_37",
"deduction_80ia_business", "deduction_sec37_disallowance", "deduction_80g",
"net_taxable_income", "tax_30_percent", "tax_book_profit_18_5",
"surcharge_12", "edu_cess_3", "total_tax_payable", "mat_credit",
"interest_234c", "total_tax", "advance_tax", "tds", "tcs",
"tax_on_assessment", "refund"
]
# INSERT ITR RECORD using procedure "add_itr"
# def add_itr(self, data):
values = [data.get(f, 0) for f in fields]
# columns = [
# 'year', 'gross_total_income', 'disallowance_14a', 'disallowance_37',
# 'deduction_80ia_business', 'deduction_80ia_misc', 'deduction_80ia_other',
# 'deduction_sec37_disallowance', 'deduction_80g', 'net_taxable_income',
# 'tax_30_percent', 'tax_book_profit_18_5', 'tax_payable', 'surcharge_12',
# 'edu_cess_3', 'total_tax_payable', 'mat_credit', 'interest_234c',
# 'total_tax', 'advance_tax', 'tds', 'tcs', 'tax_on_assessment', 'refund'
# ]
# values = [data.get(col, 0) for col in columns]
# # Call your stored procedure
# self.cursor.callproc("InsertITR", values)
# self.conn.commit()
self.cursor.callproc("InsertAO", values)
self.conn.commit()
# UPDATE ITR RECORD by ITR id
# UPDATE ITR RECORD by AO id
# def update(self, id, data):
# columns = [
@@ -82,11 +86,11 @@ class AOHandler:
# self.conn.commit()
# # DELETE RECORD by ITR id
# def delete_itr_by_id(self, id):
# # Call the stored procedure
# self.cursor.callproc('DeleteITRById', [id])
# self.conn.commit()
# DELETE RECORD by AO id
def delete_ao_by_id(self, id):
# Call the stored procedure
self.cursor.callproc('DeleteAOById', [id])
self.conn.commit()
# CLOSE CONNECTION