Download index.html from Amujeeb/myspace: direct link, hf CLI and curl.
- Browser
- Download file 62.5 kB
-
https://huggingface.co/spaces/Amujeeb/myspace/resolve/main/index.html
- Command line
-
hf download hf://spaces/Amujeeb/myspace/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Amujeeb/myspace/resolve/main/index.html
62.5 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>India Income Tax Calculator 2025-26</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.sheetjs.com/xlsx-0.19.3/package/dist/xlsx.full.min.js"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| .toggle-checkbox:checked { | |
| right: 0; | |
| background-color: #4f46e5; | |
| } | |
| .toggle-checkbox:checked + .toggle-label { | |
| background-color: #a5b4fc; | |
| } | |
| .tab-active { | |
| border-bottom: 3px solid #4f46e5; | |
| color: #4f46e5; | |
| font-weight: 600; | |
| } | |
| .input-highlight { | |
| transition: all 0.3s; | |
| } | |
| .input-highlight:focus { | |
| box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3); | |
| border-color: #4f46e5; | |
| } | |
| .tooltip { | |
| position: relative; | |
| display: inline-block; | |
| } | |
| .tooltip .tooltiptext { | |
| visibility: hidden; | |
| width: 200px; | |
| background-color: #555; | |
| color: #fff; | |
| text-align: center; | |
| border-radius: 6px; | |
| padding: 5px; | |
| position: absolute; | |
| z-index: 1; | |
| bottom: 125%; | |
| left: 50%; | |
| margin-left: -100px; | |
| opacity: 0; | |
| transition: opacity 0.3s; | |
| } | |
| .tooltip:hover .tooltiptext { | |
| visibility: visible; | |
| opacity: 1; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen"> | |
| <div class="container mx-auto px-4 py-8 max-w-6xl"> | |
| <!-- Header --> | |
| <header class="mb-8 text-center"> | |
| <h1 class="text-3xl md:text-4xl font-bold text-indigo-800 mb-2">India Income Tax Calculator</h1> | |
| <p class="text-lg text-gray-600">Financial Year 2025-26 | Old & New Regime Comparison</p> | |
| <div class="mt-4 flex justify-center"> | |
| <div class="bg-indigo-100 text-indigo-800 px-4 py-2 rounded-full flex items-center"> | |
| <i class="fas fa-info-circle mr-2"></i> | |
| <span>Assessment Year: 2026-27</span> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Main Calculator --> | |
| <div class="bg-white rounded-xl shadow-lg overflow-hidden"> | |
| <!-- Tabs --> | |
| <div class="flex border-b"> | |
| <button id="personal-tab" class="tab-active px-6 py-4 text-sm font-medium">Personal Details</button> | |
| <button id="income-tab" class="px-6 py-4 text-sm font-medium text-gray-500 hover:text-indigo-600">Income Details</button> | |
| <button id="deductions-tab" class="px-6 py-4 text-sm font-medium text-gray-500 hover:text-indigo-600">Deductions</button> | |
| <button id="results-tab" class="px-6 py-4 text-sm font-medium text-gray-500 hover:text-indigo-600">Results</button> | |
| </div> | |
| <!-- Personal Details Tab --> | |
| <div id="personal-section" class="p-6"> | |
| <h2 class="text-xl font-semibold text-gray-800 mb-6">Taxpayer Information</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
| <div> | |
| <label for="name" class="block text-sm font-medium text-gray-700 mb-1">Full Name*</label> | |
| <input type="text" id="name" class="w-full px-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="Enter your full name"> | |
| </div> | |
| <div> | |
| <label for="pan" class="block text-sm font-medium text-gray-700 mb-1">PAN Number*</label> | |
| <input type="text" id="pan" class="w-full px-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none uppercase" placeholder="ABCDE1234F" maxlength="10" pattern="[A-Z]{5}[0-9]{4}[A-Z]{1}"> | |
| </div> | |
| <div> | |
| <label for="age" class="block text-sm font-medium text-gray-700 mb-1">Age*</label> | |
| <input type="number" id="age" class="w-full px-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="Enter your age" min="18" max="120"> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-1">Gender*</label> | |
| <div class="flex space-x-4"> | |
| <label class="inline-flex items-center"> | |
| <input type="radio" name="gender" value="male" class="h-4 w-4 text-indigo-600" checked> | |
| <span class="ml-2 text-gray-700">Male</span> | |
| </label> | |
| <label class="inline-flex items-center"> | |
| <input type="radio" name="gender" value="female" class="h-4 w-4 text-indigo-600"> | |
| <span class="ml-2 text-gray-700">Female</span> | |
| </label> | |
| <label class="inline-flex items-center"> | |
| <input type="radio" name="gender" value="other" class="h-4 w-4 text-indigo-600"> | |
| <span class="ml-2 text-gray-700">Other</span> | |
| </label> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="mt-8 flex justify-end"> | |
| <button id="next-to-income" class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300">Next <i class="fas fa-arrow-right ml-2"></i></button> | |
| </div> | |
| </div> | |
| <!-- Income Details Tab --> | |
| <div id="income-section" class="p-6 hidden"> | |
| <h2 class="text-xl font-semibold text-gray-800 mb-6">Income Details</h2> | |
| <div class="space-y-6"> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
| <div> | |
| <label for="salary" class="block text-sm font-medium text-gray-700 mb-1">Salary Income*</label> | |
| <div class="relative"> | |
| <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">₹</span> | |
| <input type="number" id="salary" class="w-full pl-8 pr-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="0" min="0"> | |
| </div> | |
| </div> | |
| <div> | |
| <label for="rental" class="block text-sm font-medium text-gray-700 mb-1">House Property Income</label> | |
| <div class="relative"> | |
| <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">₹</span> | |
| <input type="number" id="rental" class="w-full pl-8 pr-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="0" min="0"> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
| <div> | |
| <label for="capital-gains" class="block text-sm font-medium text-gray-700 mb-1">Capital Gains</label> | |
| <div class="relative"> | |
| <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">₹</span> | |
| <input type="number" id="capital-gains" class="w-full pl-8 pr-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="0" min="0"> | |
| </div> | |
| </div> | |
| <div> | |
| <label for="business" class="block text-sm font-medium text-gray-700 mb-1">Business/Profession Income</label> | |
| <div class="relative"> | |
| <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">₹</span> | |
| <input type="number" id="business" class="w-full pl-8 pr-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="0" min="0"> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
| <div> | |
| <label for="other-income" class="block text-sm font-medium text-gray-700 mb-1">Other Income</label> | |
| <div class="relative"> | |
| <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">₹</span> | |
| <input type="number" id="other-income" class="w-full pl-8 pr-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="0" min="0"> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="mt-8 flex justify-between"> | |
| <button id="back-to-personal" class="px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 transition duration-300"><i class="fas fa-arrow-left mr-2"></i> Back</button> | |
| <button id="next-to-deductions" class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300">Next <i class="fas fa-arrow-right ml-2"></i></button> | |
| </div> | |
| </div> | |
| <!-- Deductions Tab --> | |
| <div id="deductions-section" class="p-6 hidden"> | |
| <h2 class="text-xl font-semibold text-gray-800 mb-6">Deductions (Old Regime Only)</h2> | |
| <div class="mb-6"> | |
| <div class="flex items-center justify-between mb-4"> | |
| <h3 class="text-lg font-medium text-gray-800">Section 80C Deductions</h3> | |
| <span class="text-sm text-gray-500">Max ₹1,50,000</span> | |
| </div> | |
| <div class="space-y-4"> | |
| <div> | |
| <label for="ppf" class="block text-sm font-medium text-gray-700 mb-1">PPF/EPF Contribution</label> | |
| <div class="relative"> | |
| <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">₹</span> | |
| <input type="number" id="ppf" class="w-full pl-8 pr-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="0" min="0" max="150000"> | |
| </div> | |
| </div> | |
| <div> | |
| <label for="elss" class="block text-sm font-medium text-gray-700 mb-1">ELSS Mutual Funds</label> | |
| <div class="relative"> | |
| <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">₹</span> | |
| <input type="number" id="elss" class="w-full pl-8 pr-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="0" min="0" max="150000"> | |
| </div> | |
| </div> | |
| <div> | |
| <label for="insurance" class="block text-sm font-medium text-gray-700 mb-1">Life Insurance Premium</label> | |
| <div class="relative"> | |
| <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">₹</span> | |
| <input type="number" id="insurance" class="w-full pl-8 pr-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="0" min="0" max="150000"> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="mb-6"> | |
| <h3 class="text-lg font-medium text-gray-800 mb-4">Other Deductions</h3> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
| <div> | |
| <label for="medical-insurance" class="block text-sm font-medium text-gray-700 mb-1">Medical Insurance (80D)</label> | |
| <div class="relative"> | |
| <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">₹</span> | |
| <input type="number" id="medical-insurance" class="w-full pl-8 pr-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="0" min="0" max="50000"> | |
| </div> | |
| </div> | |
| <div> | |
| <label for="education-loan" class="block text-sm font-medium text-gray-700 mb-1">Education Loan Interest (80E)</label> | |
| <div class="relative"> | |
| <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">₹</span> | |
| <input type="number" id="education-loan" class="w-full pl-8 pr-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="0" min="0"> | |
| </div> | |
| </div> | |
| <div> | |
| <label for="donations" class="block text-sm font-medium text-gray-700 mb-1">Donations (80G)</label> | |
| <div class="relative"> | |
| <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">₹</span> | |
| <input type="number" id="donations" class="w-full pl-8 pr-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="0" min="0"> | |
| </div> | |
| </div> | |
| <div> | |
| <label for="hra" class="block text-sm font-medium text-gray-700 mb-1">HRA Exemption</label> | |
| <div class="relative"> | |
| <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-gray-500">₹</span> | |
| <input type="number" id="hra" class="w-full pl-8 pr-4 py-2 rounded-lg border border-gray-300 input-highlight focus:outline-none" placeholder="0" min="0"> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="mt-8 flex justify-between"> | |
| <button id="back-to-income" class="px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 transition duration-300"><i class="fas fa-arrow-left mr-2"></i> Back</button> | |
| <button id="calculate-tax" class="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300">Calculate Tax <i class="fas fa-calculator ml-2"></i></button> | |
| </div> | |
| </div> | |
| <!-- Results Tab --> | |
| <div id="results-section" class="p-6 hidden"> | |
| <h2 class="text-xl font-semibold text-gray-800 mb-6">Tax Calculation Results</h2> | |
| <div class="mb-8"> | |
| <div class="flex items-center justify-between mb-4"> | |
| <h3 class="text-lg font-medium text-gray-800">Tax Regime Comparison</h3> | |
| <div class="flex items-center"> | |
| <span class="mr-3 text-sm font-medium text-gray-700">Regime:</span> | |
| <div class="relative inline-block w-12 mr-2 align-middle select-none"> | |
| <input type="checkbox" id="regime-toggle" class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"/> | |
| <label for="regime-toggle" class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"></label> | |
| </div> | |
| <span id="regime-label" class="text-sm font-medium text-indigo-600">Old Regime</span> | |
| </div> | |
| </div> | |
| <div class="bg-gray-50 rounded-lg p-6"> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-8"> | |
| <!-- Old Regime Results --> | |
| <div id="old-regime-results"> | |
| <div class="flex items-center mb-4"> | |
| <div class="w-3 h-3 bg-indigo-500 rounded-full mr-2"></div> | |
| <h4 class="text-lg font-semibold text-gray-800">Old Regime Calculation</h4> | |
| </div> | |
| <div class="space-y-3"> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Total Income:</span> | |
| <span id="old-total-income" class="font-medium">₹0</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Total Deductions:</span> | |
| <span id="old-total-deductions" class="font-medium">₹0</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Taxable Income:</span> | |
| <span id="old-taxable-income" class="font-medium text-indigo-600">₹0</span> | |
| </div> | |
| <div class="border-t border-gray-200 my-2"></div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Income Tax:</span> | |
| <span id="old-income-tax" class="font-medium">₹0</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Surcharge:</span> | |
| <span id="old-surcharge" class="font-medium">₹0</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Health & Education Cess:</span> | |
| <span id="old-cess" class="font-medium">₹0</span> | |
| </div> | |
| <div class="border-t border-gray-200 my-2"></div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600 font-semibold">Total Tax Liability:</span> | |
| <span id="old-total-tax" class="font-bold text-lg text-indigo-600">₹0</span> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- New Regime Results --> | |
| <div id="new-regime-results" class="opacity-50"> | |
| <div class="flex items-center mb-4"> | |
| <div class="w-3 h-3 bg-gray-400 rounded-full mr-2"></div> | |
| <h4 class="text-lg font-semibold text-gray-600">New Regime Calculation</h4> | |
| </div> | |
| <div class="space-y-3"> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Total Income:</span> | |
| <span id="new-total-income" class="font-medium">₹0</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Standard Deduction:</span> | |
| <span id="new-standard-deduction" class="font-medium">₹50,000</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Taxable Income:</span> | |
| <span id="new-taxable-income" class="font-medium text-indigo-600">₹0</span> | |
| </div> | |
| <div class="border-t border-gray-200 my-2"></div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Income Tax:</span> | |
| <span id="new-income-tax" class="font-medium">₹0</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Surcharge:</span> | |
| <span id="new-surcharge" class="font-medium">₹0</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600">Health & Education Cess:</span> | |
| <span id="new-cess" class="font-medium">₹0</span> | |
| </div> | |
| <div class="border-t border-gray-200 my-2"></div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-600 font-semibold">Total Tax Liability:</span> | |
| <span id="new-total-tax" class="font-bold text-lg text-indigo-600">₹0</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="mt-6 bg-indigo-50 border border-indigo-100 rounded-lg p-4"> | |
| <div class="flex items-center"> | |
| <i class="fas fa-lightbulb text-indigo-500 mr-2"></i> | |
| <h4 class="font-medium text-indigo-800">Recommendation</h4> | |
| </div> | |
| <p id="regime-recommendation" class="mt-2 text-sm text-gray-700">Based on your income and deductions, the old regime appears more beneficial.</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="mb-8"> | |
| <h3 class="text-lg font-medium text-gray-800 mb-4">Tax Slabs Applied</h3> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full divide-y divide-gray-200"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Income Range</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Old Regime Rate</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">New Regime Rate</th> | |
| </tr> | |
| </thead> | |
| <tbody class="bg-white divide-y divide-gray-200"> | |
| <tr> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Up to ₹2,50,000</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">0%</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">0%</td> | |
| </tr> | |
| <tr class="bg-gray-50"> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">₹2,50,001 - ₹5,00,000</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">5%</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">5%</td> | |
| </tr> | |
| <tr> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">₹5,00,001 - ₹7,50,000</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">20%</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">10%</td> | |
| </tr> | |
| <tr class="bg-gray-50"> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">₹7,50,001 - ₹10,00,000</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">20%</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">15%</td> | |
| </tr> | |
| <tr> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">₹10,00,001 - ₹12,50,000</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">30%</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">20%</td> | |
| </tr> | |
| <tr class="bg-gray-50"> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">₹12,50,001 - ₹15,00,000</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">30%</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">25%</td> | |
| </tr> | |
| <tr> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Above ₹15,00,000</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">30%</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">30%</td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| <div class="flex justify-between"> | |
| <button id="back-to-deductions" class="px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 transition duration-300"><i class="fas fa-arrow-left mr-2"></i> Back</button> | |
| <div class="space-x-4"> | |
| <button id="save-data" class="px-6 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition duration-300"><i class="fas fa-save mr-2"></i> Save Data</button> | |
| <button id="export-excel" class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition duration-300"><i class="fas fa-file-excel mr-2"></i> Export to Excel</button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Data Retrieval Section --> | |
| <div class="mt-12 bg-white rounded-xl shadow-lg overflow-hidden p-6"> | |
| <h2 class="text-xl font-semibold text-gray-800 mb-6">Retrieve Saved Data</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
| <div> | |
| <label for="search-pan" class="block text-sm font-medium text-gray-700 mb-1">Search by PAN</label> | |
| <div class="flex"> | |
| <input type="text" id="search-pan" class="flex-1 px-4 py-2 rounded-l-lg border border-gray-300 input-highlight focus:outline-none uppercase" placeholder="Enter PAN" maxlength="10"> | |
| <button id="search-by-pan" class="px-4 py-2 bg-indigo-600 text-white rounded-r-lg hover:bg-indigo-700 transition duration-300"><i class="fas fa-search"></i></button> | |
| </div> | |
| </div> | |
| <div> | |
| <label for="search-name" class="block text-sm font-medium text-gray-700 mb-1">Search by Name</label> | |
| <div class="flex"> | |
| <input type="text" id="search-name" class="flex-1 px-4 py-2 rounded-l-lg border border-gray-300 input-highlight focus:outline-none" placeholder="Enter name"> | |
| <button id="search-by-name" class="px-4 py-2 bg-indigo-600 text-white rounded-r-lg hover:bg-indigo-700 transition duration-300"><i class="fas fa-search"></i></button> | |
| </div> | |
| </div> | |
| </div> | |
| <div id="search-results" class="mt-6 hidden"> | |
| <h3 class="text-lg font-medium text-gray-800 mb-4">Search Results</h3> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full divide-y divide-gray-200"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">PAN</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Age</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Gender</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total Income</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tax (Old)</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tax (New)</th> | |
| </tr> | |
| </thead> | |
| <tbody id="results-table-body" class="bg-white divide-y divide-gray-200"> | |
| <!-- Results will be populated here --> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Footer --> | |
| <footer class="mt-12 text-center text-gray-600 text-sm"> | |
| <p>© 2025 India Income Tax Calculator. This tool is for informational purposes only.</p> | |
| <p class="mt-1">Tax rates are as per the Finance Act for FY 2025-26 (AY 2026-27).</p> | |
| </footer> | |
| </div> | |
| <script> | |
| // Global variables to store tax data | |
| let taxData = { | |
| personal: {}, | |
| income: {}, | |
| deductions: {}, | |
| results: {} | |
| }; | |
| // Store all saved records | |
| let savedRecords = JSON.parse(localStorage.getItem('taxRecords')) || []; | |
| // Tab navigation | |
| document.getElementById('next-to-income').addEventListener('click', function() { | |
| const name = document.getElementById('name').value; | |
| const pan = document.getElementById('pan').value; | |
| const age = document.getElementById('age').value; | |
| const gender = document.querySelector('input[name="gender"]:checked').value; | |
| if (!name || !pan || !age) { | |
| alert('Please fill all required personal details'); | |
| return; | |
| } | |
| if (!/^[A-Z]{5}[0-9]{4}[A-Z]{1}$/.test(pan)) { | |
| alert('Please enter a valid PAN number'); | |
| return; | |
| } | |
| taxData.personal = { name, pan, age, gender }; | |
| document.getElementById('personal-section').classList.add('hidden'); | |
| document.getElementById('income-section').classList.remove('hidden'); | |
| document.getElementById('personal-tab').classList.remove('tab-active'); | |
| document.getElementById('income-tab').classList.add('tab-active'); | |
| }); | |
| document.getElementById('back-to-personal').addEventListener('click', function() { | |
| document.getElementById('income-section').classList.add('hidden'); | |
| document.getElementById('personal-section').classList.remove('hidden'); | |
| document.getElementById('income-tab').classList.remove('tab-active'); | |
| document.getElementById('personal-tab').classList.add('tab-active'); | |
| }); | |
| document.getElementById('next-to-deductions').addEventListener('click', function() { | |
| const salary = parseFloat(document.getElementById('salary').value) || 0; | |
| const rental = parseFloat(document.getElementById('rental').value) || 0; | |
| const capitalGains = parseFloat(document.getElementById('capital-gains').value) || 0; | |
| const business = parseFloat(document.getElementById('business').value) || 0; | |
| const otherIncome = parseFloat(document.getElementById('other-income').value) || 0; | |
| if (salary === 0 && rental === 0 && capitalGains === 0 && business === 0 && otherIncome === 0) { | |
| alert('Please enter at least one income source'); | |
| return; | |
| } | |
| taxData.income = { salary, rental, capitalGains, business, otherIncome }; | |
| document.getElementById('income-section').classList.add('hidden'); | |
| document.getElementById('deductions-section').classList.remove('hidden'); | |
| document.getElementById('income-tab').classList.remove('tab-active'); | |
| document.getElementById('deductions-tab').classList.add('tab-active'); | |
| }); | |
| document.getElementById('back-to-income').addEventListener('click', function() { | |
| document.getElementById('deductions-section').classList.add('hidden'); | |
| document.getElementById('income-section').classList.remove('hidden'); | |
| document.getElementById('deductions-tab').classList.remove('tab-active'); | |
| document.getElementById('income-tab').classList.add('tab-active'); | |
| }); | |
| document.getElementById('calculate-tax').addEventListener('click', function() { | |
| // Get deductions data | |
| const ppf = parseFloat(document.getElementById('ppf').value) || 0; | |
| const elss = parseFloat(document.getElementById('elss').value) || 0; | |
| const insurance = parseFloat(document.getElementById('insurance').value) || 0; | |
| const medicalInsurance = parseFloat(document.getElementById('medical-insurance').value) || 0; | |
| const educationLoan = parseFloat(document.getElementById('education-loan').value) || 0; | |
| const donations = parseFloat(document.getElementById('donations').value) || 0; | |
| const hra = parseFloat(document.getElementById('hra').value) || 0; | |
| taxData.deductions = { ppf, elss, insurance, medicalInsurance, educationLoan, donations, hra }; | |
| // Calculate taxes | |
| calculateTaxes(); | |
| // Show results | |
| document.getElementById('deductions-section').classList.add('hidden'); | |
| document.getElementById('results-section').classList.remove('hidden'); | |
| document.getElementById('deductions-tab').classList.remove('tab-active'); | |
| document.getElementById('results-tab').classList.add('tab-active'); | |
| }); | |
| document.getElementById('back-to-deductions').addEventListener('click', function() { | |
| document.getElementById('results-section').classList.add('hidden'); | |
| document.getElementById('deductions-section').classList.remove('hidden'); | |
| document.getElementById('results-tab').classList.remove('tab-active'); | |
| document.getElementById('deductions-tab').classList.add('tab-active'); | |
| }); | |
| // Tax calculation function | |
| function calculateTaxes() { | |
| // Get income data | |
| const { salary, rental, capitalGains, business, otherIncome } = taxData.income; | |
| const { ppf, elss, insurance, medicalInsurance, educationLoan, donations, hra } = taxData.deductions; | |
| // Calculate total income | |
| const totalIncome = salary + rental + capitalGains + business + otherIncome; | |
| // OLD REGIME CALCULATION | |
| // Calculate total deductions under old regime | |
| const total80C = Math.min(ppf + elss + insurance, 150000); | |
| const totalDeductions = total80C + medicalInsurance + educationLoan + donations + hra; | |
| // Calculate taxable income | |
| const oldTaxableIncome = Math.max(0, totalIncome - totalDeductions); | |
| // Calculate tax based on slabs | |
| let oldTax = 0; | |
| let oldSlabs = []; | |
| if (oldTaxableIncome > 1500000) { | |
| oldTax += (oldTaxableIncome - 1500000) * 0.3; | |
| oldSlabs.push({ range: 'Above ₹15,00,000', amount: oldTaxableIncome - 1500000, rate: '30%', tax: (oldTaxableIncome - 1500000) * 0.3 }); | |
| oldTax += (1500000 - 1250000) * 0.3; | |
| oldSlabs.push({ range: '₹12,50,001 - ₹15,00,000', amount: 1500000 - 1250000, rate: '30%', tax: (1500000 - 1250000) * 0.3 }); | |
| oldTax += (1250000 - 1000000) * 0.3; | |
| oldSlabs.push({ range: '₹10,00,001 - ₹12,50,000', amount: 1250000 - 1000000, rate: '30%', tax: (1250000 - 1000000) * 0.3 }); | |
| oldTax += (1000000 - 750000) * 0.2; | |
| oldSlabs.push({ range: '₹7,50,001 - ₹10,00,000', amount: 1000000 - 750000, rate: '20%', tax: (1000000 - 750000) * 0.2 }); | |
| oldTax += (750000 - 500000) * 0.2; | |
| oldSlabs.push({ range: '₹5,00,001 - ₹7,50,000', amount: 750000 - 500000, rate: '20%', tax: (750000 - 500000) * 0.2 }); | |
| oldTax += (500000 - 250000) * 0.05; | |
| oldSlabs.push({ range: '₹2,50,001 - ₹5,00,000', amount: 500000 - 250000, rate: '5%', tax: (500000 - 250000) * 0.05 }); | |
| } else if (oldTaxableIncome > 1250000) { | |
| oldTax += (oldTaxableIncome - 1250000) * 0.3; | |
| oldSlabs.push({ range: '₹12,50,001 - ₹15,00,000', amount: oldTaxableIncome - 1250000, rate: '30%', tax: (oldTaxableIncome - 1250000) * 0.3 }); | |
| oldTax += (1250000 - 1000000) * 0.3; | |
| oldSlabs.push({ range: '₹10,00,001 - ₹12,50,000', amount: 1250000 - 1000000, rate: '30%', tax: (1250000 - 1000000) * 0.3 }); | |
| oldTax += (1000000 - 750000) * 0.2; | |
| oldSlabs.push({ range: '₹7,50,001 - ₹10,00,000', amount: 1000000 - 750000, rate: '20%', tax: (1000000 - 750000) * 0.2 }); | |
| oldTax += (750000 - 500000) * 0.2; | |
| oldSlabs.push({ range: '₹5,00,001 - ₹7,50,000', amount: 750000 - 500000, rate: '20%', tax: (750000 - 500000) * 0.2 }); | |
| oldTax += (500000 - 250000) * 0.05; | |
| oldSlabs.push({ range: '₹2,50,001 - ₹5,00,000', amount: 500000 - 250000, rate: '5%', tax: (500000 - 250000) * 0.05 }); | |
| } else if (oldTaxableIncome > 1000000) { | |
| oldTax += (oldTaxableIncome - 1000000) * 0.3; | |
| oldSlabs.push({ range: '₹10,00,001 - ₹12,50,000', amount: oldTaxableIncome - 1000000, rate: '30%', tax: (oldTaxableIncome - 1000000) * 0.3 }); | |
| oldTax += (1000000 - 750000) * 0.2; | |
| oldSlabs.push({ range: '₹7,50,001 - ₹10,00,000', amount: 1000000 - 750000, rate: '20%', tax: (1000000 - 750000) * 0.2 }); | |
| oldTax += (750000 - 500000) * 0.2; | |
| oldSlabs.push({ range: '₹5,00,001 - ₹7,50,000', amount: 750000 - 500000, rate: '20%', tax: (750000 - 500000) * 0.2 }); | |
| oldTax += (500000 - 250000) * 0.05; | |
| oldSlabs.push({ range: '₹2,50,001 - ₹5,00,000', amount: 500000 - 250000, rate: '5%', tax: (500000 - 250000) * 0.05 }); | |
| } else if (oldTaxableIncome > 750000) { | |
| oldTax += (oldTaxableIncome - 750000) * 0.2; | |
| oldSlabs.push({ range: '₹7,50,001 - ₹10,00,000', amount: oldTaxableIncome - 750000, rate: '20%', tax: (oldTaxableIncome - 750000) * 0.2 }); | |
| oldTax += (750000 - 500000) * 0.2; | |
| oldSlabs.push({ range: '₹5,00,001 - ₹7,50,000', amount: 750000 - 500000, rate: '20%', tax: (750000 - 500000) * 0.2 }); | |
| oldTax += (500000 - 250000) * 0.05; | |
| oldSlabs.push({ range: '₹2,50,001 - ₹5,00,000', amount: 500000 - 250000, rate: '5%', tax: (500000 - 250000) * 0.05 }); | |
| } else if (oldTaxableIncome > 500000) { | |
| oldTax += (oldTaxableIncome - 500000) * 0.2; | |
| oldSlabs.push({ range: '₹5,00,001 - ₹7,50,000', amount: oldTaxableIncome - 500000, rate: '20%', tax: (oldTaxableIncome - 500000) * 0.2 }); | |
| oldTax += (500000 - 250000) * 0.05; | |
| oldSlabs.push({ range: '₹2,50,001 - ₹5,00,000', amount: 500000 - 250000, rate: '5%', tax: (500000 - 250000) * 0.05 }); | |
| } else if (oldTaxableIncome > 250000) { | |
| oldTax += (oldTaxableIncome - 250000) * 0.05; | |
| oldSlabs.push({ range: '₹2,50,001 - ₹5,00,000', amount: oldTaxableIncome - 250000, rate: '5%', tax: (oldTaxableIncome - 250000) * 0.05 }); | |
| } | |
| // Rebate under section 87A (for income up to 7 lakhs) | |
| if (oldTaxableIncome <= 700000) { | |
| const rebate = Math.min(oldTax, 12500); | |
| oldTax -= rebate; | |
| } | |
| // Surcharge | |
| let oldSurcharge = 0; | |
| if (oldTaxableIncome > 5000000 && oldTaxableIncome <= 10000000) { | |
| oldSurcharge = oldTax * 0.1; | |
| } else if (oldTaxableIncome > 10000000 && oldTaxableIncome <= 20000000) { | |
| oldSurcharge = oldTax * 0.15; | |
| } else if (oldTaxableIncome > 20000000 && oldTaxableIncome <= 50000000) { | |
| oldSurcharge = oldTax * 0.25; | |
| } else if (oldTaxableIncome > 50000000) { | |
| oldSurcharge = oldTax * 0.37; | |
| } | |
| // Health and education cess | |
| const oldCess = (oldTax + oldSurcharge) * 0.04; | |
| // Total tax liability | |
| const oldTotalTax = oldTax + oldSurcharge + oldCess; | |
| // NEW REGIME CALCULATION | |
| // Standard deduction (only for salaried individuals) | |
| const newStandardDeduction = salary > 0 ? 50000 : 0; | |
| const newTaxableIncome = Math.max(0, totalIncome - newStandardDeduction); | |
| // Calculate tax based on new regime slabs | |
| let newTax = 0; | |
| let newSlabs = []; | |
| if (newTaxableIncome > 1500000) { | |
| newTax += (newTaxableIncome - 1500000) * 0.3; | |
| newSlabs.push({ range: 'Above ₹15,00,000', amount: newTaxableIncome - 1500000, rate: '30%', tax: (newTaxableIncome - 1500000) * 0.3 }); | |
| newTax += (1500000 - 1250000) * 0.25; | |
| newSlabs.push({ range: '₹12,50,001 - ₹15,00,000', amount: 1500000 - 1250000, rate: '25%', tax: (1500000 - 1250000) * 0.25 }); | |
| newTax += (1250000 - 1000000) * 0.2; | |
| newSlabs.push({ range: '₹10,00,001 - ₹12,50,000', amount: 1250000 - 1000000, rate: '20%', tax: (1250000 - 1000000) * 0.2 }); | |
| newTax += (1000000 - 750000) * 0.15; | |
| newSlabs.push({ range: '₹7,50,001 - ₹10,00,000', amount: 1000000 - 750000, rate: '15%', tax: (1000000 - 750000) * 0.15 }); | |
| newTax += (750000 - 500000) * 0.1; | |
| newSlabs.push({ range: '₹5,00,001 - ₹7,50,000', amount: 750000 - 500000, rate: '10%', tax: (750000 - 500000) * 0.1 }); | |
| newTax += (500000 - 250000) * 0.05; | |
| newSlabs.push({ range: '₹2,50,001 - ₹5,00,000', amount: 500000 - 250000, rate: '5%', tax: (500000 - 250000) * 0.05 }); | |
| } else if (newTaxableIncome > 1250000) { | |
| newTax += (newTaxableIncome - 1250000) * 0.25; | |
| newSlabs.push({ range: '₹12,50,001 - ₹15,00,000', amount: newTaxableIncome - 1250000, rate: '25%', tax: (newTaxableIncome - 1250000) * 0.25 }); | |
| newTax += (1250000 - 1000000) * 0.2; | |
| newSlabs.push({ range: '₹10,00,001 - ₹12,50,000', amount: 1250000 - 1000000, rate: '20%', tax: (1250000 - 1000000) * 0.2 }); | |
| newTax += (1000000 - 750000) * 0.15; | |
| newSlabs.push({ range: '₹7,50,001 - ₹10,00,000', amount: 1000000 - 750000, rate: '15%', tax: (1000000 - 750000) * 0.15 }); | |
| newTax += (750000 - 500000) * 0.1; | |
| newSlabs.push({ range: '₹5,00,001 - ₹7,50,000', amount: 750000 - 500000, rate: '10%', tax: (750000 - 500000) * 0.1 }); | |
| newTax += (500000 - 250000) * 0.05; | |
| newSlabs.push({ range: '₹2,50,001 - ₹5,00,000', amount: 500000 - 250000, rate: '5%', tax: (500000 - 250000) * 0.05 }); | |
| } else if (newTaxableIncome > 1000000) { | |
| newTax += (newTaxableIncome - 1000000) * 0.2; | |
| newSlabs.push({ range: '₹10,00,001 - ₹12,50,000', amount: newTaxableIncome - 1000000, rate: '20%', tax: (newTaxableIncome - 1000000) * 0.2 }); | |
| newTax += (1000000 - 750000) * 0.15; | |
| newSlabs.push({ range: '₹7,50,001 - ₹10,00,000', amount: 1000000 - 750000, rate: '15%', tax: (1000000 - 750000) * 0.15 }); | |
| newTax += (750000 - 500000) * 0.1; | |
| newSlabs.push({ range: '₹5,00,001 - ₹7,50,000', amount: 750000 - 500000, rate: '10%', tax: (750000 - 500000) * 0.1 }); | |
| newTax += (500000 - 250000) * 0.05; | |
| newSlabs.push({ range: '₹2,50,001 - ₹5,00,000', amount: 500000 - 250000, rate: '5%', tax: (500000 - 250000) * 0.05 }); | |
| } else if (newTaxableIncome > 750000) { | |
| newTax += (newTaxableIncome - 750000) * 0.15; | |
| newSlabs.push({ range: '₹7,50,001 - ₹10,00,000', amount: newTaxableIncome - 750000, rate: '15%', tax: (newTaxableIncome - 750000) * 0.15 }); | |
| newTax += (750000 - 500000) * 0.1; | |
| newSlabs.push({ range: '₹5,00,001 - ₹7,50,000', amount: 750000 - 500000, rate: '10%', tax: (750000 - 500000) * 0.1 }); | |
| newTax += (500000 - 250000) * 0.05; | |
| newSlabs.push({ range: '₹2,50,001 - ₹5,00,000', amount: 500000 - 250000, rate: '5%', tax: (500000 - 250000) * 0.05 }); | |
| } else if (newTaxableIncome > 500000) { | |
| newTax += (newTaxableIncome - 500000) * 0.1; | |
| newSlabs.push({ range: '₹5,00,001 - ₹7,50,000', amount: newTaxableIncome - 500000, rate: '10%', tax: (newTaxableIncome - 500000) * 0.1 }); | |
| newTax += (500000 - 250000) * 0.05; | |
| newSlabs.push({ range: '₹2,50,001 - ₹5,00,000', amount: 500000 - 250000, rate: '5%', tax: (500000 - 250000) * 0.5 }); | |
| } else if (newTaxableIncome > 250000) { | |
| newTax += (newTaxableIncome - 250000) * 0.05; | |
| newSlabs.push({ range: '₹2,50,001 - ₹5,00,000', amount: newTaxableIncome - 250000, rate: '5%', tax: (newTaxableIncome - 250000) * 0.05 }); | |
| } | |
| // Rebate under section 87A (for income up to 7 lakhs) | |
| if (newTaxableIncome <= 700000) { | |
| const rebate = Math.min(newTax, 12500); | |
| newTax -= rebate; | |
| } | |
| // Surcharge | |
| let newSurcharge = 0; | |
| if (newTaxableIncome > 5000000 && newTaxableIncome <= 10000000) { | |
| newSurcharge = newTax * 0.1; | |
| } else if (newTaxableIncome > 10000000 && newTaxableIncome <= 20000000) { | |
| newSurcharge = newTax * 0.15; | |
| } else if (newTaxableIncome > 20000000 && newTaxableIncome <= 50000000) { | |
| newSurcharge = newTax * 0.25; | |
| } else if (newTaxableIncome > 50000000) { | |
| newSurcharge = newTax * 0.37; | |
| } | |
| // Health and education cess | |
| const newCess = (newTax + newSurcharge) * 0.04; | |
| // Total tax liability | |
| const newTotalTax = newTax + newSurcharge + newCess; | |
| // Determine which regime is better | |
| const recommendation = oldTotalTax < newTotalTax ? | |
| "Based on your income and deductions, the old regime appears more beneficial." : | |
| "Based on your income and deductions, the new regime appears more beneficial."; | |
| // Store results | |
| taxData.results = { | |
| oldRegime: { | |
| totalIncome, | |
| totalDeductions, | |
| taxableIncome: oldTaxableIncome, | |
| incomeTax: oldTax, | |
| surcharge: oldSurcharge, | |
| cess: oldCess, | |
| totalTax: oldTotalTax, | |
| slabs: oldSlabs | |
| }, | |
| newRegime: { | |
| totalIncome, | |
| standardDeduction: newStandardDeduction, | |
| taxableIncome: newTaxableIncome, | |
| incomeTax: newTax, | |
| surcharge: newSurcharge, | |
| cess: newCess, | |
| totalTax: newTotalTax, | |
| slabs: newSlabs | |
| }, | |
| recommendation | |
| }; | |
| // Update UI with results | |
| updateResultsUI(); | |
| } | |
| // Update results UI | |
| function updateResultsUI() { | |
| const { oldRegime, newRegime, recommendation } = taxData.results; | |
| // Format currency | |
| const formatCurrency = (amount) => { | |
| return new Intl.NumberFormat('en-IN', { style: 'currency', currency: 'INR', maximumFractionDigits: 0 }).format(amount).replace('₹', '₹'); | |
| }; | |
| // Old regime | |
| document.getElementById('old-total-income').textContent = formatCurrency(oldRegime.totalIncome); | |
| document.getElementById('old-total-deductions').textContent = formatCurrency(oldRegime.totalDeductions); | |
| document.getElementById('old-taxable-income').textContent = formatCurrency(oldRegime.taxableIncome); | |
| document.getElementById('old-income-tax').textContent = formatCurrency(oldRegime.incomeTax); | |
| document.getElementById('old-surcharge').textContent = formatCurrency(oldRegime.surcharge); | |
| document.getElementById('old-cess').textContent = formatCurrency(oldRegime.cess); | |
| document.getElementById('old-total-tax').textContent = formatCurrency(oldRegime.totalTax); | |
| // New regime | |
| document.getElementById('new-total-income').textContent = formatCurrency(newRegime.totalIncome); | |
| document.getElementById('new-standard-deduction').textContent = formatCurrency(newRegime.standardDeduction); | |
| document.getElementById('new-taxable-income').textContent = formatCurrency(newRegime.taxableIncome); | |
| document.getElementById('new-income-tax').textContent = formatCurrency(newRegime.incomeTax); | |
| document.getElementById('new-surcharge').textContent = formatCurrency(newRegime.surcharge); | |
| document.getElementById('new-cess').textContent = formatCurrency(newRegime.cess); | |
| document.getElementById('new-total-tax').textContent = formatCurrency(newRegime.totalTax); | |
| // Recommendation | |
| document.getElementById('regime-recommendation').textContent = recommendation; | |
| } | |
| // Regime toggle | |
| document.getElementById('regime-toggle').addEventListener('change', function() { | |
| const oldRegimeResults = document.getElementById('old-regime-results'); | |
| const newRegimeResults = document.getElementById('new-regime-results'); | |
| const regimeLabel = document.getElementById('regime-label'); | |
| if (this.checked) { | |
| oldRegimeResults.classList.add('opacity-50'); | |
| newRegimeResults.classList.remove('opacity-50'); | |
| regimeLabel.textContent = 'New Regime'; | |
| // Update the active tab indicator | |
| oldRegimeResults.querySelector('h4').classList.remove('text-gray-800'); | |
| oldRegimeResults.querySelector('h4').classList.add('text-gray-600'); | |
| newRegimeResults.querySelector('h4').classList.remove('text-gray-600'); | |
| newRegimeResults.querySelector('h4').classList.add('text-gray-800'); | |
| // Update the dot color | |
| oldRegimeResults.querySelector('.w-3').classList.remove('bg-indigo-500'); | |
| oldRegimeResults.querySelector('.w-3').classList.add('bg-gray-400'); | |
| newRegimeResults.querySelector('.w-3').classList.remove('bg-gray-400'); | |
| newRegimeResults.querySelector('.w-3').classList.add('bg-indigo-500'); | |
| } else { | |
| oldRegimeResults.classList.remove('opacity-50'); | |
| newRegimeResults.classList.add('opacity-50'); | |
| regimeLabel.textContent = 'Old Regime'; | |
| // Update the active tab indicator | |
| oldRegimeResults.querySelector('h4').classList.remove('text-gray-600'); | |
| oldRegimeResults.querySelector('h4').classList.add('text-gray-800'); | |
| newRegimeResults.querySelector('h4').classList.remove('text-gray-800'); | |
| newRegimeResults.querySelector('h4').classList.add('text-gray-600'); | |
| // Update the dot color | |
| oldRegimeResults.querySelector('.w-3').classList.remove('bg-gray-400'); | |
| oldRegimeResults.querySelector('.w-3').classList.add('bg-indigo-500'); | |
| newRegimeResults.querySelector('.w-3').classList.remove('bg-indigo-500'); | |
| newRegimeResults.querySelector('.w-3').classList.add('bg-gray-400'); | |
| } | |
| }); | |
| // Save data to localStorage | |
| document.getElementById('save-data').addEventListener('click', function() { | |
| // Check if PAN already exists | |
| const existingIndex = savedRecords.findIndex(record => record.personal.pan === taxData.personal.pan); | |
| if (existingIndex !== -1) { | |
| // Update existing record | |
| savedRecords[existingIndex] = taxData; | |
| } else { | |
| // Add new record | |
| savedRecords.push(taxData); | |
| } | |
| // Save to localStorage | |
| localStorage.setItem('taxRecords', JSON.stringify(savedRecords)); | |
| alert('Your tax data has been saved successfully!'); | |
| }); | |
| // Export to Excel | |
| document.getElementById('export-excel').addEventListener('click', function() { | |
| // Create a worksheet | |
| const ws = XLSX.utils.json_to_sheet([ | |
| { | |
| 'Name': taxData.personal.name, | |
| 'PAN': taxData.personal.pan, | |
| 'Age': taxData.personal.age, | |
| 'Gender': taxData.personal.gender, | |
| 'Salary Income': taxData.income.salary, | |
| 'House Property Income': taxData.income.rental, | |
| 'Capital Gains': taxData.income.capitalGains, | |
| 'Business Income': taxData.income.business, | |
| 'Other Income': taxData.income.otherIncome, | |
| 'Total Income': taxData.results.oldRegime.totalIncome, | |
| 'Total Deductions (Old Regime)': taxData.results.oldRegime.totalDeductions, | |
| 'Taxable Income (Old Regime)': taxData.results.oldRegime.taxableIncome, | |
| 'Tax Liability (Old Regime)': taxData.results.oldRegime.totalTax, | |
| 'Standard Deduction (New Regime)': taxData.results.newRegime.standardDeduction, | |
| 'Taxable Income (New Regime)': taxData.results.newRegime.taxableIncome, | |
| 'Tax Liability (New Regime)': taxData.results.newRegime.totalTax, | |
| 'Recommended Regime': taxData.results.oldRegime.totalTax < taxData.results.newRegime.totalTax ? 'Old Regime' : 'New Regime' | |
| } | |
| ]); | |
| // Create a workbook | |
| const wb = XLSX.utils.book_new(); | |
| XLSX.utils.book_append_sheet(wb, ws, "Tax Data"); | |
| // Export the workbook | |
| XLSX.writeFile(wb, `Tax_Calculation_${taxData.personal.pan}.xlsx`); | |
| }); | |
| // Search functionality | |
| document.getElementById('search-by-pan').addEventListener('click', function() { | |
| const pan = document.getElementById('search-pan').value.trim().toUpperCase(); | |
| if (!pan) { | |
| alert('Please enter a PAN number to search'); | |
| return; | |
| } | |
| if (!/^[A-Z]{5}[0-9]{4}[A-Z]{1}$/.test(pan)) { | |
| alert('Please enter a valid PAN number'); | |
| return; | |
| } | |
| searchRecords('pan', pan); | |
| }); | |
| document.getElementById('search-by-name').addEventListener('click', function() { | |
| const name = document.getElementById('search-name').value.trim(); | |
| if (!name) { | |
| alert('Please enter a name to search'); | |
| return; | |
| } | |
| searchRecords('name', name); | |
| }); | |
| // Search records function | |
| function searchRecords(field, value) { | |
| const results = savedRecords.filter(record => { | |
| if (field === 'pan') { | |
| return record.personal.pan === value; | |
| } else { | |
| return record.personal.name.toLowerCase().includes(value.toLowerCase()); | |
| } | |
| }); | |
| if (results.length === 0) { | |
| alert('No records found matching your search criteria'); | |
| return; | |
| } | |
| // Display results | |
| displaySearchResults(results); | |
| } | |
| // Display search results | |
| function displaySearchResults(results) { | |
| const resultsTableBody = document.getElementById('results-table-body'); | |
| resultsTableBody.innerHTML = ''; | |
| const formatCurrency = (amount) => { | |
| return new Intl.NumberFormat('en-IN', { style: 'currency', currency: 'INR', maximumFractionDigits: 0 }).format(amount).replace('₹', '₹'); | |
| }; | |
| results.forEach(record => { | |
| const row = document.createElement('tr'); | |
| row.innerHTML = ` | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">${record.personal.name}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${record.personal.pan}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${record.personal.age}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${record.personal.gender.charAt(0).toUpperCase() + record.personal.gender.slice(1)}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatCurrency(record.results.oldRegime.totalIncome)}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatCurrency(record.results.oldRegime.totalTax)}</td> | |
| <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatCurrency(record.results.newRegime.totalTax)}</td> | |
| `; | |
| resultsTableBody.appendChild(row); | |
| }); | |
| document.getElementById('search-results').classList.remove('hidden'); | |
| } | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Amujeeb/myspace" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |