This commit is contained in:
2023-02-15 09:35:55 -07:00
7 changed files with 5543 additions and 4254 deletions

View File

@@ -1903,14 +1903,15 @@ Public Class ClsBancos
Return Retorno Return Retorno
End Function End Function
Public Function GetIngresoEgresosDelDia(Fecha As Date, Tipo As String, CveEmpresa As Integer) As Boolean Public Function GetIngresoEgresosDelDia(Fecha As Date, Tipo As String, CveEmpresa As Integer, Optional Opcion As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Banc_IngresoEgresosDiariosGet") DataAdapter("PA_Banc_IngresoEgresosDiariosGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@Fecha", SqlDbType.Date).Value = Fecha .Add("@Fecha", SqlDbType.Date).Value = Fecha
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Tipo", SqlDbType.VarChar).Value = Tipo .Add("@Tipo", SqlDbType.VarChar).Value = Tipo 'Ing Ingresp Egs Egreso
.Add("@Opcion", SqlDbType.VarChar).Value = Opcion ' 1 Bancos 2 caja chica
End With End With
Try Try

View File

@@ -60,21 +60,40 @@ Partial Class Bancos_FlujoDiario
params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
'SE LLENA TmpDTSaldosIniciales 'SE LLENA TmpDTSaldosIniciales
Dim Ban As New ClsBancos Dim Ban As New ClsBancos
Dim TmpDTIngresosDelDiaCajaChica As New DataTable
Dim TmpDTGastosDelDiaCajaChica As New DataTable
If Ban.GetBancosSaldos(-1, -1, -1, MinFecha.ToString, TxtFecha.Text.ToDate.AddDays(-1).ToShortDateString, 0, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then If Ban.GetBancosSaldos(-1, -1, -1, MinFecha.ToString, TxtFecha.Text.ToDate.AddDays(-1).ToShortDateString, 0, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TmpDTSaldosIniciales = Ban.DtResultados TmpDTSaldosIniciales = Ban.DtResultados
End If End If
'Se Llena TmpDTIngresosDelDia 'Se Llena TmpDTIngresosDelDia
If Ban.GetIngresoEgresosDelDia(TxtFecha.Text.ToDate, "Ing", UsuarioActual.CveEmpresa) Then If Ban.GetIngresoEgresosDelDia(TxtFecha.Text.ToDate, "Ing", UsuarioActual.CveEmpresa, 1) Then
TmpDTIngresosDelDia = Ban.DtResultados'.FiltraParametros("CveTipoTransaccion <> 8") TmpDTIngresosDelDia = Ban.DtResultados
TmpDTIngresosDelDia = Ban.DtResultados
End If
If Ban.GetIngresoEgresosDelDia(TxtFecha.Text.ToDate, "Ing", UsuarioActual.CveEmpresa, 2) Then
TmpDTIngresosDelDiaCajaChica = Ban.DtResultados '.FiltraParametros("CveTipoTransaccion <> 8")
End If End If
'Se Llena TmpDTGastosDelDia 'Se Llena TmpDTGastosDelDia
If Ban.GetIngresoEgresosDelDia(TxtFecha.Text.ToDate, "Egs", UsuarioActual.CveEmpresa) Then If Ban.GetIngresoEgresosDelDia(TxtFecha.Text.ToDate, "Egs", UsuarioActual.CveEmpresa, 1) Then
TmpDTGastosDelDia = Ban.DtResultados'.FiltraParametros("CveTipoTransaccion <> 2") TmpDTGastosDelDia = Ban.DtResultados '.FiltraParametros("CveTipoTransaccion <> 2")
End If
If Ban.GetIngresoEgresosDelDia(TxtFecha.Text.ToDate, "Egs", UsuarioActual.CveEmpresa, 2) Then
TmpDTGastosDelDiaCajaChica = Ban.DtResultados '.FiltraParametros("CveTipoTransaccion <> 2")
End If End If
'Se Llena TmpDTSaldosActuales 'Se Llena TmpDTSaldosActuales
@@ -91,10 +110,15 @@ Partial Class Bancos_FlujoDiario
Dim rds5 As New ReportDataSource With {.Name = "DataSet5", .Value = If(TmpDTGastosDelDia IsNot Nothing, TmpDTGastosDelDia, New DataTable)} Dim rds5 As New ReportDataSource With {.Name = "DataSet5", .Value = If(TmpDTGastosDelDia IsNot Nothing, TmpDTGastosDelDia, New DataTable)}
Dim rds4 As New ReportDataSource With {.Name = "DataSet4", .Value = If(TmpDTSaldosActuales IsNot Nothing, TmpDTSaldosActuales, New DataTable)} Dim rds4 As New ReportDataSource With {.Name = "DataSet4", .Value = If(TmpDTSaldosActuales IsNot Nothing, TmpDTSaldosActuales, New DataTable)}
Dim rds6 As New ReportDataSource With {.Name = "DataSet6", .Value = If(TmpDTIngresosDelDiaCajaChica IsNot Nothing, TmpDTIngresosDelDiaCajaChica, New DataTable)}
Dim rds7 As New ReportDataSource With {.Name = "DataSet7", .Value = If(TmpDTGastosDelDiaCajaChica IsNot Nothing, TmpDTGastosDelDiaCajaChica, New DataTable)}
lrds.Add(rds) lrds.Add(rds)
lrds.Add(rds2) lrds.Add(rds2)
lrds.Add(rds3) lrds.Add(rds3)
lrds.Add(rds4) lrds.Add(rds4)
lrds.Add(rds6)
lrds.Add(rds7)
'lrds.Add(rds5)- 'lrds.Add(rds5)-

View File

@@ -1247,8 +1247,7 @@
</div> </div>
<div class="tools"> <div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
</div> </div>
<div class="actions"> <div class="actions">
@@ -1257,6 +1256,10 @@
<ContentTemplate> <ContentTemplate>
<asp:LinkButton ID="LnkHistorialComprasPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkHistorialComprasPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkHistorialComprasExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkHistorialComprasExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHistorial.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHistorial.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="LnkHistorialComprasPDF" /> <asp:PostBackTrigger ControlID="LnkHistorialComprasPDF" />
@@ -1268,10 +1271,6 @@
</div> </div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom "> <div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHistorial.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHistorial.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<table border="0" class="Widthall"> <table border="0" class="Widthall">
<tr> <tr>
<td> <td>
@@ -1770,7 +1769,7 @@
<br /> <br />
<div class="row"> <div class="row">
<div class="pull-right"> <div class="pull-right">
<asp:HyperLink ID="HplAbonarMasivoNotas" Visible="False" runat="server" CssClass="Texto" NavigateUrl="#" ToolTip="Devolución múltiple">Devolución múltiple <img src="/Imagenes/Money_Add.png" alt="Pagar múltiples facturas" /></asp:HyperLink>&nbsp; &nbsp;&nbsp;&nbsp
</div> </div>
</div> </div>
@@ -1783,17 +1782,22 @@
</div> </div>
<div class="tools"> <div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
<a href="javascript:;" class="remove" data-original-title="" title=""></a>
</div> </div>
<div class="actions"> <div class="actions">
<div class="btn-group"> <div class="btn-group">
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel7"> <asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel7">
<ContentTemplate> <ContentTemplate>
<asp:HyperLink ID="HplAbonarMasivoNotas" Visible="False" runat="server" CssClass="Texto" NavigateUrl="#" ToolTip="Devolución múltiple">Devolución múltiple <img src="/Imagenes/Money_Add.png" alt="Pagar múltiples facturas" /></asp:HyperLink> &nbsp;
<asp:LinkButton ID="LnkNCxAplicarPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkNCxAplicarPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkNCxAplicarExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkNCxAplicarExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<input type="text" id="TxtBusqueda4" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda4','{0}')", GvA.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda4','{0}')", GvA.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="LnkNCxAplicarPDF" /> <asp:PostBackTrigger ControlID="LnkNCxAplicarPDF" />
@@ -1805,8 +1809,7 @@
</div> </div>
<div class="portlet-body "> <div class="portlet-body ">
<div class="row" style="margin-right: 10px;" align="right"> <div class="row" style="margin-right: 10px;" align="right">
<input type="text" id="TxtBusqueda4" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda4','{0}')", GvA.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda4','{0}')", GvA.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<asp:GridView ID="GvA" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Anticipos" DataKeyNames="CveCompra" <asp:GridView ID="GvA" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Anticipos" DataKeyNames="CveCompra"
@@ -1866,9 +1869,7 @@
</div> </div>
<div class="tools"> <div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
<a href="javascript:;" class="remove" data-original-title="" title=""></a>
</div> </div>
<div class="actions"> <div class="actions">
@@ -1877,6 +1878,10 @@
<ContentTemplate> <ContentTemplate>
<asp:LinkButton ID="LnkNCxAplicarHistorialPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkNCxAplicarHistorialPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkNCxAplicarHistorialExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkNCxAplicarHistorialExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<input type="text" id="TxtBusqueda5" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda5','{0}')", GvAH.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda5','{0}')", GvAH.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="LnkNCxAplicarHistorialPDF" /> <asp:PostBackTrigger ControlID="LnkNCxAplicarHistorialPDF" />
@@ -1888,8 +1893,7 @@
</div> </div>
<div class="portlet-body "> <div class="portlet-body ">
<div class="row" style="margin-right: 10px;" align="right"> <div class="row" style="margin-right: 10px;" align="right">
<input type="text" id="TxtBusqueda5" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda5','{0}')", GvAH.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda5','{0}')", GvAH.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<table border="0" class="Widthall"> <table border="0" class="Widthall">
<tr> <tr>
@@ -1958,9 +1962,6 @@
</div> </div>
<div class="tools"> <div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
<a href="javascript:;" class="remove" data-original-title="" title=""></a>
</div> </div>
<div class="actions"> <div class="actions">
@@ -1969,6 +1970,11 @@
<ContentTemplate> <ContentTemplate>
<asp:LinkButton ID="LnkCtasBancariasPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkCtasBancariasPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkCtasBancariasExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkCtasBancariasExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<input type="text" id="TxtBancosCuentasBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBancosCuentasBusqueda','{0}')", GvBancosCuentas.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBancosCuentasBusqueda','{0}')", GvBancosCuentas.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="LnkCtasBancariasPDF" /> <asp:PostBackTrigger ControlID="LnkCtasBancariasPDF" />
@@ -2082,9 +2088,7 @@
</div> </div>
<div class="tools"> <div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
<a href="javascript:;" class="remove" data-original-title="" title=""></a>
</div> </div>
<div class="actions"> <div class="actions">
@@ -2093,6 +2097,10 @@
<ContentTemplate> <ContentTemplate>
<asp:LinkButton ID="LnkPagosProveedoresBancosPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkPagosProveedoresBancosPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkPagosProveedoresBancosExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkPagosProveedoresBancosExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<input type="text" id="TxtBusqueda7" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda7','{0}')", GvBancos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda7','{0}')", GvBancos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="LnkPagosProveedoresBancosPDF" /> <asp:PostBackTrigger ControlID="LnkPagosProveedoresBancosPDF" />
@@ -2104,10 +2112,6 @@
</div> </div>
<div class="portlet-body "> <div class="portlet-body ">
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda7" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda7','{0}')", GvBancos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda7','{0}')", GvBancos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<table border="0" width="100%"> <table border="0" width="100%">
<tr> <tr>
<td> <td>
@@ -2197,6 +2201,10 @@
<ContentTemplate> <ContentTemplate>
<asp:LinkButton ID="LnkPagosNoBancariosPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkPagosNoBancariosPDF" runat="server" data-toggle="tooltip" Title="PDF"> <i class="fa fa-file-pdf-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<asp:LinkButton ID="LnkPagosNoBancariosExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton> <asp:LinkButton ID="LnkPagosNoBancariosExcel" runat="server" data-toggle="tooltip" Title="Excel"><i class="fa fa-file-excel-o" style="margin-right: 10px; font-size:15px; font-weight:bold; color:dimgray;"></i> </asp:LinkButton>
<input type="text" id="TxtBusquedaPagosNoBancarios" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaPagosNoBancarios','{0}')", GvPagosNoBancarios.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaPagosNoBancarios','{0}')", GvPagosNoBancarios.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="LnkPagosNoBancariosPDF" /> <asp:PostBackTrigger ControlID="LnkPagosNoBancariosPDF" />
@@ -2208,8 +2216,7 @@
</div> </div>
<div class="portlet-body"> <div class="portlet-body">
<div class="" align="right"> <div class="" align="right">
<input type="text" id="TxtBusquedaPagosNoBancarios" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaPagosNoBancarios','{0}')", GvPagosNoBancarios.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaPagosNoBancarios','{0}')", GvPagosNoBancarios.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<div class="table-scrollable"> <div class="table-scrollable">

