<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="PurchasingOption.aspx.cs" Inherits="HRMS.Purcahsing.PurchasingOption" %>
<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">
                    Purchasing Options
                        <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>
                        

                        <div class="row" style="padding-top:10px">
                        <label class="control-label col-md-2">Organization</label>
                                 <div class="col-md-3">
                                   
                                 <asp:DropDownList  CssClass="form-control" ID="ddl_Organizations" runat="server"></asp:DropDownList> 
                                 <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_Organiztion" controltovalidate="ddl_Organizations" errormessage="Organization is Required!" />
                                   
                                   
                               </div>
                               </div>
                          <div class="panel">
                         <div class="panel-heading">
                                    <h3 class="panel-title">Document Control</h3>
                                </div>
                        <div class="row" style="padding-top:10px">
                                
                                <asp:HiddenField ID="hid_PurID" runat="server" />
                                 <asp:HiddenField ID="hid_RecAccount" runat="server" />
                                 <asp:HiddenField ID="hid_Linetype" runat="server" />
                                 <asp:HiddenField ID="hid_Ordertype" runat="server" />
                                <%--<asp:HiddenField ID="hid_tax_regime_code" runat="server" />
                                <asp:HiddenField ID="hid_tax_regimeid" runat="server" />--%>
                                  <label class="control-label col-md-2">Price Tolerence(%)</label>
                                <div class="col-md-3">
                               <asp:TextBox ID="txt_PriceTol" runat="server" CssClass="form-control"></asp:TextBox>
                                    <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_pricetol" controltovalidate="txt_PriceTol" errormessage="Price Tolerence  is Required!" />
                                                          </div>
                                 <label class="col-md-1 control-label"></label>
                                <div class="col-md-4 text-left" >
                              <span class="checkbox"><input id="chk_eforcetol" runat="server" type="checkbox" name="ctl00$ContentPlaceHolder1$eforcetol" />
                                   <label class="col-md-1 control-label" ></label>Enforce Price Tolerence(%)</span>                   
                               
                                </div>
                               </div>

                        <div class="row" style="padding-top:10px">
                                
                              
                                <%--<asp:HiddenField ID="hid_tax_regime_code" runat="server" />
                                <asp:HiddenField ID="hid_tax_regimeid" runat="server" />--%>
                                  <label class="control-label col-md-2">Price Tolerence Amount(USD)</label>
                                <div class="col-md-3">
                                 <asp:TextBox ID="txt_pricetolamount" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>
                                 <label class="col-md-1 control-label"></label>
                                <div class="col-md-4 text-left" >
                              <span class="checkbox"><input id="chk_pricetolamount" runat="server" type="checkbox" name="ctl00$ContentPlaceHolder1$pricetolamount" />
                                   <label class="col-md-1 control-label" ></label>Enforce Price Tolerence Amount</span>                   
                               
                                </div>
                               </div>

                        <div class="row" style="padding-top:10px">
                            <asp:HiddenField ID="hid_content_owner_id" runat="server" />
                            <label class="col-md-2 control-label">Enforce Full Lot Quantity</label>
                                <div class="col-md-3">
                                    
                                     <asp:DropDownList  CssClass="form-control" ID="ddl_fullotqty" runat="server"></asp:DropDownList>        
                                   
                                    </div>
                           <label class="col-md-1 control-label"></label>
                                <div class="col-md-4 text-left" >
                              <span class="checkbox"><input id="chk_Ddisposmessge" runat="server" type="checkbox" name="ctl00$ContentPlaceHolder1$Ddisposmessge" />
                                   <label class="col-md-1 control-label" ></label>Display Disposition Messages</span>                   
                               
                                </div>  
                            </div>

                        <div class="row" style="padding-top:10px">
                            <asp:HiddenField ID="HiddenField1" runat="server" />
                            <label class="col-md-2 control-label">Reciept Close Point</label>
                                <div class="col-md-3">
                                    
                                    <asp:DropDownList  CssClass="form-control" ID="ddl_recclospoint" runat="server"></asp:DropDownList>     
                                   
                                    </div>
                           <label class="col-md-1 control-label"></label>
                                <div class="col-md-4 text-left" >
                              <span class="checkbox"><input id="chk_Npoexists" runat="server" type="checkbox" name="ctl00$ContentPlaceHolder1$Npoexists" />
                                   <label class="col-md-1 control-label" ></label>Notify If Blanket PO Exists</span>                   
                               
                                </div>  
                            </div>

                        <div class="row" style="padding-top:10px">
                                
                              
                                <%--<asp:HiddenField ID="hid_tax_regime_code" runat="server" />
                                <asp:HiddenField ID="hid_tax_regimeid" runat="server" />--%>
                                  <label class="control-label col-md-2">Cancel Requisitions</label>
                                <div class="col-md-3">
                                 <asp:DropDownList  CssClass="form-control" ID="ddl_Cancrequ" runat="server"></asp:DropDownList>     
                                </div>
                                 <label class="col-md-1 control-label"></label>
                                <div class="col-md-4 text-left" >
                              <span class="checkbox"><input id="chk_AllitemDescUpdate" runat="server" type="checkbox" name="ctl00$ContentPlaceHolder1$AllitemDescUpdate" />
                                   <label class="col-md-1 control-label" ></label>Allow Item Description Update</span>                   
                               
                                </div>
                               </div>

                        <div class="row" style="padding-top:10px">
                            <asp:HiddenField ID="HiddenField2" runat="server" />
                            <label class="col-md-2 control-label">SBI Buying Company Identifier</label>
                                <div class="col-md-3">
                                    
                                    <asp:TextBox ID="txt_SbiBCI" runat="server" CssClass="form-control"></asp:TextBox>
                                                                
                                    </div>
                            <label class="col-md-1 control-label"></label>
                                <div class="col-md-4 text-left" >
                              <span class="checkbox"><input id="Chk_EnbuyerName" runat="server" type="checkbox" name="ctl00$ContentPlaceHolder1$EnbuyerName" />
                                   <label class="col-md-1 control-label" ></label>Enforce Buyer Name</span>                   
                               
                                </div>
                            </div>

                        <div class="row" style="padding-top:10px">
                            <asp:HiddenField ID="HiddenField3" runat="server" />
                            <label class="col-md-2 control-label">Out Put Format</label>
                         
                                 <div class="col-md-3">
                                 <asp:DropDownList  CssClass="form-control" ID="ddl_Outputformat" runat="server"></asp:DropDownList>     
                                </div>
                           <label class="col-md-1 control-label"></label>
                                <div class="col-md-4 text-left" >
                              <span class="checkbox"><input id="Chk_EnSupplierHold" runat="server" type="checkbox" name="ctl00$ContentPlaceHolder1$EnSupplierHold" />
                                   <label class="col-md-1 control-label" ></label>Enforce Supplier Hold</span>                   
                               
                                </div>
                            </div>

                        <div class="row"  style="padding-top:10px">  
                               
                                 <label class="col-md-2 control-label">Maximum Attachment Files (In MD)</label>
                                <div class="col-md-3">
                                 <asp:TextBox ID="txt_Maxattfiles" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>
                                <label class="col-md-1 control-label"></label>
                                <div class="col-md-4 text-left" >
                              <span class="checkbox"><input id="Chk_GaplessInvNumber" runat="server" type="checkbox" name="ctl00$ContentPlaceHolder1$GaplessInvNumber" />
                                   <label class="col-md-1 control-label" ></label>Gapless Invoice Numbering</span>                   
                               
                                </div>
                            </div>

                        <div class="row"  style="padding-top:10px">  
                               
                                 <label class="col-md-2 control-label">Email Attachment FileName</label>
                                <div class="col-md-3">
                                 <asp:TextBox ID="txt_EmailAttachment" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>
                               <label class="col-md-1 control-label"></label>
                                <div class="col-md-4 text-left" >
                              <span class="checkbox"><input id="Chk_Rfqreqired" runat="server" type="checkbox" name="ctl00$ContentPlaceHolder1$Rfqreqired" />
                                   <label class="col-md-1 control-label" ></label>RFQ Required</span>                   
                               
                                </div>
                            </div>
                        </div>
                        <div class="panel">
                                <div class="panel-heading">
                                    <h3 class="panel-title">Document Default</h3>
                                </div>
                        <div class="row" style="padding-top:10px">
                                
                               
                                <%--<asp:HiddenField ID="hid_tax_regime_code" runat="server" />
                                <asp:HiddenField ID="hid_tax_regimeid" runat="server" />--%>
                                  <label class="control-label col-md-2">Requisition Import Group-By</label>
                                <div class="col-md-3">
                              <asp:DropDownList  CssClass="form-control" ID="ddl_ReqimportGroupby" runat="server"></asp:DropDownList>    

                                </div>
                                 <label class="control-label col-md-2">Line Type</label>
                                 <div class="col-md-3">
                                    <div class="input-group">
                                 <asp:TextBox  CssClass="form-control" ID="txt_Linetype" runat="server" ></asp:TextBox>
                                 <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_linetype" controltovalidate="txt_Linetype" errormessage="Line Type is Required!" />
                                    <span class="input-group-btn">
                                    <button id="btn_lov_LineType" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_LineType_Click"><i class="fa fa-search"></i></button>
                                    </span>
                               </div>
                                     </div>
                               </div>

                        <div class="row" style="padding-top:10px">
                                
                              
                               <label class="control-label col-md-2">Internal Requisition Order Type</label>
                                 <div class="col-md-3">
                                    <div class="input-group">
                                 <asp:TextBox  CssClass="form-control" ID="txt_internalReqordtype" runat="server" ></asp:TextBox>
                                 <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_internalReqordtype" controltovalidate="txt_internalReqordtype" errormessage="Order Type is Required!" />
                                    <span class="input-group-btn">
                                    <button id="btn_lov_Ordertype" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_Ordertype_Click"><i class="fa fa-search"></i></button>
                                    </span>
                                        </div>
                               </div>
                                 <label class="col-md-2 control-label">Rate Type</label>
                                <div class="col-md-3">
                                    
                                     <asp:DropDownList  CssClass="form-control" ID="ddl_RateType" runat="server"></asp:DropDownList>        
                                   
                                    </div>
                               </div>

                        <div class="row" style="padding-top:10px">
                            <asp:HiddenField ID="HiddenField8" runat="server" />
                            <label class="col-md-2 control-label">Internal Requisition Order Source</label>
                                <div class="col-md-3">
                                    
                                     <asp:DropDownList  CssClass="form-control" ID="ddl_Internalrequorder" runat="server"></asp:DropDownList>        
                                   
                                    </div>
                           <label class="col-md-2 control-label">Match Approval Level</label>
                                <div class="col-md-3">
                                    
                                     <asp:DropDownList  CssClass="form-control" ID="ddl_MatchApproLavel" runat="server"></asp:DropDownList>        
                                   
                                    </div>
                            </div>

                        <div class="row" style="padding-top:10px">
                            
                            <label class="col-md-2 control-label">Reciept Close Tolerence(%)</label>
                                <div class="col-md-3">
                                    
                                     <asp:TextBox ID="txt_RecClosetol" runat="server" CssClass="form-control"></asp:TextBox>
                                   
                                    </div>
                           <label class="control-label col-md-2">Price Break Type</label>
                                <div class="col-md-3">
                                 <asp:DropDownList  CssClass="form-control" ID="ddl_PriceBreakType" runat="server"></asp:DropDownList>     
                                </div>
                            </div>
                        
                        <div class="row" style="padding-top:10px">
                            
                            <label class="col-md-2 control-label">Invoice Close Tolerence(%)</label>
                                <div class="col-md-3">
                                    
                                     <asp:TextBox ID="txt_Invoiceclose" runat="server" CssClass="form-control"></asp:TextBox>
                                   
                                    </div>
                           <label class="control-label col-md-2">Price Type</label>
                                <div class="col-md-3">
                                 <asp:DropDownList  CssClass="form-control" ID="ddl_Pricetype" runat="server"></asp:DropDownList>     
                                </div>
                            </div>

                        <div class="row" style="padding-top:10px">
           
                                  <label class="control-label col-md-2">Quote Warning Delay</label>
                                <div class="col-md-3">
                                 <asp:TextBox ID="txt_Quotewardelay" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>
                                 <label class="control-label col-md-2">Minimum Release Amount(USD)</label>
                                <div class="col-md-3">
                                 <asp:TextBox ID="txt_MinimunReleaseAmount" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>
                               </div>

                       
                         <div class="row" style="padding-top:10px">
                              
                               <label class="control-label col-md-2">Acceptance Required Flag</label>
                                <div class="col-md-3">
                                 <asp:DropDownList  CssClass="form-control" ID="ddl_AccReqFlag" runat="server"></asp:DropDownList>     
                                </div>

                               </div>                            

                           </div>
                              <div class="panel">
                                <div class="panel-heading">
                                    <h3 class="panel-title">Reciept Accounting</h3>
                                </div>

                                  <div class="row" style="padding-top:10px">
                            
                            <label class="col-md-2 control-label">Accure Expense Items</label>
                                <div class="col-md-3">
                                    
                                     <asp:DropDownList  CssClass="form-control" ID="ddl_AccureExpIte" runat="server"></asp:DropDownList>     
                                   
                                    </div>
                           <label class="control-label col-md-2">Automatic Offset Method</label>
                                <div class="col-md-3">
                                 <asp:DropDownList  CssClass="form-control" ID="ddl_automaticoffset" runat="server"></asp:DropDownList>     
                                </div>
                            </div>
                  <div class="row" style="padding-top:10px">
                            
                            <label class="col-md-2 control-label">Accure Inventory Items</label>
                                <div class="col-md-3">
                                    
                                     <asp:DropDownList  CssClass="form-control" ID="ddl_AccureInventoryItems" runat="server"></asp:DropDownList>     
                                   
                                    </div>
                          <label class="control-label col-md-2">Expense AP Accrual Account</label>
                                 <div class="col-md-3">
                                    <div class="input-group">
                                 <asp:TextBox  CssClass="form-control" ID="txt_ExpenseAPAccrualAccount" runat="server" ></asp:TextBox>
                                 <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_ExpenseAPAccrualAccount" controltovalidate="txt_ExpenseAPAccrualAccount" errormessage="AP Accrual Accounts is Required!" />
                                    <span class="input-group-btn">
                                    <button id="btn_lov_ExpenseAPAccrualAccount" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_ExpenseAPAccrualAccount_Click"><i class="fa fa-search"></i></button>
                                    </span>
                               </div>
                            </div>
                                    </div>
               
                            <hr />
                            <div class="row">
                                <asp:Label CssClass="control-label col-md-offset-2" ID="lbl_due" runat="server"></asp:Label>
                            </div>


                    </div>
                         <hr />
                            <div class="row" style="padding-top:10px">
                                <div class="col-md-offset-0">
                                    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
                                        CssClass="table table-striped table-bordered table-hover" CellPadding="0"
                                        Width="90%" OnRowCommand="GridView2_RowCommand">
                                        <Columns>
                                            <asp:TemplateField HeaderStyle-Width="1%">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_PurID" runat="server"
                                                        Value='<%#Bind("Purchasing_Option_ID")%>' />
                                                    <asp:HiddenField ID="hid_Purdtl" runat="server"
                                                        Value='<%#Bind("Purchasing_Option_line_ID")%>' />

                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Document Name" HeaderStyle-Width="30%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        <asp:HiddenField ID="hid_Document" runat="server"
                                                            Value='<%#Bind("Document_Type")%>' />
                                                        <asp:TextBox ID="txt_DocumentName" runat="server"
                                                            CssClass="form-control text" Text='<%#Bind("DocTypeName") %>'>
                                                        </asp:TextBox>
                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_DocTypeName" type="button" runat="server"
                                                                class="btn btn-white"
                                                                onserverclick="btn_lov_DocTypeName_Click"><i
                                                                    class="fa fa-search"></i></button>
                                                        </span>
                                                    </div>
                                                    <%--<asp:RequiredFieldValidator SetFocusOnError="true"
                                                        ValidationGroup="d_save" runat="server" id="req_rcv_date"
                                                        controltovalidate="txt_rcv_date"
                                                        errormessage="Receive Date is Required!" />
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Amount" HeaderStyle-Width="20%">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_rcv_amount" runat="server"
                                                        CssClass="form-control" Text='<%#Bind("AMOUNT") %>'>
                                                    </asp:TextBox>
                                                    <%--<asp:RequiredFieldValidator SetFocusOnError="true"
                                                        ValidationGroup="d_save" runat="server" id="req_rcv_amt"
                                                        controltovalidate="txt_rcv_amount"
                                                        errormessage="Receive Amount is Required!" />--%>
                                                </ItemTemplate>

                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Entry Type" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <asp:DropDownList ID="Entry" runat="server" CssClass="form-control" >
                                                <asp:ListItem Selected= "True" Text="--- Select ---" Value="0" ></asp:ListItem>
                                                <asp:ListItem  Text="Automatic" Value="1"></asp:ListItem>
                                                <asp:ListItem  Text="Manual" Value="2"></asp:ListItem>
                                                
                                            </asp:DropDownList>
                                                </ItemTemplate>



                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Type" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <asp:DropDownList ID="ddltype" runat="server" CssClass="form-control" >
                                                <asp:ListItem Selected= "True" Text="--- Select ---" Value="0" ></asp:ListItem>
                                                <asp:ListItem  Text="Numeric" Value="1"></asp:ListItem>
                                            </asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Number" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                     <asp:TextBox ID="txt_Number" runat="server"
                                                            CssClass="form-control"
                                                            Text='<%#Bind("Next_Number") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Action" ItemStyle-Width="6%">
                                                    <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" ValidationGroup="d_save"
                                                            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>
                            </div>
                </section>
            </div>
        </div>
</asp:Content>
