changes of ITAT from new desing and sql insert update proce chnage code of v2

This commit is contained in:
2026-01-06 15:52:08 +05:30
parent a65e7efa63
commit 91b7932a2f
26 changed files with 516 additions and 1119 deletions

View File

@@ -1,89 +1,78 @@
document.addEventListener("DOMContentLoaded", function () {
const fields = [
"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",
"tax_payable", "surcharge_12", "edu_cess_3", "total_tax_payable",
"mat_credit", "interest_234c", "total_tax",
"advance_tax", "tds", "tcs", "tax_on_assessment", "refund"
];
function getVal(id) {
let el = document.getElementsByName(id)[0];
function getValue(id) {
var el = document.getElementsByName(id)[0];
return el ? parseFloat(el.value) || 0 : 0;
}
function setVal(id, value) {
let el = document.getElementsByName(id)[0];
if (el) el.value = Number(value).toFixed(2);
function setValue(id, val) {
var el = document.getElementsByName(id)[0];
if (el) el.value = Number(val).toFixed(2);
}
function calculate() {
window.calculate = function () {
// Base values
let gross_total_income = getVal("gross_total_income");
let disallowance_14a = getVal("disallowance_14a");
let disallowance_37 = getVal("disallowance_37");
// --- BASIC INPUTS ---
var gross_total_income = getValue("gross_total_income");
var disallowance_14a = getValue("disallowance_14a");
var disallowance_37 = getValue("disallowance_37");
// Deductions
let d80_business = getVal("deduction_80ia_business");
let deduction_sec37 = getVal("deduction_sec37_disallowance");
let deduction_80g = getVal("deduction_80g");
// -- total gross income --
var gross_total = gross_total_income + disallowance_37 + disallowance_14a
console.log("gross_total income:: " + gross_total)
// Net Taxable Income
let net_taxable_income =
(gross_total_income + disallowance_14a + disallowance_37)
- (d80_business + deduction_sec37)
- deduction_80g;
// --- 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");
setVal("net_taxable_income", net_taxable_income);
var deduction = d80_business + d80_misc + d80_other + d80_sec37;
// 30% tax
let tax_30_percent = net_taxable_income * 0.30;
setVal("tax_30_percent", tax_30_percent);
var deduction_80g = getValue("deduction_80g");
// Book profit tax (user input)
let tax_payable = getVal("tax_book_profit_18_5");
setVal("tax_payable", tax_payable);
// --- NET TAXABLE INCOME ---
var net_taxable_income = gross_total - deduction - deduction_80g;
setValue("net_taxable_income", net_taxable_income);
// Surcharge 12%
let surcharge_12 = tax_payable * 0.12;
setVal("surcharge_12", surcharge_12);
// --- TAX 30% ---
var tax30 = net_taxable_income * 0.30;
setValue("tax_30_percent", tax30);
// Education Cess 3%
let edu_cess_3 = (tax_payable + surcharge_12) * 0.03;
setVal("edu_cess_3", edu_cess_3);
// --- TAX PAYABLE (18.5%) ---
var tax185 = getValue("tax_book_profit_18_5");
// Total Tax Payable
let total_tax_payable = tax_payable + surcharge_12 + edu_cess_3;
setVal("total_tax_payable", total_tax_payable);
var tax_payable = (tax30 > tax185) ? tax30 : tax185;
setValue("tax_payable", tax_payable);
// MAT + Interest
let mat_credit = getVal("mat_credit");
let interest_234c = getVal("interest_234c");
// --- SURCHARGE ---
var percent = getValue("persentage");
var surcharge = tax_payable * (percent / 100);
setValue("surcharge_12", surcharge);
// Total Tax
let total_tax = total_tax_payable + mat_credit + interest_234c;
setVal("total_tax", total_tax);
var edu_cess = (tax_payable + surcharge) * 0.03;
setValue("edu_cess_3", edu_cess);
// Assessment → Advance Tax + TDS + TCS
let advance_tax = getVal("advance_tax");
let tds = getVal("tds");
let tcs = getVal("tcs");
// --- total tax payable ---
var total_tax_payable = tax_payable + surcharge + edu_cess;
setValue("total_tax_payable", total_tax_payable);
let tax_on_assessment = advance_tax + tds + tcs;
setVal("tax_on_assessment", tax_on_assessment);
// --- FINAL TAX ---
var mat_credit = getValue("mat_credit");
var interest_234c = getValue("interest_234c");
// Refund (or payable)
let refund = total_tax - tax_on_assessment;
setVal("refund", refund);
}
var total_tax = total_tax_payable + mat_credit + interest_234c;
setValue("total_tax", total_tax);
// Attach listeners
fields.forEach(id => {
let el = document.getElementsByName(id)[0];
if (el) el.addEventListener("input", calculate);
});
// --- 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);
};
});