<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Distributions.aspx.cs" Inherits="HRMS.Purcahsing.Distributions" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <div class="main-panel">
        <div class="row">
            <div class="col-md-12">
                <section class="panel">

                        <header class="panel-heading">
                            Buyers
                            <div class="pull-right">
                                <asp:button text="Save" CssClass="btn btn-info" ID="btn_save" Width="120px"
                                    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" /> 
                            </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>

                      
                              <updatepanel>
                            <asp:HiddenField runat="server" ID="hidTAB" Value="0" />
                         
                            <ul class="nav nav-tabs">
                                <li class="active"><a data-toggle="tab" id="Destination_click" href="#Destination" aria-expanded="true">Destination</a></li>
                               <li class="inactive"><a data-toggle="tab" id="More_click" href="#More" aria-expanded="false">More</a></li>
                                <li class="inactive"><a data-toggle="tab"id="Project_click" href="#Project" aria-expanded="false">Project</a></li>
                                
                                </li>
                            </ul>


                           <div class="tab-content">
                            <div id="Destination" class="tab-pane fade active in">
                                    <br />

                                <%--<div style="width:102%;height:250px;overflow:scroll;">--%>
                                 <div class="row" style="padding-top:10px">
                                      <div class="modal-body" style="overflow-y: scroll;">
                                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                                       CssClass="table table-striped table-bordered table-hover" CellPadding="0" Width="5000px"
                                        >
                                        <Columns>
                                            <asp:TemplateField HeaderStyle-Width="10px">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_line_id" runat="server"  Value='<%#Bind("po_line_id")%>'/>
                                                     <asp:HiddenField ID="hid_po_header_id" runat="server"  Value='<%#Bind("po_header_id")%>'/>
                                                    <asp:HiddenField ID="hid_Location" runat="server"
                                                        Value='<%#Bind("Ship_To_Location_Id")%>' />
                                                    <asp:HiddenField ID="hid_UOM" runat="server"
                                                        Value='<%#Bind("Unit_Meas_Lookup_Code")%>' />
                                                    <asp:HiddenField ID="hid_org" runat="server"
                                                        Value='<%#Bind("Ship_To_Organization_Id")%>' />
                                                    <asp:HiddenField ID="hidShipment_Num" runat="server"
                                                        Value='<%#Bind("Shipment_Num")%>' />
                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                         
                                              <asp:TemplateField HeaderText="Type"  HeaderStyle-Width="30%">
                                                <ItemTemplate>
                                                    <div class="input-group">                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Type"
                                                            runat="server" Text='<%#Bind("CatName") %>'>
                                                        </asp:TextBox>
                                                        
                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_Type" type="button" runat="server"
                                                                class="btn btn-white"
                                                                onserverclick="btn_lov_Type_ServerClick"><i
                                                                    class="fa fa-search"></i></button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Requster"  HeaderStyle-Width="30%">
                                                <ItemTemplate>
                                                    <div class="input-group">                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Requster"
                                                            runat="server" Text='<%#Bind("CatName") %>'>
                                                        </asp:TextBox>
                                                        
                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_Requster" type="button" runat="server"
                                                                class="btn btn-white"
                                                                ><i
                                                                    class="fa fa-search"></i></button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Deliver To"  HeaderStyle-Width="30%">
                                                <ItemTemplate>
                                                    <div class="input-group">                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Deliverto"
                                                            runat="server" Text='<%#Bind("CatName") %>'>
                                                        </asp:TextBox>
                                                        
                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_Deliverto" type="button" runat="server"
                                                                class="btn btn-white"
                                                                ><i
                                                                    class="fa fa-search"></i></button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="SubInventory">
                                                <ItemTemplate>
                                                    <div class="input-group">                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_SubInventory"
                                                            runat="server" Text='<%#Bind("UOM") %>'>
                                                        </asp:TextBox>
                                                        
                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_SubInventory" type="button" runat="server"
                                                                class="btn btn-white"
                                                                ><i
                                                                    class="fa fa-search"></i></button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                   
                                         <asp:TemplateField HeaderText="Quantity" HeaderStyle-Width="25%">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_qty" runat="server"
                                                        Text='<%#Bind("Quantity") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                                                                         
                                                </ItemTemplate>
                                            </asp:TemplateField>
                    
                                            <asp:TemplateField HeaderText="PO Charge Account" HeaderStyle-Width="50%">
                                                <ItemTemplate>
                                                                    <asp:TextBox ID="txt_pochargeAccount" runat="server"
                                                        Text='<%#Bind("country_of_origin_code") %>'
                                                        CssClass="form-control"></asp:TextBox>            
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            
                                            
                                             <asp:TemplateField HeaderText="Des Charge Account" HeaderStyle-Width="25%">
                                                <ItemTemplate>
                                                   <asp:TextBox ID="txt_deshargeAccount" runat="server"
                                                        Text='<%#Bind("country_of_origin_code") %>'
                                                        CssClass="form-control"></asp:TextBox>         
                                                                                                         
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                              
                                        
                                              <asp:TemplateField HeaderText="Recovery Rate" HeaderStyle-Width="25%">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_Recrate" runat="server"
                                                        Text='<%#Bind("encumbered_flag") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                                                                         
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="GL-Date" HeaderStyle-Width="25%">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_Gl_Date" runat="server"
                                                        Text='<%#Bind("need_by_date") %>' CssClass="form-control datetime" 
                                                        ></asp:TextBox>
                                                                                                         
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                          
                                           
                                            <asp:TemplateField HeaderText="Action" ItemStyle-Width="5%">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="LinkButton4" runat="server" Visible="false"
                                                        CommandName="gEdit"><i class="fa fa-pencil"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:LinkButton ID="LinkButton5"
                                                        
                                                        runat="server" CommandName="gadd"><i class="fa fa-plus"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:linkbutton ID="Linkbutton6" CausesValidation="false"
                                                        CommandName="gDelete" runat="server"
                                                        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>
                                    <br />
                                </div>
                            
                            <div id="More" class="tab-pane fade">
                                    <br />
                                 <div class="modal-body" style="overflow-y: scroll;">
                                    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
                                      CssClass="table table-striped table-bordered table-hover" CellPadding="0" Width="1500px"
                                        >
                                        <Columns>
                                            <asp:TemplateField HeaderStyle-Width="10px">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_priceref_id" runat="server" Value='<%#Bind("po_line_id")%>' />
                                                     <asp:HiddenField ID="hid_Pricetpe" runat="server" Value='<%#Bind("price_type_lookup_code")%>' />
                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                              
                                            <asp:TemplateField HeaderText="Number" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Number"
                                                            runat="server" Text='<%#Bind("receive_close_tolerance") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Line" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Line"
                                                            runat="server" Text='<%#Bind("invoice_close_tolerance") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Rate Date" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Ratedate"
                                                            runat="server" Text='<%#Bind("invoice_close_tolerance") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Rate" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Rate"
                                                            runat="server" Text='<%#Bind("invoice_close_tolerance") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="">
                                                <ItemTemplate>
                                               <label class="col-md-1 control-label"></label>
                                            <div class="col-md-3 text-left">
                                                <span class="checkbox"><input id="chk_Accurat" runat="server"
                                                        type="checkbox" name="ctl00$ContentPlaceHolder1$Accurat"  />
                                                    <label class="col-md-1 control-label"></label>Accurat Reciept</span>

                                            </div>
                                                     </ItemTemplate>
                                            </asp:TemplateField>
                                             
                                                 
                                          <asp:TemplateField HeaderText="Action" ItemStyle-Width="5%">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="LinkButton1" runat="server" Visible="false"
                                                        CommandName="gEdit"><i class="fa fa-pencil"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:LinkButton ID="LinkButton2"
                                                        
                                                        runat="server" CommandName="gadd"><i class="fa fa-plus"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:linkbutton ID="Linkbutton3" CausesValidation="false"
                                                        CommandName="gDelete" runat="server"
                                                        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>
                                    <br />

                                </div>
                         
                             <div id="Project" class="tab-pane fade">
                                    <br />
                                                                  <div class="modal-body" style="overflow-y: scroll;">
                                    <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False"
                                      CssClass="table table-striped table-bordered table-hover" CellPadding="0" Width="2000px"
                                        >
                                        <Columns>
                                            <asp:TemplateField HeaderStyle-Width="10px">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_priceDoc_id" runat="server" Value='<%#Bind("po_line_id")%>' />
                                                    <asp:HiddenField ID="hid_ContractID" runat="server" Value='<%#Bind("Contract_Num")%>' />
                                                     <asp:HiddenField ID="hid_ConID" runat="server" Value='<%#Bind("oke_contract_header_id")%>' />
                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                              
                                    
                                             <asp:TemplateField HeaderText="Days Early" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Dayearly"
                                                            runat="server" Text='<%#Bind("days_early_receipt_allowed") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Day Late" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_DayLate"
                                                            runat="server" Text='<%#Bind("days_late_receipt_allowed") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Action" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    
                                                <div class="col-md-3">

                                                    <asp:DropDownList ID="ddl_Action" runat="server"
                                                        CssClass="form-control">

                                                        <asp:ListItem Text="None" Value="1"></asp:ListItem>
                                                        <asp:ListItem Text="Warning" Value="2"></asp:ListItem>
                                                         <asp:ListItem Text="Reject" Value="3"></asp:ListItem>
                                                    </asp:DropDownList>

                                                </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Last Accept Date " HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control Datetime" ID="txt_lastacceptdate"
                                                            runat="server" Text='<%#Bind("last_accept_date") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>

                                           
                                            
                                             <asp:TemplateField HeaderText="Tolerance" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Tolerance"
                                                            runat="server" Text='<%#Bind("Qty_Rcv_Tolerance") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                            
                                            <asp:TemplateField HeaderText="Action" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                            <div class="col-md-3">
                                                 <div class="input-group">
                                                    <asp:DropDownList ID="ddl_Action1" runat="server"
                                                        CssClass="form-control">

                                                        <asp:ListItem Text="None" Value="1"></asp:ListItem>
                                                        <asp:ListItem Text="Warning" Value="2"></asp:ListItem>
                                                         <asp:ListItem Text="Reject" Value="3"></asp:ListItem>
                                                    </asp:DropDownList>

                                                </div>
                                                </div>
                                                    </ItemTemplate>
                                          </asp:TemplateField>

                                         
                                             <asp:TemplateField HeaderText="">
                                                <ItemTemplate>
                                               <label class="col-md-1 control-label"></label>
                                            <div class="col-md-3 text-left">
                                                <span class="checkbox"><input id="chk_Allowsub" runat="server"
                                                        type="checkbox" name="ctl00$ContentPlaceHolder1$Allowsub" />
                                                    <label class="col-md-1 control-label"></label>Allow Substituis Reciept</span>

                                            </div>
                                                     </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Tolerance" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Tolerance"
                                                            runat="server" Text='<%#Bind("QTY_RCV_EXCEPTION_CODE") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Reciept Routing" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Routing"
                                                            runat="server" Text='<%#Bind("RECEIVING_ROUTING_ID") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Enforce SHip-To" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Enfoorce"
                                                            runat="server" Text='<%#Bind("ENFORCE_SHIP_TO_LOCATION_CODE") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                          <asp:TemplateField HeaderText="Action" ItemStyle-Width="5%">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="linkedit" runat="server" Visible="false"
                                                        CommandName="gEdit"><i class="fa fa-pencil"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:LinkButton ID="lnk_add"
                                                        
                                                        runat="server" CommandName="gadd"><i class="fa fa-plus"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:linkbutton ID="linkdlt" CausesValidation="false"
                                                        CommandName="gDelete" runat="server"
                                                        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>
                                    <br />

                                </div>
                            
                        

                        </div>
                               </updatepanel>
                            <hr />

                            <div class="row">
                                <asp:Label CssClass="control-label col-md-offset-2" ID="lbl_due" runat="server">
                                </asp:Label>
                            </div>

                        </div>
                    </section>
            </div>
        </div>
    </div>
</asp:Content>