View File

@@ -39,7 +39,7 @@
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton> <asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="ImgExcelPersonalizado" runat="server" Visible="false"> <i class="fa fa-ad-excel"></i> Generar Excel Personalizado</asp:LinkButton> <asp:LinkButton ID="ImgExcelPersonalizado" runat="server" Visible="false"> <i class="fa fa-file-excel-o"></i> Generar Excel Personalizado</asp:LinkButton>
</li> </li>
<li> <li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar Columnas</asp:HyperLink> <asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar Columnas</asp:HyperLink>
@@ -544,7 +544,7 @@
<asp:BoundField HeaderText="Dias Trans" DataField="DiasTranscurridos" DataFormatString="{0}" Visible="false" /> <asp:BoundField HeaderText="Dias Trans" DataField="DiasTranscurridos" DataFormatString="{0}" Visible="false" />
<asp:BoundField HeaderText="T.C." DataField="TipoCambio" DataFormatString="{0}" Visible="false" /> <asp:BoundField HeaderText="T.C." DataField="TipoCambio" DataFormatString="{0}" Visible="false" />
<asp:BoundField HeaderText="Fecha Ejecución" DataField="FechaEjecucion" DataFormatString="{0:d}" Visible="false" /> <asp:BoundField HeaderText="Fecha Ejecución" DataField="FechaEjecucion" DataFormatString="{0:d}" Visible="false" />
<asp:BoundField HeaderText="Linea Adicional" DataField="LineaAdicional" ItemStyle-HorizontalAlign="Center" Visible="false" /> <asp:BoundField HeaderText="Linea Adicional" DataField="LineaAdicional" ItemStyle-HorizontalAlign="Left" Visible="false" />
<asp:BoundField HeaderText="Descripción" DataField="DescripcionVenta" ItemStyle-HorizontalAlign="Center" Visible="false" /> <asp:BoundField HeaderText="Descripción" DataField="DescripcionVenta" ItemStyle-HorizontalAlign="Center" Visible="false" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>

