diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 3779fad2f..10c4b925e 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -8045,6 +8045,15 @@ Partial Class Compras_Compras
End If
End If
+
+ If Not ErrorPrepoliza AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
+ If ObjConta.ValorPolizaDescuadre > 0 Then
+ GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+ ErrorPrepolizaDescuadre = True
+ End If
+ End If
+
+
'ACTUALIZA CVEFACTURA
If Request("CveFactura") IsNot Nothing Then
diff --git a/Finanzas/RepRazonesFinancieras2.aspx b/Finanzas/RepRazonesFinancieras2.aspx
index ab46b5920..186359d82 100644
--- a/Finanzas/RepRazonesFinancieras2.aspx
+++ b/Finanzas/RepRazonesFinancieras2.aspx
@@ -11,9 +11,20 @@
-
- Generar Excel
-
+
+
+
+
+ Generar Excel
+
+
+
+
+
+
+
+
+
@@ -35,7 +46,7 @@
-
+
@@ -66,7 +77,7 @@
-
+
@@ -84,19 +95,19 @@
-
-
+ Codigo
-
+ Cuenta
@@ -234,9 +245,9 @@
-
<%--
@@ -246,126 +257,126 @@
--%>
-
+ Ratio
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Finanzas/RepRazonesFinancieras2.aspx.vb b/Finanzas/RepRazonesFinancieras2.aspx.vb
index 65aac5862..67fb0272f 100644
--- a/Finanzas/RepRazonesFinancieras2.aspx.vb
+++ b/Finanzas/RepRazonesFinancieras2.aspx.vb
@@ -4,6 +4,7 @@ Option Strict On
Imports System.Data
Imports System.Drawing
Imports System.IO
+Imports System.Windows.Forms
Imports Extensiones
Imports GemBox.Spreadsheet
Imports Microsoft.Reporting.WebForms
@@ -13,6 +14,24 @@ Partial Class Finanzas_RepRazonesFinancieras2
+
+
+ Property DTRatios As DataTable
+ Get
+ If ViewState("DTRatios") Is Nothing Then
+ ViewState("DTRatios") = New DataTable
+ End If
+
+ Return DirectCast(ViewState("DTRatios"), DataTable)
+
+ End Get
+ Set(value As DataTable)
+ ViewState("DTRatios") = value
+ End Set
+ End Property
+
+
+
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
@@ -107,14 +126,14 @@ Partial Class Finanzas_RepRazonesFinancieras2
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
+ LnkExportar.Visible = False
-
- If TAB.ActiveTabIndex = 0 Then
+ If Tab.ActiveTabIndex = 0 Then
CargaDatosBalanceGeneral()
End If
- If TAB.ActiveTabIndex = 1 Then
+ If Tab.ActiveTabIndex = 1 Then
CargaDatosEstadoResultados()
End If
@@ -158,7 +177,7 @@ Partial Class Finanzas_RepRazonesFinancieras2
GVEstadoRsultados.DataSource = dtTemp
If dtTemp.Rows.Count > 0 Then
- LnkExportar.Visible = True
+ ' LnkExportar.Visible = True
End If
Else
@@ -203,6 +222,7 @@ Partial Class Finanzas_RepRazonesFinancieras2
If e.Row.DataKey("Tipo").ToEntero = 1 Then
e.Row.Font.Bold = True
+ e.Row.Cells(0).Text = ""
End If
If e.Row.DataKey("Tipo").ToEntero = 3 Then
@@ -211,6 +231,7 @@ Partial Class Finanzas_RepRazonesFinancieras2
If e.Row.DataKey("Tipo").ToEntero = 4 Then
e.Row.Attributes.Add("style", "border-top: solid;border-bottom: solid")
+ e.Row.Cells(0).Text = ""
End If
@@ -229,6 +250,8 @@ Partial Class Finanzas_RepRazonesFinancieras2
+ DTRatios = New DataTable
+
LnkExportar.Visible = False
GVRatiosOcultarColumnas(GVRatios, 1)
@@ -241,16 +264,16 @@ Partial Class Finanzas_RepRazonesFinancieras2
Dim objFinanzas As New ClsFinanzas
- Dim dtTemp As New DataTable
+
If objFinanzas.GetRazonesFinancierasRatiosRep(FechaI, FechaF, -1, CveSubProyecto, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, 1, 12) Then
- dtTemp = objFinanzas.DtResultados
+ DTRatios = objFinanzas.DtResultados
- GVRatiosMostrarColumnas(dtTemp, GVRatios)
- GVRatios.DataSource = dtTemp
+ GVRatiosMostrarColumnas(DTRatios, GVRatios)
+ GVRatios.DataSource = DTRatios
- If dtTemp.Rows.Count > 0 Then
- LnkExportar.Visible = True
+ If DTRatios.Rows.Count > 0 Then
+ ' LnkExportar.Visible = True
End If
Else
@@ -274,19 +297,28 @@ Partial Class Finanzas_RepRazonesFinancieras2
End Sub
Private Sub GVRatiosMostrarColumnas(dt As DataTable, ByRef Gv As GridView)
- Dim index = 1
+ Dim index = 3
- For index = 1 To dt.Columns.Count - 2
+ For index = 3 To dt.Columns.Count - 2
CType(Gv.Columns(index + 1), BoundField).DataField = dt.Columns(index + 1).ColumnName
-
- CType(Gv.Columns(index + 1), BoundField).DataFormatString = "{0:P2}"
-
-
+ 'CType(Gv.Columns(index + 1), BoundField).DataFormatString = "{0:P2}"
Gv.Columns(index + 1).Visible = True
CType(Gv.Columns(index + 1), BoundField).HeaderText = dt.Columns(index + 1).ColumnName
-
Next
+
+ 'Dim Count As Integer = 1
+ 'For Each GvColumn As DataGridViewColumn In GVRatios.Columns
+
+
+ ' GvColumn.Width = If(Count = 1, 300, 75)
+
+ ' Count = Count + 1
+ 'Next
+
+
+
+
End Sub
Protected Sub GVRatios_RowDataBound(sender As Object, e As GridViewRowEventArgs)
@@ -305,6 +337,25 @@ Partial Class Finanzas_RepRazonesFinancieras2
e.Row.Attributes.Add("style", "border-top: solid;border-bottom: solid")
End If
+ If e.Row.DataKey("Tipo").ToEntero <> 1 AndAlso DTRatios.Columns.Count > 0 Then
+
+ Dim EsPorcentaje = If(e.Row.DataKey("EsPorcentaje").ToEntero = 1, True, False)
+
+ For x = 1 To DTRatios.Columns.Count - 2
+
+ 'If e.Row.Cells(x).Text.ToDecimal = 0 Then
+ ' e.Row.Cells(x).Text = ""
+ 'Else
+ If EsPorcentaje Then
+ e.Row.Cells(x).Text = $"{(e.Row.Cells(x).Text.ToDecimal * 100.0).ToString("###.00")}%"
+ Else
+ e.Row.Cells(x).Text = $"{e.Row.Cells(x).Text.ToDecimal.ToString("###,###,###.00")}"
+ End If
+ 'End If
+
+ Next
+
+ End If
End If
@@ -323,12 +374,46 @@ Partial Class Finanzas_RepRazonesFinancieras2
#Region "DESCARGA EXCEL"
+ Protected Sub LnkExportar_Click(sender As Object, e As EventArgs)
+
+ Dim SubProyecto As String = ""
+
+ If DdlSubproyecto.SelectedValue.ToEntero > 0 Then
+ SubProyecto = DdlSubproyecto.SelectedItem.Text
+ End If
+
+ Dim SbFiltros As New StringBuilder()
+ SbFiltros.Append($"Año Inicio: {DdlEjercicio.SelectedItem.Text} Año Fin: {DdlEjercicio2.SelectedItem.Text} ")
+ SbFiltros.Append($"SubProyecto: {SubProyecto}")
+
+ Dim Titulo As String = ""
+ Dim NombreReporte As String = ""
+
+ If Tab.ActiveTabIndex = 0 Then
+ Titulo = "Balance General"
+ NombreReporte = "BalanceGenral"
+ End If
+
+ If Tab.ActiveTabIndex = 1 Then
+ Titulo = "Estado de Resultados"
+ NombreReporte = "Estado de Resultados"
+ End If
+
+ If Tab.ActiveTabIndex = 2 Then
+
+ Titulo = "Ratios"
+ NombreReporte = "Ratios"
+ End If
+
+
+ GVRatios.ExportToExcelGembox(NombreReporte, UsuarioActual, $"Reporte {Titulo}", "", DatosFiltros:=SbFiltros.ToString())
- Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub
+
+
#End Region
@@ -338,5 +423,8 @@ Partial Class Finanzas_RepRazonesFinancieras2
+
+
+
End Class