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

<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl" TagPrefix="ScreenGroup" %>
<%@ Register Src="~/UserControls/AutoComplete/AutoCompleteControl.ascx" TagName="AutoCompleteControl" TagPrefix="acc" %>
<%@ Register Src="~/UserControls/Common/CommonSearch/AlphabetSearchCommonControl.ascx" TagName="AlphabetSearchCommonControl" TagPrefix="ACS" %>
<%@ Register Src="~/UserControls/Common/Payroll/PayrollDetailBoxControl.ascx" TagName="PayrollControl" TagPrefix="Pay" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="OTQueueListingUpdatePanel" runat="server">
        <ContentTemplate>
            <ACS:AlphabetSearchCommonControl ID="AlphabetCommonSearch" runat="server" Visible="false" />
            <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="162"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <Pay:PayrollControl ID="PayrollUserControl" runat="server" Visible="true" />
                    <div class="himssuHeader1WireBox card card-box">
                        <div class="himsBoxHeader card-head">
                            <div class="leftdiv">
                            </div>
                            <div class="himsBoxTitle">
                                <div class="headerText">
                                    <i class="fas fa-wrench"></i>
                                    <asp:Label ID="PaySetupTitleLabel" runat="server" Text="Pay Setup"></asp:Label>
                                </div>


                            </div>
                        </div>
                        <div class="himsBoxContent card-body">
                            <asp:Panel ID="DetailPanel" runat="Server">
                                <div class="contentHolder">
                                    <div class="cBoth">
                                    </div>
                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="PayrollGroupLabel" runat="server" Text="Payroll Group" SkinID="MandatoryLabel">
                                            </asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="PayrollGroupDropDownList" SkinID="CustomWidthDropDownList"
                                                onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                AutoPostBack="true" OnSelectedIndexChanged="PayrollGroupDropDownList_SelectedIndexChanged" CssClass="form-control">
                                            </asp:DropDownList>
                                        </div>
                                    </div>
                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="CopyPaySetupForPayrollGroupLabel" runat="server" Text="Copy Pay Setup For  Payroll Group">
                                            </asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="CopyPayrollGroupDropDownList" SkinID="CustomWidthDropDownList"
                                                onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" Enabled="false" CssClass="form-control">
                                            </asp:DropDownList>
                                            &nbsp;
                                         
                                        </div>
                                    </div>

                                    <div class="col-md-12 pTop5 pb15 text-center">
                                        <asp:Button ID="CopyButtonId" Text="&#xf0c5; Copy" runat="Server" OnClick="CopyButton_Click" Enabled="false" SkinID="0" CssClass="btn-assign btn fas" />
                                    </div>
                                    <div class="cBoth">
                                    </div>

                                    <div id="Div1" class="himssuHeader6WireBox col-md-12 pTop5" runat="server" visible="false">
                                        <div class="himsBoxHeader card-head inner">
                                            <div class="leftdiv">
                                            </div>
                                            <div class="himsBoxTitle">
                                                <div class="col-md-12">
                                                    <div class="pull-right display-flex">
                                                        <asp:DropDownList ID="ApplyDropDownList" runat="server" SkinID="CustomWidthDropDownList" CssClass="form-control mt-10">
                                                            <asp:ListItem Text="- Select -" Value="-1" Selected="True"></asp:ListItem>
                                                            <asp:ListItem Text="Amount" Value="1"></asp:ListItem>
                                                            <asp:ListItem Text="Percentage" Value="2"></asp:ListItem>
                                                        </asp:DropDownList>
                                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                                        <asp:TextBox ID="ApplyAllTextBox" runat="server" ClientIDMode="Static" MaxLength="18"
                                                            SkinID="CustomWidthTextBox" CssClass="pTop5" onKeypress="javascript:return MaskDecimal(event,16,2)"
                                                            onBlur="javascript:return fnValidateDecimal(this,16,2)"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
                                                        <asp:Button ID="ApplyAllButton" runat="server" OnClick="ApplyAllButton_Click"
                                                            Text="Apply All" SkinID="0" CssClass="btn btn-apply mt-10" />
                                                    </div>

                                                </div>
                                            </div>
                                        </div>
                                        <div class="himsBoxContent ">
                                            <div id="GridViewMessageDiv" class="himsBoxContentMsg" runat="server" visible="False">
                                            </div>
                                            <asp:GridView ID="PaySetupGridview" runat="server" Width="100%" AutoGenerateColumns="False"
                                                EmptyDataText="No Records Found !!" AllowPaging="false" OnRowDataBound="PaySetupGridview_RowDataBound"
                                                ShowHeader="true" DataKeyNames="Id,PayElementId,PayElementDefaultId,PayrollId"
                                                CssClass="table table-striped table-bordered">
                                                <Columns>
                                                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
                                                        <HeaderTemplate>
                                                            <label class="rt-chkbox rt-chkbox-outline">
                                                                <asp:CheckBox ID="HeaderSelectCheckBox" runat="server" AutoPostBack="true" onclick="CheckAll(this);" OnCheckedChanged="HeaderSelectCheckBox_OnCheckedChanged" />
                                                                <span></span>
                                                            </label>
                                                        </HeaderTemplate>
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        <ItemTemplate>
                                                            <label class="rt-chkbox rt-chkbox-outline">
                                                                <asp:CheckBox ID="SelectCheckBox" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem,"Id").ToString()!="0"?true:false %>'
                                                                    OnCheckedChanged="SelectCheckBox_CheckedChange" AutoPostBack="true" />
                                                                <span></span>
                                                            </label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="PayElement" HeaderText="Pay Element" ItemStyle-Width="10%"
                                                        HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                    <asp:TemplateField HeaderText="Amount" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="10%">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="AmountTextBox" runat="server" SkinID="CustomWidthTextbox"
                                                                AutoCompleteType="Disabled" Style="text-align: right;"
                                                                Text='<%# Bind("Amount")%>' onKeypress="javascript:return MaskDecimal(event,16,6)"
                                                                onBlur="javascript:return fnValidateDecimal(this,16,6)" onmouseleave="showHideTooltip()"
                                                                onmouseenter="showHideTooltip()" Width="100%"></asp:TextBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Percentage" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="10%">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="PercentageTextBox" runat="server" SkinID="CustomWidthTextbox"
                                                                Style="text-align: right;"
                                                                Text='<%# Bind("Percentage")%>' onKeypress="javascript:return MaskDecimal(event,3,2)"
                                                                onBlur="javascript:return fnValidateDecimal(this,3,2)" onmouseleave="showHideTooltip()"
                                                                onmouseenter="showHideTooltip()" Width="100%"></asp:TextBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Formula" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="20%">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="FormulaTextBox" runat="server" MaxLength="200" SkinID="CustomWidthTextbox" Text='<%# Bind("Formula")%>'  Width="100%"></asp:TextBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Process Order" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="10%">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="ProcessOrderTextBox" runat="server" onkeypress="return isNumberKey(event);"
                                                                SkinID="CustomwidthTextBox" Text='<%# Bind("ProcessOrder")%>' Width="100%"></asp:TextBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Display Order" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="10%">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="DisplayOrderTextBox" runat="server" onkeypress="return isNumberKey(event);"
                                                                SkinID="CustomwidthTextBox" Text='<%# Bind("DisplayOrder")%>' Enabled="false" Width="100%"></asp:TextBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Depend Pay Element" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="20%">
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="PaySetupDependElement" runat="server" Text='<%# Bind("PaySetupDependentElement") %>' ></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField meta:resourcekey="TemplateFieldResource1" ItemStyle-Width="10%">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="SelectLinkButton" runat="server" OnClick="LinkButton_Click" Text="Add Pay Element"
                                                                CausesValidation="False"></asp:LinkButton>
                                                        </ItemTemplate>
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </asp:TemplateField>
                                                </Columns>
                                                <PagerSettings Visible="False" />
                                            </asp:GridView>
                                        </div>
                                    </div>
                                </div>
                            </asp:Panel>

                            <div runat="server" id="DependentPayElementDiv" visible="false">
                                <div class="himssuHeader1WireBox col-md-12">
                                    <div class="himsBoxHeader card-head inner">
                                        <div class="leftdiv">
                                        </div>
                                        <div class="himsBoxTitle">
                                            <div class="headerText">
                                                <header>
                                                    <asp:Label ID="Label1" runat="server" Text="Depend Pay Element"></asp:Label>
                                                </header>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="himsBoxContent col-md-12 padd-0">
                                        <asp:Panel ID="Panel1" runat="Server">
                                            <div class="contentHolder">
                                                <div class="cBoth">
                                                </div>
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        Pay Element = 
                                                            <asp:Label ID="PyElementLabel" runat="server" Text="Pay Element">
                                                            </asp:Label>
                                                        <asp:HiddenField ID="SelectedSetupIdHiddenField" runat="server" Value="0" />
                                                    </div>
                                                </div>
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="DependPayElementLabel" Text="Depend Pay Element" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                                    </div>
                                                    <div class="fLeft pRight5">
                                                        <asp:DropDownList ID="DependPayElementDropDownList1" runat="server" SkinID="CustomWidthDropDownList"
                                                            CssClass="form-control">
                                                        </asp:DropDownList>
                                                    </div>
                                                </div>
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="DeductPayElementLabel" Text="Type" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                                    </div>
                                                    <div class="fLeft pRight5">
                                                        <asp:DropDownList ID="DeductPayElementDropDownList" runat="server" SkinID="CustomWidthDropDownList"
                                                            CssClass="form-control">
                                                        </asp:DropDownList>
                                                    </div>
                                                </div>
                                                <div class="pTop5 pTop5">
                                                    <asp:Button ID="AddDependpayElement" runat="server" Text="Add" OnClick="AddButton_Click" SkinID="0" CssClass="btn-assign btn fas" />
                                                </div>
                                                <div class="cBoth">
                                                </div>
                                                <br />
                                                <div id="DependGridVIewDiv" class="himssuHeader7WireBox col-md-12" runat="server" visible="false">
                                                    <div class="himsBoxContent table-responsive">
                                                        <asp:GridView ID="DependPayElementGridView1" runat="server" Width="100%" AutoGenerateColumns="False"
                                                            EmptyDataText="No Records Found !!" AllowPaging="false" OnRowDataBound="DependPayElementGridview_RowDataBound"
                                                            ShowHeader="true" DataKeyNames="DependPayElementId"
                                                            CssClass="table table-striped table-bordered table-hover">
                                                            <Columns>
                                                                <asp:BoundField DataField="DependPayElement" HeaderText="Depend Pay Element" ItemStyle-Width="50%"
                                                                    HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                <asp:BoundField DataField="PayElementStatus" HeaderText="Type" ItemStyle-Width="20%"
                                                                    HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                <asp:TemplateField HeaderStyle-HorizontalAlign="Left">
                                                                    <ItemStyle HorizontalAlign="Left" />
                                                                    <ItemTemplate>
                                                                        <asp:ImageButton ID="DeleteImageButton" runat="server" ImageUrl="~/Images/delete.png" OnClick="DeleteImageButton_Click" />
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                            </Columns>
                                                            <PagerSettings Visible="False" />
                                                        </asp:GridView>
                                                    </div>
                                                </div>
                                            </div>
                                        </asp:Panel>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                </div>
            </div>
            <div class="spacer">
                <img src="../../../Images/spacer.gif" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--<script data-main="../../../JavaScript/rjs/encrypt/pay-setup-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/pay-setup")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
</asp:Content>
