<%@ Page Title="Stock Adjust" Language="C#" MasterPageFile="~/SunMaster.Master" AutoEventWireup="true" CodeBehind="StockAdjust.aspx.cs" Inherits="SUNWEB.StockAdjust" %>
<%@ Register Assembly="AjaxControlToolkit" TagPrefix="asp" Namespace="AjaxControlToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">


 function validate() {

          if (document.getElementById("<%=txtBarcode.ClientID %>").value == "")
           {
                alert("Enter Barcode");
                document.getElementById("<%=txtBarcode.ClientID %>").focus();
                return false;
            }



            if (document.getElementById("<%=txtAdjustqty.ClientID %>").value == "") {
                alert("Enter Adjust Qty");
                document.getElementById("<%=txtAdjustqty.ClientID %>").focus();
                return false;
            }
            

        }
        </script>

              <script type="text/javascript" language="javascript">
                  function AllowOnlyNumeric() {
                      // Get the ASCII value of the key that the user entered
                      var key = window.event.keyCode;

                      // Verify if the key entered was a numeric character (0-9) or a decimal (.)
                      if ((key > 47 && key < 58) || key == 46)
                      // If it was, then allow the entry to continue
                          return;

                      else
                      // If it was not, then dispose the key and continue with entry
                          window.event.returnValue = null;
                      alert("Number Only Allowed")
                  }



                  function isNumberKey(evt, obj) {

                      var charCode = (evt.which) ? evt.which : event.keyCode
                      var value = obj.value;
                      var dotcontains = value.indexOf(".") != -1;
                      if (dotcontains)
                          if (charCode == 46) return false;
                      if (charCode == 46) return true;
                      if (charCode > 31 && (charCode < 48 || charCode > 57))
                          return false;
                      return true;
                  }

</script>



</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">


<asp:UpdatePanel runat="server" ID="updatepanel1" UpdateMode="Conditional">
  <ContentTemplate>
      <table style="margin-left: 1%; width: 98%;">
      <tr>
      <td style="font-size:large; width: 50%; font-family:'Open Sans', sans-serif; font-weight:bolder;">
      STOCK  ADJUST
     </td>    
     
     </tr>
     </table>
    

      <div class="row">
                 
                          <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                            <div class="card">
                                                    
                                <div class="card-body">
                                 
                                
                                 <div class="form-row">
                                       
                                          
                              

                              
                                 </div>
                                 <div class="row">
                                        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                                            <div class="card">

                                                <div class="card-body">


                                                    <div class="form-row">

                                                  
                                                        <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                                            <label for="validationCustom04">
                                                                Barcode
                                                            </label>
                                                            <%--<div id="scandit-barcode-result">
                                                                No codes scanned yet
                                                                <br />
                                                            </div>--%>
                                                              <%--<asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="GetData" />--%>
                                                              <asp:TextBox ID="txtBarcode" runat="server" autocomplete="off" class="form-control" AutoPostBack="True"
                                                                 OnTextChanged="txtBarcode_TextChanged"></asp:TextBox>
                                                                  
                                                            <br />
                                                            <%--<img alt="" style="cursor: pointer; width: 40px; height: 40px" src="IMG/BarCodeScan.png" />--%>
                                                        </div>
                                                        <div>
                                                        </div>

                                                         <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                                        Desc: <asp:Label ID="lblDescription"  runat="server" AutoPostBack="true"></asp:Label>
                                                        </div>
                                                       
                                                        <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                                       OHQty: <asp:Label ID="lblOnHand" runat="server" AutoPostBack="true"></asp:Label>   
                                                        </div> 
                                                        <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                                            <label for="validationCustom03">
                                                                Adjust Qty</label>
                                                            <asp:TextBox ID="txtAdjustqty" runat="server" autocomplete="off"
                                                                class="form-control"  MaxLength="8" TextMode="Number"></asp:TextBox>
                                                            <asp:HiddenField ID="hdInventoryid" runat="server" />
                                                            
                                                        </div>

                                                   
                                                         </div>

                                                         <asp:Button ID="btnStockAdjust" runat="server" Text="Stock Adjust" ToolTip="Click button for Adjust"
                                                         CssClass="btn btn-primary" onclick="btnStockAdjust_Click" OnClientClick="return validate()" /> &nbsp;&nbsp;&nbsp;
                                                         
                                                         <asp:Button ID="btnClear" runat="server" Text="Clear" ToolTip="Click button for Clear" onclick="btnClear_Click"
                                                         CssClass="btn btn-primary" />

                                                          <div class="form-row">

                                                                       <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                                      <label for="validationCustom03">
                                                      <asp:Label ID="lblBranchAliasName"  ForeColor="Gray" runat="server" Text="Branch Name"></asp:Label></label>
                                                      <asp:DropDownList ID="cmbBranches" CssClass="custom-select"  
                                                      runat="server" AutoPostBack="true" 
                                                      onselectedindexchanged="cmbBranches_SelectedIndexChanged"></asp:DropDownList>
                                                      </div>
                                                         

                                                          </div>

                                                
                                                    
                                                </div>

                                            </div>
                                        </div>

                                        
                                    </div>

                                 </div> 
                                 
                                
                                                         
                                </div>
                            </div>
                        </div>
 
   
   <div>
       <h4>&nbsp;<asp:Label ID="lblGreeting" runat="server"></asp:Label></h4>
           <%--<asp:Button ID="btnPdf" runat="server" Text="PDF" 
            ToolTip="To Export  the Report Click Here"  CssClass="btn btn-secondary" 
            onclick="btnPdf_Click"/>--%>   
     </div>
     </ContentTemplate>
     </asp:UpdatePanel>

<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css?v=1.1" rel="stylesheet" />
<!-- Bootstrap 5 -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />
<!-- Optional Bootstrap Icons -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" rel="stylesheet" />


</asp:Content>
