<%@ Page Language="C#" EnableEventValidation="true" AutoEventWireup="true" CodeFile="frmListaAsientos.aspx.cs" Inherits="frmListaAsientos" %>
<%@ 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">
    <link rel="Shortcut Icon" href="images/ico.ico"/> 
    <title id="Titulo" runat="server"></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>
    <style type="text/css">
        .auto-style1 {
            height: 139px;
        }
        #btnNuevo {
            width: 157px;
            height: 19px;
        }
    </style>
    </head>

<body>
    <form id="form1" runat="server" method="post" defaultfocus="txtUsuario">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">


                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);
                    if (args.get_eventTarget().indexOf("ReporteBoton") > 0)
                        args.set_enableAjax(false);
                }
                
                function ShowEditForm(id, rowIndex, sudid) {
                var grid = $find("<%= tk_Grid.ClientID %>");

                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                grid.get_masterTableView().selectItem(rowControl, true);

                window.radopen("frmArchivos.aspx?AsientoContableID=" + id +"&SubDiarioID=" + sudid, "UserListDialog");
                return false;
                }
                function ShowInsertForm() {
                window.radopen("frmArchivos.aspx", "UserListDialog");
                return false;
                }

                function refreshGrid(arg) {
                if (!arg) {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                }
                else {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                }
                }
                function RowDblClick(sender, eventArgs) {
                window.radopen("frmArchivos.aspx?AsientoContableID=" + eventArgs.getDataKeyValue("AsientoContableID"), "UserListDialog");
            }


            function RadGrid1_DataBinding(sender, args) 
            {
                // This event will be raised twice by default! 
                // The first call will retrieve data and the second call will retrieve total items count.
                // If you want to cancel the event you can use:
                // args.set_cancel(true);

                // get data source location, method name and arguments
                var dataSourceLocation = args.get_location();
                var selectMethodName = args.get_methodName();
                var methodArguments = args.get_methodArguments();

                // set data source location and method name
                // args.set_location("url to your data source");
                // args.set_methodName("your method name");

                // The grid will always pass by default four arguments for the SelectMethod.
                // SelectCountMethod will be called with no arguments by default!

                // get names for select parameters
                var startRowIndexParameterName = sender.ClientSettings.DataBinding.StartRowIndexParameterName;
                // default is "startRowIndex". 

                var maximumRowsParameterName = sender.ClientSettings.DataBinding.MaximumRowsParameterName;
                // default is "maximumRows"

                var sortParameterName = sender.ClientSettings.DataBinding.SortParameterName;
                // default is "sortExpression"

                var filterParameterName = sender.ClientSettings.DataBinding.FilterParameterName;
                // default is "filterExpression"

                // construct your own arguments
                // var myMethodArguments = new Object();
                // myMethodArguments.myArgumentName = "myArgumentValue";
                // args.set_methodArguments(myMethodArguments);
            }                
                
                
                
                
               </script>
           </telerik:RadCodeBlock>

    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

        <script type="text/javascript">
            var tableView = null;
            function pageLoad(sender, args) {
                tableView = $find("<%= tk_Grid.ClientID %>").get_masterTableView();
            }

            function RadComboBox1_SelectedIndexChanged(sender, args) {
                tableView.set_pageSize(sender.get_value());
            }

            function changePage(argument) {
                tableView.page(argument);
            }

            function RadNumericTextBox1_ValueChanged(sender, args) {
                tableView.page(sender.get_value());
            }
            
            
        </script>

    </telerik:RadScriptBlock>           
           
           
      <table  style="height:455px; width:100%" cellpadding="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" bgcolor="#FFFFFF" class=""></td>
            </tr>
            <tr id="TRCerrar" runat="server" visible="false">
              <td align=right colspan="2" style="height:24px;" background="images/LineForest.jpg"></asp:Label> <a href="#" class="linksblanco" style="vertical-align:text-top" onClick="cerrar()"> Cerrar</a>&nbsp;&nbsp</td>
            </tr>
            <tr id="TRImagen" runat="server" visible="false">
              <td align="center" colspan="2" style="height:10px">
                <table width="95%" cellpadding="0" cellspacing="0" border="0">
                  <tr>
                    <td align="left" style="height: 18px">
                      
                      <asp:Image ID="imgLogo"  runat="server" align="left" />
                    </td>
                    <td align="right" valign="middle" >
                     
                      <asp:Image ID="imgLogoEmpresa"  runat="server" />
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
            <tr>
              <td colspan="2" align="center">
              
              <table id="Table3" cellspacing="0" cellpadding="0" width="100%" border="0">
        <tr>
            <td align="center"  >
                
                
                
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="width:1px;">
                            <img id="Img3" runat="server" src="~/images/TitleLeftLightBlue.png" alt="" />
                        </td>
                        <td background="images/LineBodySky.png" style="padding-left:20px; text-align:left" class="tituloseccion">
                            
                            
                          Listado de Asientos Contables&nbsp;&nbsp; |&nbsp;&nbsp; Diario Auxiliar : <asp:Label ID="lblDiarioAuxiliar" runat="server"/>
                            
                        </td>
                        <td background="images/LineGray.png" style="width:20px; padding-left:10px; vertical-align:bottom; display:none">
                            <a href="BusquedaInteligente.aspx" class="gridtext">
                                <img id="imgHome" runat="server" src="images/home.png" border="0" />                                            
                            </a>                            
                        </td>
                        <td background="images/LineGray.png" style="width:20px;display:none" class="gridtextbold">
                            <a href="#" class="gridtext"  onClick="Regresar()">Inicio</a>
                        </td>
                        <td background="images/LineGray.png" style="width:20px; padding-left:15px" class="gridtextbold">
                            <a href="#" class="gridtext"  onClick="cerrar()">
                                <img id="img2" runat="server" src="images/close.png" border="0" />                                            
                            </a>
                        </td>                 
                        <td background="images/LineGray.png" style="width:20px; padding-right:5px" class="gridtextbold">
                            <a href="#" class="gridtext"  onClick="CerraryRegresar()">Cerrar</a>
                        </td>
                        <td style="text-align:right; width:1px;">
                            <img id="Img1" class="gridtext" runat="server" src="~/images/TitleRightLightGray.png" alt="" />
                        </td>
                    </tr>
                </table>        
                   
            </td>
        </tr>
        
 
        <tr><td style="height:15px"></td></tr>
        
        <tr>
            <td colspan="3" align="center">

                <table border="0" style="border: #CCCCCC 1px solid; width: 100%">
                <tr >
                    <td align="left" style="padding-top:6px; padding-bottom:6px; border-bottom:1px solid #3C7FB1;">
                    
                    <div style="float:left">
                            <asp:Label CssClass="gridtextgray" ID="Label8" runat="server" Text="Sucursal: "></asp:Label>
                            &nbsp;
                            <asp:Label CssClass="gridtextgray" ID="lblSucursal" runat="server" Text="Label"></asp:Label>
                            &nbsp;
                            <asp:Label CssClass="gridtextgray" ID="Label7" runat="server" Text="Unidad de Negocio: " Width="110px"></asp:Label>
                            &nbsp;
                            <asp:Label CssClass="gridtextgray" ID="lblUnidadNegocio" runat="server" Text="Label"></asp:Label>
                            &nbsp;
                            <asp:Label CssClass="gridtextgray" ID="Label11" runat="server" Text="Area: "></asp:Label>
                            &nbsp;
                            <asp:Label CssClass="gridtextgray" ID="lblArea" runat="server" Text="Label"></asp:Label>
                            &nbsp;
                            <span class="gridtextgray">Moneda: </span>
                            <asp:Label CssClass="gridtextgray" ID="lblMoneda" runat="server" Text="Label"></asp:Label>
                            &nbsp;
                            <span class="gridtextgray">Desde: </span>
                            <asp:Label CssClass="gridtextgray" ID="lblDesde" runat="server" Text="Label"></asp:Label>
                            &nbsp;
                            <span class="gridtextgray">Hasta: </span>
                            <asp:Label CssClass="gridtextgray" ID="lblHasta" runat="server" Text="Label"></asp:Label>

                    </div>
                     <script type="text/javascript">
                         //the following code use radconfirm to mimic the blocking of the execution thread.
                         //The approach has the following limitations:
                         //1. It works inly for elements that have *click* method, e.g. links and buttons
                         //2. It cannot be used in if(!confirm) checks
                         window.blockConfirm = function(text, mozEvent, oWidth, oHeight, callerObj, oTitle) {
                             var ev = mozEvent ? mozEvent : window.event; //Moz support requires passing the event argument manually
                             //Cancel the event
                             ev.cancelBubble = true;
                             ev.returnValue = false;
                             if (ev.stopPropagation) ev.stopPropagation();
                             if (ev.preventDefault) ev.preventDefault();

                             //Determine who is the caller
                             var callerObj = ev.srcElement ? ev.srcElement : ev.target;

                             //Call the original radconfirm and pass it all necessary parameters
                             if (callerObj) {
                                 //Show the confirm, then when it is closing, if returned value was true, automatically call the caller's click method again.
                                 var callBackFn = function(arg) {
                                     if (arg) {
                                         callerObj["onclick"] = "";
                                         if (callerObj.click) callerObj.click(); //Works fine every time in IE, but does not work for links in Moz
                                         else if (callerObj.tagName == "A") //We assume it is a link button!
                                         {
                                             try {
                                                 eval(callerObj.href)
                                             }
                                             catch (e) { }
                                         }
                                     }
                                 }

                                 radconfirm(text, callBackFn, oWidth, oHeight, callerObj, oTitle);
                             }
                             return false;
                         }
    </script>
                    <div style="float:right">
                    
                    <asp:Button ID="btnEliminar" runat="server" Text="Eliminar" CssClass="Button" 
                    onclick="btnEliminar_Click"
                    />
                    <asp:Button ID="btnEliminarTodo" runat="server" Text="Eliminar Todo" CssClass="Button" 
                    OnClientClick="if (!Confirmacion()) return false;" onclick="btnEliminarTodo_Click"
                    />
                    <asp:Button ID="btnActualizar" runat="server" Text="Actualizar" CssClass="Button" 
                            onclick="btnActualizar_Click" />
                    </div>
