<%@ Page Language="C#" MasterPageFile="~/MasterPages/Main.master" AutoEventWireup="true" CodeFile="GWFileSummary.aspx.cs" Inherits="GWFileSummary"  %>
<%@ Register Src="../UserControls/DatePicker.ascx" TagName="DatePicker" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <table class="body_MainTB" border="0" cellpadding="0" cellspacing="0">
                    <tr align="center">
                        <td valign="top">
                            <!------------------------------------body St  ---------------------------------------------->
                            <table border="0" cellpadding="0" cellspacing="0" class="body_formTitle">
                                <tr>
                                    <td>
                                        GW File Summary</td>
                                </tr>
                            </table>
                            <br>
                            <!------------------------------------body End1 ----------------------------------------------->
                            <table border="0" cellpadding="0" cellspacing="0" class="contTB">
                                <tr>
                                    <td align="center">
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="Frow">
                                            <tr>
                                                <td>
                                                </td>
                                            </tr>
                                        </table>
                                        <br />
                                        <asp:Label ID="lblError" runat="server" Text="" class="fieldError"></asp:Label>
                                        <asp:Label ID="lblVAT" runat="server" Visible="false"></asp:Label>
                                        <table border="0" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                            <tr>
                                                <td class="tdNormal">Post Date (From)
                                                </td>
                                                <td>
                                                    <uc1:DatePicker ID="dtPostDateFrom" runat="server" width=250/>
                                                </td>
                                                <td></td>
                                                <td colspan="2" class="tdNormal" style="text-align: left">
                                                    <asp:Button ID="btnGetFiles" runat="server" Text="Get Files" CssClass="Btn_L_Normal"
                                                        OnClick="btnGetFiles_Click" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="tdNormal">
                                                    Post Date (To)
                                                </td>
                                                <td>
                                                    <uc1:DatePicker ID="dtPostDateTo" runat="server" width=250 />
                                                </td>
                                                <td class="tdNormal"></td>
                                                <td class="tdNormal">File Name
                                                </td>
                                                <td>
                                                    <asp:DropDownList ID="ddlFiles" runat="server" DataTextField="File_Name"
                                                        Width="250px" DataValueField="File_Number" class="fieldNormal">
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="5" style="text-align: center">
                                                    <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="Btn_L_Normal"
                                                        OnClick="btnSearch_Click" />
                                                </td>
                                            </tr>
                                        </table>
                                            <br />
                                            
                                        <asp:Panel ID="pnlResult" runat="server" Width="100%" Visible="false">
                                            <fieldset id="addItem">
                                             <legend id="addItem">File Summary</legend>
                                            </fieldset>
                                            <table border="0" width=100% cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                <tr>
                                                    <td class="tdNormal" colspan=5>
                                                        <asp:GridView ID="GridView1" CssClass="gridMaster" Width ="100%" runat="server" AutoGenerateColumns="False"
                                                             DataKeyNames="PostDate" AllowPaging="True" AllowSorting="True" 
                                                            CellPadding="4" ForeColor="#333333" GridLines="None" 
                                                            OnRowCommand="GridView1_RowCommand" EmptyDataText="There are no Results" 
                                                            OnRowDataBound="GridView1_RowDataBound">
                                                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Right" />
                                                            <Columns>
                                                                
                                                                <asp:BoundField DataField="PostDate" HeaderText="PostDate" />
                                                                <asp:BoundField DataField="Proc_Start_Time" HeaderText="Start Time" />
                                                                <asp:BoundField DataField="Proc_End_Time" HeaderText="End Time" />
                                                                <asp:BoundField DataField="GwFileName" HeaderText="Gw FileName" />
                                                                <asp:BoundField DataField="FileNumber" HeaderText="File Number" />
                                                                <asp:BoundField DataField="Processing_Status" HeaderText="Processing Status" />
                                                                <asp:BoundField DataField="Genvat_File_Flag" HeaderText="File Generated" />
                                                                <asp:BoundField DataField="Records_Present" HeaderText="Records Present" />
                                                                <asp:BoundField DataField="SettledAmount" HeaderText="Settled Amount"/>
                                                                <asp:BoundField DataField="Merch_NetAmount" HeaderText="Merch NetAmount"/>
                                                                <asp:BoundField DataField="Merch_ServAmount" HeaderText="Merch ServAmount"/>
                                                                <asp:BoundField DataField="Merch_VatAmount" HeaderText="Merch VatAmount"/>
                                                                <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="v" Text="View VAT Summary" ImageUrl="~/Images/view.jpg" Visible=false />
                                                                <asp:ButtonField ButtonType="Image" ItemStyle-Width="30px" CommandName="g" Text="generate VAT GL" Visible=false
                                                                     ImageUrl="~/Images/document_view.jpg" >
                                                                    <ItemStyle Width="30px" />
                                                                </asp:ButtonField>
                                                                <asp:TemplateField HeaderText="Actions" Visible="true">
                                                                <ItemTemplate>
                                                                    <div class="dropdown-menu">
                                                                        <a class="dropdown-item" href="#">
                                                                            <asp:Button ID="btn_Generate_VAT_File" runat="server" Text="Generate VAT File" CommandName="g" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
                                                                        </a>
                                                                    </div>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            </Columns>
                                                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="Black" />
                                                            <EditRowStyle BackColor="#999999" />
                                                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" HorizontalAlign="Right" />
                                                        </asp:GridView>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="tdNormal" style="width:20%">Go To Page: <asp:DropDownList ID="ddlPages" runat="server" class="fieldNormal" 
                                                            AutoPostBack="True" Width=50px onselectedindexchanged="ddlPages_SelectedIndexChanged"></asp:DropDownList></td>
                                                    <td class="tdNormal">
                                                        </td>
                                                    <td class="tdNormal"></td>
                                                    <td class="tdNormal"></td>
                                                    <td class="tdNormal"><asp:HyperLink ID="HyperLink1" runat="server" Visible=false>DownloadFile</asp:HyperLink></td>
                                                </tr>
                                            </table>
                                            
                                        </asp:Panel> 
                                            
                                            <asp:Panel ID="pnlBR" runat="server" Width="80%" Visible="false">
                                                
                                            </asp:Panel>

                                        <br />

                                        <asp:Panel ID="pnlVATResult" runat="server" Width="100%" Visible="false">
                                            <fieldset id="addItem">
                                                <legend id="addItem">VAT GL Summary</legend>
                                            </fieldset>
                                            <table border="0" width="100%" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                <tr>
                                                    <td class="tdNormal" colspan="5">
                                                        <asp:GridView ID="GridView2" CssClass="gridMaster" Width="100%" runat="server" AutoGenerateColumns="False"
                                                            DataKeyNames="File_Date" AllowPaging="True" AllowSorting="True"
                                                            CellPadding="4" ForeColor="#333333" GridLines="None"
                                                            OnRowCommand="GridView2_RowCommand" EmptyDataText="There are no Results">
                                                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Right" />
                                                            <Columns>
                                                                <asp:BoundField DataField="File_Date" HeaderText="PostDate" />
                                                                <asp:BoundField DataField="Proc_Start_Time" HeaderText="Start Time" />
                                                                <asp:BoundField DataField="Proc_End_Time" HeaderText="End Time" />
                                                                <asp:BoundField DataField="VAT_Inv_FileName" HeaderText="VAT FileName" />
                                                                <asp:BoundField DataField="Vat_Inv_Filenumber" HeaderText="VAT File Number" />
                                                                <asp:BoundField DataField="Processing_Status" HeaderText="Processing Status" />
                                                                <asp:BoundField DataField="Records_Present" HeaderText="Records Present" />
                                                                <asp:TemplateField HeaderText="Actions" Visible="true">
                                                                <ItemTemplate>
                                                                    <div class="dropdown-menu">
                                                                        <a class="dropdown-item" href="#">
                                                                            <asp:Button ID="btn_Details" runat="server" Text="Details" CommandName="v" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
                                                                        </a>
                                                                    </div>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            </Columns>
                                                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="Black" />
                                                            <EditRowStyle BackColor="#999999" />
                                                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" HorizontalAlign="Right" />
                                                        </asp:GridView>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="5" class="tdNormal" style="width: 20%">Go To Page:
                                                        <asp:DropDownList ID="DropDownList1" runat="server" class="fieldNormal"
                                                            AutoPostBack="True" Width="50px" OnSelectedIndexChanged="ddlPages_SelectedIndexChanged">
                                                        </asp:DropDownList></td>
                                                </tr>
                                            </table>

                                        </asp:Panel> 
                                        <!------------------------------------body End2 ----------------------------------------------->
                                        <br>
                                    </td>
                                </tr>
                            </table>
                            <!------------------------------------body End2 ----------------------------------------------->
                        </td>
                    </tr>
                </table>
                
</asp:Content>

