<%@ control language="VB" autoeventwireup="false" inherits="PCC_Reseller_CC_NewCommissionTrans, MachSol.MachPanel.Web" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %>

<script type="text/javascript" language="javascript">
    function AmountChange(CS, AM, P1, P2, P3) {
        var TxBx_Amount = document.getElementById(AM);
        var CSV = CS + ' ';
        FormatPrice(AM, CSV, P1, P2, P3);
    }
</script>

<asp:UpdatePanel ID="UP_TransDetail" runat="server">
    <ContentTemplate>
        <div class="container-fluid">
            <div class="card">
                <div class="header">
                    <h3>
                        <asp:Literal ID="Lbl_SummaryHeading" runat="server" Text="<%$ Resources:Content,USM0101%>"></asp:Literal>
                    </h3>
                </div>
                <div class="body">
                    <div class="row">
                        <div class="col-xs-12 col-sm-4 col-md-3 form-label font-bold">
                            <asp:Literal ID="Ltrl_CustomerIdHeading" runat="server" Text="<%$ Resources:Content,GN0000678 %>"></asp:Literal>
                        </div>
                        <div class="col-xs-12 col-sm-8 col-md-9">
                            <asp:LinkButton ID="Lbtn_CustomerId" runat="server"></asp:LinkButton>
                        </div>

                        <div class="col-xs-12 col-sm-4 col-md-3 form-label font-bold">
                            <asp:Literal ID="Ltrl_CustomerNameHeading" runat="server" Text="<%$ Resources:Content,GN000170 %>"></asp:Literal>
                        </div>
                        <div class="col-xs-12 col-sm-8 col-md-9">
                            <asp:Literal ID="Ltrl_CustomerName" runat="server"></asp:Literal>
                        </div>

                        <div class="col-xs-12 col-sm-4 col-md-3 form-label font-bold">
                            <asp:Literal ID="Ltrl_CompanyNameHeading" runat="server" Text="<%$ Resources:Content,GN00001077 %>"></asp:Literal>:
                        </div>
                        <div class="col-xs-12 col-sm-8 col-md-9">
                            <asp:Literal ID="Ltrl_CompanyName" runat="server"></asp:Literal>
                        </div>

                        <div class="col-xs-12 col-sm-4 col-md-3 form-label font-bold">
                            <asp:Literal ID="Ltrl_PrimaryEmailHeading" runat="server" Text="<%$ Resources:Content,GN00001525 %>"></asp:Literal>
                        </div>
                        <div class="col-xs-12 col-sm-8 col-md-9">
                            <asp:Literal ID="Ltrl_PrimaryEmail" runat="server"></asp:Literal>
                        </div>

                        <div class="col-xs-12 col-sm-4 col-md-3 form-label font-bold">
                            <asp:Literal ID="Ltrl_PhoneHeading" runat="server" Text="<%$ Resources:Content,GN00012 %>"></asp:Literal>
                        </div>
                        <div class="col-xs-12 col-sm-8 col-md-9">
                            <asp:Literal ID="Ltrl_Phone" runat="server"></asp:Literal>
                        </div>

                        <div class="clearfix"></div>
                        <div class="col-xs-12">
                            <table class="table table-bordered table-striped table-hover table-responsive">
                                <tr>
                                    <th class="text-center col-xs-2 hidden-xs">
                                        <asp:Literal ID="Ltrl_PaymentGroup" runat="server" Text="<%$ Resources:Content,GN0000196%>" />
                                    </th>
                                    <th class="text-center col-xs-1">
                                        <asp:Literal ID="Ltrl_TotalIncome" runat="server" Text="<%$ Resources:Content,USM0098%>" />
                                    </th>
                                    <th class="text-center col-xs-1">
                                        <asp:Literal ID="Ltrl_Bonuses" runat="server" Text="<%$ Resources:Content,GN0000319%>" />
                                    </th>
                                    <th class="text-center col-xs-1">
                                        <asp:Literal ID="Ltrl_Deductions" runat="server" Text="<%$ Resources:Content,USM0105%>" />
                                    </th>
                                    <th class="text-center col-xs-3 hidden-xs">
                                        <asp:Literal ID="Ltrl_NetIncome" runat="server" Text="<%$ Resources:Content,USM0100%>" />
                                    </th>
                                    <th class="text-center col-xs-2">
                                        <asp:Literal ID="Ltrl_Payments" runat="server" Text="<%$ Resources:Content,GN000120%>" />
                                    </th>
                                    <th class="text-center col-xs-2">
                                        <asp:Literal ID="Ltrl_Balance" runat="server" Text="<%$ Resources:Content,GN0000693%>" />
                                    </th>
                                </tr>
                                <asp:Repeater ID="Rep_CommissionSummary" runat="server">
                                    <ItemTemplate>
                                        <tr>
                                            <td class="text-center col-xs-2 hidden-xs">
                                                <asp:Label ID="Lbl_PGName" runat="server" />
                                            </td>
                                            <td class="text-center col-xs-1">
                                                <asp:Label ID="Lbl_TotalIncome" runat="server" />
                                            </td>
                                            <td class="text-center col-xs-1">
                                                <asp:Label ID="Lbl_Bonuses" runat="server" />
                                            </td>
                                            <td class="text-center col-xs-1">
                                                <asp:Label ID="Lbl_Deductions" runat="server" />
                                            </td>
                                            <td class="text-center col-xs-3 hidden-xs">
                                                <asp:Label ID="Lbl_NetIncome" runat="server" />
                                            </td>
                                            <td class="text-center col-xs-2">
                                                <asp:Label ID="Lbl_Payments" runat="server" />
                                            </td>
                                            <td class="text-center col-xs-2">
                                                <asp:Label ID="Lbl_Balance" runat="server" />
                                                <asp:HiddenField ID="HF_PGID" runat="server" Value='<%# Eval("PGID")%>' />
                                                <asp:HiddenField ID="HF_Balance" runat="server" Value='<%# Eval("BalanceAmount")%>' />
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table>
                        </div>
                        <div class="clearfix"></div>

                        <div class="col-xs-12">
                            <div class="card">
                                <div class="header">
                                    <h3>
                                        <asp:Literal ID="Ltrl_TransHeading" runat="server" Text="<%$ Resources:Content,SMI0252%>"></asp:Literal>
                                    </h3>
                                </div>
                                <div class="body">
                                    <div class="row">

                                        <div class="col-xs-12 col-sm-4 col-md-3 form-label font-bold">
                                            *&nbsp;
                        <asp:Literal ID="Ltrl_SelectReseller" runat="server" Text='<%$ Resources:Content,String252 %>'></asp:Literal>
                                        </div>
                                        <div class="col-xs-12 col-sm-8 col-md-9">
                                            <asp:DropDownList ID="Ddl_ResellerList" runat="server" Width="150px" AutoPostBack="true"></asp:DropDownList>
                                        </div>

                                        <div class="col-xs-12 col-sm-4 col-md-3 form-label font-bold">
                                            *&nbsp;
                        <asp:Literal ID="Ltrl_TransType" runat="server" Text='<%$ Resources:Content,USM0109 %>'></asp:Literal>
                                        </div>
                                        <div class="col-xs-12 col-sm-8 col-md-9">
                                            <asp:DropDownList ID="Ddl_TransType" runat="server" Width="150px"></asp:DropDownList>
                                        </div>

                                        <div class="col-xs-12 col-sm-4 col-md-3 form-label font-bold">
                                            *&nbsp;
                        <asp:Literal ID="Ltrl_PaymengGroups" runat="server" Text='<%$ Resources:Content,GN0000831 %>'></asp:Literal>
                                        </div>
                                        <div class="col-xs-12 col-sm-8 col-md-9">
                                            <asp:DropDownList ID="Ddl_PaymentGroups" runat="server" Width="100px" AutoPostBack="true"></asp:DropDownList>
                                        </div>

                                        <div class="col-xs-12 col-sm-4 col-md-3 form-label font-bold">
                                            *&nbsp;
                        <asp:Literal ID="Ltrl_TransAmount" runat="server" Text='<%$ Resources:Content,GN0000845 %>'></asp:Literal>
                                        </div>
                                        <div class="col-xs-12 col-sm-8 col-md-9">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_TransAmount" runat="server" CausesValidation="true" ValidationGroup="SaveTrans" CssClass="form-control"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RFV_TransAmount" runat="server" ControlToValidate="TxBx_TransAmount" Display="None"
                                                        ErrorMessage="Amount is mandatory" SetFocusOnError="true" ValidationGroup="SaveTrans"></asp:RequiredFieldValidator>
                                                    <%--<asp:RegularExpressionValidator ID="REV_TransAmount" runat="server" ControlToValidate="TxBx_TransAmount" Display="None"
                        ErrorMessage="Amount must be a valid numeric value" SetFocusOnError="true" ValidationGroup="SaveTrans"
                        ValidationExpression="^([0-9])+(\.)?([0-9]{0,3})$"></asp:RegularExpressionValidator>--%>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-xs-12 col-sm-4 col-md-3 form-label font-bold">
                                            *&nbsp;
                        <asp:Literal ID="Ltrl_Date" runat="server" Text='<%$ Resources:Content,GN0000721 %>'></asp:Literal>
                                        </div>
                                        <div class="col-xs-12 col-sm-8 col-md-9">
                                            <div class="pull-left">
                                                <div class="form-group">
                                                    <div class="form-line">
                                                        <asp:TextBox ID="TxBx_TransDate" Enabled="false" runat="server" CausesValidation="true" ValidationGroup="SaveTrans" CssClass="form-control"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="RFV_TransDate" runat="server" ControlToValidate="TxBx_TransDate" Display="None"
                                                            ErrorMessage="Date is mandatory" SetFocusOnError="true" ValidationGroup="SaveTrans"></asp:RequiredFieldValidator>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="pull-left padding-top-10px">
                                                 <i runat="server" id="Ibtn_TransDate" class="material-icons icon-calendar col-calendar"></i>
                                               
                                                <ajax:Calendarextender id="CE_TransDate" runat="server" targetcontrolid="TxBx_TransDate"
                                                    popupbuttonid="Ibtn_TransDate" cssclass="date__calendar">
                                                </ajax:Calendarextender>
                                            </div>
                                        </div>

                                        <div class="col-xs-12 col-sm-4 col-md-3 form-label font-bold">
                                            *&nbsp;
                        <asp:Literal ID="Ltrl_TransRefNo" runat="server" Text="<%$ Resources:Content,DGN1110019 %>"></asp:Literal>
                                        </div>
                                        <div class="col-xs-12 col-sm-8 col-md-9">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_TransRefNo" runat="server" CssClass="form-control"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RFV_TransRefNo" runat="server" ControlToValidate="TxBx_TransRefNo" Display="None"
                                                        ErrorMessage="Reference Id is mandatory" SetFocusOnError="true" ValidationGroup="SaveTrans"></asp:RequiredFieldValidator>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-xs-12 col-sm-4 col-md-3 form-label font-bold">
                                            *&nbsp;
                    <asp:Literal ID="Ltrl_Comments" runat="server" Text='<%$ Resources:Content,GN000148 %>'></asp:Literal>
                                        </div>
                                        <div class="col-xs-12 col-sm-8 col-md-9">
                                            <div class="form-group">
                                                <asp:TextBox ID="TxBx_Comments" runat="server" TextMode="MultiLine" Width="100%" Rows="5"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RFV_Comments" runat="server" ControlToValidate="TxBx_Comments" Display="None"
                                                    ErrorMessage="Comments are mandatory" SetFocusOnError="true" ValidationGroup="SaveTrans"></asp:RequiredFieldValidator>
                                            </div>
                                        </div>
                                        <div class="col-xs-12">
                                            <span class="pull-right">
                                                <asp:Button ID="btn_save" runat="server" Text="<%$Resources:Content,GN0000281%>"
                                                    CssClass="btn btn-primary btnAction" CausesValidation="true" ValidationGroup="SaveTrans" />
                                                <asp:Button ID="Btn_Cancel" runat="server" Text="<%$Resources:Content,GN0000572 %>"
                                                    CssClass="btn btn-primary" CausesValidation="false" />
                                                <asp:ValidationSummary ID="VS_SavTrans" runat="server" DisplayMode="List" ShowMessageBox="true" ValidationGroup="SaveTrans" ShowSummary="false" />
                                            </span>
                                        </div>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>

