-- unificación de módulos de Contabilidad a una sola carpeta. como principal ContaSIG

This commit is contained in:
2024-06-17 08:33:45 -07:00
parent 54ac9b836b
commit 9219751707
88 changed files with 17456 additions and 21235 deletions

View File

@@ -4,7 +4,7 @@ Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Contabilidad_RepOrigenAplicacion
Partial Class Contabilidad2_RepOrigenAplicacion
Inherits ClsPaginas
@@ -64,12 +64,12 @@ Partial Class Contabilidad_RepOrigenAplicacion
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
If UsuarioActual.Empresa.UsaAC Then
TipoReporte = -1
Else
TipoReporte = 1
tdTipoReporte.Visible = True
End If
'If UsuarioActual.Empresa.UsaAC Then
' TipoReporte = -1
'Else
TipoReporte = 1
tdTipoReporte.Visible = True
'End If
'Normal
TxtFechaDel.Text = DateSerial(Year(NowADS()), Month(NowADS()), 1).ToShortDateString
@@ -77,23 +77,20 @@ Partial Class Contabilidad_RepOrigenAplicacion
'Anual
Anos = 0
Dim ClsConta As New ClsContabilidad
If ClsConta.GetEjercicios(UsuarioActual.CveEmpresa) Then
DdlEjercicio.DataSource = ClsConta.DtResultados
Else
DdlEjercicio.DataSource = Nothing
End If
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.DataBind()
DdlEjercicio.SelectedValue = NowADS().Year.ToString
TabContainer_ActiveTabChanged(TabContainer, EventArgs.Empty)
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
TabMensual.Visible = False
TabAnual.Visible = False
TdFI.Visible = False
tdTipoReporte.Visible = False
GvOrigenAplicacionSIG.Visible = True
GvDatos.Visible = False
End If
End If
End Sub
@@ -152,63 +149,32 @@ Partial Class Contabilidad_RepOrigenAplicacion
#Region " NORMAL "
Private Sub CargaDatos()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
' Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, "0"c), Anio)
' Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy")
LnkExcel.Visible = False
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
Dim AnioActual As Integer = TxtFechaAl.Text.ToDate.Year
Dim AnioAnteior As Integer = AnioActual - 1
GvOrigenAplicacionSIG.Columns(1).Visible = True
GvOrigenAplicacionSIG.Columns(2).Visible = True
GvOrigenAplicacionSIG.Columns(1).HeaderText = AnioAnteior.ToString
GvOrigenAplicacionSIG.Columns(2).HeaderText = AnioActual.ToString
Dim ObjConta As New ClsContabilidad
'GvOrigenAplicacionSIG
If ObjConta.GetRepOrigenAplicacion(TxtFechaAl.Text.ToDate, UsuarioActual.CveEmpresa) Then
GvOrigenAplicacionSIG.DataSource = ObjConta.DtResultados
If ObjConta.DtResultados.Rows.Count > 0 Then
LnkExcel.Visible = True
End If
Else
GvOrigenAplicacionSIG.DataSource = Nothing
End If
ObjConta.Dispose()
GvOrigenAplicacionSIG.DataBind()
Dim FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", NowADS(), TxtFechaDel.Text.ToDate)
Dim FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", NowADS(), TxtFechaAl.Text.ToDate)
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
Dim FechaI = String.Format("{0}/{1}/{2}", FechaInicio.Day, FechaInicio.Month, FechaInicio.Year)
Dim FechaF = String.Format("{0}/{1}/{2}", FechaFin.Day, FechaFin.Month, FechaFin.Year)
If ObjConta.GetOrigenAplicacion(FechaI, FechaF, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatos = ObjConta.DtResultados
Else
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", NowADS(), TxtFechaDel.Text.ToDate)
Dim FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", NowADS(), TxtFechaAl.Text.ToDate)
If ObjConta.GetOrigenAplicacion(FechaInicio, FechaFin) Then
DtDatos = ObjConta.DtResultados
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos de origen y aplicación", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
If DtDatos IsNot Nothing Then
CargaGrid()
End If
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos de origen y aplicación", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
If DtDatos IsNot Nothing Then
CargaGrid()
End If
End Sub
Private Sub CargaGrid()
@@ -220,15 +186,15 @@ Partial Class Contabilidad_RepOrigenAplicacion
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'Titulo y Sumatoria de cambios
If e.Row.DBCampo("Orden3").ToString.ToEntero = 10 Or e.Row.DBCampo("Orden3").ToString.ToEntero = 30 Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
''Titulo y Sumatoria de cambios
'If e.Row.DBCampo("Orden3").ToString.ToEntero = 10 Or e.Row.DBCampo("Orden3").ToString.ToEntero = 30 Then
' e.Row.FCLabel("LbNombre").Font.Bold = True
'End If
'CUENTAS
If e.Row.DBCampo("Orden3").ToString.ToEntero = 20 Then
e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 20px;")
End If
''CUENTAS
'If e.Row.DBCampo("Orden3").ToString.ToEntero = 20 Then
' e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 20px;")
'End If
'TOTAL
If e.Row.DBCampo("Nombre").ToString.Trim = "" Then
@@ -240,62 +206,17 @@ Partial Class Contabilidad_RepOrigenAplicacion
End If
End Sub
Protected Sub GvOrigenAplicacionSIG_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOrigenAplicacionSIG.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'Titulo y Sumatoria de cambios
If e.Row.DBCampo("Orden3").ToString.ToEntero = 10 Or e.Row.DBCampo("Orden3").ToString.ToEntero = 30 Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
'CUENTAS
If e.Row.DBCampo("Orden3").ToString.ToEntero = 20 Then
e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 20px;")
End If
'TOTAL
If e.Row.DBCampo("Nombre").ToString.Trim = "" Then
e.Row.Attributes.Add("style", "border-top: 1px solid; margin-top:10px;")
e.Row.FCLabel("LbNombre").Font.Bold = True
e.Row.FCLabel("LbNombre").Font.Italic = True
e.Row.FCLabel("LbNombre").Text = "TOTAL"
End If
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
'Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta=55274&FF=31/12/2021
Dim FechaFinBase As Date = New Date(TxtFechaAl.Text.ToDate.Year - 1, 12, 31)
If e.Row.DataKey("CveCuenta").ToEntero > 0 Then
e.Row.FCHyperLink("HLlImporteBase").NavigateUrl = $"/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={e.Row.DataKey("CveCuenta")}&FF={FechaFinBase.ToString("dd/MM/yyyy")}"
e.Row.FCHyperLink("HLImporteActual").NavigateUrl = $"/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={e.Row.DataKey("CveCuenta")}&FF={TxtFechaAl.Text}"
e.Row.FCHyperLink("HLOrigen").NavigateUrl = $"/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={e.Row.DataKey("CveCuenta")}&FF={TxtFechaAl.Text}"
e.Row.FCHyperLink("HLAplicacion").NavigateUrl = $"/Contabilidad2/RepAnexoCatalogo.aspx?CveCuenta={e.Row.DataKey("CveCuenta")}&FF={TxtFechaAl.Text}"
End If
End If
End If
End Sub
#End Region
#Region " MENSUAL "
Private Sub CargaDatosMensual()
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
''Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
If ObjConta.GetOrigenAplicacionMensual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte) Then
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
If ObjConta.GetOrigenAplicacionMensual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatosMensual = ObjConta.DtResultados
Else
DtDatosMensual = Nothing
@@ -370,11 +291,14 @@ Partial Class Contabilidad_RepOrigenAplicacion
#Region " ANUAL "
Private Sub CargaDatosAnual()
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
Anos = (Year(NowADS()) - DdlEjercicio.SelectedValue.ToEntero) + 1
If ObjConta.GetOrigenAplicacionAnual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte) Then
If ObjConta.GetOrigenAplicacionAnual(DdlEjercicio.SelectedValue.ToEntero, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatosAnual = ObjConta.DtResultados
Else
DtDatosAnual = Nothing
@@ -382,7 +306,7 @@ Partial Class Contabilidad_RepOrigenAplicacion
End If
ObjConta.Dispose()
Anos = (Year(NowADS()) - DdlEjercicio.SelectedValue.ToEntero) + 1
If DtDatosAnual IsNot Nothing Then
CargaGridAnual()
@@ -433,7 +357,4 @@ Partial Class Contabilidad_RepOrigenAplicacion
#End Region
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs)
GvDatos.ExportToExcel2("RepOrigenAplicacion.xlsx")
End Sub
End Class