<%--OnClientClick="return blockConfirm('Are you sure you want to postback?', event, 330, 100,'','Custom title');"--%>

                 </td>
                    
                        
</tr>
                    <tr>
                        <td style="text-align: left; height: 21px; padding: 4px;">
                           
   <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"   ClientEvents-OnRequestStart="requestStart">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnEliminar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tk_Grid"  LoadingPanelID="RadAjaxLoadingPanel1"  />
                    <telerik:AjaxUpdatedControl ControlID="Mensaje" UpdatePanelCssClass="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            
            <telerik:AjaxSetting AjaxControlID="btnEliminarTodo">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tk_Grid"  LoadingPanelID="RadAjaxLoadingPanel1"  />
                    <telerik:AjaxUpdatedControl ControlID="Mensaje" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelCssClass="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            
            <telerik:AjaxSetting AjaxControlID="btnActualizar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tk_Grid"  LoadingPanelID="RadAjaxLoadingPanel1"  />
                    <telerik:AjaxUpdatedControl ControlID="Mensaje" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="chkImporteCuadra">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tk_Grid"  LoadingPanelID="RadAjaxLoadingPanel1"  />
                </UpdatedControls>
            </telerik:AjaxSetting>
            
            <telerik:AjaxSetting AjaxControlID="chkImporteNoCuadra">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tk_Grid"  LoadingPanelID="RadAjaxLoadingPanel1"  />
                </UpdatedControls>
            </telerik:AjaxSetting>
            
            <telerik:AjaxSetting AjaxControlID="tk_Grid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tk_Grid"  LoadingPanelID="RadAjaxLoadingPanel1"  />
                </UpdatedControls>
            </telerik:AjaxSetting>
            
            

        </AjaxSettings>

