diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 1cfd182a5..1f94c267d 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -3861,6 +3861,7 @@ Public Class ClsContabilidad Return Retorno End Function + Public Function GetAnexoCatalogo(IdCuenta As Integer, FechaI As Date, FechaF As Date, OpcionCuentas As Integer, CveSubProyecto As String, CveEmpresa As Integer, Optional TipoMovtos As Integer = -1, Optional SAT As Integer = 0) As Boolean Dim Retorno = False diff --git a/Contabilidad2/RepBalanceGeneralHorizontal.aspx b/Contabilidad2/RepBalanceGeneralHorizontal.aspx index d43ed39fe..54d5f2b59 100644 --- a/Contabilidad2/RepBalanceGeneralHorizontal.aspx +++ b/Contabilidad2/RepBalanceGeneralHorizontal.aspx @@ -722,7 +722,7 @@ - + @@ -828,11 +828,11 @@ <%-- --%> - + - + @@ -1053,17 +1053,18 @@ --%> <%----%> - + - + - +

+ @@ -1119,7 +1120,7 @@
- + @@ -1273,20 +1274,26 @@ - <%-- + - + - --%> + <%----%> + + + + + + <%----%> diff --git a/Contabilidad2/RepBalanceGeneralHorizontal.aspx.vb b/Contabilidad2/RepBalanceGeneralHorizontal.aspx.vb index 27be0dd30..15e2bc7bb 100644 --- a/Contabilidad2/RepBalanceGeneralHorizontal.aspx.vb +++ b/Contabilidad2/RepBalanceGeneralHorizontal.aspx.vb @@ -430,9 +430,12 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal GvActivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString GvPasivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue - GvPasivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString - - Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero + GvPasivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString + + + + + Dim CveSubProyecto As Integer = If(DdlSubproyecto.SelectedValue.ToEntero = -1, -2, DdlSubproyecto.SelectedValue.ToEntero) If ObjConta.GetSituacionFinanciera2("01/01/1900".ToDate, FechaF.ToDate, CveSubProyecto, DdlDivisor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, TipoReporte) Then DtDatos = ObjConta.DtResultados @@ -852,7 +855,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal FechaIMes = $"01/01/1900" FechaFMes = $"31/12/{DdlEjercicio.SelectedValue}" - Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero + Dim CveSubProyecto As Integer = If(DdlSubproyecto.SelectedValue.ToEntero = -1, -2, DdlSubproyecto.SelectedValue.ToEntero) 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) Dim ObjConta As New ClsContabilidad @@ -1243,7 +1246,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal RowAF.Item("Noviembre") = DT_ACTIVO.SUM("Noviembre", "NOT CtaMayor in (-1,3,4)") - DT_PASIVO.SUM("Noviembre", "NOT CtaMayor in (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM("Noviembre", "NOT CtaMayor in (-1,3,4)") RowAF.Item("Diciembre") = DT_ACTIVO.SUM("Diciembre", "NOT CtaMayor in (-1,3,4)") - DT_PASIVO.SUM("Diciembre", "NOT CtaMayor in (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM("Diciembre", "NOT CtaMayor in (-1,3,4)") - RowAF.Item("Nombre") = "Resultados del Ejercicio:" + RowAF.Item("Nombre") = "TOTALES" RowAF.Item("CtaMayor") = -1 RowAF.Item("ImporteAcumulado") = DT_ACTIVO.SUM("ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - DT_PASIVO.SUM("ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM("ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") ' TotalAnterior.ToString DT_TOTALES.Rows.Add(RowAF) @@ -1365,7 +1368,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal FechaIMes = $"01/01/1900" FechaFMes = $"31/12/{DdlEjercicio.SelectedValue}" - Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero + Dim CveSubProyecto As Integer = If(DdlSubproyecto.SelectedValue.ToEntero = -1, -2, DdlSubproyecto.SelectedValue.ToEntero) Dim ObjConta As New ClsContabilidad @@ -1504,7 +1507,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item(IndexData) = DT_ACTIVO_FIJO.SUM($"[{DT_ACTIVO_FIJO.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") Next - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" + Row.Item("Nombre") = "TOTAL ACTIVO NO CIRCULANTE" Row.Item("ImporteActual") = DT_ACTIVO_FIJO.SUM("ImporteActual", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeActual") = 100.0 Row.Item("ImporteAcumulado") = DT_ACTIVO_FIJO.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") @@ -1512,7 +1515,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("CtaMayor") = -1 DT_ACTIVO_FIJO.Rows.Add(Row) Else - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" + Row.Item("Nombre") = "TOTAL ACTIVO NO CIRCULANTE" Row.Item("ImporteActual") = "0.00" Row.Item("ImporteAcumulado") = "0.00" Row.Item("CtaMayor") = -1 @@ -1531,15 +1534,15 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item(IndexData) = DT_ACTIVO_DIFERIDO.SUM($"[{DT_ACTIVO_DIFERIDO.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") Next - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" - Row.Item("ImporteActual") = DtIngresosAnualH.SUM("ImporteActual", "NOT CtaMayor in (3,4)") + Row.Item("Nombre") = "TOTAL ACTIVO DIFERIDO" + Row.Item("ImporteActual") = DT_ACTIVO_DIFERIDO.SUM("ImporteActual", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeActual") = 100.0 - Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") + Row.Item("ImporteAcumulado") = DT_ACTIVO_DIFERIDO.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 DT_ACTIVO_DIFERIDO.Rows.Add(Row) Else - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" + Row.Item("Nombre") = "TOTAL ACTIVO DIFERIDO" Row.Item("ImporteActual") = "0.00" Row.Item("ImporteAcumulado") = "0.00" Row.Item("CtaMayor") = -1 @@ -1557,15 +1560,15 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item(IndexData) = DT_PASIVO_CIRCULANTE.SUM($"[{DT_PASIVO_CIRCULANTE.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") Next - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" - Row.Item("ImporteActual") = DtIngresosAnualH.SUM("ImporteActual", "NOT CtaMayor in (3,4)") + Row.Item("Nombre") = "TOTAL PASIVO CIRCULANTE" + Row.Item("ImporteActual") = DT_PASIVO_CIRCULANTE.SUM("ImporteActual", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeActual") = 100.0 - Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") + Row.Item("ImporteAcumulado") = DT_PASIVO_CIRCULANTE.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 DT_PASIVO_CIRCULANTE.Rows.Add(Row) Else - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" + Row.Item("Nombre") = "TOTAL PASIVO CIRCULANTE" Row.Item("ImporteActual") = "0.00" Row.Item("ImporteAcumulado") = "0.00" Row.Item("CtaMayor") = -1 @@ -1583,15 +1586,15 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item(IndexData) = DT_PASIVO_NO_CIRCULANTE.SUM($"[{DT_PASIVO_NO_CIRCULANTE.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") Next - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" - Row.Item("ImporteActual") = DtIngresosAnualH.SUM("ImporteActual", "NOT CtaMayor in (3,4)") + Row.Item("Nombre") = "TOTAL PASIVO NO CIRCULANTE" + Row.Item("ImporteActual") = DT_PASIVO_NO_CIRCULANTE.SUM("ImporteActual", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeActual") = 100.0 - Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") + Row.Item("ImporteAcumulado") = DT_PASIVO_NO_CIRCULANTE.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 DT_PASIVO_NO_CIRCULANTE.Rows.Add(Row) Else - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" + Row.Item("Nombre") = "TOTAL PASIVO NO CIRCULANTE" Row.Item("ImporteActual") = "0.00" Row.Item("ImporteAcumulado") = "0.00" Row.Item("CtaMayor") = -1 @@ -1609,15 +1612,15 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item(IndexData) = DT_CAPITAL_CONTABLE.SUM($"[{DT_CAPITAL_CONTABLE.Columns(IndexData).ColumnName}]", "NOT CtaMayor in (3,4)") Next - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" - Row.Item("ImporteActual") = DtIngresosAnualH.SUM("ImporteActual", "NOT CtaMayor in (3,4)") + Row.Item("Nombre") = "TOTAL CAPITAL CONTABLE" + Row.Item("ImporteActual") = DT_CAPITAL_CONTABLE.SUM("ImporteActual", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeActual") = 100.0 - Row.Item("ImporteAcumulado") = DtIngresosAnualH.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") + Row.Item("ImporteAcumulado") = DT_CAPITAL_CONTABLE.SUM("ImporteAcumulado", "NOT CtaMayor in (3,4)") Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 DT_CAPITAL_CONTABLE.Rows.Add(Row) Else - Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" + Row.Item("Nombre") = "TOTAL CAPITAL CONTABLE" Row.Item("ImporteActual") = "0.00" Row.Item("ImporteAcumulado") = "0.00" Row.Item("CtaMayor") = -1 @@ -1646,7 +1649,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Next Row.Item("Nombre") = "TOTAL ACTIVO" - Row.Item("ImporteActual") = DT_ACTIVO.SUM("ImporteActual", "NOT CtaMayor in (3,4)") + Row.Item("ImporteActual") = DT_ACTIVO.SUM("ImporteActual", "NOT CtaMayor in (-1,3,4)") Row.Item("PorcentajeActual") = 100.0 Row.Item("ImporteAcumulado") = DT_ACTIVO.SUM("ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") Row.Item("PorcentajeAcumulado") = 100.0 @@ -1693,7 +1696,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal If DT_TOTALES.Rows.Count > 0 Then - Row = DTTotalesAnualH.NewRow + Row = DT_TOTALES.NewRow IndexData = 11 @@ -1701,11 +1704,13 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item(IndexData) = DT_ACTIVO.SUM($"[{DT_ACTIVO.Columns(IndexData).ColumnName}]", "Not CtaMayor In (-1,3,4)") - DT_PASIVO.SUM($"[{DT_PASIVO.Columns(IndexData).ColumnName}]", "Not CtaMayor In (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM($"[{DT_CAPITAL_CONTABLE.Columns(IndexData).ColumnName}]", "Not CtaMayor In (-1,3,4)") Next - Row.Item("Nombre") = "Resultados del Ejercicio" + Row.Item("Nombre") = "TOTALES" + Row.Item("CtaMayor") = -1 + Row.Item("ImporteActual") = DT_ACTIVO.SUM($"ImporteActual", "Not CtaMayor in (-1,3,4)") - DT_PASIVO.SUM($"ImporteActual", "Not CtaMayor in (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM($"ImporteActual", "Not CtaMayor in (-1,3,4)") Row.Item("ImporteAcumulado") = DT_ACTIVO.SUM($"ImporteAcumulado", "Not CtaMayor in (-1,3,4)") - DT_PASIVO.SUM($"ImporteAcumulado", "Not CtaMayor in (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM($"ImporteAcumulado", "Not CtaMayor in (-1,3,4)") - DTTotalesAnualH.Rows.Add(Row) + DT_TOTALES.Rows.Add(Row) End If @@ -1934,6 +1939,8 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_ACTIVO_CIRCULANTE.SUM("ImporteActual", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_ACTIVO_CIRCULANTE.SUM("SinSP", "NOT CtaMayor in (3,4)") 'Sin SP + DT_ACTIVO_CIRCULANTE.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL ACTIVO CIRCULANTE" @@ -1965,6 +1972,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_ACTIVO_FIJO.SUM("ImporteActual", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_ACTIVO_FIJO.SUM("SinSP", "NOT CtaMayor in (3,4)") 'Sin SP DT_ACTIVO_FIJO.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL ACTIVO NO CIRCULANTE" @@ -1996,6 +2004,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_ACTIVO_DIFERIDO.SUM("ImporteActual", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_ACTIVO_DIFERIDO.SUM("SinSP", "NOT CtaMayor in (3,4)") 'Sin SP DT_ACTIVO_DIFERIDO.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL ACTIVO DIFERIDO" @@ -2027,6 +2036,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_PASIVO_CIRCULANTE.SUM("ImporteActual", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_PASIVO_CIRCULANTE.SUM("SinSP", "NOT CtaMayor in (3,4)") 'Sin SP DT_PASIVO_CIRCULANTE.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL PASIVO CIRCULANTE" @@ -2064,6 +2074,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteActual") = 0.00 Row.Item("ImporteAcumulado") = 0.00 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_PASIVO_NO_CIRCULANTE.SUM("SinSP", "NOT CtaMayor in (3,4)") 'Sin SP DT_PASIVO_NO_CIRCULANTE.Rows.Add(Row) End If @@ -2090,6 +2101,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_CAPITAL_CONTABLE.SUM("ImporteActual", "NOT CtaMayor in (3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_CAPITAL_CONTABLE.SUM("SinSP", "NOT CtaMayor in (3,4)") 'Sin SP DT_CAPITAL_CONTABLE.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL CAPITAL CONTABLE" @@ -2129,6 +2141,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_ACTIVO.SUM("ImporteActual", "NOT CtaMayor in (-1,3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_ACTIVO.SUM("SinSP", "NOT CtaMayor in (-1,3,4)") 'Sin SP DT_ACTIVO.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL ACTIVO" @@ -2160,6 +2173,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_PASIVO.SUM("ImporteActual", "NOT CtaMayor in (-1,3,4)") 'TotalAnterior.ToString Row.Item("PorcentajeAcumulado") = 100.0 Row.Item("CtaMayor") = -1 + Row.Item("SinSP") = DT_PASIVO.SUM("SinSP", "NOT CtaMayor in (-1,3,4)") 'Sin SP DT_PASIVO.Rows.Add(Row) Else Row.Item("Nombre") = "TOTAL PASIVO" @@ -2192,6 +2206,7 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Row.Item("ImporteAcumulado") = DT_ACTIVO.SUM($"ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - DT_PASIVO.SUM($"ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") - DT_CAPITAL_CONTABLE.SUM($"ImporteAcumulado", "NOT CtaMayor in (-1,3,4)") Row.Item("CtaMayor") = -2 + Row.Item("SinSP") = DT_TOTALES.SUM("SinSP", "NOT CtaMayor in (-1,3,4)") 'Sin SP DT_TOTALES.Rows.Add(Row) @@ -2245,13 +2260,13 @@ Partial Class Contabilidad_RepBalanceGeneralHorizontal Dim CveSubProyectoIntermo As String = CType(GvIngresosSubProyectoH.Columns(IndiceInicio), BoundField).DataField Dim Importe As String = e.Row.Cells(IndiceInicio).Text - - e.Row.Cells(IndiceInicio).Text = $"{Importe}" Next IndiceInicio e.Row.FCHyperLink("HLAnterior").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF={FEchaMesFinal.ToString("dd/MM/yyyy")}&FI=01/01/1900&ER=1&CveSubProyecto={-1}" + e.Row.FCHyperLink("HLSinSP").NavigateUrl = $"./RepAnexoCatalogo.aspx?CveCuenta={CveCuenta}&FF={FEchaMesFinal.ToString("dd/MM/yyyy")}&FI=01/01/1900&ER=1&CveSubProyecto=0" + End If If e.Row.DBCampo("ImporteAcumulado").ToString.ToDouble < 0 Then