<%@ Page Title="ItemSale Report" Language="C#" MasterPageFile="~/SunMaster.Master"
    EnableEventValidation="false" AutoEventWireup="true" CodeBehind="ItemSale.aspx.cs"
    Inherits="SUNWEB.ItemSale" %>

<%@ Register Assembly="AjaxControlToolkit" TagPrefix="asp" Namespace="AjaxControlToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <%--Newly AddedCode : --%>
    <link rel="stylesheet" href="../assets/vendor/bootstrap/css/bootstrap.min.css">
    <link href="../assets/vendor/fonts/circular-std/style.css" rel="stylesheet">
    <link rel="stylesheet" href="../assets/libs/css/style.css">
    <link rel="stylesheet" href="../assets/vendor/fonts/fontawesome/css/fontawesome-all.css">
    <link rel="stylesheet" type="text/css" href="../assets/vendor/datatables/css/dataTables.bootstrap4.css">
    <link rel="stylesheet" type="text/css" href="../assets/vendor/datatables/css/buttons.bootstrap4.css">
    <link rel="stylesheet" type="text/css" href="../assets/vendor/datatables/css/select.bootstrap4.css">
    <link rel="stylesheet" type="text/css" href="../assets/vendor/datatables/css/fixedHeader.bootstrap4.css">
    <link type="text/css" rel="Stylesheet" href="css/style.css" />
    <%--<script type="text/javascript">
    function showProgress() 
    {
        var updateProgress = $get("<%= UpdateProgress.ClientID %>");
        updateProgress.style.display = "block";
    }
    </script>--%>
    <script type="text/javascript">
        $("[src*=plus]").live("click", function () {
            $(this).closest("tr").after("<tr><td></td><td colspan = '999'>" + $(this).next().html() + "</td></tr>")
            $(this).attr("src", "IMG/minus.gif");
        });
        $("[src*=minus]").live("click", function () {
            $(this).attr("src", "IMG/plus.gif");
            $(this).closest("tr").next().remove();
        });
    </script>
    <script type="text/javascript">
        function switchViews(obj, row) {
            var div = document.getElementById(obj);
            var img = document.getElementById('img' + obj);

            if (div.style.display == "none") {
                div.style.display = "inline";
                img.src = "IMG/minus.gif";
            } else {
                div.style.display = "none";
                img.src = "IMG/plus.gif";
            }
        }

        function CheckOne(obj)
        {
            var grid = obj.parentNode.parentNode.parentNode;
            var inputs = grid.getElementsByTagName("input");
            for (var i = 0; i < inputs.length; i++) {
                if (inputs[i].type == "checkbox") {
                    if (obj.checked && inputs[i] != obj && inputs[i].checked) {
                        inputs[i].checked = false;
                    }
                }
            }
        }

        function myFunction() {

            //                    var x = document.getElementById('DivID');
            //                    if (x.style.display === "none") {
            //                        alert("1");
            //                        x.style.display = "block";
            //                    } else {
            //                        alert("2");
            //                        x.style.display = "none";
            //                    }

        }

       
 

    </script>
    <%--This is for Lable Responsive --%>
    <style type="text/css">
        @media only screen and (max-width: 600px)
        {
            table, th, td
            {
                font-size: 10px;
                font-weight: bold;
            }
        
            .Labels
            {
                font-size: 10px;
            }
            .alnright
            {
                text-align: right;
            }
        
        }
        
        .gridview
        {
            background-color: #fff;
            padding: 2px;
            margin: 1% auto;
        }
        
        .SectionCSS
        {
          background-color: #4c4c4c;
          color: White;
        }
    </style>
    <style type="text/css">
        .overlay
        {
            position: fixed;
            top: 0px;
            left: 0px;
            z-index: 0;
            height: 100%;
            width: 100%;
            top: 0;
            background-color: White;
            filter: alpha(opacity=60);
            opacity: 0.9;
            -moz-opacity: 1;
        }
        
        .LoadingDivCss
        {
            margin: 0;
            position: absolute;
            top: 50%;
            left: 50%;
            margin-right: -50%;
            transform: translate(-50%, -50%);
        }
        
        .LoadingImgCss
        {
            height: 100px;
            width: 100px;
        }
    </style>
    <script type="text/javascript">
        function showProgress() {
            var updateProgress = $get("<%= UpdateProgress.ClientID %>");
            updateProgress.style.display = "block";
        }
    
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <%--<div style="padding-left: 15px;">
        <div class="row">
            <div class="column" style="text-align: center; padding-left: 0px">
                <asp:Button ID="btnExcel" runat="server" CssClass="btn btn-success btn-xs" Visible="true"
                    OnClick="btnExcel_Click" Text="Product Sales Report" BackColor="green" BorderColor="green"
                    ToolTip="Export Product Sales Report" />
                <div>
                </div>
            </div>
            &nbsp; &nbsp; &nbsp;
            <div class="column" style="text-align: center;">
                <asp:Button ID="btnExcel2" runat="server" Text="Product Sales Detailed Report" CssClass="btn btn-primary btn-xs"
                    Visible="true" OnClick="btnExcel2_Click" ToolTip="Export Product Sales Detailed Report" BackColor="Green" />
                <div>
                </div>
            </div>
            &nbsp; &nbsp; &nbsp;
            <div class="column" style="text-align: center;">
                <asp:Button ID="btnExcel3" runat="server" Text="Product Sales with Condiments" CssClass="btn btn-primary btn-xs"
                    Visible="true" OnClick="btnExcel3_Click" ToolTip="Export Product Sales with Condiments" BackColor="Green" />
                <div>
                </div>
            </div>
            &nbsp; &nbsp; &nbsp;
              <div class="column" style="text-align: center; display:none">
                <asp:Button ID="btnMonthlycondiment" runat="server" Text="Monthly Condiments Report" CssClass="btn btn-primary btn-xs"
                    Visible="true" OnClick="btnMonthlycondiment_Click" ToolTip="Export Monthly Condiments Reports" BackColor="Green" />
                <div>
                </div>
            </div>
        </div>
    </div>--%>

  <div class="row">
    <div class="d-flex flex-wrap align-items-center gap-2 px-3">
    <asp:Button ID="btnExcel" runat="server" CssClass="btn btn-success btn-xs"
        OnClick="btnExcel_Click" Text="Product Sales Report" ToolTip="Export Product Sales Report" />

    <asp:Button ID="btnExcel2" runat="server" CssClass="btn btn-success btn-xs"
        OnClick="btnExcel2_Click" Text="Product Sales Detailed Report" ToolTip="Export Product Sales Detailed Report" />

    <asp:Button ID="btnExcel3" runat="server" CssClass="btn btn-success btn-xs"
        OnClick="btnExcel3_Click" Text="Product Sales with Condiments" ToolTip="Export Product Sales with Condiments" />

    <asp:Button ID="btnMonthlycondiment" runat="server" CssClass="btn btn-success btn-xs"
        OnClick="btnMonthlycondiment_Click" Text="Monthly Condiments Report" ToolTip="Export Monthly Condiments Reports"
        Style="display: none;" />
   </div>
 </div>

    <asp:UpdatePanel runat="server" ID="updatepanel1" UpdateMode="Conditional">
        <ContentTemplate>
            
            <div class="section-block">
                <h7 class="section-title">
                 PRODUCT SALES REPORT
                </h7>
            </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">
                                    <caption>
                                        <label for="validationCustom03">
                                            From
                                        </label>
                                        <asp:TextBox ID="txtStartDt" class="form-control" runat="server"></asp:TextBox>
                                        <asp:CalendarExtender ID="calFirstDueDate" Format="yyyy-MM-dd" runat="server" TargetControlID="txtStartDt"
                                            PopupPosition="BottomLeft" FirstDayOfWeek="Sunday"></asp:CalendarExtender>
                                    </caption>
                                </div>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <label for="validationCustom03">
                                        To
                                    </label>
                                    <asp:TextBox ID="txtEndDt" class="form-control" runat="server"></asp:TextBox>
                                    <asp:CalendarExtender ID="CalendarExtender1" Format="yyyy-MM-dd" runat="server" TargetControlID="txtEndDt"
                                        PopupPosition="BottomLeft" FirstDayOfWeek="Sunday"></asp:CalendarExtender>
                                </div>
                                <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"></asp:Label></label>
                                    <asp:DropDownList ID="cmbBranches" CssClass="custom-select" runat="server" AutoPostBack="true"
                                        OnSelectedIndexChanged="cmbBranches_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </div>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <caption>
                                        <label for="validationCustom03">
                                            Select By:
                                        </label>
                                        <asp:DropDownList ID="cmbSelectby" runat="server" CssClass="custom-select" OnSelectedIndexChanged="cmbSelectby_SelectedIndexChanged"
                                            AutoPostBack="true">
                                            <asp:ListItem Text="All Inventory" Value="AInventory"></asp:ListItem>
                                            <asp:ListItem Text="Category" Value="Category"></asp:ListItem>
                                            <asp:ListItem Text="Single Inventory" Value="SInventory"></asp:ListItem>
                                            <asp:ListItem Text="Customer" Value="Customer"></asp:ListItem>
                                            <asp:ListItem Text="Group 1" Value="Group1"></asp:ListItem>
                                            <asp:ListItem Text="Group 2" Value="Group2"></asp:ListItem>
                                            <asp:ListItem Text="Group 3" Value="Group3"></asp:ListItem>
                                            <asp:ListItem Text="Group 4" Value="Group4"></asp:ListItem>
                                            <asp:ListItem Text="Group 5" Value="Group5"></asp:ListItem>
                                        </asp:DropDownList>
                                    </caption>
                                </div>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <label for="validationCustom03" style="font-color: white">
                                        Number
                                    </label>
                                    <asp:TextBox ID="txtID" class="form-control" runat="server" ReadOnly="false" OnTextChanged="txtID_OnTextChange"></asp:TextBox>
                                </div>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <label for="validationCustom03">
                                        Name</label>
                                    <asp:TextBox ID="txtName" class="form-control" runat="server" ReadOnly="false" OnTextChanged="txtName_OnTextChange"></asp:TextBox>
                                </div>
                                <%--  <div id="DivID">
                                    <div>
                                        test
                                    </div> 
                                </div>--%>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <asp:Button ID="btnApplySearch" runat="server" Text="Update" CssClass="btn btn-primary"
                                        OnClick="btnApplySearch_Click" />
                                </div>
                                <%-- <asp:Button ID="Button1" runat="server" Text="Button" />--%>
                                <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                                    <div class="card">
                                        <h5 class="card-header" id="idSearch" runat="server">
                                            <asp:Label ID="lblSearchResult" runat="server" CssClass="Labels"> </asp:Label>
                                            <%--This Code for Image validation   Msg --%>
                                        </h5>
                                        <%-- <div class="card-header">
                                            <div>
                                                <asp:Label ID="lblSearchResult" runat="server" CssClass="Labels"> </asp:Label>
                                            </div>
                                        </div>--%>
                                        <div class="card-body">
                                            <div class="table-responsive">
                                                <table id="example" class="table table-striped table-bordered second" style="width: 100%">
                                                    <tbody>
                                                        <caption>
                                                            <asp:Panel ID="Panel8" runat="server" BackColor="white" Height="180px" ScrollBars="Auto"
                                                                Width="1500px">
                                                                <asp:GridView ID="grv" runat="server" AutoGenerateColumns="False" EmptyDataRowStyle-CssClass="alert-dark"
                                                                    Font-Size="11px" HeaderStyle-BackColor="RoyalBlue" EmptyDataText="No Record! "
                                                                    DataKeyNames="row1" FooterStyle-BackColor="Green" FooterStyle-ForeColor="white"
                                                                    Width="920px" AllowPaging="true" PageSize="150" BackColor="White" AllowSorting="true"
                                                                    BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3">
                                                                    <Columns>
                                                                        <asp:TemplateField>
                                                                            <ItemTemplate>
                                                                                <asp:CheckBox ID="chkSelect" runat="server" onclick="CheckOne(this)" OnCheckedChanged="CheckBox_Changed"
                                                                                    AutoPostBack="true" />
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderText="Number" ItemStyle-HorizontalAlign="Left" Visible="true">
                                                                            <ItemTemplate>
                                                                                <asp:Label ID="lblrow1" runat="server" Text='<%#Eval("row1") %>'></asp:Label>
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderText="Name" ItemStyle-HorizontalAlign="Left">
                                                                            <ItemTemplate>
                                                                                <asp:Label ID="lblrow2" runat="server" Text='<%#Eval("row2") %>'></asp:Label>
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Left">
                                                                            <ItemTemplate>
                                                                                <asp:Label ID="lblrow3" runat="server" Text='<%#Eval("row3") %>'></asp:Label>
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                    </Columns>
                                                                    <PagerStyle CssClass="gridview"></PagerStyle>
                                                                    <FooterStyle BackColor="#006699" ForeColor="White"></FooterStyle>
                                                                    <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black"></HeaderStyle>
                                                                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                                                    <RowStyle ForeColor="#000066" />
                                                                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                                                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                                                    <SortedAscendingHeaderStyle BackColor="#007DBB" />
                                                                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                                                    <SortedDescendingHeaderStyle BackColor="#00547E" />
                                                                </asp:GridView>
                                                            </asp:Panel>
                                                        </caption>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                    <asp:Button ID="btnGetReports" runat="server" Text="Generate Report" CssClass="btn btn-primary"
                                         OnClick="btnGetReports_Click" />
                                </div>
                                <div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div>
                <h4>
                    &nbsp;<asp:Label ID="lblGreeting" runat="server"></asp:Label></h4>
            </div>
            <div class="card-header" >
                <%--  <div>
                        <asp:Label ID="lblMsgTotalSelection" runat="server" CssClass="Labels"> </asp:Label>
                </div>--%>
                <div>
                <h5 class="card-header" id="idGenReport" runat="server">
                    <asp:Label ID="lblReportSearchResult" runat="server" CssClass="Labels"> </asp:Label>
                      <asp:Label ID="lblMsgTotalSelection" runat="server" > </asp:Label>
                    <%--This Code for Image validation   Msg --%>
                </h5>

                <div class="card-body">
                    <div class="table-responsive">
                        <div align="center" style="overflow-x: scroll; width: 100%">
                            <table id="example4" class="table table-striped table-bordered" style="width: 100%">
                                <tbody>
                                    <caption>
                                        <asp:GridView ID="gvProductsale" runat="server" ShowFooter="true" BorderColor="Transparent"
                                            DataKeyNames="CategoryNo" AutoGenerateColumns="false" Font-Size="14px" OnRowDataBound="gvProductsale_RowDataBound"
                                            Width="100%" AllowPaging="True" PageSize="20" EmptyDataText="No Record  ! " OnPageIndexChanging="gvProductsale_PageIndexChanging">
                                            <HeaderStyle CssClass="dataTable" />
                                            <HeaderStyle BackColor="White" ForeColor="Black" />
                                            <FooterStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                                            <RowStyle CssClass="dataTable" />
                                            <Columns>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <a href="javascript:switchViews('div<%# Eval("CategoryNo") %>', 'one');">
                                                            <img id="imgdiv<%# Eval("CategoryNo") %>" alt="Click to show/hide Details" border="0"
                                                                src="IMG/plus.gif" />
                                                        </a>
                                                    </ItemTemplate>
                                                    <AlternatingItemTemplate>
                                                        <a href="javascript:switchViews('div<%# Eval("CategoryNo") %>', 'alt');">
                                                            <img id="imgdiv<%# Eval("CategoryNo") %>" alt="Click to show/hide Details" border="0"
                                                                src="IMG/plus.gif" />
                                                        </a>
                                                    </AlternatingItemTemplate>
                                                </asp:TemplateField>
                                                <%-- <asp:BoundField DataField="CategoryNumber" HeaderText="Number" HeaderStyle-HorizontalAlign="Left"
                                                    HtmlEncode="False" ItemStyle-HorizontalAlign="left" ItemStyle-Width="150px" FooterText="Grand Total:"
                                                    FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="left" />--%>
                                                <asp:TemplateField HeaderText="Name">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblCategoryName" runat="server" Text='<%#Eval("CategoryName") %>'
                                                            Width="90px"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="PriceType" HeaderText="Price Type" HeaderStyle-HorizontalAlign="Center"
                                                    HeaderStyle-CssClass="text-center" HtmlEncode="False" ItemStyle-HorizontalAlign="Right"
                                                    ItemStyle-Width="150px" FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="Right" />
                                                <asp:BoundField DataField="space1" HeaderText="Price" HeaderStyle-HorizontalAlign="Right"
                                                    HeaderStyle-CssClass="text-center" HtmlEncode="False" ItemStyle-HorizontalAlign="Right"
                                                    ItemStyle-Width="150px" FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="Right" />
                                                <asp:BoundField DataField="space2" HeaderText="Price(Avg)" HeaderStyle-HorizontalAlign="Right"
                                                    HeaderStyle-CssClass="text-center" HtmlEncode="False" ItemStyle-HorizontalAlign="Right"
                                                    ItemStyle-Width="150px" FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="Right" />
                                                <asp:TemplateField HeaderText="QTY" HeaderStyle-CssClass="text-center" ItemStyle-CssClass="text-center">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblQTY" runat="server" Text='<%#Eval("Qty") %>' Width="45px"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Gross Amt" HeaderStyle-CssClass="text-center" ItemStyle-CssClass="text-right">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblGrossAmt" runat="server" Text='<%# string.Format("{0:n2}", Eval("GrossAmt"))%>'
                                                            Width="45px"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="FOC Amt" HeaderStyle-CssClass="text-center" ItemStyle-CssClass="text-right">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblFOC" runat="server" Text='<%# string.Format("{0:n2}", Eval("FOCAMT"))%>'
                                                            Width="37px"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Item Disc" HeaderStyle-CssClass="text-center" ItemStyle-CssClass="text-right">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblItemDisc" runat="server" Text='<%# string.Format("{0:n2}", Eval("ManualDisc"))%>'
                                                            Width="37px"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Total Disc" HeaderStyle-CssClass="text-center" ItemStyle-CssClass="text-right">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblTotalDisc" runat="server" Text='<%# string.Format("{0:n2}", Eval("TotalDisc"))%>'
                                                            Width="40px"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Promo Disc" HeaderStyle-CssClass="text-center" ItemStyle-CssClass="text-right">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblPromoDisc" runat="server" Text='<%# string.Format("{0:n2}", Eval("ActualPSDiscAmount"))%>'
                                                            Width="50px"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Member Disc" HeaderStyle-CssClass="text-center" ItemStyle-CssClass="text-right">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblMemberDisc" runat="server" Text='<%# string.Format("{0:n2}", Eval("TotalMemberDisc"))%>'
                                                            Width="55px"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Disc Amt" HeaderStyle-CssClass="text-center" ItemStyle-CssClass="text-right">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblDiscAmt" runat="server" Text='<%# string.Format("{0:n2}", Eval("DiscAmt"))%>'
                                                            Width="43px"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Disc QTY" HeaderStyle-CssClass="text-center" ItemStyle-CssClass="text-right">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblDiscQty" runat="server" Text='<%# string.Format("{0:n2}", Eval("DiscQty"))%>'
                                                            Width="35px"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Sales Amt" HeaderStyle-CssClass="text-center" ItemStyle-CssClass="text-right">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblSalesAmt" runat="server" Text='<%# string.Format("{0:n2}", Eval("SalesAmt"))%>'
                                                            Width="43px"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="GST" HeaderText="GST" HtmlEncode="False" ItemStyle-HorizontalAlign="Right"
                                                    HeaderStyle-CssClass="text-center" ItemStyle-Width="75px" FooterStyle-Font-Bold="false"
                                                    FooterStyle-HorizontalAlign="Right" DataFormatString="{0:F2}" />
                                                <asp:BoundField DataField="TaxableAmount" HeaderText="Taxable Amt" HtmlEncode="False"
                                                    ItemStyle-HorizontalAlign="Right" HeaderStyle-CssClass="text-center" ItemStyle-Width="100px"
                                                    FooterStyle-Font-Bold="false" FooterStyle-HorizontalAlign="Right" DataFormatString="{0:F2}" />
                                                <asp:BoundField DataField="PL" HeaderText="P&L" HtmlEncode="False" ItemStyle-HorizontalAlign="Right"
                                                    HeaderStyle-CssClass="text-center" ItemStyle-Width="75px" FooterStyle-Font-Bold="false"
                                                    FooterStyle-HorizontalAlign="Right" DataFormatString="{0:F2}" />
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <tr>
                                                            <td colspan="100%" style="padding-left: 25px">
                                                                <div id="div<%# Eval("CategoryNo") %>" style="display: none; left: 150px;">
                                                                    <asp:GridView ID="gvchild" runat="server" Width="100%" AutoGenerateColumns="false"
                                                                        BorderColor="Transparent" DataKeyNames="Categorynumber" EmptyDataText="No Details for this Category"
                                                                        HeaderStyle-Width="20px">
                                                                        <HeaderStyle CssClass="dataTable" />
                                                                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                                                        <HeaderStyle BackColor="White" ForeColor="Black" />
                                                                        <PagerStyle BackColor="White" ForeColor="Black" />
                                                                        <FooterStyle BackColor="White" ForeColor="Black" Font-Size="Large" />
                                                                        <RowStyle CssClass="dataTable" />
                                                                        <Columns>
                                                                            <asp:TemplateField HeaderText="Barcode" ControlStyle-CssClass="text-center">
                                                                                <ItemTemplate>
                                                                                    <asp:Label ID="lblBarcode" runat="server" Text='<%#Eval("Barcode") %>' Width="60px"
                                                                                        Style="word-wrap: normal; word-break: break-all;"></asp:Label>
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                            <asp:BoundField ItemStyle-Width="210px" DataField="InventoryDesc" HeaderText="Description"
                                                                                HeaderStyle-CssClass="text-center" />
                                                                            <asp:BoundField ItemStyle-Width="200px" DataField="PriceType" HeaderText="Price Type"
                                                                                HeaderStyle-CssClass="text-center" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="Price"
                                                                                HeaderText="Price" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="AvgPrice"
                                                                                HeaderText="Price(Avg)" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Center" DataField="Qty"
                                                                                HeaderText="QTY" HeaderStyle-CssClass="text-center" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="GrossAmt"
                                                                                HeaderText="Gross Amt" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="FOCAMT"
                                                                                HeaderText="FOC Amt" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="ManualDisc"
                                                                                HeaderText="Item Disc" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="TotalDisc"
                                                                                HeaderText="Total Disc" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="ActualPSDiscAmount"
                                                                                HeaderText="Promo Disc" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="TotalMemberDisc"
                                                                                HeaderText="Member Disc" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="DiscAmt"
                                                                                HeaderText="Disc Amt" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="DiscQty"
                                                                                HeaderText="Disc Qty" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="SalesAmt"
                                                                                HeaderText="Sales Amt" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="GST"
                                                                                HeaderText="GST" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="TaxableAmount"
                                                                                HeaderText="Taxable Amt" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Right" DataField="UCostAvg"
                                                                                HeaderText="Cost(Avg)" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="TUCost"
                                                                                HeaderText="Total Cost" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                            <asp:BoundField ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right" DataField="PL"
                                                                                HeaderText="P&L" HeaderStyle-CssClass="text-center" DataFormatString="{0:F2}" />
                                                                        </Columns>
                                                                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                                                    </asp:GridView>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                            <RowStyle ForeColor="#000066" />
                                            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                            <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                            <SortedAscendingHeaderStyle BackColor="#007DBB" />
                                            <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                            <SortedDescendingHeaderStyle BackColor="#00547E" />
                                        </asp:GridView>
                                    </caption>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            </div> </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <div class="overlay">
                <div class="LoadingDivCss">
                    <img alt="" src="IMG/Spinner.gif" class="LoadingImgCss" />
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <br />

    
 <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>