<ClientEvents OnRequestStart="requestStart"></ClientEvents>
    </telerik:RadAjaxManager>

<table>
    <tr>
        <td>
            <asp:CheckBox ID="chkImporteCuadra" runat="server" Text="Asientos Cuadrados" 
                AutoPostBack="true" oncheckedchanged="chkImporteCuadra_CheckedChanged" 
                CssClass="gridtext" Checked="True" />
        </td>
        <td>
            <asp:CheckBox ID="chkImporteNoCuadra" runat="server" Text="Asientos No Cuadrados" 
                AutoPostBack="true" oncheckedchanged="chkImporteNoCuadra_CheckedChanged" 
                CssClass="gridtext" Checked="True" />
        </td>
        <td style="padding-left:10px">
        
            <telerik:RadComboBox ID="cbxFiltro" runat="server" 
                LoadingMessage="Cargando..." Skin="Outlook">
                <Items>
                    <telerik:RadComboBoxItem runat="server" Text="Todos" Value="0" />
                    <telerik:RadComboBoxItem runat="server" Text="Por Asientos" Value="1" />
                    <telerik:RadComboBoxItem runat="server" Text="Por Transferencia" Value="2" />
                </Items>
            </telerik:RadComboBox>
            
        </td>
    </tr>
</table>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Telerik" /></telerik:RadAjaxLoadingPanel>
                                  <div class="LineaExportar">
                                            <table  style="width:100%" cellpadding="0" cellspacing="0" border="0" >
                                            <tr>
                                            <td style="width:30%; text-align:left;">
                                               <div id="btnNuevo" visible="true" runat="server" >
                                                   
                                               <a href="#" onclick="javascript: NewWindow('frmAsientosDetalle.html?ID=&IDS=<%=Request.QueryString["ID"]%>&auxiliar=<%=lblDiarioAuxiliar.Text %>','CreaEditaAsientoDetalle','screen.width','screen.height','yes' );" class="botones arial10bold" title="Agregar Nuevo Registro">Nuevo Registro</a>
                                                </div>
                                            </td>
                                            <td>
                                                <span id="Mensaje" runat="server" visible="false" class="textoRojo">* Si los asientos no se eliminaron es porque no está permitida su eliminación en Bloques.</span> 
                                            </td>
                                            <td style="width:15%" align="right">
                                            <!--<asp:ImageButton runat="server" ID="ReporteBoton" ImageUrl="~/images/printer.png" ToolTip="Reporte" />-->
                                            <asp:ImageButton runat="server" ID="ExcelExport" OnClick="Exportar_Data" ImageUrl="~/images/page_excel.png" CommandName="ExportExcel" AlternateText="Excel" ToolTip="Excel" /> 
                                            <asp:ImageButton runat="server" ID="PDFExport" OnClick="Exportar_Data" ImageUrl="~/images/page_acrobat.png" CommandName="ExportPDF" AlternateText="Pdf" ToolTip="Pdf" />
                                            <asp:ImageButton runat="server" ID="WordExport" OnClick="Exportar_Data" ImageUrl="~/images/page_word.png" CommandName="ExportWord" AlternateText="Word" ToolTip="Word" />
                                            <asp:ImageButton runat="server" ID="CSVExport" OnClick="Exportar_Data" ImageUrl="~/images/page_csv.png" CommandName="ExportCSV" AlternateText="CSV" ToolTip="CSV" />
                                            <asp:ImageButton runat="server" ID="Print" OnClick="Exportar_Data" ImageUrl="~/images/printer.png" CommandName="Print" AlternateText="Print" ToolTip="Imprimir" />
                                            </td>
                                            </tr>
                                            </table>
                                  
                                  </div>
                                  
                                  
                        
                         <telerik:RadGrid
                                AutoGenerateColumns="False" 
                                ID="tk_Grid" 
                                AllowPaging="True" 
                                PageSize="100" 
                                AllowSorting="True" 
                                runat="server" 
                                ShowFooter="True"                                            
                                AllowFilteringByColumn="True"
                                Height="550px"
                                Skin="Office2007" 
                                AllowMultiRowSelection="True"
                               
                                onneeddatasource="tk_Grid_NeedDataSource" 
                                onitemdatabound="tk_Grid_ItemDataBound" 
                                OnItemCommand="tk_Grid_ItemCommand"
                                OnItemCreated="tk_Grid_ItemCreated"
                                OnGridExporting="RadGrid1_GridExporting" Culture="es-ES" GroupPanelPosition="Top"
                                 >
                                
                                <HeaderStyle CssClass="arial10bold" Font-Bold="true"/>
                                <FooterStyle CssClass="arial10bold" BackColor="AliceBlue"/>
                                <FilterItemStyle HorizontalAlign="Right" />
                                <GroupHeaderItemStyle CssClass="arial10px" />
                                <GroupingSettings CaseSensitive="False" /> 
                                
                                <HeaderContextMenu Skin="Office2007">
                                    <ExpandAnimation Duration="100" />
                                </HeaderContextMenu>
                                
                                <ExportSettings  ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" >
                                    <Pdf PageWidth="480mm" Creator="SGH-Peru" Author="Sistema de Contabilidad" PageBottomMargin="5px" PageTopMargin="5px" PageLeftMargin="5px" PageRightMargin="5px" />
                                </ExportSettings>
                                
                                <MasterTableView DataKeyNames="AsientoContableID,HotelID,Bloqueado,SubDiarioID" 
                                    ShowGroupFooter="true" GroupLoadMode="Client" 
                                    NoMasterRecordsText="No hay Registros." >
                              
                                    <Columns>
                                        
                                        <telerik:GridClientSelectColumn  UniqueName="CheckBoxTemplateColumn" HeaderStyle-Width="40px"  >
                                            <HeaderStyle HorizontalAlign="Center" />
                                        </telerik:GridClientSelectColumn>
                                        
                                        <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="2%">
                                            <ItemTemplate>
                                            <asp:ImageButton ID="btnLock" runat="server" ToolTip="Bloquear" ImageUrl="~/images/lock.GIF" 
                                                CommandName="Bloquear" CommandArgument=''/>
                                            </ItemTemplate>
                                            <HeaderStyle Width="3%"></HeaderStyle>
                                        </telerik:GridTemplateColumn>                                                                                               
                                                <%--nbernuy  --%>   
                                        <telerik:GridBoundColumn HeaderText="Usuario" DataField="NombreUsuario"  Visible="true" Display="false"
                                            UniqueName="NombreUsuario" SortExpression="NombreUsuario" AutoPostBackOnFilter="true"
                                            CurrentFilterFunction="Contains" ShowFilterIcon="false">
                                            <HeaderStyle HorizontalAlign="Center" />
                                        </telerik:GridBoundColumn>
                                        
                                        <telerik:GridBoundColumn HeaderText="FECHAREGISTRO" DataField="FechaRegistro"  Visible="true" Display="false"
                                            UniqueName="FechaRegistro" SortExpression="FechaRegistro" AutoPostBackOnFilter="true"
                                            CurrentFilterFunction="Contains" ShowFilterIcon="false">
                                            <HeaderStyle HorizontalAlign="Center" />
                                        </telerik:GridBoundColumn>

                                        
                                        <%-- nbernuy --%>   
                                        <telerik:GridBoundColumn HeaderText="AsientoContableID" DataField="AsientoContableID" Visible="false"
                                            UniqueName="AsientoContableID" SortExpression="AsientoContableID" AutoPostBackOnFilter="true"
                                            CurrentFilterFunction="Contains" ShowFilterIcon="false" FilterListOptions="VaryByDataTypeAllowCustom">
                                            <HeaderStyle HorizontalAlign="Center" />
                                        </telerik:GridBoundColumn>

                                        <telerik:GridBoundColumn HeaderText="SubDiarioID" DataField="SubDiarioID"  Visible="false"
                                            UniqueName="SubDiarioID" SortExpression="SubDiarioID" AutoPostBackOnFilter="true" 
                                            CurrentFilterFunction="Contains" ShowFilterIcon="false" FilterListOptions="VaryByDataTypeAllowCustom">
                                            <HeaderStyle HorizontalAlign="Center" />
                                        </telerik:GridBoundColumn>

                                        <telerik:GridBoundColumn HeaderText="NombreSubDiario" DataField="BESubDiarios.NombreSubDiario" Display="false"
                                            UniqueName="BESubDiarios.NombreSubDiario" SortExpression="BESubDiarios.NombreSubDiario" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                            CurrentFilterFunction="Contains" ShowFilterIcon="false">
                                            <HeaderStyle HorizontalAlign="Left" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </telerik:GridBoundColumn>

                                        
                                        <telerik:GridBoundColumn HeaderText="Glosa" DataField="Glosa"
                                            UniqueName="Glosa" SortExpression="Glosa" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                            CurrentFilterFunction="Contains" ShowFilterIcon="false">
                                            <HeaderStyle HorizontalAlign="Left" Width="330px" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </telerik:GridBoundColumn>
                                        

                                        <telerik:GridBoundColumn HeaderText="Dia" DataField="Dia" DataFormatString="{0:dd/MM/yyyy}"
                                            UniqueName="Dia" SortExpression="Dia" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                            CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            <HeaderStyle HorizontalAlign="Left" Width="70px" />
                                            <ItemStyle HorizontalAlign="Left" />
                                        </telerik:GridBoundColumn>

                                        <telerik:GridBoundColumn HeaderText="Comprob" DataField="Comprobante"  FilterControlWidth="100%"
                                            UniqueName="Comprobante" SortExpression="Comprobante" AutoPostBackOnFilter="true"
                                            CurrentFilterFunction="Contains" ShowFilterIcon="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                            <HeaderStyle HorizontalAlign="Right" Width="40px" />
                                        </telerik:GridBoundColumn>
                                        

                                        <telerik:GridNumericColumn  HeaderText="DebeSoles" DataField="DebeSoles" Aggregate="Sum" FooterAggregateFormatString="{0:N2}"
                                             AutoPostBackOnFilter="true" DataFormatString="{0:N2}"  FilterControlWidth="100%"
                                            CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                            <HeaderStyle HorizontalAlign="Right" Width="70px" />
                                            <FooterStyle HorizontalAlign="Right"  />
                                        </telerik:GridNumericColumn>
                                        
                                        <telerik:GridNumericColumn HeaderText="HaberSoles" DataField="HaberSoles" Aggregate="Sum" FooterAggregateFormatString="{0:N2}"
                                            AutoPostBackOnFilter="true" DataFormatString="{0:N2}"  FilterControlWidth="100%"
                                            CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                            <HeaderStyle HorizontalAlign="Right" Width="70px" />
                                            <FooterStyle HorizontalAlign="Right" />
                                        </telerik:GridNumericColumn>         
                                                                                                                               
                                        <telerik:GridNumericColumn HeaderText="Saldo S/" DataField="SaldoSoles" Aggregate="Sum" DataFormatString="{0:N2}" FooterAggregateFormatString="{0:N2}"
                                            UniqueName="SaldoSoles" SortExpression="SaldoSoles" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                            CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                            <HeaderStyle HorizontalAlign="Right" Width="60px" />
                                            <FooterStyle HorizontalAlign="Right" />
                                        </telerik:GridNumericColumn>
                                        

                                        <telerik:GridNumericColumn HeaderText="DebeDolares" DataField="DebeDolares" Aggregate="Sum" DataFormatString="{0:N2}" FooterAggregateFormatString="{0:N2}"
                                            UniqueName="DebeDolares" SortExpression="DebeDolares" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                            CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                            <HeaderStyle HorizontalAlign="Right" Width="70px"  />
                                            <FooterStyle HorizontalAlign="Right" />
                                        </telerik:GridNumericColumn>
                                        
                                        <telerik:GridNumericColumn HeaderText="HaberDolares" DataField="HaberDolares" Aggregate="Sum" DataFormatString="{0:N2}" FooterAggregateFormatString="{0:N2}" 
                                            UniqueName="HaberDolares" SortExpression="HaberDolares" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                            CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                            <HeaderStyle HorizontalAlign="Right" Width="70px" />
                                            <FooterStyle HorizontalAlign="Right" />
                                        </telerik:GridNumericColumn>            
                                                                                                                            
                                        <telerik:GridNumericColumn HeaderText="Saldo $." DataField="SaldoDolares" Aggregate="Sum" DataFormatString="{0:N2}" FooterAggregateFormatString="{0:N2}"
                                            UniqueName="SaldoDolares" SortExpression="SaldoDolares" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                                            CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                            <HeaderStyle HorizontalAlign="Right" Width="60px" />
                                            <FooterStyle HorizontalAlign="Right" />
                                        </telerik:GridNumericColumn>
                                        
                                        <telerik:GridNumericColumn HeaderText="Bloqueado" DataField="Bloqueado" UniqueName="Bloqueado" SortExpression="Bloqueado" AutoPostBackOnFilter="true" Visible="true" Display="false"
                                            FilterControlWidth="100%" CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                            <HeaderStyle HorizontalAlign="Right" />
                                            <FooterStyle HorizontalAlign="Right" />
                                        </telerik:GridNumericColumn>
                                                                                
                                        
                                        <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="3%">
                                            <ItemTemplate>
                                                 <asp:Image ID="btnEditar" runat="server" ToolTip="Ver Detalle" ImageUrl="images/botones/editar.png"/>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Right" />
                                            <HeaderStyle HorizontalAlign="Right" />
                                        </telerik:GridTemplateColumn>
                                                            
                                        <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="3%">
                                            <ItemTemplate>
                                            
                                            <asp:HyperLink ID="ArchivoLink" runat="server"  ToolTip=' Archivos Adjuntos'  ImageUrl="~/images/botones/attachment.GIF"></asp:HyperLink>
                                            </ItemTemplate>
                                            <HeaderStyle Width="3%"></HeaderStyle>
                                        </telerik:GridTemplateColumn>

                                       <telerik:GridTemplateColumn AllowFiltering="false" ShowFilterIcon="false" ShowSortIcon="false" HeaderStyle-Width="3%">
                                           <ItemTemplate >
                                            <asp:ImageButton ID="btnAuditoria" runat="server" ToolTip="Ver Detalle" ImageUrl="images/botones/historial.gif" />    
                                            
                                           </ItemTemplate>
                                           <HeaderStyle Width="3%" />
                                       </telerik:GridTemplateColumn>  
                                         
                                        
                                    </Columns>
                                    <CommandItemStyle HorizontalAlign="Left" Height="25px" />
                                    
                                 
                                    <GroupByExpressions >
                                        <telerik:GridGroupByExpression > 
                                            <GroupByFields >                                                                                                        
                                                <telerik:GridGroupByField   FieldName="SubDiarioID"  FormatString="{0:g}" />  
                                            </GroupByFields>
                                            
                                            <SelectFields>
                                                <telerik:GridGroupByField FieldName="BESubDiarios.NombreSubDiario" HeaderText="Cuenta" />
                                            </SelectFields>
                                            
                                        </telerik:GridGroupByExpression>
                                    </GroupByExpressions>
                                   <GroupHeaderItemStyle HorizontalAlign="Left" CssClass="gridtext"  />
                                
                                
                                </MasterTableView>
                                
                                <GroupingSettings ShowUnGroupButton="True" CollapseTooltip="" ExpandTooltip="" 
                                    GroupContinuedFormatString="... grupo continua de l apagin anterior. " 
                                    GroupContinuesFormatString="Grupo continua en la pagina siguiente" 
                                    GroupSplitDisplayFormat="Mostrando {0} de {1} items." />
                                <GroupHeaderItemStyle HorizontalAlign="Left" />
                                                
                                <ClientSettings EnableRowHoverStyle="true">
                                    <Selecting AllowRowSelect="true" />
                                    <Scrolling AllowScroll="true" UseStaticHeaders="true"/>
                                     <%--<DataBinding Location=frmListaAsientos.aspx" SelectMethod="GetDataAndCount" EnableCaching="true" />--%>
                                     <%--<DataBinding Location="WebService.asmx" SelectMethod="GetDataAndCount" />--%>
                                     <DataBinding EnableCaching="true" SelectMethod="GetDataAndCount" ></DataBinding>
                                </ClientSettings>
                                
                            </telerik:RadGrid>
                        <%--    <telerik:RadGrid ID="RadGrid1" runat="server"></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>
      <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Office2007">
        <Windows>
            <telerik:RadWindow ID="UserListDialog" runat="server" Behaviors="Move,Close" VisibleStatusbar="false"
                Title="Listado de Archivos Adjuntos" AutoSize="false" Width="630px" Height="500px" ReloadOnShow="true"
                ShowContentDuringLoad="false" Modal="true" />
        </Windows>
    </telerik:RadWindowManager>
    
    <script type="text/javascript">

        function Confirmacion() {

            return confirm("Seguro de eliminar todos los registros?");

        }

    </script>
    </form>
</body>
</html>
