<%@ Page Title="Sales" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" 
    CodeBehind="Sales.aspx.cs" Inherits="SMTBETECH_V3.Sales" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<style type="text/css">

    .GridPager a, .GridPager span {
        display: block;
        height: 28px;
        width: 24px;
        font-weight: bold;
        text-align: center;
        text-decoration: none;
    }

    .GridPager a {
        background-color: #f5f5f5;
        color: #969696;
        border: 1px solid #969696;
    }

    .GridPager span {
        /*background-color: #A1DCF2;*/
        background-color: steelblue;
        color: whitesmoke;
        border: 1px solid #3AC0F2;
    }
</style>

 <asp:ScriptManagerProxy ID="ScriptManagerProxySales" runat="server"></asp:ScriptManagerProxy>

 <asp:UpdateProgress ID="UpdateProgressSales" runat="server" DynamicLayout="true" AssociatedUpdatePanelID="UpdatePanelSales" >

<ProgressTemplate>
   Loading...
</ProgressTemplate>

 </asp:UpdateProgress>

 <asp:UpdatePanel ID="UpdatePanelSales" runat="server">
     <ContentTemplate>

         <h2 id="title"><%: Title %></h2>

        
         <asp:Panel runat="server" >

         <div class="row" style="width:100%">

             <div class="col-2" style="text-align:left">
                 <%--<label style="font-weight:bold;font-size:xx-large" for="btnNewSales" class="form-label">Sales</label>--%>
                 <asp:Button CssClass="btn btn-primary btn-sm" ID="btnNewSales" runat="server"
                     Text="New" OnClick="btnNewSales_Click"/>
             </div>

             <div class="col-3">
                 <label style="font-weight:bold" for="ddlCustomers" class="form-label">Customer Name:</label>
                 <asp:DropDownList ID="ddlCustomers" AutoPostBack="true" runat="server" CssClass="form-select" OnSelectedIndexChanged="ddlCustomers_SelectedIndexChanged">
                 </asp:DropDownList>
             </div>

             <div class="col-2">
                <label style="font-weight:bold" for="dtFrom" class="form-label">From:</label>
                <asp:TextBox CssClass="form-control" runat="server" ID="dtFrom" TextMode="Date" AutoPostBack="true" OnTextChanged="Date_TextChanged" ></asp:TextBox>
             </div>
             <div class="col-2">
               <label style="font-weight:bold" for="dtTo" class="form-label">To:</label>
               <asp:TextBox CssClass="form-control" runat="server" ID="dtTo" TextMode="Date" AutoPostBack="true" OnTextChanged="Date_TextChanged" ></asp:TextBox>
            </div>

            <div class="col-3">
                <label style="font-weight:bold" for="ddlPaymentStatus" class="form-label">Status:</label>
                <asp:DropDownList ID="ddlPaymentStatus" AutoPostBack="true" runat="server" CssClass="form-select" OnSelectedIndexChanged="Date_TextChanged">
                </asp:DropDownList>
            </div>

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

     <div style="overflow-x:scroll">
         <asp:GridView CssClass="table table-bordered table-striped table-sm table-hover" DataKeyNames="Id"
             ID="GVSales"
             runat="server"
             AutoGenerateColumns="False"
             AllowPaging="True"
             AllowSorting="False"
             OnRowCommand="GVSales_RowCommand" OnPageIndexChanging="GVSales_PageIndexChanging" PageSize="10" OnDataBound="GVSales_DataBound">
         <HeaderStyle CssClass="table-primary" />
             <Columns>

                 <%--<asp:BoundField HeaderStyle-Width="40px" DataField="Id" HeaderText="Id" ReadOnly="True" InsertVisible="False" SortExpression="Id"></asp:BoundField>--%>

                 <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="100px" ItemStyle-Wrap="false" 
                    DataField="InternalFolioNo" HeaderText="Folio No" ></asp:BoundField>
                                 
                 <asp:ButtonField HeaderStyle-Wrap="false" HeaderStyle-Width="70px" ItemStyle-Wrap="false"  
                     CommandName="Payment" DataTextField="PaymentStatus" HeaderText="Status"  />

                 <asp:BoundField DataFormatString="{0:yyyy-MM-dd}" ItemStyle-Wrap="false" ItemStyle-Width="150px" DataField="CreationDate" HeaderText="Creation"></asp:BoundField>

                 <asp:BoundField Visible="false" HeaderStyle-Wrap="false" HeaderStyle-Width="300px" ItemStyle-Wrap="false" 
                        DataField="IdCustomer" HeaderText="IdCustomer" ></asp:BoundField>

                 <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="300px" ItemStyle-Wrap="false" 
                        DataField="CustomerName" HeaderText="Customer Name" ></asp:BoundField>

                 <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="150px" ItemStyle-Wrap="false" 
                        DataField="DateOfDelivery" HeaderText="Delivery" ></asp:BoundField>

                 <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" 
                        DataField="NetDaysCredit" HeaderText="Net Days Credit" ></asp:BoundField>

                 <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" 
                        DataField="DaysPassed" HeaderText="Days Passed" ></asp:BoundField>

                 <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" 
                        DataField="RemainingDays" HeaderText="Remaining Days" ></asp:BoundField>

                 <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="150px" ItemStyle-Wrap="false" 
                        DataField="DatePaymentDue" HeaderText="Date Due" ></asp:BoundField>

                 <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="150px" ItemStyle-Wrap="false" 
                        DataField="DateBilling" HeaderText="Billing" ></asp:BoundField>

                 <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false"  HeaderStyle-HorizontalAlign="Right"
                        DataField="TotalQuoted" HeaderText="Total $" ItemStyle-ForeColor="Blue" ItemStyle-HorizontalAlign="Right"></asp:BoundField>

                 <asp:BoundField Visible="false" HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" 
                        DataField="Tax" HeaderText="Tax" ></asp:BoundField>

                 <asp:BoundField Visible="false" HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" 
                        DataField="TotalInvoiced" HeaderText="Total Invoiced" ></asp:BoundField>

                 <asp:BoundField Visible="false" HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" 
                        DataField="TaxIdInvoiced" HeaderText="Tax Id Invoiced" ></asp:BoundField>
                 
                 <asp:BoundField Visible="false" HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" 
                        DataField="PaymentDate" HeaderText="Payment Date" ></asp:BoundField>

                 <asp:BoundField Visible="false" HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" 
                        DataField="MonthDeclarationPeriod" HeaderText="Month Declaration Period" ></asp:BoundField>

                 <asp:BoundField Visible="false" HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" 
                        DataField="InvoicePaymentReceptionFolioID" HeaderText="Invoice Payment Reception Folio ID" ></asp:BoundField>
                 
                 <asp:BoundField Visible="false" ItemStyle-Wrap="false" ItemStyle-Width="200px" DataField="ModifiedDate" HeaderText="Modified Date"></asp:BoundField>
                 
             </Columns>
                 <PagerStyle CssClass="GridPager" />
     
     </asp:GridView>
 </div>
         <p></p>
         <%--<div style="width:50%">
             Total: <asp:Label runat="server" ID="lblCount"></asp:Label>
         </div>--%>

         <table width="100%">
           <tr>
             <td style="width: 50%">Total: <asp:Label runat="server" ID="lblCount" ForeColor="Blue"></asp:Label></td>
             <td style="width: 50%; text-align: right;">Total $: <asp:Label runat="server" ID="lblTotal" ForeColor="Blue"></asp:Label></td>
           </tr>
         </table>

     </ContentTemplate>
 </asp:UpdatePanel>





</asp:Content>
