<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Proc_ProvisionVentas.aspx.cs" Inherits="Proc_ProvisionVentas" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/ControlUsuario/pl_pie.ascx" TagName="pl_pie" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Provisiones de Ventas</title>
    <link href="estilos/Estilos.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="JavaScript/actb.js"></script>
    <script language="javascript" type="text/javascript" src="JavaScript/common.js"></script>
    <script language="javascript" type="text/javascript" src="JavaScript/SGH_Script.js"></script>    
    
    <script type="text/javascript" language="JavaScript">
        function cerrar() {
        var ventana = window.self;
        ventana.opener = window.self;
        parent.close();
        }
        
      function requestStart(sender, args)
        {
            if (args.get_eventTarget().indexOf("ExcelExport") != -1)
                args.set_enableAjax(false);
            if (args.get_eventTarget().indexOf("PDFExport") > 0)
                args.set_enableAjax(false);
            if (args.get_eventTarget().indexOf("WordExport") > 0)
                args.set_enableAjax(false);
            if (args.get_eventTarget().indexOf("CSVExport") > 0)
                args.set_enableAjax(false);
            if (args.get_eventTarget().indexOf("Print") > 0)
                args.set_enableAjax(false);
        }   
        function Regresar() {
            
            var ventana = window.self;
            ventana.opener = window.self;
            ventana.opener.focus();
    }
  
        function CerraryRegresar() {
            var ventana = window.self;
            ventana.opener = window.self;
            parent.close();
        }                                                 
    </script>

    

    <style type="text/css">
        .style1
        {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 11px;
            font-style: normal;
            line-height: normal;
            font-weight: normal;
            color: #000000;
            height: 26px;
        }
        </style>

    

    </head>
<body>
    <form id="form2" runat="server" method="post" defaultfocus="txtUsuario">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
   
     <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Outlook" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" ClientEvents-OnRequestStart="requestStart">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="tk_Grid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tk_Grid" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            
             <telerik:AjaxSetting AjaxControlID="btn_Aceptar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tk_Grid" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>

             <telerik:AjaxSetting AjaxControlID="btnActualizar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tk_Grid" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            
             <telerik:AjaxSetting AjaxControlID="btnTransferirTodo">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tk_Grid" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            

        </AjaxSettings>
    </telerik:RadAjaxManager>

      <table  style="height:455px; width:100%" cellpdading="0" cellspacing="0" border="0">
      <tr>
        <td align="center" valign="middle">
          <table width="100%" cellpadding="0" cellspacing="0" border="0" 
                style="height:435px; background-color: #FFFFFF;">
            <tr>
              <td colspan="2" style="height:7px" bgcolor="#FFFFFF"></td>
            </tr>
            <tr>
              <%--<td align=right colspan="2" style="height:20px" bgcolor="#A9CE53" ><a href="#" class="linksblanco" onClick="cerrar()"> Cerrar</a>&nbsp;&nbsp</td>--%>
              <td>
              
              <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="width:1px; padding-left:20px">
                            <img id="Img4" runat="server" src="~/images/TitleLeftLightBlue.png" alt="" />
                        </td>
                        <td background="images/LineBodySky.png" style="width:15px; padding-left:5px; text-align:left; vertical-align:middle;" class="tituloseccion">
                            <img id="img5" runat="server" src="images/Report.png" border="0" />                             
                        </td>
                        <td background="images/LineBodySky.png" style="padding-left:10px; text-align:left; vertical-align:middle;" class="tituloseccion">                            
                            PROCESO :: Provisiones de Ventas</td>
                        <td background="images/LineGray.png" style="width:20px; padding-left:10px; vertical-align:bottom;">
                            <a href="BusquedaInteligente.aspx" class="gridtext">
                                <img id="img15" runat="server" src="images/Back.png" border="0" />                                            
                            </a>                            
                        </td>
                        <td background="images/LineGray.png" style="width:20px" class="gridtextbold">
                           <a href="BusquedaInteligente.aspx" class="gridtext">Atras</a>
                            <%--<asp:LinkButton runat="server" ID="l1" Text="Inicio2" onclick="l1_Click"></asp:LinkButton>--%>
                        </td>
                        <td background="images/LineGray.png" style="width:20px; padding-left:15px; vertical-align:middle;" class="gridtextbold">
                            <a href="#" class="gridtext"  onClick="cerrar()">
                                <img id="img6" runat="server" src="images/close.png" border="0" />                                            
                            </a>
                        </td>                 
                        <td background="images/LineGray.png" style="width:20px; padding-right:5px; vertical-align:middle;" class="gridtextbold">
                            <a href="#" class="gridtext"  onClick="CerraryRegresar()">Cerrar</a>
                        </td>
                        <td style="text-align:right; width:1px; padding-right:20px" 
                            <img id="Img7" class="gridtext" runat="server" src="~/images/TitleRightLightGray.png" alt="" />
                        </td>
                    </tr>
                   
                </table>
              
              
              
              </td>
            </tr>

            <tr>
              <td colspan="2" align="center">
              
              <table id="Table3" cellspacing="0" cellpadding="0" width="97%" border="0">

       
        
        <tr>
            <td align="center" class="arial10bold" style="height: 15px;" valign="top">
                &nbsp;</td>
        </tr>
        
        <tr>
            <td align="left" class="style1" valign="bottom" style="height: 5px;">

                <asp:Button ID="btn_Aceptar" runat="server" CssClass="Button" 
                    Text="Generar Asientos" Width="130px" onclick="btn_Aceptar_Click" />    


                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    


                Desde: 
                <telerik:RadDatePicker ID="txtDesde" runat="server" Skin="Outlook">
<Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" 
                        Skin="Outlook"></Calendar>

<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                </telerik:RadDatePicker>
                Hasta: 
                <telerik:RadDatePicker ID="txtHasta" runat="server" Skin="Outlook">
<Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" 
                        Skin="Outlook"></Calendar>

<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                </telerik:RadDatePicker>

        
                        &nbsp;&nbsp;
                        <asp:Button ID="btnActualizar" runat="server" CssClass="Button" 
                    Text=" Buscar " Width="130px" onclick="btnActualizar_Click" />    
                    
                        &nbsp;&nbsp;
                        <asp:Button ID="btnTransferirTodo" runat="server" CssClass="Button" 
                    Text=" Transferir Todo " Width="130px" onclick="btnTransferirTodo_Click" />    
                    

            </td>
        </tr>
        
 
            <td align="center">
                
                         
                        <table border="0" style="border: #CCCCCC 1px solid; width: 100%">
                            <tr>
                                <td style="text-align: center; height: 21px; padding: 4px;">
                                                                    
                                 <telerik:RadGrid                                              
                                            ID="tk_Grid" 
                                            GridLines="None"
                                            AllowSorting="True" 
                                            AllowMultiRowSelection="true"
                                            Height="450px"
                                            runat="server" 
                                            AllowPaging="True" 
                                            PageSize="150" 
                                            AutoGenerateColumns="false"
                                            onneeddatasource="tk_Grid_NeedDataSource" 
                                            OnItemCommand="tk_Grid_ItemCommand"
                                            Skin="Office2007" >    
                                            
                                        <AlternatingItemStyle HorizontalAlign="Center" />
                                                                                                                                                                
                                        <PagerStyle Mode="NextPrevAndNumeric" PageButtonCount="15" />
                                        
                                        <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" >
                                            <Pdf PageWidth="360mm" />
                                        </ExportSettings>
                                        
                                        <MasterTableView  DataKeyNames="TransaccionDocumentoID"   Width="100%" CommandItemDisplay="Top" CellSpacing="0" GroupLoadMode="Client" >  
                                        <CommandItemTemplate>
                                            <asp:ImageButton runat="server" ID="ExcelExport" ImageUrl="~/images/page_excel.png" CommandName="ExportExcel" AlternateText="Excel" ToolTip="Excel" /> 
                                            <asp:ImageButton runat="server" ID="PDFExport" ImageUrl="~/images/page_acrobat.png" CommandName="ExportPDF" AlternateText="Pdf" ToolTip="Pdf" />
                                            <asp:ImageButton runat="server" ID="WordExport" ImageUrl="~/images/page_word.png" CommandName="ExportWord" AlternateText="Word" ToolTip="Word" />
                                            <asp:ImageButton runat="server" ID="CSVExport" ImageUrl="~/images/page_csv.png" CommandName="ExportCSV" AlternateText="CSV" ToolTip="CSV" />
                                            <asp:ImageButton runat="server" ID="Print" ImageUrl="~/images/printer.png" CommandName="Print" AlternateText="Print" ToolTip="Imprimir" />
                                        </CommandItemTemplate>
                                        
                                        <CommandItemStyle  HorizontalAlign="Right" />
                                        
                                            <Columns>   
                                            
                                        <telerik:GridClientSelectColumn HeaderStyle-Width="3%"  >
                                            <HeaderStyle HorizontalAlign="Center" />
                                        </telerik:GridClientSelectColumn>
                                            
                                                                                                                                                                                                                                                                                            
                                        <telerik:GridClientSelectColumn  UniqueName="CheckBoxTemplateColumn" HeaderStyle-Width="40px"  >
                                            <HeaderStyle HorizontalAlign="Center" />
                                        </telerik:GridClientSelectColumn>
                                        
                        
                                          <telerik:GridNumericColumn HeaderText="Documento" DataField="DocumentoId"  HeaderStyle-Width="100px"
                                                    UniqueName="DocumentoId" SortExpression="DocumentoId" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridNumericColumn>

                                          <telerik:GridNumericColumn HeaderText="Ruc" DataField="Ruc"  HeaderStyle-Width="12%"
                                                    UniqueName="Ruc" SortExpression="Ruc" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridNumericColumn>
                                          <telerik:GridNumericColumn HeaderText="Empresa" DataField="NombreEmpresa"  HeaderStyle-Width="350px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left"
                                                    UniqueName="NombreEmpresa" SortExpression="NombreEmpresa" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridNumericColumn>
                                          <telerik:GridNumericColumn HeaderText="Razon Social" DataField="RazonSocial"  HeaderStyle-Width="200px"  HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left"
                                                    UniqueName="RazonSocial" SortExpression="RazonSocial" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridNumericColumn>
                                          <telerik:GridBoundColumn HeaderText="Fecha Emision" DataField="FechaEmision"  HeaderStyle-Width="100px" DataFormatString="{0:dd/MM/yyyy}"
                                                    UniqueName="FechaEmision" SortExpression="FechaEmision" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridBoundColumn>
                                          <telerik:GridNumericColumn HeaderText="Reserva" DataField="ReservaId"  HeaderStyle-Width="70px"
                                                    UniqueName="ReservaId" SortExpression="ReservaId" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridNumericColumn>
                                          <telerik:GridBoundColumn HeaderText="Nro Habitacion" DataField="NroHabitacion"  HeaderStyle-Width="100px"
                                                    UniqueName="NroHabitacion" SortExpression="NroHabitacion" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridBoundColumn>
                                          <telerik:GridNumericColumn HeaderText="Prepago" DataField="Prepagoid"  HeaderStyle-Width="70px"
                                                    UniqueName="Prepagoid" SortExpression="Prepagoid" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridNumericColumn>
                                          <telerik:GridNumericColumn HeaderText="Nombre Estado" DataField="NombreEstado"  HeaderStyle-Width="100px"
                                                    UniqueName="NombreEstado" SortExpression="NombreEstado" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridNumericColumn>

                                          <telerik:GridBoundColumn HeaderText="Tipo Cambio" DataField="TipoCambio"  HeaderStyle-Width="90px"  HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right"
                                                    UniqueName="TipoCambio" SortExpression="TipoCambio" DataFormatString="{0:N2}" AutoPostBackOnFilter="true" FilterControlWidth="100%" 
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridBoundColumn>
                                          <telerik:GridNumericColumn HeaderText="Moneda" DataField="NombreMoneda" HeaderStyle-Width="80px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                                    UniqueName="NombreMoneda" SortExpression="NombreMoneda" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridNumericColumn>
                                          <telerik:GridNumericColumn HeaderText="Total" DataField="Total" HeaderStyle-Width="60px"  HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right"
                                                    UniqueName="Total" SortExpression="Total" AutoPostBackOnFilter="true" DataFormatString="{0:N2}" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridNumericColumn>
                                          <telerik:GridBoundColumn HeaderText="Cliente" DataField="Cliente"  HeaderStyle-Width="360px"  HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left"
                                                    UniqueName="Cliente" SortExpression="Cliente" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridBoundColumn>
                                          <telerik:GridNumericColumn HeaderText="Transaccion Documento " DataField="TransaccionDocumentoId" HeaderStyle-Width="150px" 
                                                    UniqueName="TransaccionDocumentoId" SortExpression="TransaccionDocumentoId" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            </telerik:GridNumericColumn>
                                                                                                                                                                          
                                            </Columns>
                                            
                                        </MasterTableView>
                                        <HeaderStyle Width="200px" />
                                         <ClientSettings EnableRowHoverStyle="true">
                                            <Selecting AllowRowSelect="true" />
                                            <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" FrozenColumnsCount="0">
                                            </Scrolling>
                                        </ClientSettings>
                                        
                                    </telerik:RadGrid>
                                    
                                </td>
                                
                            </tr>
                        </table>
                        
            </td>
        </tr>
    </table>
              
              
              </td>
            </tr>
            <tr>
              <td colspan="2" style="height:40px">
                  
                  <uc1:pl_pie ID="pl_pie1" runat="server" />
                  
              </td>
            </tr>
          </table>
        </td>
      </tr>
      </table>
   
    
    </form>
</body>
</html>

