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

<%@ 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/AutoComplete/AutoCompleteControl.ascx" TagName="AutoCompleteControl"
    TagPrefix="acc" %>
<%@ Register Src="~/UserControls/Common/CommonSearch/CommonSearch.ascx" TagName="CommonSearchUserControl"
TagPrefix="Common" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="ResonMasterUpdatePanel" runat="server">
        <ContentTemplate>
        <Common:CommonSearchUserControl ID="CommonSearchControl" runat ="server" Visible="false"/>
            <!-- Sub Container Box1 Start -->
            <div class="himssuHeader2WireBox">
                <div class="himsBoxHeader">
                   <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">
                                <asp:Label ID="Label3" runat="server" Text="Stock Audit Search" 
                                    meta:resourcekey="Label3Resource1"></asp:Label>
                                <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">
                    <asp:Panel ID="DetailPanel" runat="server" 
                        meta:resourcekey="DetailPanelResource1">
                        <div class="contentHolder">
                        <table cellpadding="0" cellspacing="0" style="width: 0%!important;">
                            <tr>
                                <td class="formLabel">
                                    <asp:Label ID="StockAuditNoLabel" runat="server" Text="Stock Audit No." 
                                        meta:resourcekey="StockAuditNoLabelResource1"></asp:Label>
                                </td>
                                <td>
                                    <acc:AutoCompleteControl ID="StockAuditNoAutoCompleteControl" runat="server" MinimumPrefixLength="2"
                                        Width="115px" ContextKey="Procurement.StockAuditNumber" 
                                        AutoPostBack="true" DisplayLoadingStatus="true"
                                        FirstRowSelected="false" MaxLength="20" ValidateOnTextChanged="false" 
                                        OnTextChanged="StockAuditNoAutoCompleteControl_TextChanged" />
                                    <asp:ImageButton ID="StockAuditNoSearchImageButton" ToolTip="Stock Audit No. Search"
                                        SkinID="FindImage" OnClick="StockAuditNoSearchImageButton_Click" 
                                        runat="server" meta:resourcekey="StockAuditNoSearchImageButtonResource1" />
                                </td>
                                <td class="formLabel pLeft40">
                                    <asp:Label ID="LocationLabel" runat="server" Text="Location" 
                                        SkinID="MandatoryLabel" meta:resourcekey="LocationLabelResource1"></asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="LocationDropDownList" runat="server" SkinID="CustomWidthDropDownList"
                                        Width="120px" onmouseleave="showHideTooltip()" 
                                        onmouseenter="showHideTooltip()" 
                                        meta:resourcekey="LocationDropDownListResource1">
                                    </asp:DropDownList>
                                    <asp:HiddenField ID="IdHiddenField" runat="server" />
                                </td>
                                <td class="formLabel pLeft40">
                                    <asp:Label ID="ItemMainCategoryLabel" runat="server" Text="Item Main Category" 
                                        meta:resourcekey="ItemMainCategoryLabelResource1"></asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ItemMainCategoryDropDownList" runat="server" SkinID="CustomWidthDropDownList"
                                        AutoPostBack="True" Width="120px" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                        OnSelectedIndexChanged="ItemMainCategoryDropDownList_SelectedIndexChanged" 
                                        meta:resourcekey="ItemMainCategoryDropDownListResource1">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="spacer">
                                        <asp:Image ID="Image3" runat="server" ImageUrl="~/Images/spacer.gif" 
                                            meta:resourcekey="Image3Resource1" />
                                     </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="formLabel">
                                    <asp:Label ID="SubCategoryLabel" runat="server" Text="Sub Category" 
                                        meta:resourcekey="SubCategoryLabelResource1"></asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="SubCategoryDropDownList" runat="server" SkinID="CustomWidthDropDownList"
                                        Width="120px" onmouseleave="showHideTooltip()" 
                                        onmouseenter="showHideTooltip()" 
                                        meta:resourcekey="SubCategoryDropDownListResource1">
                                    </asp:DropDownList>
                                </td>
                                <td class="formLabel pLeft40">
                                    <asp:Label ID="ItemLabel" runat="server" Text="Item" 
                                        meta:resourcekey="ItemLabelResource1"></asp:Label>
                                </td>
                                <td>
                                    <acc:AutoCompleteControl ID="ItemAutoCompleteControl" runat="server" MinimumPrefixLength="2"
                                        Width="115px" FirstRowSelected="true" ContextKey="Common.ItemTitleAll" AutoPostBack="true"
                                        DisplayLoadingStatus="true" MaxLength="20" ValidateOnTextChanged="true" />
                                    <asp:ImageButton ID="ItemSearchImageButton" ToolTip="Item Code Search" SkinID="FindImage"
                                        OnClick="ItemSearchImageButton_Click" runat="server" 
                                        meta:resourcekey="ItemSearchImageButtonResource1" />
                                </td>
                                <td class="formLabel pLeft40">
                                    <asp:Button ID="RetrieveButton" Text="Retrieve" runat="server" SkinID="CustomWidthButton"
                                        Width="100px" OnClick="RetrieveButton_Click" 
                                        meta:resourcekey="RetrieveButtonResource1" />
                                </td>
                                <td class="formLabel pLeft10">
                                    <asp:Button ID="RetrievePrintButton" Text="Retrieve & Print" runat="server" SkinID="CustomWidthButton"
                                        Width="110px" OnClick="RetrievePrintButton_Click" 
                                        meta:resourcekey="RetrievePrintButtonResource1" />
                                </td>
                            </tr>
                        </table>
                    </div>
                    </asp:Panel>
                </div>
                <!-- Sub Container Box1 Ends -->
                <!-- Sub Container Box2 Start -->
                <div id="StockAuditRetrieveGridViewDiv" class="himssuHeader1WireBox" runat="server" style="width: 100%; margin-right: 5px;">
                    <!--StockAuditRetrieveGridView starts-->
                    <div id="StockAuditRetrieveDiv" class="himssuHeader1WireBox" runat="server" style="width: 100%;
                        margin-right: 5px;">
                        <div id="StockAuditDiv" runat="server">
                            <div class="spacer">
                                <asp:Image ID="Image14" runat="server" ImageUrl="~/Images/spacer.gif" 
                                    meta:resourcekey="Image14Resource1" />
                            </div>
                            <div id="BillingListDiv" runat="server">
                                <div class="himssuHeader1WireBox cBoth">
                                    <div class="himsBoxHeader">
                                        <div class="leftdiv">
                                        </div>
                                        <div class="himsBoxTitle">
                                            <div class="headerText" id="Div4">
                                                <asp:Label ID="OutstandingBillLabel" runat="server" Text="Details" 
                                                    meta:resourcekey="OutstandingBillLabelResource1"></asp:Label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="himsBoxContent">
                                        <!--Grid starts-->
                                        <asp:UpdatePanel ID="PatientBillUpdatePanel" runat="server" UpdateMode="Conditional">
                                            <ContentTemplate>
                                                <div id="DivHeader" style="vertical-align: top; width: 100%;">
                                                    <asp:Table ID="PatientBillGridViewTable" runat="server" CellPadding="0" CellSpacing="0" 
                                                        BackColor="#E8E8E8" ForeColor="Black" Width="100%" GridLines="Both" 
                                                        CssClass="GridViewTableRow" 
                                                        meta:resourcekey="PatientBillGridViewTableResource1">
                                                    </asp:Table>
                                                </div>
                                                <div id="DivData" class="Container" style="vertical-align: top; width: 99.6%;">
                                                    <asp:GridView ID="StockAuditDetailGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                                        OnRowDataBound="StockAuditDetailGridView_RowDataBound" 
                                                        OnPageIndexChanging="StockAuditDetailGridView_PageIndexChanging" 
                                                        OnDataBinding="StockAuditDetailGridView_DataBinding" OnDataBound="StockAuditDetailGridView_DataBound"
                                                        ShowHeader="False" DataKeyNames="Id,StockItemId" 
                                                        EmptyDataText="No Records Found" 
                                                        meta:resourcekey="StockAuditDetailGridViewResource1">
                                                        <Columns>
                                                            <asp:TemplateField Visible="False" meta:resourcekey="TemplateFieldResource1">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="StockItemIdLabel" runat="server" Text='<%# Bind("StockItemId") %>'
                                                                        Visible="False" meta:resourcekey="StockItemIdLabelResource1"></asp:Label>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Item Code" 
                                                                meta:resourcekey="TemplateFieldResource2">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="ItemCodeLabel" runat="server" Text='<%# Bind("ItemCode") %>' 
                                                                        meta:resourcekey="ItemCodeLabelResource1"></asp:Label>
                                                                </ItemTemplate>
                                                                <HeaderStyle Width="30%" />
                                                                <ItemStyle Width="30%" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Name" meta:resourcekey="TemplateFieldResource3">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="ItemNameLabel" runat="server" Text='<%# Bind("ItemName") %>' 
                                                                        meta:resourcekey="ItemNameLabelResource1"></asp:Label>
                                                                </ItemTemplate>
                                                                <HeaderStyle Width="40%" />
                                                                <ItemStyle Width="40%" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="System Quantity" 
                                                                meta:resourcekey="TemplateFieldResource4">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="SystemQuantityLabel" runat="server" 
                                                                        Text='<%# Bind("SQuantity") %>' meta:resourcekey="SystemQuantityLabelResource1"></asp:Label>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Right" Width="15%" />
                                                                <ItemStyle HorizontalAlign="Right" Width="15%" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Physical Quantity" 
                                                                meta:resourcekey="TemplateFieldResource5">
                                                                <ItemTemplate>
                                                                    <asp:TextBox ID="PhysicalQuantityTextBoxGrid" runat="server" Text="0.00"
                                                                        Width="200px" MaxLength="13" onblur="javascript:return fnValidateDecimal(this,10,2)"
                                                                        onKeypress="javascript:return MaskDecimal(event,10,2)" ToolTip="Max value: 9999999999.99"
                                                                        Style="text-align: right;" AutoPostBack="True" 
                                                                        OnTextChanged="PhysicalQuantityTextBoxGrid_TextChanged" 
                                                                        meta:resourcekey="PhysicalQuantityTextBoxGridResource1"></asp:TextBox>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Center" Width="15%" />
                                                                <ItemStyle HorizontalAlign="Center" Width="15%" />
                                                            </asp:TemplateField>
                                                        </Columns>
                                                        <PagerSettings Visible="False" />
                                                    </asp:GridView>
                                                </div>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                        <!--Grid Ends-->
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--StockAuditRetrieveGridView Ends-->
                    <!--StockAuditNoSearchGridView starts-->
                    <div id="StockAuditNoDiv" class="himssuHeader1WireBox" runat="server" style="width: 100%;
                        margin-right: 5px;">
                        <div id="StockAuditNoDiv2" runat="server">
                            <div class="spacer">
                                <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/spacer.gif" 
                                    meta:resourcekey="Image1Resource1" />
                            </div>
                            <div class="himsBoxHeader" id="Div3" runat="server">
                                <div class="leftdiv">
                                </div>
                                <div class="himsBoxTitle" style="width: 99%">
                                    <div class="headerText">
                                        <div class="fLeft">
                                            <asp:Label ID="ListLabel" Text="List" runat="server" Font-Bold="True" 
                                                meta:resourcekey="ListLabelResource1" />
                                        </div>
                                    </div>
                                    <div align="right" class="fRight" style="margin-top: -3px;">
                                        <uc1:GridViewPager ID="StockAuditListGridView_GridViewPager" runat="server" OnFirstRecordClick="StockAuditListGridView_GridViewPager_FirstRecordClick"
                                            OnLastRecordClick="StockAuditListGridView_GridViewPager_LastRecordClick" OnNextRecordClick="StockAuditListGridView_GridViewPager_NextRecordClick"
                                            OnPrevRecordClick="StockAuditListGridView_GridViewPager_PrevRecordClick" OnTextBoxValueChange="StockAuditListGridView_GridViewPager_TextBoxValueChange"
                                            ParentGridView="StockAuditListGridView" />
                                    </div>
                                </div>
                            </div>
                            <div class="himsBoxContent">
                                <div class="himsBoxContentMsg" id="StockAuditGridMessageDiv" runat="server" 
                                    visible="False">
                                </div>
                                <asp:GridView ID="StockAuditListGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                    OnRowDataBound="StockAuditListGridView_RowDataBound" OnPageIndexChanging="StockAuditListGridView_PageIndexChanging"
                                    AllowPaging="True" PageSize="5" OnDataBinding="StockAuditListGridView_DataBinding"
                                    DataKeyNames="Id" EmptyDataText="No Records Found" 
                                    meta:resourcekey="StockAuditListGridViewResource1">
                                    <Columns>
                                        <asp:TemplateField HeaderText="StockItemId" SortExpression="StockItemId" 
                                            Visible="False" meta:resourcekey="TemplateFieldResource6">
                                            <ItemTemplate>
                                                <asp:Label ID="StockItemIdLabel" runat="server" 
                                                    Text='<%# Bind("StockAuditId") %>' meta:resourcekey="StockItemIdLabelResource2"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Name" meta:resourcekey="TemplateFieldResource7">
                                            <ItemTemplate>
                                                <asp:Label ID="NameLabel" runat="server" Text='<%# Bind("ItemName") %>' 
                                                    meta:resourcekey="NameLabelResource2"></asp:Label>
                                            </ItemTemplate>
                                            <HeaderStyle Width="30%" />
                                            <ItemStyle Width="30%" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Location" 
                                            meta:resourcekey="TemplateFieldResource8">
                                            <ItemTemplate>
                                                <asp:Label ID="LocationLabel" runat="server" 
                                                    Text='<%# Bind("StoreLocation") %>' meta:resourcekey="LocationLabelResource2"></asp:Label>
                                            </ItemTemplate>
                                            <HeaderStyle Width="30%" />
                                            <ItemStyle Width="30%" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="System Quantity" 
                                            meta:resourcekey="TemplateFieldResource9">
                                            <ItemTemplate>
                                                <asp:Label ID="SystemQuantityLabel" runat="server" 
                                                    Text='<%# Bind("SQuantity") %>' meta:resourcekey="SystemQuantityLabelResource2"></asp:Label>
                                            </ItemTemplate>
                                            <HeaderStyle HorizontalAlign="Right" Width="20%" />
                                            <ItemStyle HorizontalAlign="Right" Width="20%" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Physical Quantity" 
                                            meta:resourcekey="TemplateFieldResource10">
                                            <ItemTemplate>
                                                <asp:Label ID="PhysicalQuantityLabel" runat="server" 
                                                    Text='<%# Bind("PQuantity") %>' 
                                                    meta:resourcekey="PhysicalQuantityLabelResource1"></asp:Label>
                                            </ItemTemplate>
                                            <HeaderStyle HorizontalAlign="Right" Width="20%" />
                                            <ItemStyle HorizontalAlign="Right" Width="20%" />
                                        </asp:TemplateField>
                                    </Columns>
                                    <PagerSettings Visible="False" />
                                </asp:GridView>
                            </div>
                        </div>
                    </div>
                    <!--StockAuditNoSearchGrid Ends-->
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--<script data-main="../../../JavaScript/rjs/encrypt/stock-audit-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/stock-audit")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>    
</asp:Content>