<!DOCTYPE html>
<html>

<head>
    <title>Add New AO Record </title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/add_ao.css') }}">
    <script src="/static/js/ao_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>AO Form Entry</h2>
        <form method="POST" onsubmit="return showSuccessMessage()">
            <!-- <label>Year:</label>
            <input type="number" name="year" required> -->

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

            {% for field in [
            "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",
            "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>
            <!-- <input type="number" name="{{ field }}" step="0.01" oninput="calculate()" required> -->
            {% endfor %}
            <button type="submit">Submit</button>
        </form>
    </div>

    <!-- JavaScript Alert -->
    <script>
        function showSuccessMessage() {
            alert("Form submitted successfully!");
            return true; // allow form to submit after showing alert
        }
    </script>
</body>

</html>