2025-12-04 17:31:12 +05:30
|
|
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
function getValue(name) {
|
|
|
|
|
|
var el = document.getElementsByName(name)[0];
|
2025-12-08 13:40:33 +05:30
|
|
|
|
return el ? parseFloat(el.value) || 0 : 0;
|
2025-12-04 17:31:12 +05:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
function setValue(name, val) {
|
|
|
|
|
|
var el = document.getElementsByName(name)[0];
|
2025-12-08 13:40:33 +05:30
|
|
|
|
if (el) el.value = Number(val).toFixed(2);
|
2025-12-04 17:31:12 +05:30
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
// ---- Track last edited field for Tax(A) ----
|
|
|
|
|
|
let lastEditedTaxA = null;
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementsByName("per_a")[0].addEventListener("input", () => {
|
|
|
|
|
|
lastEditedTaxA = "percentage";
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementsByName("tax_30_percent")[0].addEventListener("input", () => {
|
|
|
|
|
|
lastEditedTaxA = "amount";
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-12-08 13:40:33 +05:30
|
|
|
|
window.calculate = function () {
|
2025-12-04 17:31:12 +05:30
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
// ---------------- BASIC INPUTS ----------------
|
2025-12-08 13:40:33 +05:30
|
|
|
|
var gross_total_income = getValue("gross_total_income");
|
|
|
|
|
|
var disallowance_14a = getValue("disallowance_14a");
|
|
|
|
|
|
var disallowance_37 = getValue("disallowance_37");
|
2025-12-04 17:31:12 +05:30
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
var gross_total = gross_total_income + disallowance_14a + disallowance_37;
|
2026-02-08 13:05:23 +05:30
|
|
|
|
setValue("gti_as_per_ao", gross_total);
|
2025-12-04 17:31:12 +05:30
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
// ---------------- DEDUCTIONS ----------------
|
2025-12-08 13:40:33 +05:30
|
|
|
|
var d80_business = getValue("deduction_80ia_business");
|
|
|
|
|
|
var d80_misc = getValue("deduction_80ia_misc");
|
|
|
|
|
|
var d80_other = getValue("deduction_80ia_other");
|
2026-01-06 15:52:08 +05:30
|
|
|
|
var d80_sec37 = getValue("deduction_sec37_disallowance");
|
2026-02-10 15:41:18 +05:30
|
|
|
|
var deduction_80g = getValue("deduction_80g");
|
2025-12-04 17:31:12 +05:30
|
|
|
|
|
2026-01-06 15:52:08 +05:30
|
|
|
|
var deduction = d80_business + d80_misc + d80_other + d80_sec37 - 1.35;
|
2025-12-04 17:31:12 +05:30
|
|
|
|
|
2026-01-06 15:52:08 +05:30
|
|
|
|
var net_taxable_income = gross_total - deduction - deduction_80g;
|
2025-12-04 17:31:12 +05:30
|
|
|
|
setValue("net_taxable_income", net_taxable_income);
|
|
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
// ================= TAX (A) – TWO WAY =================
|
2026-02-08 13:05:23 +05:30
|
|
|
|
var per_a = getValue("per_a");
|
2026-02-10 15:41:18 +05:30
|
|
|
|
var tax30 = getValue("tax_30_percent");
|
|
|
|
|
|
|
|
|
|
|
|
if (net_taxable_income > 0) {
|
|
|
|
|
|
if (lastEditedTaxA === "percentage") {
|
|
|
|
|
|
tax30 = net_taxable_income * (per_a / 100);
|
|
|
|
|
|
setValue("tax_30_percent", tax30);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (lastEditedTaxA === "amount") {
|
|
|
|
|
|
per_a = (tax30 / net_taxable_income) * 100;
|
|
|
|
|
|
setValue("per_a", per_a);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-12-04 17:31:12 +05:30
|
|
|
|
|
2026-02-08 13:05:23 +05:30
|
|
|
|
var per_surcharge_a = getValue("per_surcharge_a");
|
|
|
|
|
|
var surcharge_a = tax30 * (per_surcharge_a / 100);
|
|
|
|
|
|
setValue("surcharge_a", surcharge_a);
|
|
|
|
|
|
|
|
|
|
|
|
var per_cess_a = getValue("per_cess_a");
|
|
|
|
|
|
var edu_cess_a = (tax30 + surcharge_a) * (per_cess_a / 100);
|
|
|
|
|
|
setValue("edu_cess_a", edu_cess_a);
|
|
|
|
|
|
|
|
|
|
|
|
var sum_of_a = tax30 + surcharge_a + edu_cess_a;
|
|
|
|
|
|
setValue("sum_of_a", sum_of_a);
|
|
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
// ================= TAX (B) =================
|
2025-12-29 15:22:15 +05:30
|
|
|
|
var tax185 = getValue("tax_book_profit_18_5");
|
|
|
|
|
|
|
2026-02-08 13:05:23 +05:30
|
|
|
|
var per_surcharge_b = getValue("per_surcharge_b");
|
|
|
|
|
|
var surcharge_b = tax185 * (per_surcharge_b / 100);
|
|
|
|
|
|
setValue("surcharge_b", surcharge_b);
|
|
|
|
|
|
|
|
|
|
|
|
var per_cess_b = getValue("per_cess_b");
|
|
|
|
|
|
var edu_cess_b = (tax185 + surcharge_b) * (per_cess_b / 100);
|
|
|
|
|
|
setValue("edu_cess_b", edu_cess_b);
|
2025-12-04 17:31:12 +05:30
|
|
|
|
|
2026-02-08 13:05:23 +05:30
|
|
|
|
var sum_of_b = tax185 + surcharge_b + edu_cess_b;
|
|
|
|
|
|
setValue("sum_of_b", sum_of_b);
|
2025-12-04 17:31:12 +05:30
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
// ================= TAX PAYABLE =================
|
|
|
|
|
|
var tax_payable = (sum_of_a > sum_of_b) ? tax30 : tax185;
|
2026-02-08 13:05:23 +05:30
|
|
|
|
setValue("tax_payable", tax_payable);
|
2026-02-10 15:41:18 +05:30
|
|
|
|
|
|
|
|
|
|
var total_tax_payable = (sum_of_a > sum_of_b) ? sum_of_a : sum_of_b;
|
2025-12-04 17:31:12 +05:30
|
|
|
|
setValue("total_tax_payable", total_tax_payable);
|
|
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
// ================= MAT CREDIT =================
|
|
|
|
|
|
var mat_created = 0;
|
|
|
|
|
|
var mat_utilized = 0;
|
2026-02-08 13:05:23 +05:30
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
if (sum_of_a < sum_of_b) {
|
|
|
|
|
|
mat_created = sum_of_b - sum_of_a;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
mat_utilized = sum_of_a - sum_of_b;
|
2026-02-06 15:11:58 +05:30
|
|
|
|
}
|
2026-02-05 15:02:55 +05:30
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
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 =================
|
2025-12-08 13:40:33 +05:30
|
|
|
|
var interest_234c = getValue("interest_234c");
|
2025-12-04 17:31:12 +05:30
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
var total_tax = total_tax_payable + interest_234c - mat_utilized;
|
2025-12-04 17:31:12 +05:30
|
|
|
|
setValue("total_tax", total_tax);
|
|
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
// ================= ADJUSTMENTS =================
|
2025-12-08 13:40:33 +05:30
|
|
|
|
var adv_tax = getValue("advance_tax");
|
|
|
|
|
|
var tds = getValue("tds");
|
|
|
|
|
|
var tcs = getValue("tcs");
|
2026-02-10 15:41:18 +05:30
|
|
|
|
var tax_on_assessment = getValue("tax_on_assessment");
|
|
|
|
|
|
var interest_244a_per143 = getValue("interest_244a_per143");
|
|
|
|
|
|
var refund_received = getValue("refund_received");
|
2025-12-04 17:31:12 +05:30
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
var paid_tax = adv_tax + tds + tcs + tax_on_assessment;
|
2025-12-04 17:31:12 +05:30
|
|
|
|
|
2026-02-10 15:41:18 +05:30
|
|
|
|
var refund = total_tax - paid_tax;
|
2025-12-04 17:31:12 +05:30
|
|
|
|
setValue("refund", refund);
|
2026-02-10 15:41:18 +05:30
|
|
|
|
|
|
|
|
|
|
var balance_receivable = (refund + interest_244a_per143) - refund_received
|
|
|
|
|
|
setValue("balance_receivable", balance_receivable);
|
|
|
|
|
|
|
2025-12-08 13:40:33 +05:30
|
|
|
|
};
|
2025-12-04 17:31:12 +05:30
|
|
|
|
});
|