update itr and ao from and auto save mat ceadit and utility
This commit is contained in:
@@ -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 and 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 - mat_credit + interest_234c;
|
||||
setValue("total_tax", total_tax);
|
||||
|
||||
// --- ASSESSMENT ---
|
||||
|
||||
@@ -61,16 +61,36 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
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));
|
||||
// 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 ---
|
||||
|
||||
55
static/js/summary_preview.js
Normal file
55
static/js/summary_preview.js
Normal file
@@ -0,0 +1,55 @@
|
||||
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));
|
||||
});
|
||||
Reference in New Issue
Block a user