<!DOCTYPE html>
<html>

<head>
    <title>CIT Form Entry</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/add_cit.css') }}">
    <script src="/static/js/cit_calc.js"></script>
    <script src="/static/js/year_dropdown.js"></script>

</head>

<body>
    <div class="container">
        <!-- Back to Dashboard Button -->
        <a href="{{ url_for('index') }}" class="back-btn">← Back to Dashboard</a>

        <h2>CIT Form Entry</h2>
        <form method="POST">
            <!-- <label>Year:</label>
            <input type="number" name="year" required value="{{ record.year if record else '' }}"> -->

            <div class="form-group">
                <label> Year:</label>
                <select id="year" name="year" required></select>
            </div>

            {% for field in [
            "gross_total_income", "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"
            ] %}
            <label for="{{ field }}">{{ field.replace("_", " ").title() }}:</label>
            <input type="number" name="{{ field }}" step="0.01" required value="{{ record[field] if record else '' }}">
            {% endfor %}
            <button type="submit">{{ 'Update' if record else 'Submit' }}</button>
        </form>

    </div>

    <script>
        function showSuccessMessage() {
            alert("Form submitted successfully!");
            return true; // continue with form submission
        }
    </script>
</body>

</html>