<%@ page language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="MaterialManagement_InventoryPlanning_StockBatch, App_Web_skpkmd1y" title="Stock Batch" uiculture="auto" meta:resourcekey="PageResource1" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Src="~/UserControls/AutoComplete/AutoCompleteControl.ascx" TagName="AutoCompleteControl"
    TagPrefix="acc" %>
<%@ Register Src="~/UserControls/MaterialManagement/PurchaseUom/MultiplePurchaseUom.ascx"
    TagPrefix="cc1" TagName="UomUserControl" %>
<%@ Register Src="~/UserControls/MaterialManagement/MultiPleBin/MultiPleBin.ascx"
    TagPrefix="cc2" TagName="MultiPleBinUserControl" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager"
    TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/Common/CommonSearch/CommonSearch.ascx" TagName="CommonSearchUserControl"
    TagPrefix="Common" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl"
    TagPrefix="ScreenGroup" %>
<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl" TagPrefix="DPC" %>
<%@ Register Src="~/UserControls/Common/Stock/StockDetailBoxControl.ascx" TagName="StockControl" TagPrefix="Stock" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="ServiceItemUpdatePanel" runat="server">
        <ContentTemplate>
            <Common:CommonSearchUserControl ID="CommonSearchControl" runat="server" Visible="false" />
            <cc1:UomUserControl ID="UomUpdationCtrl" runat="server" Visible="false"/>
            <cc2:MultiPleBinUserControl ID="BinUserControl" runat="server" Visible="false"/>
            <div id="divContentPage" class="divcontentpagemargin">
                <!-- ContentPlaceHolder Box Starts -->

                <div class="dashBoardLeftCont" valign="top">
                    <div class="himssuHeader3WireBox">
                        <%-- <div class="himsBoxHeader">
                                        <div class="leftdiv">
                                        </div>
                                        <div class="himsBoxTitle">
                                            <div class="headerText">
                                               <asp:Label runat="server" ID="ScreenGroupNameLabel"></asp:Label>    
                                            </div>
                                        </div>
                                    </div>--%>
                        <table width="0px" cellpadding="0" cellspacing="0">
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="160"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <Stock:StockControl ID="StockUserControl" runat="server" Visible="true" />
                    <div class="card card-box">
                        <!-- Sub Container2 Box Start -->
                        <div class="himssuHeader2WireBox" id="SearchDiv" runat="server">
                            <div class="himsBoxHeader card-head">
                                <asp:Panel ID="Panel1" runat="server" meta:resourcekey="Panel1Resource1">
                                    <div class="leftdiv">
                                    </div>
                                    <div class="himsBoxTitle">
                                        <asp:Image ID="Image2" runat="server" class="fLeft"
                                            meta:resourcekey="Image2Resource1" />
                                        <div class="headerText">
                                            <header>
                                                <i class="fal fa-search"></i>
                                                <asp:Label ID="Label3" runat="server" Text="Search"
                                                    meta:resourcekey="Label3Resource1">
                                                </asp:Label>
                                            </header>
                                            <%--   <cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server" TargetControlID="DetailPanel"
                                                        ExpandControlID="Image2" CollapseControlID="Image2" TextLabelID="Label3" Collapsed="True"
                                                        ImageControlID="Image2" ExpandedImage="~/images/buttonCollapse.gif"
                                                        CollapsedImage="~/images/buttonExpand.gif" Enabled="True" />--%>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </div>
                            <div class="himsBoxContent card-body">
                                <asp:Panel ID="DetailPanel" runat="server"
                                    meta:resourcekey="DetailPanelResource1">
                                    <div class="himsBoxContent">
                                        <div class="contentHolder">
                                            <asp:Panel ID="SearchCriteriaPanel" runat="server"
                                                meta:resourcekey="SearchCriteriaPanelResource1">

                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="ItemNameLikeLabel" Text="Item Name" runat="server"
                                                            meta:resourcekey="Label1Resource1"></asp:Label>
                                                    </div>
                                                    <div class="fLeft">
                                                        <asp:TextBox ID="ItemNameLikeTextBox" SkinID="CustomWidthTextBox"
                                                            runat="server" meta:resourcekey="SearchCodeTextBoxResource1" MaxLength="100"></asp:TextBox>
                                                    </div>
                                                </div>

                                                <div class="outerBox pTop5 col-md-3" runat="server" visible="false">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="Label1" Text="Item Code" runat="server"
                                                            meta:resourcekey="Label1Resource1"></asp:Label>
                                                    </div>
                                                    <div class="fLeft">
                                                        <asp:TextBox ID="SearchCodeTextBox" SkinID="CustomWidthTextBox"
                                                            runat="server" meta:resourcekey="SearchCodeTextBoxResource1" MaxLength="100"></asp:TextBox>
                                                    </div>
                                                </div>
                                                <div class="outerBox pTop5 col-md-3" runat="server" visible="false">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="Label2" Text="Item Name" runat="server"
                                                            meta:resourcekey="Label2Resource1"></asp:Label>
                                                    </div>
                                                    <div class="fLeft pRight5">
                                                        <asp:TextBox ID="SearchNameTextBox" SkinID="CustomWidthTextBox"
                                                            runat="server" meta:resourcekey="SearchNameTextBoxResource1" MaxLength="100"></asp:TextBox>
                                                    </div>
                                                </div>
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="ItemCodeLabel" Text="Code" runat="server"
                                                            meta:resourcekey="Label1Resource1"></asp:Label>
                                                    </div>
                                                    <div class="fLeft">
                                                        <asp:TextBox ID="ItemCodeLikeTextBox" SkinID="CustomWidthTextBox"
                                                            runat="server" meta:resourcekey="SearchCodeTextBoxResource1" MaxLength="100"></asp:TextBox>
                                                    </div>
                                                </div>

                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="SearchMainGroupLabel" runat="server" Text="Main Group"
                                                            meta:resourcekey="Label11Resource1"></asp:Label>
                                                    </div>
                                                    <div class="fLeft pRight5">
                                                        <asp:DropDownList ID="SearchMainGroupDropDownList"
                                                            runat="server" onmouseleave="showHideTooltip()" AutoPostBack="true" OnSelectedIndexChanged="Fill_Search_Item_Sub_Category" SkinID="CustomWidthDropDownList" CssClass="form-control" onmouseenter="showHideTooltip()"
                                                            meta:resourcekey="MainGroupDropDownListResource1">
                                                        </asp:DropDownList>
                                                    </div>
                                                </div>

                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="SearchSubGroupLabel" runat="server" Text="Sub Group"
                                                            meta:resourcekey="Label11Resource1"></asp:Label>
                                                    </div>
                                                    <div class="fLeft pRight5">
                                                        <asp:DropDownList ID="SearchSubGroupDropDownList"
                                                            runat="server" onmouseleave="showHideTooltip()" AutoPostBack="false" SkinID="CustomWidthDropDownList" CssClass="form-control" onmouseenter="showHideTooltip()"
                                                            meta:resourcekey="MainGroupDropDownListResource1">
                                                        </asp:DropDownList>
                                                    </div>
                                                </div>
                                                <div class="cBoth">
                                                </div>
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="CatagoryLabel" runat="server" Text="Item Category" meta:resourcekey="DepartmentLabelResource1"></asp:Label>
                                                    </div>
                                                    <div class="fLeft">
                                                        <asp:DropDownList ID="StockItemCategoryDropDownList" runat="server" CssClass="form-control" SkinID="CustomWidthDropDownList"
                                                            onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" meta:resourcekey="DepartmentDropDownListResource1">
                                                        </asp:DropDownList>
                                                    </div>
                                                </div>

                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="BatchSearchLabel" runat="server" Text="Batch" meta:resourcekey="DepartmentLabelResource1"></asp:Label>
                                                    </div>
                                                    <div class="fLeft">
                                                        <asp:TextBox ID="BatchSearchTextBox" runat="server"></asp:TextBox>
                                                    </div>
                                                </div>
                                                <div class="outerBox pTop5 col-md-3">
                                                    <div class="controlLabelWidth">
                                                        <asp:Label ID="DateSearchLabel" runat="server" Text="Expiry Date" meta:resourcekey="DepartmentLabelResource1"></asp:Label>
                                                    </div>
                                                    <div class="fLeft">
                                                        <DPC:DatePickerControl DisplayDatePicker="true"  ID="DateDatePickerControl" runat="Server"></DPC:DatePickerControl>
                                                    </div>
                                                </div>

                                                <div class="cBoth">
                                                </div>

                                                <div class="cBoth">
                                                </div>
                                                <div class="alignCenter col-md-12 pTop5">
                                                    <div class="searchBoxBtn">
                                                        <asp:Button ID="SearchButton" Text="&#xf002; Search" runat="server"
                                                            OnClick="SearchButton_Click" SkinID="0" CssClass="fas btn btn-search" />
                                                        <asp:Button ID="ResetButton" runat="server" Text="&#xf12d; Reset" CssClass="btn btn-reset fas" SkinID="0" onblur="fnClearTabIndexChange()"
                                                            OnClick="ResetButton_Click" meta:resourcekey="ResetButtonResource1" />
                                                        <asp:Button ID="GenerateRequestButton" CssClass="btn btn-generate fas" Text="Generate Request" onblur="fnClearTabIndexChange()" runat="server"
                                                            SkinID="0" OnClick="GenerateRequestButton_Click" meta:resourcekey="ClearButtonResource1" Visible="false" />
                                                        <asp:Button ID="Button1" CssClass="btn btn-generate fas" Text="Generate Request" onblur="fnClearTabIndexChange()" runat="server" Visible="false"
                                                            SkinID="0" meta:resourcekey="ClearButtonResource1" />

                                                    </div>
                                                </div>
                                            </asp:Panel>


                                            <div class="spacer">
                                                <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/spacer.gif"
                                                    meta:resourcekey="Image1Resource1" />
                                            </div>
                                            <div class="cBoth">
                                            </div>
                                            <div id="StockItemMasterDetailDiv" visible="False" runat="server">

                                                <div class="himssuHeader7WireBox col-md-12" id="PatientRelationDiv" runat="server" style="width: 100%">
                                                    <div class="himsBoxHeader" id="ListDiv" runat="server" visible="True">
                                                        <div class="leftdiv">
                                                        </div>
                                                        <div class="himsBoxTitle" style="width: 99%">
                                                            <div class="headerText">
                                                                <div class="fLeft">
                                                                </div>
                                                            </div>
                                                            <div align="right" class="fRight" style="margin-top: 0px;">
                                                                <uc1:GridViewPager ID="StockItemMasterGridView_GridViewPager" runat="server" OnFirstRecordClick="StockItemMasterGridView_GridViewPager_FirstRecordClick"
                                                                    OnLastRecordClick="StockItemMasterGridView_GridViewPager_LastRecordClick" OnNextRecordClick="StockItemMasterGridView_GridViewPager_NextRecordClick"
                                                                    OnPrevRecordClick="StockItemMasterGridView_GridViewPager_PrevRecordClick" OnTextBoxValueChange="StockItemMasterGridView_GridViewPager_TextBoxValueChange"
                                                                    ParentGridView="StockItemMasterGridView" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <asp:HiddenField ID="StockItemPlanningHiddenField" runat="server" />
                                                    <div class="himsBoxContent">
                                                        <%-- <div id="DivHeader" style="vertical-align: top; width: 100%; height: 21px;">
                                    <asp:Table ID="StockItemMasterGridViewTable" runat="server" CellPadding="0" CellSpacing="0"
                                        BackColor="#E8E8E8" ForeColor="Black" Width="100%" GridLines="Both" 
                                        CssClass="GridViewTableRow" 
                                        meta:resourcekey="StockItemMasterGridViewTableResource1">
                                    </asp:Table>
                                </div>--%>


                                                        <%-- <div id="DivData" class="Container" style="vertical-align: top; height: 109px; width: 99.6%;">--%>

                                                        <div id="Div2" runat="server" class="table-responsive">
                                                            <asp:GridView ID="StockItemMasterGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                                                OnRowDataBound="StockItemMasterGridView_RowDataBound" OnPageIndexChanging="StockItemMasterGridView_PageIndexChanging"
                                                                ShowHeader="True" AllowPaging="True" DataKeyNames="StoreLocationId,StockBatchId,IsbatchWiseTracking,StockItemId"
                                                                meta:resourcekey="StockItemMasterGridViewResource1" OnRowEditing="StockItemMasterGridView_RowEditing" OnRowUpdating="StockItemMasterGridView_RowUpdating" OnRowCancelingEdit="StockItemMasterGridView_RowCancelingEdit"
                                                                CssClass="table table-striped table-bordered table-hover" PageSize="500">

                                                                <Columns>

                                                                    <asp:TemplateField HeaderText="StockItemId" SortExpression="Id" Visible="false" meta:resourcekey="TemplateFieldResource1">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="StockItemIdLabel" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "StockItemId") %>'
                                                                                meta:resourcekey="IdLabelResource1"></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Store Location" meta:resourcekey="TemplateFieldResource2" Visible="false" HeaderStyle-HorizontalAlign="Left">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="StoreLocationLabel" runat="server" Text='<%#Eval("StoreLocationName") %>'
                                                                                meta:resourcekey="DepartmentNameLabelResource1"></asp:Label>
                                                                        </ItemTemplate>
                                                                        <HeaderStyle Width="10%" />
                                                                        <ItemStyle Width="10%" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Item Code" meta:resourcekey="TemplateFieldResource2" HeaderStyle-HorizontalAlign="Left">
                                                                        <ItemTemplate>

                                                                            <asp:Label ID="itemCodeLabel" runat="server" Text='<%#Eval("StockItemCode") %>'
                                                                                meta:resourcekey="DepartmentNameLabelResource1"></asp:Label>
                                                                        </ItemTemplate>
                                                                        <HeaderStyle Width="13%" />
                                                                        <ItemStyle Width="13%" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Item Name" meta:resourcekey="TemplateFieldResource3" HeaderStyle-HorizontalAlign="Left">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="ItemNameLabel" runat="server" Text='<%#Eval("StockItemName") %>'
                                                                                meta:resourcekey="ItemNameLabelResource2"></asp:Label>
                                                                        </ItemTemplate>
                                                                        <HeaderStyle Width="15%" />
                                                                        <ItemStyle Width="15%" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="UOM" meta:resourcekey="TemplateFieldResource3" HeaderStyle-HorizontalAlign="Left">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="UNITLabel" runat="server" Text='<%#Eval("UOM") %>'
                                                                                meta:resourcekey="ItemNameLabelResource2"></asp:Label>
                                                                        </ItemTemplate>
                                                                        <HeaderStyle Width="10%" />
                                                                        <ItemStyle Width="10%" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Batch" meta:resourcekey="TemplateFieldResource3" HeaderStyle-HorizontalAlign="Left">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="BatchNameLabel" runat="server" Text='<%#Eval("BatchName") %>'
                                                                                meta:resourcekey="ItemNameLabelResource2"></asp:Label>
                                                                        </ItemTemplate>
                                                                        <EditItemTemplate>
                                                                            <asp:TextBox ID="BatchNameTextBox" runat="server" Text='<%#Eval("BatchName") %>'></asp:TextBox>
                                                                        </EditItemTemplate>
                                                                        <HeaderStyle Width="13%" />
                                                                        <ItemStyle Width="13%" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Expiry Date">
                                                                        <ItemTemplate>
                                                                            <asp:PlaceHolder ID="pclExpiry" runat="server" Visible='<%#Convert.ToString(Eval("ExpiryDate","{0:dd/MM/yyyy}").ToString()) != "01-01-1900" ? true : false%>'>
                                                                                <asp:Label ID="ExpiryDateLabel" runat="server" Text='<%#Eval("ExpiryDate","{0:dd/MM/yyyy}") %>'
                                                                                    meta:resourcekey="ExpiryDateLabelResource1"></asp:Label>
                                                                            </asp:PlaceHolder>
                                                                        </ItemTemplate>
                                                                        <EditItemTemplate>
                                                                            <asp:PlaceHolder ID="pclExpiry" runat="server" Visible='<%#Convert.ToString(Eval("ExpiryDate","{0:dd/MM/yyyy}").ToString()) != "01-01-1900" ? true : false%>'>
                                                                                <DPC:DatePickerControl DisplayDatePicker="true" Width="100px" ID="DatePickerControl1" Text='<%#Eval("ExpiryDate","{0:dd/MM/yyyy}") %>'
                                                                                    runat="Server"></DPC:DatePickerControl>
                                                                            </asp:PlaceHolder>
                                                                        </EditItemTemplate>
                                                                        <HeaderStyle Width="13%" />
                                                                        <ItemStyle Width="13%" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Quantity" meta:resourcekey="TemplateFieldResource4">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="QuantityLinkButton" runat="server" Text='<%#Eval("Quantity") %>' OnClick="QuantityLinkButton_Click"></asp:Label>

                                                                        </ItemTemplate>
                                                                        <HeaderStyle HorizontalAlign="Right" Width="9%" />
                                                                        <ItemStyle HorizontalAlign="Right" Width="9%" />
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField>

                                                                        <ItemTemplate>

                                                                            <asp:Button ID="ButtonEdit" runat="server" CommandName="Edit" Text="&#xf044; Edit" CssClass="btn btn-edit fas"/>
                                                                        </ItemTemplate>
                                                                        <EditItemTemplate>

                                                                            <asp:Button ID="ButtonUpdate" runat="server" CommandName="Update" Text="&#xf021; Update" CssClass="fas btn btn-update" />
                                                                            <asp:Button ID="ButtonCancel" runat="server" CommandName="Cancel" Text="&#xf00d; Cancel" CssClass="fas btn btn-cancel" />
                                                                        </EditItemTemplate>
                                                                        <HeaderStyle HorizontalAlign="Right" Width="15%" />
                                                                        <ItemStyle HorizontalAlign="Center" Width="15%" />
                                                                    </asp:TemplateField>

                                                                </Columns>
                                                                <PagerSettings Visible="False" />
                                                            </asp:GridView>
                                                        </div>
                                                        <%-- <div class="spacer">
                                    <asp:Image ID="Image3" runat="server" ImageUrl="~/Images/spacer.gif" 
                                        meta:resourcekey="Image3Resource1" />
                                </div>--%>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </div>
                        </div>
                        <asp:HiddenField ID="TaxGroupIdHiddenField" runat="server" />
                        <%--   <div class="spacer">
                                    <asp:Image ID="Image4" runat="server" ImageUrl="~/Images/spacer.gif"
                                        meta:resourcekey="Image4Resource1" />
                                </div>--%>
                    </div>
                </div>

            </div>
            <%--    <div class="spacer">
                <img src="../../../Images/spacer.gif" />
            </div>--%>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--<script data-main="../../../JavaScript/rjs/encrypt/stock-item-master-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/stock-item-master")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>    
</asp:Content>
