<%@ page title="" language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_Hrm_IncomeTax_Form16New, App_Web_bbk52f2h" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl" TagPrefix="Date" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager" TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl" TagPrefix="ScreenGroup" %>
<%@ Register Src="~/UserControls/Common/EmployeeSearch/EmployeeSearch.ascx" TagName="EmployeeSearchControl" TagPrefix="hims" %>
<%@ Register Src="~/UserControls/Common/IncomeTax/IncomeTaxLabelControl.ascx" TagName="ITaxControl" TagPrefix="ITax" %>
<%@ Register Src="~/UserControls/MessageBox/MessageBoxControl.ascx" TagName="MessageControl" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">



    <asp:UpdatePanel ID="ResonMasterUpdatePanel" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <hims:EmployeeSearchControl ID="EmployeeSearch" Visible="false" runat="server" />
            <div id="divContentPage" class="divcontentpagemargin">

                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">
                        <table>
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="232"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <ITax:ITaxControl ID="ITaxUserControl" runat="server" Visible="true" />
                    <div class="himssuHeader5WireBox card card-box" id="SearchDiv" runat="server">
                        <div class="himsBoxHeader card-head">
                            <asp:Panel ID="Panel1" runat="server">

                                <div class="himsBoxTitle">
                                    <div class="headerText">
                                        <header>
                                            <i class="fas fa-search"></i>
                                            <asp:Label ID="Label3" runat="server" Text="Search"></asp:Label>
                                        </header>
                                    </div>
                                    <div class="fRight mt-27">
                                        <asp:Button ID="AddNewButtonID" runat="server" OnClick="AddNewButton_Click" SkinID="0" class="btn btn-add fas" Text="&#xf067; Add" />
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                        <div class="himsBoxContent card-body">
                            <asp:Panel ID="DetailPanel" runat="Server">
                                <div class="contentHolder">
                                    <asp:Panel ID="SearchCriteriaPanel" runat="Server">

                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="Label2" runat="server" Text="Organization"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:DropDownList runat="server" ID="OrganizationSearchDropDownList" SkinID="CustomWidthDropDownList" onmouseleave="showHideTooltip()" CssClass="form-control" onmouseenter="showHideTooltip()">
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="TitleSearchLabel" Text="Employee Name" runat="server"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:TextBox ID="TitleSearchTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                    SkinID="CustomWidthTextBox" runat="Server" MaxLength="100"></asp:TextBox>
                                            </div>
                                        </div>
                                        <div class="outerBox pTop5 col-md-3">
                                            <div class="controlLabelWidth">
                                                <asp:Label ID="CodeSearchLabel" Text="Employee Code" runat="server"></asp:Label>
                                            </div>
                                            <div class="fLeft pRight5">
                                                <asp:TextBox ID="CodeSearchTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                    SkinID="CustomWidthTextBox" runat="Server" MaxLength="100"></asp:TextBox>
                                            </div>
                                        </div>

                                        <div class="alignCenter pTop5 col-md-12 center">
                                            <asp:Button ID="SearchButton" Text="&#xf002; Search" runat="Server" OnClick="SearchButton_Click" SkinID="0" class="btn-search btn fas" />
                                            <asp:Button ID="ResetButton" runat="server" Text="&#xf0e2; Reset" OnClick="ResetButton_Click" SkinID="0" class="btn-reset btn fas" />
                                        </div>

                                    </asp:Panel>
                                    <div id="Div1" class="himssuHeader7WireBox col-md-12" runat="server" style="width: 100%; margin-right: 5px;">
                                        <div id="ReasonMasterDetailDiv" visible="false" runat="server">

                                            <div class="himsBoxHeader" id="PatientRelationDiv" visible="True" runat="server">
                                                <div class="leftdiv">
                                                </div>
                                                <div class="himsBoxTitle" style="width: 99%">
                                                    <div class="headerText">
                                                        <div>
                                                            <asp:Label ID="GridViewLabel" Text="" runat="server" Font-Bold="true" />
                                                        </div>
                                                    </div>

                                                    <div align="right" class="mt-10">
                                                        <div align="right" style="margin-right: -2px">
                                                            <table id="PagerTable" runat="server" cellpadding="0" cellspacing="0">
                                                                <tr>
                                                                    <td class="formLabel">
                                                                        <asp:Panel ID="RecordPanel" runat="server">
                                                                            <label class="pLeft5" style="font-weight: 600">
                                                                                Total Records: <b>
                                                                                    <asp:Label ID="NoofRecords" runat="server" /></b></label>
                                                                            <label class="colorBlue">|</label>
                                                                            <label style="font-weight: 600">
                                                                                Records per Page: <b>
                                                                                    <asp:Label ID="RecordsperPageLabel" runat="server" /></b></label>
                                                                            <label class="colorBlue">|</label><label class="pLeft40" />
                                                                        </asp:Panel>
                                                                    </td>
                                                                    <td class="formLabel fRight">
                                                                        <asp:LinkButton CssClass="btn btn-default gridviewpagerbuttonpadding" ToolTip="First Page" ID="ImageButtonFirst" OnClick="ImageButtonFirst_Click" runat="server"><i class="fa fa-fast-backward" style="font-size:8px"></i>
                                                                        </asp:LinkButton>
                                                                        <asp:LinkButton CssClass="btn btn-default gridviewpagerbuttonpadding" ToolTip="Previous Page" ID="ImageButtonPrev" OnClick="ImageButtonPrev_Click" runat="server"><i class="fa fa-play fa-rotate-180" style="font-size:8px"></i>
                                                                        </asp:LinkButton>
                                                                        &nbsp;&nbsp;
                                                                                    <asp:Label Font-Bold="false" ID="Label9" runat="server" Text="Record " AssociatedControlID="ReCordNumber" />
                                                                        <asp:TextBox ID="TextBoxPage" Font-Bold="true" Height="15PX" Width="24Px" runat="server" AutoPostBack="true" OnTextChanged="TextBoxPage_OnTextChanged" SkinID="Dummy" CssClass="pageTextbox" onkeypress="return isNumberKey(event);"
                                                                            onPaste="return false;"
                                                                            onDrag="return false"
                                                                            onDrop="return false"
                                                                            autocomplete="off" />
                                                                        <asp:Label ID="Label10" Font-Bold="true" SkinID="Dummy" runat="server"></asp:Label>
                                                                        <asp:Label ID="Label11" Text="of" runat="server" />
                                                                        <asp:Label Font-Bold="true" ID="LabelNumberOfPages" runat="server" />
                                                                        &nbsp;&nbsp;
                                                                                    <asp:LinkButton CssClass="btn btn-default gridviewpagerbuttonpadding" ToolTip="Next Page" ID="ImageButtonNext" OnClick="ImageButtonNext_Click" runat="server"><i class="fa fa-play" style="font-size:8px"></i>
                                                                                    </asp:LinkButton>
                                                                        <asp:LinkButton CssClass="btn btn-default gridviewpagerbuttonpadding" ToolTip="Last Page" ID="ImageButtonLast" runat="server" OnClick="ImageButtonLast_Click"><i class="fa fa-fast-forward" style="font-size:8px"></i>
                                                                        </asp:LinkButton>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </div>

                                                    </div>
                                                </div>
                                            </div>
                                            <div class="himsBoxContent card-body">
                                                <div id="GridViewMessageDiv" class="himsBoxContentMsg" runat="server" visible="true">
                                                </div>
                                                <asp:UpdatePanel ID="MenuPlanDetailUpdatePanel" runat="server" UpdateMode="Always">
                                                    <ContentTemplate>
                                                        <div id="Div5" runat="server" visible="false">
                                                            <asp:GridView ID="IncomeTaxSlabGridView" runat="server" class="himssuHeader7WireBox col-md-12 table-responsive" AutoGenerateColumns="False"
                                                                OnRowDataBound="AccountMasterGridView_RowDataBound"
                                                                SkinID="" ShowHeader="True"
                                                                DataKeyNames="Id" EmptyDataText="No Records Found !!!"
                                                                CssClass="table table-striped table-bordered">
                                                                <Columns>
                                                                    <asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:LinkButton ID="EditLinkButton" runat="server" CommandName="Select" OnClick="LinkButton_Click"
                                                                                Text="Select" CausesValidation="false"></asp:LinkButton>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Organization" ItemStyle-Width="30%" SortExpression="Organization" HeaderStyle-HorizontalAlign="Left"
                                                                        ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="OrganizationLabel" runat="server" Text='<%# Bind("Organization") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Employee Code" ItemStyle-Width="10%" SortExpression="Code" HeaderStyle-HorizontalAlign="Left"
                                                                        ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="CodeLabel" runat="server" Text='<%# Bind("Code") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Employee Name" ItemStyle-Width="20%" SortExpression="EmployeeName" HeaderStyle-HorizontalAlign="Left"
                                                                        ItemStyle-Wrap="true">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="EmployeeNameLabel" runat="server" Text='<%# Bind("EmployeeName") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                </Columns>
                                                            </asp:GridView>
                                                        </div>
                                                    </ContentTemplate>
                                                </asp:UpdatePanel>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                    </div>
                    <div class="himssuHeader1WireBox card card-box" id="DetailDiv" runat="server" visible="false">
                        <div class="himsBoxHeader card-head">

                            <div class="himsBoxTitle">
                                <div class="headerText">
                                    <header>
                                        <i class="fas fa-cog"></i>
                                        <asp:Label ID="AccountingYearMasterDetailLabel" runat="server" Text="Maintenance"></asp:Label>
                                    </header>
                                </div>
                            </div>
                            <div class="fRight mt-27 pagination display-flex">
                                <table>
                                    <tr>
                                        <td class="formLabel">
                                            <div id="NumberOfRecordDiv" class="display-flex" runat="server" visible="true">
                                                <asp:LinkButton AlternateText="First page" ToolTip="First page" ID="FirstRecordImageButton"
                                                    runat="server" ImageUrl="~/Images/arrowLlast.gif" CommandName="Page" CommandArgument="First"
                                                    OnClick="FirstRecordImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                                <i class="fa fa-fast-backward"></i>
                                                </asp:LinkButton>
                                                <asp:LinkButton AlternateText="Previous page" ToolTip="Previous page" ID="PreviousImageButton"
                                                    runat="server" ImageUrl="~/Images/arrowLeft.gif" CommandName="Page" CommandArgument="Prev"
                                                    OnClick="PreviousImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                                <i class="fa fa-play fa-rotate-180"></i>
                                                </asp:LinkButton>
                                                &nbsp; &nbsp;
                                                            <asp:Label ID="LabelPage" runat="server" Text="Record " AssociatedControlID="ReCordNumber" />
                                                <asp:Label ID="ReCordNumber" Font-Bold="true" SkinID="Dummy" runat="server"></asp:Label>
                                                <asp:Label ID="ofLabel" Text="of" runat="server" />
                                                <asp:Label ID="TotalRecord" runat="server" />
                                                &nbsp; &nbsp;
                                                            <asp:LinkButton AlternateText="Next page" ToolTip="Next page" ID="NextImageButtom"
                                                                runat="server" ImageUrl="~/Images/arrowRight.gif" CommandName="Page" CommandArgument="Next"
                                                                OnClick="NextImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                                <i class="fa fa-play"></i>
                                                            </asp:LinkButton>
                                                <asp:LinkButton AlternateText="Last page" ToolTip="Last page" ID="LastRecordImageButton"
                                                    runat="server" ImageUrl="~/Images/arrowRLast.gif" CommandName="Page" CommandArgument="Last"
                                                    OnClick="LastRecordImageButton_Click" CssClass="btn btn-default gridviewpagerbuttonpadding">
                                                                <i class="fa fa-fast-forward"></i>
                                                </asp:LinkButton>
                                            </div>
                                        </td>
                                        <td>&nbsp; &nbsp;
                                            <asp:Button ID="BackButton" runat="Server" OnClick="BackButton_Click" SkinID="0" class="btn btn-back fas" Text="&#xf30a; Back" />
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                        <div class="himsBoxContent card-body">
                            <div class="contentHolder">

                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="OrganizationLabel" runat="server" Text="Organization" SkinID="MandatoryLabel"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <asp:DropDownList runat="server" ID="OrganizationDropDownList" SkinID="CustomWidthDropDownList" AutoPostBack="true"
                                            OnSelectedIndexChanged="OrganizationDropDownListSelectedIndexChanged" onmouseleave="showHideTooltip()" CssClass="form-control" onmouseenter="showHideTooltip()">
                                        </asp:DropDownList>
                                    </div>
                                </div>

                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="EmployeeCodeLabel" runat="server" Text="Employee Code" SkinID="MandatoryLabel"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5 display-flex">
                                        <asp:TextBox ID="EmployeeCodeTextBox" SkinID="CustomWidthTextBox" runat="server"
                                            MaxLength="100" AutoPostBack="True"
                                            OnTextChanged="EmployeeCodeTextBox_TextChanged"></asp:TextBox>
                                        <asp:ImageButton SkinID="FindImage" ToolTip="Search" ID="EmployeeCodeImageButton"
                                            runat="server" OnClick="EmployeeCodeImageButton_Click" ImageUrl="../../../../Images/icons/icon_find.gif" />
                                        <asp:HiddenField ID="PaySetupIdHiddenField" runat="server" Value="0" />
                                        <asp:HiddenField ID="EmployeeIdHiddenField" runat="server" />
                                        <asp:HiddenField ID="IdHiddenField" runat="server" />
                                        <asp:HiddenField ID="MaxRowHiddenField" runat="server" />
                                    </div>
                                </div>
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="EmployeeNameLabel" runat="server" Text="Employee Name"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <asp:TextBox ID="EmployeeNameTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                            Enabled="False" SkinID="CustomWidthTextBox" runat="server"
                                            MaxLength="100"></asp:TextBox>
                                    </div>
                                </div>

                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="ForYearLabel" runat="server" Visible="false" Text="Payroll Name:"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <asp:Label ID="PayrollYearLabel" runat="server" Text="" Visible="false" Font-Size="Small" Font-Bold="true"></asp:Label>

                                    </div>
                                </div>
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="ForMonthLabel" runat="server" Visible="false" Text="Payroll Year"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <asp:DropDownList runat="server" Visible="false" ID="PayrollYearDropDownList" SkinID="CustomWidthDropDownList"
                                            AutoPostBack="true" OnSelectedIndexChanged="PayrollYearDropDownList_OnSelectedIndexChanged" CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                        </asp:DropDownList>
                                    </div>
                                </div>
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="Label1" Visible="false" runat="server" Text="Import Data From Payroll"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <asp:Button ID="ImportDataButton" Visible="false" OnClick="ImportDataButton_Click" runat="server" Text="Import" SkinID="0" CssClass="btn btn-assign" />
                                    </div>
                                </div>

                                <div class="himssuHeader7WireBox col-md-12">
                                    <div class="himsBoxContent">
                                        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
                                            <ContentTemplate>
                                                <div id="DivDetailsGridView" runat="server" visible="false">
                                                    <asp:GridView runat="server" ID="DetailsGridView" class="himssuHeader7WireBox col-md-12 table-responsive" AutoGenerateColumns="False"
                                                        ShowHeader="True" meta:resourcekey="EmployeePayrollGridViewResource1" OnRowDataBound="DetailsGridView_OnRowDataBound" Enabled="false"
                                                        CssClass="table table-striped table-bordered" DataKeyNames="SubGroupId, Form16Id">
                                                        <Columns>
                                                            <asp:TemplateField HeaderText="Group Name" ItemStyle-Width="30%" SortExpression="Group" HeaderStyle-HorizontalAlign="Left"
                                                                ItemStyle-Wrap="true">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="GroupLabel" runat="server" Text='<%# Bind("Group") %>'></asp:Label>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Sub Group Name" ItemStyle-Width="26%" SortExpression="SubGroupName" HeaderStyle-HorizontalAlign="Left"
                                                                ItemStyle-Wrap="true">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="SubGroupNameLinkButton" SkinID="CustomWidthLabel" runat="server"
                                                                        Text='<%# Bind("SubGroupName") %>' Visible="false" OnClick="SubGroupNameLinkButton_Click" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>'></asp:LinkButton>
                                                                    <asp:Label ID="SubGroupNameLabel" runat="server" Text='<%# Bind("SubGroupName") %>' Visible="true"></asp:Label>


                                                                    <asp:HiddenField ID="GroupIDHiddenField" runat="server" Value='<%# Bind("GroupID") %>' />
                                                                    <asp:HiddenField ID="SubGroupIDHiddenField" runat="server" Value='<%# Bind("SubGroupID") %>' />
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <%--<asp:BoundField DataField="SubGroupName" HeaderText="Sub Group Name" ItemStyle-Width="26%" HeaderStyle-HorizontalAlign="Left" />--%>
                                                            <%--<asp:HiddenField ID="GroupIDHiddenField" runat="server" Value='<%# Bind("GroupID") %>' />
                                                                        <asp:HiddenField ID="SubGroupIDHiddenField" runat="server" Value='<%# Bind("SubGroupID") %>' />--%>

                                                            <asp:TemplateField HeaderText="Gross Amount" ItemStyle-Width="18%" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                <ItemTemplate>
                                                                    <asp:TextBox ID="GrossAmountTextBox" Enabled='<%# Bind("IsEditable") %>' Text='<%# Bind("GrossAmount") %>' Style="text-align: right;" runat="server"
                                                                        onKeypress="javascript:return MaskDecimal(event,12,2)"
                                                                        onPaste="return false;"
                                                                        onDrag="return false"
                                                                        onDrop="return false"
                                                                        autocomplete="off"></asp:TextBox>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Qualifying Amount" ItemStyle-Width="13%" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                                                <ItemTemplate>
                                                                    <asp:TextBox ID="QualifyingAmountTextBox" Enabled="false" Text='<%# Bind("QualifyingAmount") %>' Style="text-align: right;" runat="server"
                                                                        onblur="javascript:return fnValidateDecimal(this,10,2)"
                                                                        onKeypress="javascript:return MaskDecimal(event,12,2)"
                                                                        onPaste="return false;"
                                                                        onDrag="return false"
                                                                        onDrop="return false"
                                                                        autocomplete="off"></asp:TextBox>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Deductible Amount" ItemStyle-Width="13%" HeaderStyle-HorizontalAlign="Left"
                                                                ItemStyle-Wrap="true">
                                                                <ItemTemplate>
                                                                    <asp:TextBox ID="DeductibleAmountTextBox" Enabled="false" Text='<%# Bind("DeductibleAmount") %>' Style="text-align: right;" runat="server"
                                                                        onblur="javascript:return fnValidateDecimal(this,10,2)"
                                                                        onKeypress="javascript:return MaskDecimal(event,12,2)"
                                                                        onPaste="return false;"
                                                                        onDrag="return false"
                                                                        onDrop="return false"
                                                                        autocomplete="off"></asp:TextBox>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <%-- <asp:TemplateField>
                                                                            <ItemTemplate>
                                                                                <%# Container.DataItemIndex + 1 %>
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>--%>
                                                        </Columns>
                                                        <PagerSettings Visible="False" />
                                                    </asp:GridView>
                                                </div>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </div>
                                </div>
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:CheckBox ID="IsObsolateCheckBox" runat="server" Visible="false" Text="InActive" />
                                        <asp:Label ID="IsObsolateLable" runat="server" Visible="false"></asp:Label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                </tr>
                    </table>
            </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <cc1:ModalPopupExtender ID="ModalPopupExtenderFolder" runat="server" TargetControlID="HidenButton" PopupControlID="ModalPopUpPanel" BackgroundCssClass="modalBackground"
        Drag="True" PopupDragHandleControlID="dragPanel" Enabled="True" />
    <asp:LinkButton runat="server" ID="HidenButton" meta:resourcekey="HidenButtonResource1" />
    <asp:Panel ID="ModalPopUpPanel" runat="server" CssClass="dragControl" Width="700px" DefaultButton="HidenButton" meta:resourcekey="ModalPopUpPanelResource1">
        <div class="messagebox card card-box">
            <asp:Panel ID="dragPanel" runat="server" CssClass="dragMePanel" Width="100%" meta:resourcekey="dragPanelResource1">
                <div id="dragMe1" class="dragMe card-head" style="cursor: move">
                    <div class="himsPopupWireBox">
                        <div class="himsBoxHeadermain">
                            <div>
                            </div>
                        </div>
                        <div class="himsBoxTopper headerFont">
                            <div class="fLeft headerText">
                                <asp:UpdatePanel ID="UpdatePanel3" runat="server" RenderMode="Inline">
                                    <ContentTemplate>
                                        <header>
                                            <asp:Label ID="DialogHeaderLabel" runat="server" meta:resourcekey="DialogHeaderLabelResource1" Text="Add / Update Deduction under Chapter VIA"></asp:Label>
                                        </header>
                                        <span class="pull-right">
                                            <asp:ImageButton ID="ImageButtonClose" runat="server" Height="20PX" Width="20PX" ImageUrl="~/Images/closebox.png" OnClick="ImageButtonClose_Click" />
                                        </span>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </div>
                        </div>
                    </div>
                </div>
            </asp:Panel>
            <asp:UpdatePanel ID="EmployeeSearchUpdatePanel" runat="server"
                RenderMode="Inline">
                <ContentTemplate>

                    <div id="bodyContainer" class="card-body">
                        <div class="himsPopupWireBox">
                            <div class="himsBoxHeadermain">
                                <div>
                                </div>
                            </div>
                            <uc1:MessageControl ID="SearchMessageBox" runat="server" Visible="false" />
                            <div class="himsBoxContentmain" style="overflow: hidden">
                                <div id="divContentPage1">
                                    <div class="spacer">
                                        <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/spacer.gif"
                                            meta:resourcekey="Image1Resource1" />
                                    </div>
                                    <div>
                                        <div class="himssuHeader5WireBox">
                                            <div class="himsBoxHeader">
                                                <asp:Panel ID="TopPanel" runat="server" meta:resourcekey="TopPanelResource1">
                                                    <div class="leftdiv">
                                                    </div>
                                                    <div class="himsBoxTitle">
                                                    </div>
                                                </asp:Panel>
                                            </div>
                                            <div class="alignCenter pTop5 col-md-12 center">
                                                <asp:Button ID="SaveButton" Text="&#xf0c7; Save" runat="Server" SkinID="0" OnClick="SaveButton_Click1" class="btn-save btn fas" />
                                                <%--<asp:Button ID="ClearButton" runat="server" Text="&#xf0e2; Clear" OnClick="ClearButton_Click1" SkinID="0" class="btn-reset btn fas" />--%>
                                            </div>
                                            <div class="leftdiv">
                                            </div>
                                            <div class="himsBoxContent col-md-12">
                                                <asp:Panel ID="Panel2" runat="server" meta:resourcekey="DetailPanelResource1">
                                                    <div class="contentHolder">
                                                        <asp:Panel ID="Panel3" runat="Server">
                                                            <div id="Div2" runat="server" visible="true">
                                                                <asp:GridView runat="server" ID="EmployeeDetailGridView" class="himssuHeader7WireBox col-md-12 table-responsive" AutoGenerateColumns="False"
                                                                    ShowHeader="True" ShowFooter="true" meta:resourcekey="EmployeeDetailGridViewResource" CssClass="table table-striped table-bordered" DataKeyNames="SubGroupId,AutoId,StaticIncomeTaxSubSubId">
                                                                    <Columns>
                                                                        <asp:TemplateField HeaderText="Group Name" ItemStyle-Width="30%" SortExpression="SubGroup" HeaderStyle-HorizontalAlign="Left"
                                                                            ItemStyle-Wrap="true">
                                                                            <ItemTemplate>
                                                                                <asp:Label ID="SubGroupLabel" runat="server" Text='<%# Bind("SubGroup") %>'></asp:Label>
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderText="Gross Amount" ItemStyle-Width="30%" SortExpression="GrossAmount" HeaderStyle-HorizontalAlign="Left"
                                                                            ItemStyle-Wrap="true">
                                                                            <ItemTemplate>
                                                                                <asp:TextBox ID="GrossAmountTextBox" runat="server" Text='<%# Bind("GrossAmount") %>' AutoPostBack="true" OnTextChanged="GrossAmountTextBox_TextChanged"></asp:TextBox>
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderText="Qualifying Amount" ItemStyle-Width="30%" SortExpression="QualifyingAmount" HeaderStyle-HorizontalAlign="Left"
                                                                            ItemStyle-Wrap="true">
                                                                            <ItemTemplate>
                                                                                <asp:TextBox ID="QualifyingAmountTextBox" runat="server" Text='<%# Bind("QualifyingLimit") %>' Enabled="false"></asp:TextBox>
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderText="Deductible Amount" ItemStyle-Width="30%" SortExpression="DeductibleAmount" HeaderStyle-HorizontalAlign="Left"
                                                                            ItemStyle-Wrap="true">
                                                                            <ItemTemplate>
                                                                                <asp:TextBox ID="DeductibleAmountTextBox" runat="server" Text='<%# Bind("DeductibleAmount") %>' Enabled="false"></asp:TextBox>
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                    </Columns>
                                                                    <PagerSettings Visible="False" />
                                                                </asp:GridView>
                                                            </div>
                                                            <%--<div class="outerBox pTop5 col-md-3">
                                                                <div class="controlLabelWidth">
                                                                    <asp:Label ID="SubGroupLabel" runat="server" Text="Sub Group"></asp:Label>
                                                                </div>
                                                                <div class="fLeft pRight5">
                                                                    <asp:DropDownList runat="server" AutoPostBack="true" ID="SubGroupDropDownList" SkinID="CustomWidthDropDownList" onmouseleave="showHideTooltip()" CssClass="form-control" onmouseenter="showHideTooltip()" OnSelectedIndexChanged="SubGroupDropDownList_SelectedIndexChanged">
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                            <div class="outerBox pTop5 col-md-3">
                                                                <div class="controlLabelWidth">
                                                                    <asp:Label ID="GALabel" Text="Gross Amount" runat="server"></asp:Label>
                                                                </div>
                                                                <div class="fLeft pRight5">
                                                                    <asp:TextBox ID="GATextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                                        SkinID="CustomWidthTextBox" runat="Server" MaxLength="100"></asp:TextBox>
                                                                </div>
                                                            </div>
                                                            <div class="outerBox pTop5 col-md-3">
                                                                <div class="controlLabelWidth">
                                                                    <asp:Label ID="QALabel" Text="Qualifying Amount" runat="server"></asp:Label>
                                                                </div>
                                                                <div class="fLeft pRight5">
                                                                    <asp:TextBox ID="QATextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                                        SkinID="CustomWidthTextBox" runat="Server" MaxLength="100"></asp:TextBox>
                                                                </div>
                                                            </div>
                                                            <div class="outerBox pTop5 col-md-3">
                                                                <div class="controlLabelWidth">
                                                                    <asp:Label ID="DALabel" Text="Deductible Amount" runat="server"></asp:Label>
                                                                </div>
                                                                <div class="fLeft pRight5">
                                                                    <asp:TextBox ID="DATextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                                        SkinID="CustomWidthTextBox" runat="Server" MaxLength="100"></asp:TextBox>
                                                                </div>
                                                            </div>--%>
                                                        </asp:Panel>

                                                    </div>
                                                </asp:Panel>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <asp:UpdateProgress ID="MainUpdateProgress" runat="server" DisplayAfter="200">
                        <ProgressTemplate>
                            <div style="position: absolute; top: 50%; left: 45%; font-size: 20px">
                                <asp:Image ID="LoadingImage4" runat="server" ImageUrl="~/Images/Loading.gif"
                                    meta:resourcekey="Image3Resource1" />
                            </div>
                        </ProgressTemplate>
                    </asp:UpdateProgress>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </asp:Panel>
    <%--<script data-main="../../../JavaScript/rjs/encrypt/payrollyear-master-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/payrollyear-master")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
    <script type="text/javascript" language="javascript">


        function myfunction1() {
            alert('Hello Word....!!!!');
        }


        function myfunction() {

            //-----1-----//
            debugger;
            var GrossAmount01 = document.getElementById("ctl00_CP_DetailsGridView_ctl02_GrossAmountTextBox");
            var GrossAmount02 = document.getElementById("ctl00_CP_DetailsGridView_ctl03_GrossAmountTextBox");
            var GrossAmount03 = document.getElementById("ctl00_CP_DetailsGridView_ctl04_GrossAmountTextBox");
            var GrossAmount04 = document.getElementById("ctl00_CP_DetailsGridView_ctl05_GrossAmountTextBox");

            var QualifyingAmount01 = document.getElementById("ctl00_CP_DetailsGridView_ctl02_QualifyingAmountTextBox");
            var QualifyingAmount02 = document.getElementById("ctl00_CP_DetailsGridView_ctl03_QualifyingAmountTextBox");
            var QualifyingAmount03 = document.getElementById("ctl00_CP_DetailsGridView_ctl04_QualifyingAmountTextBox");
            var QualifyingAmount04 = document.getElementById("ctl00_CP_DetailsGridView_ctl05_QualifyingAmountTextBox");

            var DeductibleAmount01 = document.getElementById("ctl00_CP_DetailsGridView_ctl02_DeductibleAmountTextBox");
            var DeductibleAmount02 = document.getElementById("ctl00_CP_DetailsGridView_ctl03_DeductibleAmountTextBox");
            var DeductibleAmount03 = document.getElementById("ctl00_CP_DetailsGridView_ctl04_DeductibleAmountTextBox");
            var DeductibleAmount04 = document.getElementById("ctl00_CP_DetailsGridView_ctl05_DeductibleAmountTextBox");



            GrossAmount01.value = GrossAmount01.value == "" || isNaN(GrossAmount01.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount01.value).toFixed(2);
            GrossAmount02.value = GrossAmount02.value == "" || isNaN(GrossAmount02.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount02.value).toFixed(2);
            GrossAmount03.value = GrossAmount03.value == "" || isNaN(GrossAmount03.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount03.value).toFixed(2);

            DeductibleAmount01.value = parseFloat(GrossAmount01.value).toFixed(2)
            DeductibleAmount02.value = parseFloat(GrossAmount02.value).toFixed(2)
            DeductibleAmount03.value = parseFloat(GrossAmount03.value).toFixed(2)


            GrossAmount04.value = (parseFloat(GrossAmount01.value) + parseFloat(GrossAmount02.value) + parseFloat(GrossAmount03.value)).toFixed(2);
            DeductibleAmount04.value = (parseFloat(GrossAmount01.value) + parseFloat(GrossAmount02.value) + parseFloat(GrossAmount03.value)).toFixed(2);



            //-----End 1-----//



            //---------2-----//
            var GrossAmount05 = document.getElementById("ctl00_CP_DetailsGridView_ctl06_GrossAmountTextBox");
            var GrossAmount06 = document.getElementById("ctl00_CP_DetailsGridView_ctl07_GrossAmountTextBox");
            var GrossAmount07 = document.getElementById("ctl00_CP_DetailsGridView_ctl08_GrossAmountTextBox");
            var GrossAmount08 = document.getElementById("ctl00_CP_DetailsGridView_ctl09_GrossAmountTextBox");
            var GrossAmount09 = document.getElementById("ctl00_CP_DetailsGridView_ctl10_GrossAmountTextBox");
            var GrossAmount10 = document.getElementById("ctl00_CP_DetailsGridView_ctl11_GrossAmountTextBox");
            var GrossAmount11 = document.getElementById("ctl00_CP_DetailsGridView_ctl12_GrossAmountTextBox");

            var QualifyingAmount05 = document.getElementById("ctl00_CP_DetailsGridView_ctl06_QualifyingAmountTextBox");
            var QualifyingAmount06 = document.getElementById("ctl00_CP_DetailsGridView_ctl07_QualifyingAmountTextBox");
            var QualifyingAmount07 = document.getElementById("ctl00_CP_DetailsGridView_ctl08_QualifyingAmountTextBox");
            var QualifyingAmount08 = document.getElementById("ctl00_CP_DetailsGridView_ctl09_QualifyingAmountTextBox");
            var QualifyingAmount09 = document.getElementById("ctl00_CP_DetailsGridView_ctl10_QualifyingAmountTextBox");
            var QualifyingAmount10 = document.getElementById("ctl00_CP_DetailsGridView_ctl11_QualifyingAmountTextBox");
            var QualifyingAmount11 = document.getElementById("ctl00_CP_DetailsGridView_ctl12_QualifyingAmountTextBox");

            var DeductibleAmount05 = document.getElementById("ctl00_CP_DetailsGridView_ctl06_DeductibleAmountTextBox");
            var DeductibleAmount06 = document.getElementById("ctl00_CP_DetailsGridView_ctl07_DeductibleAmountTextBox");
            var DeductibleAmount07 = document.getElementById("ctl00_CP_DetailsGridView_ctl08_DeductibleAmountTextBox");
            var DeductibleAmount08 = document.getElementById("ctl00_CP_DetailsGridView_ctl09_DeductibleAmountTextBox");
            var DeductibleAmount09 = document.getElementById("ctl00_CP_DetailsGridView_ctl10_DeductibleAmountTextBox");
            var DeductibleAmount10 = document.getElementById("ctl00_CP_DetailsGridView_ctl11_DeductibleAmountTextBox");
            var DeductibleAmount11 = document.getElementById("ctl00_CP_DetailsGridView_ctl12_DeductibleAmountTextBox");


            GrossAmount05.value = GrossAmount05.value == "" || isNaN(GrossAmount05.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount05.value).toFixed(2);
            GrossAmount06.value = GrossAmount06.value == "" || isNaN(GrossAmount06.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount06.value).toFixed(2);
            GrossAmount07.value = GrossAmount07.value == "" || isNaN(GrossAmount07.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount07.value).toFixed(2);
            GrossAmount08.value = GrossAmount08.value == "" || isNaN(GrossAmount08.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount08.value).toFixed(2);
            GrossAmount09.value = GrossAmount09.value == "" || isNaN(GrossAmount09.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount09.value).toFixed(2);
            GrossAmount10.value = GrossAmount10.value == "" || isNaN(GrossAmount10.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount10.value).toFixed(2);
            GrossAmount11.value = GrossAmount11.value == "" || isNaN(GrossAmount11.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount11.value).toFixed(2);

            DeductibleAmount05.value = parseFloat(GrossAmount05.value) < parseFloat(QualifyingAmount05.value) ? parseFloat(GrossAmount05.value).toFixed(2) : parseFloat(QualifyingAmount05.value).toFixed(2);
            DeductibleAmount06.value = parseFloat(GrossAmount06.value) < parseFloat(QualifyingAmount06.value) ? parseFloat(GrossAmount06.value).toFixed(2) : parseFloat(QualifyingAmount06.value).toFixed(2);
            DeductibleAmount07.value = parseFloat(GrossAmount07.value) < parseFloat(QualifyingAmount07.value) ? parseFloat(GrossAmount07.value).toFixed(2) : parseFloat(QualifyingAmount07.value).toFixed(2);
            DeductibleAmount08.value = parseFloat(GrossAmount08.value) < parseFloat(QualifyingAmount08.value) ? parseFloat(GrossAmount08.value).toFixed(2) : parseFloat(QualifyingAmount08.value).toFixed(2);
            DeductibleAmount09.value = parseFloat(GrossAmount09.value) < parseFloat(QualifyingAmount09.value) ? parseFloat(GrossAmount09.value).toFixed(2) : parseFloat(QualifyingAmount09.value).toFixed(2);
            DeductibleAmount10.value = parseFloat(GrossAmount10.value) < parseFloat(QualifyingAmount10.value) ? parseFloat(GrossAmount10.value).toFixed(2) : parseFloat(QualifyingAmount10.value).toFixed(2);
            DeductibleAmount11.value = parseFloat(GrossAmount11.value) < parseFloat(QualifyingAmount11.value) ? parseFloat(GrossAmount11.value).toFixed(2) : parseFloat(QualifyingAmount11.value).toFixed(2);


            //-----End 2-----//



            //-------- 3-----//

            var GrossAmount12 = document.getElementById("ctl00_CP_DetailsGridView_ctl13_GrossAmountTextBox");
            //var QualifyingAmount12 = document.getElementById("ctl00_CP_DetailsGridView_ctl13_QualifyingAmountTextBox");
            var DeductibleAmount12 = document.getElementById("ctl00_CP_DetailsGridView_ctl13_DeductibleAmountTextBox");



            GrossAmount12.value = ((parseFloat(GrossAmount04.value)) - (parseFloat(GrossAmount05.value) + parseFloat(GrossAmount06.value) + parseFloat(GrossAmount07.value) + parseFloat(GrossAmount08.value) + parseFloat(GrossAmount09.value) + parseFloat(GrossAmount10.value) + parseFloat(GrossAmount11.value))).toFixed(2);
            DeductibleAmount12.value = ((parseFloat(DeductibleAmount04.value)) - (parseFloat(DeductibleAmount05.value) + parseFloat(DeductibleAmount06.value) + parseFloat(DeductibleAmount07.value) + parseFloat(DeductibleAmount08.value) + parseFloat(DeductibleAmount09.value) + parseFloat(DeductibleAmount10.value) + parseFloat(DeductibleAmount11.value))).toFixed(2);


            //-----End 3-----//


            //-------- 4-----//

            var GrossAmount13 = document.getElementById("ctl00_CP_DetailsGridView_ctl14_GrossAmountTextBox");
            var GrossAmount14 = document.getElementById("ctl00_CP_DetailsGridView_ctl15_GrossAmountTextBox");
            var GrossAmount15 = document.getElementById("ctl00_CP_DetailsGridView_ctl16_GrossAmountTextBox");
            var QualifyingAmount13 = document.getElementById("ctl00_CP_DetailsGridView_ctl14_QualifyingAmountTextBox");
            var QualifyingAmount14 = document.getElementById("ctl00_CP_DetailsGridView_ctl15_QualifyingAmountTextBox");
            var QualifyingAmount15 = document.getElementById("ctl00_CP_DetailsGridView_ctl16_QualifyingAmountTextBox");
            var DeductibleAmount13 = document.getElementById("ctl00_CP_DetailsGridView_ctl14_DeductibleAmountTextBox");
            var DeductibleAmount14 = document.getElementById("ctl00_CP_DetailsGridView_ctl15_DeductibleAmountTextBox");
            var DeductibleAmount15 = document.getElementById("ctl00_CP_DetailsGridView_ctl16_DeductibleAmountTextBox");


            GrossAmount13.value = GrossAmount13.value == "" || isNaN(GrossAmount13.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount13.value).toFixed(2);
            GrossAmount14.value = GrossAmount14.value == "" || isNaN(GrossAmount14.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount14.value).toFixed(2);
            GrossAmount15.value = GrossAmount15.value == "" || isNaN(GrossAmount15.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount15.value).toFixed(2);


            DeductibleAmount13.value = parseFloat(GrossAmount13.value) < parseFloat(QualifyingAmount13.value) ? parseFloat(GrossAmount13.value).toFixed(2) : parseFloat(QualifyingAmount13.value).toFixed(2);
            DeductibleAmount14.value = parseFloat(GrossAmount14.value) < parseFloat(QualifyingAmount14.value) ? parseFloat(GrossAmount14.value).toFixed(2) : parseFloat(QualifyingAmount14.value).toFixed(2);
            DeductibleAmount15.value = parseFloat(GrossAmount15.value) < parseFloat(QualifyingAmount15.value) ? parseFloat(GrossAmount15.value).toFixed(2) : parseFloat(QualifyingAmount15.value).toFixed(2);

            //-----End 4-----//


            //-------- 5-----//
            var GrossAmount16 = document.getElementById("ctl00_CP_DetailsGridView_ctl17_GrossAmountTextBox");
            var QualifyingAmount16 = document.getElementById("ctl00_CP_DetailsGridView_ctl17_QualifyingAmountTextBox");
            var DeductibleAmount16 = document.getElementById("ctl00_CP_DetailsGridView_ctl17_DeductibleAmountTextBox");


            GrossAmount16.value = (parseFloat(GrossAmount13.value) + parseFloat(GrossAmount14.value) + parseFloat(GrossAmount15.value)).toFixed(2);
            DeductibleAmount16.value = (parseFloat(DeductibleAmount13.value) + parseFloat(DeductibleAmount14.value) + parseFloat(GrossAmount15.value)).toFixed(2);

            //-----End 5-----//






            //-------- 6-----//
            var GrossAmount17 = document.getElementById("ctl00_CP_DetailsGridView_ctl18_GrossAmountTextBox");
            var QualifyingAmount17 = document.getElementById("ctl00_CP_DetailsGridView_ctl18_QualifyingAmountTextBox");
            var DeductibleAmount17 = document.getElementById("ctl00_CP_DetailsGridView_ctl18_DeductibleAmountTextBox");

            GrossAmount17.value = (parseFloat(GrossAmount12.value) - parseFloat(GrossAmount16.value)).toFixed(2);
            DeductibleAmount17.value = (parseFloat(DeductibleAmount12.value) - parseFloat(DeductibleAmount16.value)).toFixed(2);



            //-----End 6-----//



            //-------- 7-----//
            var GrossAmount18 = document.getElementById("ctl00_CP_DetailsGridView_ctl19_GrossAmountTextBox");
            var GrossAmount19 = document.getElementById("ctl00_CP_DetailsGridView_ctl20_GrossAmountTextBox");
            var QualifyingAmount18 = document.getElementById("ctl00_CP_DetailsGridView_ctl19_QualifyingAmountTextBox");
            var QualifyingAmount19 = document.getElementById("ctl00_CP_DetailsGridView_ctl20_QualifyingAmountTextBox");
            var DeductibleAmount18 = document.getElementById("ctl00_CP_DetailsGridView_ctl19_DeductibleAmountTextBox");
            var DeductibleAmount19 = document.getElementById("ctl00_CP_DetailsGridView_ctl20_DeductibleAmountTextBox");

            GrossAmount18.value = GrossAmount18.value == "" || isNaN(GrossAmount18.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount18.value).toFixed(2);
            GrossAmount19.value = GrossAmount19.value == "" || isNaN(GrossAmount19.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount19.value).toFixed(2);


            DeductibleAmount18.value = parseFloat(GrossAmount18.value).toFixed(2);
            DeductibleAmount19.value = parseFloat(GrossAmount19.value).toFixed(2);

            //-----End 7-----//


            //-------- 8-----//
            var GrossAmount20 = document.getElementById("ctl00_CP_DetailsGridView_ctl21_GrossAmountTextBox");
            var QualifyingAmount20 = document.getElementById("ctl00_CP_DetailsGridView_ctl21_QualifyingAmountTextBox");
            var DeductibleAmount20 = document.getElementById("ctl00_CP_DetailsGridView_ctl21_DeductibleAmountTextBox");

            GrossAmount20.value = (parseFloat(GrossAmount17.value) + parseFloat(GrossAmount18.value) + parseFloat(GrossAmount19.value)).toFixed(2);
            DeductibleAmount20.value = (parseFloat(DeductibleAmount17.value) + parseFloat(DeductibleAmount18.value) + parseFloat(DeductibleAmount19.value)).toFixed(2);
            //-----End 8-----//


            //-------- 9-----//
            var GrossAmount21 = document.getElementById("ctl00_CP_DetailsGridView_ctl22_GrossAmountTextBox");
            var GrossAmount22 = document.getElementById("ctl00_CP_DetailsGridView_ctl23_GrossAmountTextBox");
            var GrossAmount23 = document.getElementById("ctl00_CP_DetailsGridView_ctl24_GrossAmountTextBox");
            var GrossAmount24 = document.getElementById("ctl00_CP_DetailsGridView_ctl25_GrossAmountTextBox");
            var GrossAmount25 = document.getElementById("ctl00_CP_DetailsGridView_ctl26_GrossAmountTextBox");
            var GrossAmount26 = document.getElementById("ctl00_CP_DetailsGridView_ctl27_GrossAmountTextBox");

            var QualifyingAmount21 = document.getElementById("ctl00_CP_DetailsGridView_ctl22_QualifyingAmountTextBox");
            var QualifyingAmount22 = document.getElementById("ctl00_CP_DetailsGridView_ctl23_QualifyingAmountTextBox");
            var QualifyingAmount23 = document.getElementById("ctl00_CP_DetailsGridView_ctl24_QualifyingAmountTextBox");
            var QualifyingAmount24 = document.getElementById("ctl00_CP_DetailsGridView_ctl25_QualifyingAmountTextBox");
            var QualifyingAmount25 = document.getElementById("ctl00_CP_DetailsGridView_ctl26_QualifyingAmountTextBox");
            var QualifyingAmount26 = document.getElementById("ctl00_CP_DetailsGridView_ctl27_QualifyingAmountTextBox");

            var DeductibleAmount21 = document.getElementById("ctl00_CP_DetailsGridView_ctl22_DeductibleAmountTextBox");
            var DeductibleAmount22 = document.getElementById("ctl00_CP_DetailsGridView_ctl23_DeductibleAmountTextBox");
            var DeductibleAmount23 = document.getElementById("ctl00_CP_DetailsGridView_ctl24_DeductibleAmountTextBox");
            var DeductibleAmount24 = document.getElementById("ctl00_CP_DetailsGridView_ctl25_DeductibleAmountTextBox");
            var DeductibleAmount25 = document.getElementById("ctl00_CP_DetailsGridView_ctl26_DeductibleAmountTextBox");
            var DeductibleAmount26 = document.getElementById("ctl00_CP_DetailsGridView_ctl27_DeductibleAmountTextBox");


            GrossAmount21.value = GrossAmount21.value == "" || isNaN(GrossAmount21.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount21.value).toFixed(2);
            GrossAmount22.value = GrossAmount22.value == "" || isNaN(GrossAmount22.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount22.value).toFixed(2);
            GrossAmount23.value = GrossAmount23.value == "" || isNaN(GrossAmount23.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount23.value).toFixed(2);
            GrossAmount24.value = GrossAmount24.value == "" || isNaN(GrossAmount24.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount24.value).toFixed(2);
            GrossAmount25.value = GrossAmount25.value == "" || isNaN(GrossAmount25.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount25.value).toFixed(2);
            GrossAmount26.value = GrossAmount26.value == "" || isNaN(GrossAmount26.value) ? parseFloat(0).toFixed(2) : parseFloat(GrossAmount26.value).toFixed(2);



            //var Section80C = parseFloat(GrossAmount20.value) + parseFloat(GrossAmount21.value) + parseFloat(GrossAmount22.value);



            //DeductibleAmount22.value = Section80C > 150000 ? parseFloat(150000).toFixed(2) : (parseFloat(GrossAmount20.value) + parseFloat(GrossAmount21.value) + parseFloat(GrossAmount22.value)).toFixed(2);


            DeductibleAmount21.value = parseFloat(GrossAmount21.value) < parseFloat(QualifyingAmount21.value) ? parseFloat(GrossAmount21.value).toFixed(2) : parseFloat(QualifyingAmount21.value).toFixed(2);
            DeductibleAmount22.value = parseFloat(GrossAmount22.value) < parseFloat(QualifyingAmount22.value) ? parseFloat(GrossAmount22.value).toFixed(2) : parseFloat(QualifyingAmount22.value).toFixed(2);
            DeductibleAmount23.value = parseFloat(GrossAmount23.value) < parseFloat(QualifyingAmount23.value) ? parseFloat(GrossAmount23.value).toFixed(2) : parseFloat(QualifyingAmount23.value).toFixed(2);
            DeductibleAmount24.value = parseFloat(GrossAmount24.value) < parseFloat(QualifyingAmount24.value) ? parseFloat(GrossAmount24.value).toFixed(2) : parseFloat(QualifyingAmount24.value).toFixed(2);
            DeductibleAmount25.value = parseFloat(GrossAmount25.value) < parseFloat(QualifyingAmount25.value) ? parseFloat(GrossAmount25.value).toFixed(2) : parseFloat(QualifyingAmount25.value).toFixed(2);
            DeductibleAmount26.value = parseFloat(GrossAmount26.value) < parseFloat(QualifyingAmount26.value) ? parseFloat(GrossAmount26.value).toFixed(2) : parseFloat(QualifyingAmount26.value).toFixed(2);

            //-----End 9-----//



            //-------- 10-----//
            var GrossAmount27 = document.getElementById("ctl00_CP_DetailsGridView_ctl28_GrossAmountTextBox");
            var QualifyingAmount27 = document.getElementById("ctl00_CP_DetailsGridView_ctl28_QualifyingAmountTextBox");
            var DeductibleAmount27 = document.getElementById("ctl00_CP_DetailsGridView_ctl28_DeductibleAmountTextBox");


            GrossAmount27.value = (parseFloat(GrossAmount21.value) + parseFloat(GrossAmount22.value) + parseFloat(GrossAmount23.value) + parseFloat(GrossAmount24.value) + parseFloat(GrossAmount25.value) + parseFloat(GrossAmount26.value)).toFixed(2);
            QualifyingAmount27.value = (parseFloat(QualifyingAmount21.value) + parseFloat(QualifyingAmount22.value) + parseFloat(QualifyingAmount23.value) + parseFloat(QualifyingAmount24.value) + parseFloat(QualifyingAmount25.value) + parseFloat(QualifyingAmount26.value)).toFixed(2);
            DeductibleAmount27.value = (parseFloat(DeductibleAmount21.value) + parseFloat(DeductibleAmount22.value) + parseFloat(DeductibleAmount23.value) + parseFloat(DeductibleAmount24.value) + parseFloat(DeductibleAmount25.value) + parseFloat(DeductibleAmount26.value)).toFixed(2);





            //-----End 10-----//


            //-------- 11-----//
            var GrossAmount28 = document.getElementById("ctl00_CP_DetailsGridView_ctl29_GrossAmountTextBox");
            var QualifyingAmount28 = document.getElementById("ctl00_CP_DetailsGridView_ctl29_QualifyingAmountTextBox");
            var DeductibleAmount28 = document.getElementById("ctl00_CP_DetailsGridView_ctl29_DeductibleAmountTextBox");



            GrossAmount28.value = ((parseFloat(GrossAmount20.value)) - (parseFloat(GrossAmount27.value))).toFixed(2);
            DeductibleAmount28.value = ((parseFloat(DeductibleAmount20.value)) - (parseFloat(DeductibleAmount27.value))).toFixed(2);



            //-----End 11-----//

            //-------- 12 13 -----//

            var GrossAmount29 = document.getElementById("ctl00_CP_DetailsGridView_ctl30_GrossAmountTextBox");
            var QualifyingAmount29 = document.getElementById("ctl00_CP_DetailsGridView_ctl30_QualifyingAmountTextBox");
            var DeductibleAmount29 = document.getElementById("ctl00_CP_DetailsGridView_ctl30_DeductibleAmountTextBox");

            var GrossAmount30 = document.getElementById("ctl00_CP_DetailsGridView_ctl31_GrossAmountTextBox");
            var QualifyingAmount30 = document.getElementById("ctl00_CP_DetailsGridView_ctl31_QualifyingAmountTextBox");
            var DeductibleAmount30 = document.getElementById("ctl00_CP_DetailsGridView_ctl31_DeductibleAmountTextBox");


            var GrossAmount31 = document.getElementById("ctl00_CP_DetailsGridView_ctl32_GrossAmountTextBox");
            var QualifyingAmount31 = document.getElementById("ctl00_CP_DetailsGridView_ctl32_QualifyingAmountTextBox");
            var DeductibleAmount31 = document.getElementById("ctl00_CP_DetailsGridView_ctl32_DeductibleAmountTextBox");



            var GrossAmount32 = document.getElementById("ctl00_CP_DetailsGridView_ctl33_GrossAmountTextBox");
            var QualifyingAmount32 = document.getElementById("ctl00_CP_DetailsGridView_ctl33_QualifyingAmountTextBox");
            var DeductibleAmount32 = document.getElementById("ctl00_CP_DetailsGridView_ctl33_DeductibleAmountTextBox");


            var GrossAmount33 = document.getElementById("ctl00_CP_DetailsGridView_ctl34_GrossAmountTextBox");
            var QualifyingAmount33 = document.getElementById("ctl00_CP_DetailsGridView_ctl34_QualifyingAmountTextBox");
            var DeductibleAmount33 = document.getElementById("ctl00_CP_DetailsGridView_ctl34_DeductibleAmountTextBox");


            var GrossAmount34 = document.getElementById("ctl00_CP_DetailsGridView_ctl35_GrossAmountTextBox");
            var QualifyingAmount34 = document.getElementById("ctl00_CP_DetailsGridView_ctl35_QualifyingAmountTextBox");
            var DeductibleAmount34 = document.getElementById("ctl00_CP_DetailsGridView_ctl35_DeductibleAmountTextBox");

            var GrossAmount35 = document.getElementById("ctl00_CP_DetailsGridView_ctl36_GrossAmountTextBox");
            var QualifyingAmount35 = document.getElementById("ctl00_CP_DetailsGridView_ctl36_QualifyingAmountTextBox");
            var DeductibleAmount35 = document.getElementById("ctl00_CP_DetailsGridView_ctl36_DeductibleAmountTextBox");

            //DeductibleAmount33.value = (parseFloat(DeductibleAmount31.value) - parseFloat(GrossAmount32.value)).toFixed(2);


            //DeductibleAmount31.value = (parseFloat(DeductibleAmount29.value) - parseFloat(GrossAmount30.value)).toFixed(2);



            //if (parseFloat(GrossAmount26.value) > 300000) {
            var URL = window.location.href;
            $.ajax({
                type: "POST", url: URL + "/GetTaxAmount", data: '{"GrossAmount":"' + parseFloat(DeductibleAmount28.value) + '","TaxDeducatedatsourceus192":"' + parseFloat(GrossAmount34.value) + '"}', contentType: "application/json;charset=utf-8",
                dataType: "json", success: function (data) {
                    debugger;
                    var datas = $.parseJSON(data.d);
                    //DeductibleAmount27.value = parseFloat(datas.TaxAmount).toFixed(2);
                    //DeductibleAmount28.value = parseFloat(datas.EducationCess3).toFixed(2);
                    //DeductibleAmount29.value = parseFloat(datas.TaxPayable).toFixed(2);
                    //DeductibleAmount30.value = parseFloat(datas.ReliefUnderSection89).toFixed(2);
                    //DeductibleAmount31.value = parseFloat(datas.TaxPayable2).toFixed(2);
                    //DeductibleAmount32.value = parseFloat(datas.TaxSeductedAtSource192).toFixed(2);
                    //DeductibleAmount33.value = parseFloat(datas.Balance).toFixed(2);

                    DeductibleAmount29.value = parseFloat(datas.TaxAmount).toFixed(2);
                    DeductibleAmount30.value = parseFloat(datas.ReliefUnderSection89).toFixed(2);
                    DeductibleAmount31.value = (parseFloat(datas.TaxAmount).toFixed(2) - parseFloat(datas.ReliefUnderSection89).toFixed(2)).toFixed(2);
                    DeductibleAmount32.value = parseFloat(datas.EducationCess3).toFixed(2);
                    DeductibleAmount33.value = parseFloat(datas.TaxPayable2).toFixed(2);
                    DeductibleAmount34.value = parseFloat(datas.TaxSeductedAtSource192).toFixed(2);
                    DeductibleAmount35.value = parseFloat(datas.Balance).toFixed(2);
                    if (Number(DeductibleAmount34.value) < 0) {
                        DeductibleAmount34.style.backgroundColor = "#00BCD4";
                    } else { DeductibleAmount34.style.backgroundColor = ""; }
                },
                error: function (xhr, status, error) {
                    DeductibleAmount29.value = parseFloat(0).toFixed(2);
                    DeductibleAmount30.value = parseFloat(0).toFixed(2);
                    DeductibleAmount31.value = parseFloat(0).toFixed(2);
                    DeductibleAmount32.value = parseFloat(0).toFixed(2);
                    DeductibleAmount33.value = parseFloat(0).toFixed(2);
                    DeductibleAmount34.value = parseFloat(0).toFixed(2);
                    DeductibleAmount35.value = parseFloat(0).toFixed(2);
                    var err = eval("(" + xhr.responseText + ")");
                    console.log(err.Message);
                }
            });



            //}
            //else {
            //    DeductibleAmount27.value = parseFloat(0).toFixed(2);
            //    DeductibleAmount28.value = parseFloat(0).toFixed(2);
            //    DeductibleAmount29.value = parseFloat(0).toFixed(2);
            //    DeductibleAmount30.value = parseFloat(0).toFixed(2);
            //    DeductibleAmount31.value = parseFloat(0).toFixed(2);
            //    DeductibleAmount32.value = parseFloat(0).toFixed(2);
            //    DeductibleAmount33.value = parseFloat(0).toFixed(2);
            //}

            //-----End 12 13 -----//









            //-------- 16-----//

            //-----End 16-----//



            //-------- 17-----//

            //-----End 17-----//



            //-------- 18-----//

            //-----End 18-----//


        }

    </script>
</asp:Content>