View File

@@ -898,49 +898,71 @@ Partial Class RepCxCDetalle
GenerarImpresion("EXCEL") GenerarImpresion("EXCEL")
End Sub End Sub
Private Sub ImgExcelPersonalizado_Click(sender As Object, e As EventArgs) Handles ImgExcelPersonalizado.Click Private Sub ImgExcelPersonalizado_Click(sender As Object, e As EventArgs) Handles ImgExcelPersonalizado.Click
SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet())
Dim ef As ExcelFile = New ExcelFile Dim Cliente = If(DdlClientesWS.SelectedValue = "-1", "", $" Cliente: {DdlClientesWS.SelectedText}")
Dim ws As ExcelWorksheet = ef.Worksheets.Add("DataTable to Sheet") Dim Sucursal = If(DdlSubProyecto.SelectedValue = "-1", "", $" Sucursal: {DdlSubProyecto.SelectedItem.Text}")
Dim dt As DataTable = New DataTable Dim Grupo = $" Agrupado Por: {DdlGrupo.SelectedItem.Text}" 'If(DdlGrupo.SelectedValue = "3", "", $"&emsp;<b>Agrupado Por:</b>&nbsp;{DdlGrupo.SelectedItem.Text}")
Dim response As HttpResponse = Me.Response Dim TipoDocto = If(DdlTipoDocto.GetSelectedText = "", "", $" Documentos: {DdlTipoDocto.GetSelectedText}")
Dim Vendedor = If(DdlVendedor.SelectedValue = "-1", "", $" Vendedor: {DdlVendedor.SelectedItem.Text}")
Dim FechaIn As String = If(txtFechaI.Text = "", "", $" Fecha Inicio Docto: {txtFechaI.Text}")
Dim FechaFn As String = If(txtFechaF.Text = "", "", $" Fecha Fin Docto: {txtFechaF.Text}")
Dim FVI As String = If(txtFechaVI.Text = "", "", $" Fecha Venc. Inic.: {txtFechaVI.Text}")
Dim FVF As String = If(txtFechaVF.Text = "", "", $" Fecha Venc. Final: ;{txtFechaVF.Text}")
Dim Registro = If(DdlUsuario.SelectedValue = "-1", "", $" Registró: ;{DdlUsuario.SelectedItem.Text}")
Dim Responsable = If(DdlResponsable.SelectedValue = "-1", "", $" Responsable: ;{DdlResponsable.SelectedItem.Text}")
Dim EstatusCob = If(DdlCobranzaEstatusFiltro.SelectedValue = "-1", "", $"status Cobranza: ;{DdlCobranzaEstatusFiltro.SelectedItem.Text}")
Dim CorteA As String = If(txtCorteA.Text = "31/12/2019", "", $"Corte A {txtCorteA.Text}")
Dim ClasificacionCli = If(DdlClienteClasificacion.SelectedValue = "-1", "", $" Clasificación Cliente: {DdlClienteClasificacion.SelectedItem.Text}")
'Recorrer columnas Dim Filtro As String = $"{Cliente}{Sucursal}{Grupo}{Vendedor}{FechaIn}{FechaFn}{Registro}{Responsable}{TipoDocto}{EstatusCob}{FVI}{FVF}{ClasificacionCli}{CorteA}"
For index = 0 To GvDatos.Columns.Count - 1
If GvDatos.Columns(index).Visible Then
dt.Columns.Add(GvDatos.Columns(index).HeaderText)
End If
Next
'Recorrer filas ExportToExcelGembox(GvDatos, "ReporteCxCDetalle", UsuarioActual, "REPORTE DE CUENTAS POR COBRAR DEL CLIENTE CON DETALLE", DatoTituloExtra:=$"", DatosFiltros:=Filtro)
For Each fila As GridViewRow In GvDatos.Rows 'GvDatos.ExportToExcelG("ReporteCxCDetalle", "REPORTE DE CUENTAS POR COBRAR DEL CLIENTE CON DETALLE", UsuarioActual, Filtro)
Dim dr As DataRow = dt.NewRow()
For index = 0 To GvDatos.Columns.Count - 1 'SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet())
If GvDatos.Columns(index).Visible Then
If TypeOf GvDatos.Columns(index) Is TemplateField Then
If GvDatos.Columns(index).HeaderText = "Folio" Then
dr(GvDatos.Columns(index).HeaderText) = fila.FCHyperLink("HlFolio").Text.Replace("&nbsp;", "")
End If
ElseIf TypeOf GvDatos.Columns(index) Is HyperLinkField Then
dr(GvDatos.Columns(index).HeaderText) = DirectCast(fila.Cells(index).Controls(0), HyperLink).Text.Replace("&nbsp;", "")
Else
dr(GvDatos.Columns(index).HeaderText) = fila.Cells(index).Text.Replace("&nbsp;", "")
End If
End If
Next
dt.Rows.Add(dr)
Next
' Insert DataTable into an Excel worksheet. 'Dim ef As ExcelFile = New ExcelFile
ws.InsertDataTable(dt, 'Dim ws As ExcelWorksheet = ef.Worksheets.Add("DataTable to Sheet")
New InsertDataTableOptions() With 'Dim dt As DataTable = New DataTable
{ 'Dim response As HttpResponse = Me.Response
.ColumnHeaders = True,
.StartRow = 1 ''Recorrer columnas
}) 'For index = 0 To GvDatos.Columns.Count - 1
' If GvDatos.Columns(index).Visible Then
' dt.Columns.Add(GvDatos.Columns(index).HeaderText)
' End If
'Next
''Recorrer filas
'For Each fila As GridViewRow In GvDatos.Rows
' Dim dr As DataRow = dt.NewRow()
' For index = 0 To GvDatos.Columns.Count - 1
' If GvDatos.Columns(index).Visible Then
' If TypeOf GvDatos.Columns(index) Is TemplateField Then
' If GvDatos.Columns(index).HeaderText = "Folio" Then
' dr(GvDatos.Columns(index).HeaderText) = fila.FCHyperLink("HlFolio").Text.Replace("&nbsp;", "")
' End If
' ElseIf TypeOf GvDatos.Columns(index) Is HyperLinkField Then
' dr(GvDatos.Columns(index).HeaderText) = DirectCast(fila.Cells(index).Controls(0), HyperLink).Text.Replace("&nbsp;", "")
' Else
' dr(GvDatos.Columns(index).HeaderText) = fila.Cells(index).Text.Replace("&nbsp;", "")
' End If
' End If
' Next
' dt.Rows.Add(dr)
'Next
'' Insert DataTable into an Excel worksheet.
'ws.InsertDataTable(dt,
' New InsertDataTableOptions() With
' {
' .ColumnHeaders = True,
' .StartRow = 1
' })
'ef.Save(response, "RepCxC.xlsx")
ef.Save(response, "RepCxC.xlsx")
End Sub End Sub
Private Sub GenerarImpresion(Optional TipoImpresion As String = "PDF") Private Sub GenerarImpresion(Optional TipoImpresion As String = "PDF")
@@ -1151,4 +1173,220 @@ Partial Class RepCxCDetalle
#End Region #End Region
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub
Public Sub ExportToExcelGembox(GridView As GridView, NombreArchivoXLSx As String, Usuario As Usuario, Titulo As String, Optional DatoTituloExtra As String = "", Optional DatosFiltros As String = "", Optional AnchoImagen As Integer = 100, Optional AlturaImagen As Integer = 100, Optional DTExtra As DataTable = Nothing)
Dim sw1 As New StringWriter()
Dim htw1 As New HtmlTextWriter(sw1)
GridView.RenderControl(htw1)
Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault
Dim htmlStream1 = New MemoryStream(options.Encoding.GetBytes(sw1.ToString()))
htmlStream1.Position = 0
Dim sr1 As New StreamReader(htmlStream1)
Dim myStr1 = sr1.ReadToEnd()
sr1.Dispose()
htmlStream1.Dispose()
sw1.Dispose()
Dim HtmlCompleto As String = myStr1
HtmlCompleto = Regex.Replace(HtmlCompleto, "\<[\/]*a[^\>]*\>", "")
Dim htmlStream5 = New MemoryStream(options.Encoding.GetBytes(HtmlCompleto))
GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet)
Dim excel As GemBox.Spreadsheet.ExcelFile
excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream5, options)
If Usuario IsNot Nothing Then
Dim TotalRowHeader As Integer = 6
Dim TotalRowFooter As Integer = 2
Dim worksheet = excel.Worksheets(0)
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
Dim celdasConTexto = worksheet.GetUsedCellRange(True)
If celdasConTexto Is Nothing Then Exit Sub 'No se recuperaron datos, salir de sin guardar porque soltará error
celdasConTexto.Style.Font.Name = "Calibri Light"
Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
RangoNombreEmpresa.Merged = True
RangoNombreEmpresa.Value = Usuario.Empresa.Empresa
RangoNombreEmpresa.Style.Font.Size = 18 * 20
RangoNombreEmpresa.Style.Font.Name = "Calibri Light"
RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
RangoTitulo.Merged = True
RangoTitulo.Value = Titulo
RangoTitulo.Style.Font.Size = 20 * 20
RangoTitulo.Style.Font.Name = "Calibri Light"
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
If DatoTituloExtra.Length > 0 Then
Dim RangoDatoTituloExtra = worksheet.Cells.GetSubrangeAbsolute(TotalRowHeader, celdasConTexto.FirstColumnIndex, TotalRowHeader, celdasConTexto.LastColumnIndex)
RangoDatoTituloExtra.Merged = True
RangoDatoTituloExtra.Value = DatoTituloExtra
RangoDatoTituloExtra.Style.Font.Size = 20 * 20
RangoDatoTituloExtra.Style.Font.Name = "Calibri Light"
RangoDatoTituloExtra.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left
RangoDatoTituloExtra.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
End If
If DatosFiltros.Length > 0 Then
Dim Arreglo As String() = DatosFiltros.Split("|"c)
worksheet.Rows.InsertEmpty(TotalRowHeader, Arreglo.Count)
For Each TextoFiltro As String In Arreglo
Dim RangoDatoTituloExtra = worksheet.Cells.GetSubrangeAbsolute(TotalRowHeader, celdasConTexto.FirstColumnIndex, TotalRowHeader, celdasConTexto.LastColumnIndex)
RangoDatoTituloExtra.Merged = True
RangoDatoTituloExtra.Value = TextoFiltro
RangoDatoTituloExtra.Style.Font.Size = 12 * 20
RangoDatoTituloExtra.Style.Font.Name = "Calibri Light"
RangoDatoTituloExtra.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left
RangoDatoTituloExtra.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
TotalRowHeader += 1
Next
End If
' TotalRowHeader += 2
For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
worksheet.Rows(TotalRowHeader).Cells(i).Style.Font.Size = 12 * 20
worksheet.Rows(TotalRowHeader).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
worksheet.Rows(TotalRowHeader).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
worksheet.Rows(TotalRowHeader).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255))
worksheet.Rows(TotalRowHeader).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
If i > 0 Then
Try
worksheet.Columns(i).AutoFit(1)
Catch ex As Exception
End Try
End If
Next
Dim IndexEndTable As Integer = GridView.Rows.Count + TotalRowHeader + TotalRowFooter
worksheet.Rows(IndexEndTable).Cells(1).Value = "Usuario Imprimió"
worksheet.Rows(IndexEndTable + 1).Cells(1).Value = Usuario.Nombre
worksheet.Rows(IndexEndTable).Cells(3).Value = "Fecha Impresión"
worksheet.Rows(IndexEndTable + 1).Cells(3).Value = DateTime.Now.ToString("dd/MM/yyyy")
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta))
If Imagen.Exists Then
Dim Ruta As String = String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)
Using sr As New StreamReader(Ruta)
Dim ms As New MemoryStream()
sr.BaseStream.CopyTo(ms)
worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel)
End Using
End If
For I = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex - 2
If I > 0 Then
If 1 = 1 Then
worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00"
Else
worksheet.Columns(I + 1).Style.NumberFormat = "#,##"
End If
Try
worksheet.Columns(I).AutoFit(1)
Catch ex As Exception
End Try
End If
Next
If DTExtra IsNot Nothing Then
Dim NombreTabla As String = ""
If DTExtra.TableName IsNot Nothing Then
NombreTabla = DTExtra.TableName
End If
If NombreTabla.Trim = "" Then
NombreTabla = "hoja2"
End If
'excel.Worksheets.Add(NombreTabla)
Dim workbookDTExtra = New ExcelFile
Dim worksheetDTExtra = workbookDTExtra.Worksheets.Add(NombreTabla)
worksheetDTExtra.InsertDataTable(DTExtra,
New InsertDataTableOptions() With
{
.ColumnHeaders = True,
.StartRow = 0
})
Dim columnCount = worksheetDTExtra.CalculateMaxUsedColumns()
For i As Integer = 0 To columnCount - 1
worksheetDTExtra.Columns(i).AutoFit(1, worksheetDTExtra.Rows(1), worksheetDTExtra.Rows(worksheetDTExtra.Rows.Count - 1))
worksheetDTExtra.Cells(0, i).Style.FillPattern.SetSolid(Drawing.ColorTranslator.FromHtml("#4b77be"))
worksheetDTExtra.Cells(0, i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
Next
excel.Worksheets.AddCopy(NombreTabla, worksheetDTExtra)
excel.Worksheets(0).Name = Titulo
End If
Dim indexRow As Integer = 8
For indexRow = 8 To worksheet.Rows.Count - 4
If worksheet.Cells(indexRow, 0).Value.ToString.Trim = "" Then
worksheet.Cells.GetSubrangeRelative(indexRow, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(Drawing.ColorTranslator.FromHtml("#c0c0c0"))
End If
Next
End If
excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx")
End Sub
End Class End Class

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff