<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" MaintainScrollPositionOnPostback="true" CodeBehind="Invoices.aspx.cs" Inherits="HRMS.Invoices" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="scriptManager" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>
    <div class="main-panel">
        <div class="row">
            <div class="col-md-12">
                <section class="panel">
                    <header class="panel-heading">
                        Invoices
                        <div class="pull-right">
                            <asp:button text="Save" CssClass="btn btn-info" ID="btn_save"   ValidationGroup="save"
                                runat="server" onclick="btn_save_Click"/>
                            <asp:button text="Back" CssClass="btn btn-info" ID="btn_cancel" runat="server" onclick="btn_cancel_Click"/>
                            <asp:button text="Post" CssClass="btn btn-info" ID="btn_post" runat="server" onclick="btn_post_Click"/>
                            <asp:button text="Validate" CssClass="btn btn-info" ID="btn_validate" runat="server" onclick="btn_validate_Click"/>
                            <asp:button text="Apply/Unapply" CssClass="btn btn-info" ID="btn_app" runat="server" onclick="btn_app_Click"/>
                        </div>
                    </header>

                    <div class="panel-body">
                        <div class="span6">
                                <div id="divmessage" runat="server" visible="false" class="alert alert-info alert-dismissable">
                                    <asp:label text="" ID="lbl_msg" CssClass="msg" runat="server"></asp:label>
                                </div>
                            </div>

                            <div class="span6">
                                <div id="diverrmessage" runat="server" visible="false" class="alert alert-info alert-dismissable">
                                    <asp:label text="" id="lbl_err_msg" CssClass="msg" runat="server"></asp:label>
                                </div>
                            </div>

                        <div class="row">
                             <asp:HiddenField ID="hid_inv_id" runat="server"/>
                                  <label class="control-label col-md-2">Operating Unit</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_ou" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                <asp:RequiredFieldValidator runat="server" ID="Reqadd" ControlToValidate="ddl_ou" ErrorMessage="Operating Unit is required." setfocusonerror="true" ValidationGroup="save"></asp:RequiredFieldValidator>
                            </div>

                          

                                  <label class="control-label col-md-2">Customer Taxpayer ID</label>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddl_cust_tax_pay_id" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                </div>
                        </div>


                         <div class="row">
                               <label class="control-label col-md-2">Type</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_type" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="ddl_type" ErrorMessage="Type is required." setfocusonerror="true" ValidationGroup="save"></asp:RequiredFieldValidator>
                            </div>

                                  <label class="control-label col-md-2">PO Number</label>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddl_po" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                </div>
                        </div>

                           <div class="row">
                                  <label class="control-label col-md-2">Trading Partner</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_supplier" runat="server"  AutoPostBack="true" CssClass="form-control select2" OnSelectedIndexChanged="ddl_supplier_SelectedIndexChanged"></asp:DropDownList>
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="ddl_supplier" ErrorMessage="Trading Partner is required." setfocusonerror="true" ValidationGroup="save"></asp:RequiredFieldValidator>
                            </div>


                                  <label class="control-label col-md-2">Supplier Site Name</label>
                                <div class="col-md-3">
                                    <asp:DropDownList ID="ddl_sup_site" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ControlToValidate="ddl_sup_site" ErrorMessage="Supplier Site Name is required." setfocusonerror="true" ValidationGroup="save"></asp:RequiredFieldValidator>
                                </div>
                        </div>



                        <div class="row">
                                  <label class="control-label col-md-2">Invoice Date</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_date" runat="server" CssClass="form-control datetime"></asp:TextBox>
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator4" ControlToValidate="txt_date" ErrorMessage="Invoice Date is required." setfocusonerror="true" ValidationGroup="save"></asp:RequiredFieldValidator>
                            </div>


                                  <label class="control-label col-md-2">Invoice Number</label>
                                <div class="col-md-3">
                                 <asp:TextBox ID="txt_inv_no" runat="server" CssClass="form-control"></asp:TextBox>
                                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator5" ControlToValidate="txt_inv_no" ErrorMessage="Invoice No is required." setfocusonerror="true" ValidationGroup="save"></asp:RequiredFieldValidator>
                                </div>
                        </div>


                        
                        <div class="row">
                                  <label class="control-label col-md-2">Invoice Currency</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_inv_curr" runat="server"  CssClass="form-control select2"></asp:DropDownList>
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator6" ControlToValidate="ddl_inv_curr" ErrorMessage="Invoice Currency is required." setfocusonerror="true" ValidationGroup="save"></asp:RequiredFieldValidator>
                            </div>

                          

                                  <label class="control-label col-md-2">Invoice Amount</label>
                                <div class="col-md-3">
                                 <asp:TextBox ID="txt_inv_amt" onkeypress="return numbersOnly(event)" runat="server" CssClass="form-control" AutoPostBack="true" OnTextChanged="txt_inv_amt_TextChanged"></asp:TextBox>
                                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator7" ControlToValidate="txt_inv_amt" ErrorMessage="Invoice Amount is required." setfocusonerror="true" ValidationGroup="save"></asp:RequiredFieldValidator>
                                    <%--<asp:RegularExpressionValidator ID="Regex4" runat="server" ValidationExpression="((\d+)((\.\d{1,2})?))$" ErrorMessage="Please enter valid number with 2 decimal places." setfocusonerror="true"  ControlToValidate="txt_inv_amt" ValidationGroup="save" />--%>
                                </div>
                        </div>

                        <hr />

                          <div class="row" style="padding-top:05px">
                                  <label class="control-label col-md-2">GL Date</label>
                            <div class="col-md-2">
                                <asp:TextBox ID="txt_gl_date" runat="server" CssClass="form-control datetime"></asp:TextBox>
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator8" ControlToValidate="txt_gl_date" ErrorMessage="GL Date is required." setfocusonerror="true" ValidationGroup="save"></asp:RequiredFieldValidator>
                            </div>

                               <%--<label class="control-label col-md-2">Distribution Set</label>
                                <div class="col-md-3">
                                 <asp:DropDownList ID="DropDownList5" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                </div>--%>

                                      <label class="control-label col-md-2">Payment Rate Date</label>
                            <div class="col-md-2">
                                <asp:TextBox ID="txt_pay_rate_date" runat="server" CssClass="form-control datetime"></asp:TextBox>
                            </div>

                                <label class="control-label col-md-2">Payment Currency</label>
                                <div class="col-md-2">
                                 <asp:DropDownList ID="ddl_pay_curr" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator9" ControlToValidate="ddl_pay_curr" ErrorMessage="Payment Currency is required." setfocusonerror="true" ValidationGroup="save"></asp:RequiredFieldValidator>
                                </div>

                             
                        </div>

                         <div class="row">
                                 <label class="control-label col-md-2">Terms Date</label>
                            <div class="col-md-2">
                                <asp:TextBox ID="txt_term_date" runat="server" CssClass="form-control datetime"></asp:TextBox>
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator10" ControlToValidate="txt_term_date" ErrorMessage="Terms Date is required." setfocusonerror="true" ValidationGroup="save"></asp:RequiredFieldValidator>
                            </div>

                                <label class="control-label col-md-2">Terms</label>
                                <div class="col-md-2">
                                 <asp:DropDownList ID="ddl_terms" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                </div>
                                 
                              
                              <label class="control-label col-md-2">Payment Method</label>
                                <div class="col-md-2">
                                 <asp:DropDownList ID="ddl_pay_method" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator11" ControlToValidate="ddl_pay_method" ErrorMessage="Payment Method is required." setfocusonerror="true" ValidationGroup="save"></asp:RequiredFieldValidator>
                                </div>
                        </div>


                        <br />
                          <ul class="nav nav-tabs">
                                <li class="active"><a data-toggle="tab" href="#lines">Lines</a></li>
                              <li><a data-toggle="tab" href="#hold">Holds</a></li>
                               <li><a data-toggle="tab" href="#vwpay">View Payments</a></li>
                            </ul>

                         <div class="tab-content">
                                <div id="lines" class="tab-pane fade in active">
                                    <br />
                                    <div style="width: 102%; height:250px; overflow: scroll">
                                                  <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                        CssClass="table table-striped table-bordered table-hover" CellPadding="0" 
                             onrowcommand="GridView2_RowCommand" onrowdatabound="GridView2_RowDataBound">
                                <Columns>
                                <asp:TemplateField HeaderStyle-Width="10px">
                                    <ItemTemplate>
                                        <asp:HiddenField ID="hid_line" runat="server" Value='<%#Bind("LINE_NUMBER")%>' />
                                        <asp:HiddenField ID="hid_type" runat="server" Value='<%#Bind("LINE_TYPE_LOOKUP_CODE")%>' />
                                        <asp:HiddenField ID="hid_uom" runat="server" Value='<%#Bind("UNIT_MEAS_LOOKUP_CODE")%>' />
                                    </ItemTemplate>
                                </asp:TemplateField>    

                                <asp:TemplateField HeaderText="Type" ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                         <asp:DropDownList ID="ddl_type" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                        <asp:RequiredFieldValidator runat="server" ID="Reqtype" ControlToValidate="ddl_type" ErrorMessage="Type is required." setfocusonerror="true" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                  <asp:TemplateField HeaderText="Amount"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_amount" runat="server" CssClass="form-control" onkeypress="return numbersOnly(event)" Text='<%#Bind("AMOUNT") %>' OnTextChanged="txt_amount_TextChanged" AutoPostBack="true" Enabled='<%#bool.Parse(Eval("AMOUNT").ToString() != "" ? "False" : "True") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator runat="server" ID="Reqamt" ControlToValidate="txt_amount" ErrorMessage="Amount is required." setfocusonerror="true" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                        <%--<asp:RegularExpressionValidator ID="Regex2" runat="server" ValidationExpression="((\d+)((\.\d{1,2})?))$" ErrorMessage="Please enter valid number with 2 decimal places." setfocusonerror="true"  ControlToValidate="txt_amount" ValidationGroup='<%# "add_"+Container.DataItemIndex %>' />--%>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="PO Number" ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_PO_Num" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="PO Line"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_po_line" runat="server" CssClass="form-control" Text='<%#Bind("PO_LINE_ID") %>' Enabled='<%#bool.Parse(Eval("PO_LINE_ID").ToString() != "" ? "False" : "True") %>'></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                     <asp:TemplateField HeaderText="PO Shipment"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_po_shp" runat="server" CssClass="form-control"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                       <asp:TemplateField HeaderText="Quantity Invoiced"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_qty_inv" runat="server" CssClass="form-control" Text='<%#Bind("QUANTITY_INVOICED") %>' Enabled='<%#bool.Parse(Eval("QUANTITY_INVOICED").ToString() != "" ? "False" : "True") %>'></asp:TextBox>
                                        <asp:RegularExpressionValidator ID="Regex3" runat="server" ValidationExpression="((\d+)((\.\d{1,2})?))$" ErrorMessage="Please enter valid number with 2 decimal places." setfocusonerror="true"  ControlToValidate="txt_qty_inv" ValidationGroup='<%# "add_"+Container.DataItemIndex %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                        <asp:TemplateField HeaderText="UOM"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_uom" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                        <asp:RequiredFieldValidator runat="server" ID="Requom" ControlToValidate="ddl_uom" ErrorMessage="UOM is required." setfocusonerror="true" ValidationGroup='<%# "add_"+ Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                    
                                       <asp:TemplateField HeaderText="Unit Price"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_u_price" runat="server" onkeypress="return numbersOnly(event)" CssClass="form-control" Text='<%#Bind("UNIT_PRICE") %>' Enabled='<%#bool.Parse(Eval("UNIT_PRICE").ToString() != "" ? "False" : "True") %>'></asp:TextBox>
                                        <asp:RegularExpressionValidator ID="Regex1" runat="server" ValidationExpression="((\d+)((\.\d{1,2})?))$" ErrorMessage="Please enter valid number with 2 decimal places." setfocusonerror="true"  ControlToValidate="txt_u_price" ValidationGroup='<%# "add_"+Container.DataItemIndex %>' />

                                    </ItemTemplate>
                                </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Description"  ControlStyle-Width="250px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_desc" runat="server" CssClass="form-control" Text='<%#Bind("DESCRIPTION") %>' Enabled='<%#bool.Parse(Eval("DESCRIPTION").ToString() != "" ? "False" : "True") %>'></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>


                                     <asp:TemplateField HeaderText="Default Distribution Account"  ControlStyle-Width="250px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                         <div class="input-group">
                                                        <asp:HiddenField ID="hid_acc" Value='<%#Bind("DEFAULT_DIST_CCID") %>' runat="server" />
                                                            <asp:TextBox ID="txt_acc"   runat="server" CssClass="form-control" Text='<%# Bind("Account") %>'></asp:TextBox>
                                                                <span class="input-group-btn">
                                                                    <asp:HiddenField ID="hf_row" Value='<%# Container.DataItemIndex %>' runat="server" />
                                                                    <button id="btn_cc" type="button" onclick="PopupBulkQuestion('<%# row_id.ClientID  %>','<%# ((GridViewRow)Container).FindControl("hf_row").ClientID %>')"class="btn btn-white">
                                                                        <i class="fa fa-plus"></i>
                                                                    </button>
                                                                     <button id="btn_lov" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_ServerClick"><i class="fa fa-search"></i></button>
                                                                </span>
                                                    </div>
                                    </ItemTemplate>
                                </asp:TemplateField>


                                     <asp:TemplateField HeaderText="Default Distribution Description"  ControlStyle-Width="600px" ItemStyle-Width="600px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_acc_desc" runat="server" CssClass="form-control" Text='<%#Bind("Account_desc") %>' Enabled="false"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>


                                     <asp:TemplateField HeaderText="Items"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_item" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>


                                     <asp:TemplateField HeaderText="Asset Book"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_asset_book" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                    
                                     <asp:TemplateField HeaderText="Asset Category"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_asset_cat" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>


                                       <asp:TemplateField HeaderText="Invoice Withholding Tax"  ControlStyle-Width="250px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_inv_tax" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                     <asp:TemplateField HeaderText="Validation Status"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_validate_status" runat="server" CssClass="form-control"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                
                                
                                
                                    <asp:TemplateField HeaderText="Action" ItemStyle-Width="6%">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lnkadd"  runat="server" CommandName="gadd" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'><i class="fa fa-plus" style="font-size:20px !important;"></i></asp:LinkButton>&nbsp;
                                            <asp:LinkButton ID="linkedit"  runat="server" CommandName="gEdit"><i class="fa fa-pencil" style="font-size:20px !important;"></i></asp:LinkButton>
                                            <asp:linkbutton ID="linkdlt" CausesValidation="false" CommandName="gDelete" runat="server" Visible="false" OnClientClick="return confirm('Are you sure to delete?')"><i class="fa fa-trash" style="font-size:20px !important"></i></asp:linkbutton>
                                        </ItemTemplate> 
                                            <ItemStyle Width="6%"></ItemStyle>
                                    </asp:TemplateField>

                                     <asp:TemplateField HeaderText="Distributions">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lnk_dist"  runat="server" CommandName="gDist" CommandArgument='<%#Eval("LINE_NUMBER") %>' Text="Distributions" CssClass="btn btn-primary" OnClick="lnk_dist_Click"  Enabled='<%#bool.Parse(Eval("LINE_NUMBER").ToString() != "" ? "True" : "False") %>'></asp:LinkButton>
                                        </ItemTemplate> 
                                    </asp:TemplateField>
                                </Columns>
                                    <%--<FooterStyle CssClass="footerStyle" />
                                    <HeaderStyle CssClass="headerStyle" />
                                    <RowStyle CssClass="rowStyle" />--%>
                            </asp:GridView>
                                         
                                    </div>
                                    </div>

                             <div id="hold" class="tab-pane fade">
                                      <div style="width: 102%; height:250px; overflow: scroll">
                                                  <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                        CssClass="table table-striped table-bordered table-hover" CellPadding="0" OnRowDataBound="GridView1_RowDataBound" >
                                <Columns>
                                <asp:TemplateField HeaderStyle-Width="10px">
                                    <ItemTemplate>
                                        <asp:HiddenField ID="hid_inv" runat="server" Value='<%# Bind("INVOICE_ID") %>'  />
                                        <asp:HiddenField ID="hid_hold" runat="server"  Value='<%# Bind("HOLD_ID") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>    

                                <asp:TemplateField HeaderText="Hold Name" ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                         <asp:DropDownList ID="ddl_hold_name" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                  <asp:TemplateField HeaderText="Hold reason"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_hold_reason" runat="server" CssClass="form-control"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Hold Date" ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_hold_date" runat="server" Text='<%# Bind("HOLD_DATE") %>' CssClass="form-control"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Held By"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_hold_by" runat="server" CssClass="form-control"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                     <asp:TemplateField HeaderText="Release Name"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_release_name" runat="server" CssClass="form-control"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                       <asp:TemplateField HeaderText="Released Reason"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_release_reason" runat="server" CssClass="form-control"></asp:TextBox>
                                        
                                    </ItemTemplate>
                                </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Released By"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                     <asp:TextBox ID="txt_release_by" runat="server" CssClass="form-control"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                    
                                       <asp:TemplateField HeaderText="Released Date"  ControlStyle-Width="150px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_release_date" runat="server" CssClass="form-control"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                
                                
                                    <asp:TemplateField HeaderText="Action" ItemStyle-Width="6%">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lnkadd"  runat="server" CommandName="gadd" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'><i class="fa fa-plus" style="font-size:20px !important;"></i></asp:LinkButton>&nbsp;
                                            <asp:LinkButton ID="linkedit"  runat="server" CommandName="gEdit"><i class="fa fa-pencil" style="font-size:20px !important;"></i></asp:LinkButton>
                                            <asp:linkbutton ID="linkdlt" CausesValidation="false" CommandName="gDelete" runat="server" Visible="false" OnClientClick="return confirm('Are you sure to delete?')"><i class="fa fa-trash" style="font-size:20px !important"></i></asp:linkbutton>
                                        </ItemTemplate> 
                                            <ItemStyle Width="6%"></ItemStyle>
                                    </asp:TemplateField>
                                </Columns>
                                    <%--<FooterStyle CssClass="footerStyle" />
                                    <HeaderStyle CssClass="headerStyle" />
                                    <RowStyle CssClass="rowStyle" />--%>
                            </asp:GridView>
                                         
                                    </div>

                             </div>





                                   <div id="vwpay" class="tab-pane fade">
                                    <br />
                                                  <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
                        CssClass="table table-striped table-bordered table-hover" CellPadding="0">
                                <Columns>
                                    <asp:BoundField DataField="Payment_Method" HeaderText="Payment Method" />
                                    <asp:BoundField DataField="CHECK_NUMBER" HeaderText="Document Number" />
                                    <asp:BoundField DataField="CHECK_DATE" HeaderText="Payment Date" />
                                    <asp:BoundField DataField="AMOUNT" HeaderText="Payment Amount" />
                                    <asp:BoundField DataField="DISCOUNT_TAKEN" HeaderText="Discount Taken" />
                                </Columns>
                                    <%--<FooterStyle CssClass="footerStyle" />
                                    <HeaderStyle CssClass="headerStyle" />
                                    <RowStyle CssClass="rowStyle" />--%>
                            </asp:GridView>
                                    </div>
                             </div>

                         
                      
             <div class="modal fade" id="CostVal" role="dialog">
                               <div class="modal-dialog modal-dialog-center" >
                                <div class="modal-content">
                                  <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                                    <h4 class="modal-title">Costing Values :</h4>
                                     
                                  </div>
                                  <div class="modal-body">
                                       <asp:HiddenField ID="row_id" runat="server" />
                                        <asp:Repeater ID="rpt_cost" runat="server" OnItemDataBound="rpt_cost_OnItemDataBound">
                                          <ItemTemplate>
                                            <div class="form-group">
                                              <div class="col-lg-1"></div>
                                                <asp:Label ID="r_lbl" runat="server" class="col-lg-3 col-sm-3 control-label" Text='<%# Eval("PROMPT") %>'></asp:Label>
                                                <div class="col-lg-6">
                                                     <asp:DropDownList Width="320px" ID="ddl_r_value" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                                     <asp:HiddenField ID="hid_field_name" runat="server" Value='<%# Eval("col_name") %>' ></asp:HiddenField>
                                                     <asp:HiddenField ID="hid_vs_name" runat="server" Value='<%# Eval("SEG_VALUE_SET") %>' ></asp:HiddenField>
                                                     <asp:HiddenField ID="hid_value" runat="server" Value='<%# Eval("VALUE") %>' ></asp:HiddenField>

                                                </div>
                                            </div>
                                            
                                           </ItemTemplate>  
                                       </asp:Repeater>
                                  </div>
                                 
                                  <div class="modal-footer">
                                  <asp:Button ID="btn_rpt_load" runat="server" CssClass="btn btn-default" Text="Save & Close" OnClick="btn_rpt_load_Click"></asp:Button>
                                  </div>
                                </div>
                               </div>
                            </div>
                           

                         <script type="text/javascript">

                             function PopupBulkQuestion(clientid, clid2) {

                                 $('#' + '' + clientid).val($('#' + '' + clid2).val());
                                 $('#CostVal').modal();
                             }
                         </script>
                       
                    </div>

                </section>
            </div>
        </div>
    </div>



    <script src="../../ThemeScrips/jquery.min.js"></script>
    <link href="../../ThemeScrips/select2.min.css"
        rel="stylesheet" />
    <script src="../../ThemeScrips/select2.min.js"></script>
    <%--<script src="/ThemeScrips/select2.min.js"></script>--%>
    <script>
        $('.select2').select2();
    </script>
</asp:Content>
