-- 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

@@ -9,7 +9,7 @@ Imports iTextSharp.text
Imports iTextSharp.text.html.simpleparser
Imports iTextSharp.text.pdf
Partial Class Contabilidad_RepFlujoEfectivo
Partial Class AC2_RepFlujoEfectivo
Inherits ClsPaginas
#Region "PROPIEDADES"
@@ -52,28 +52,27 @@ Partial Class Contabilidad_RepFlujoEfectivo
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
'TxtFechaDel.Text = DateSerial(Year(NowADS()), Month(NowADS()), 1).ToShortDateString
TxtFechaDel.Text = DateSerial(Year(NowADS()), Month(NowADS()), 1).ToShortDateString
TxtFechaAl.Text = NowADS().ToShortDateString
CargaDatos()
BtnConsultar.Enabled = True
End If
End Sub
#Region "CARGA DATOS Y GRID"
Private Sub CargaDatos()
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim ObjConta As New ClsContabilidad
'Dim FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", NowADS(), TxtFechaDel.Text.ToDate)
DdlSubproyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, -1)
DdlSubproyecto.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)
FechaAl = TxtFechaAl.Text
If ObjConta.GetFlujoEfectivo2(FechaFin, DdlTipo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString
Dim TipoReporte = DdlTipoReporte.SelectedValue.ToEntero
If ObjConta.GetFlujoEfectivo(FechaInicio, FechaFin, DdlUnidad.SelectedValue.ToEntero, TipoReporte, CveSubProyecto, UsuarioActual.CveEmpresa) Then
DtDatos = ObjConta.DtResultados
Else
DtDatos = Nothing
@@ -82,12 +81,28 @@ Partial Class Contabilidad_RepFlujoEfectivo
ObjConta.Dispose()
'OBTENEMOS TOTALES NETOS DE OPERACIONES PARA INSERTAR DIRECTO
If DtDatos IsNot Nothing Then
If UsuarioActual.CveEmpresa.Contiene(120) Then
TotalActual = DtDatos.FiltraParametros("Codigo = '040000000000000000'").Rows(0)("ImporteActual").ToString.ToDouble - DtDatos.FiltraParametros("Codigo = '050000000000000000'").Rows(0)("ImporteActual").ToString.ToDouble
TotalAnterior = DtDatos.FiltraParametros("Codigo = '040000000000000000'").Rows(0)("ImporteAnterior").ToString.ToDouble - DtDatos.FiltraParametros("Codigo = '050000000000000000'").Rows(0)("ImporteAnterior").ToString.ToDouble
Else
TotalActual = DtDatos.FiltraParametros("Codigo = '000040000000000000'").Rows(0)("ImporteActual").ToString.ToDouble - DtDatos.FiltraParametros("Codigo = '000050000000000000'").Rows(0)("ImporteActual").ToString.ToDouble
TotalAnterior = DtDatos.FiltraParametros("Codigo = '000040000000000000'").Rows(0)("ImporteAnterior").ToString.ToDouble - DtDatos.FiltraParametros("Codigo = '000050000000000000'").Rows(0)("ImporteAnterior").ToString.ToDouble
End If
End If
CargaGrid()
End Sub
Private Sub CargaGrid()
GvDatos.DataSource = DtDatos
GvDatos.DataBind()
UpDatos.Update()
End Sub
' GvDatos.Caption = String.Format("<div class='Titulos' style='width:100%; height:45px;'>{0}<br/>Estado de Flujo de Efectivo<br/>Al {1}</div>", UsuarioActual.Empresa.Empresa, TxtFechaAl.Text)
End Sub
#End Region
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
@@ -110,13 +125,13 @@ Partial Class Contabilidad_RepFlujoEfectivo
e.Row.Font.Bold = True
'CABCERA
If e.Row.DBCampo("Id") = "12" Then
If e.Row.DBCampo("CveCuenta") = "12" Then
e.Row.FCLabel("LbActual").Text = ""
e.Row.FCLabel("LbAnterior").Text = ""
End If
'TOTAL OPERACIONES
If e.Row.DBCampo("Id") = "123" Then
If e.Row.DBCampo("CveCuenta") = "123" Then
e.Row.FCLabel("LbActual").Text = TotalActual.ToString.FormatoNumero
e.Row.FCLabel("LbAnterior").Text = TotalAnterior.ToString.FormatoNumero
End If
@@ -161,18 +176,60 @@ Partial Class Contabilidad_RepFlujoEfectivo
End If
End Sub
Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs) Handles BtnImprimir.Click
ImprimirReporte()
End Sub
'No quitar porque no funciona el exporta PDF
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
' Verifies that the control is rendered
End Sub
'Protected Sub GvDatos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowCreated
' If (e.Row.RowType = DataControlRowType.Header) Then
' Dim HeaderGrid As GridView = DirectCast(sender, GridView)
' Dim HeaderGridRow As GridViewRow = New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert)
' Dim HeaderCell As TableCell = New TableCell()
' HeaderCell.Text = String.Format("<div class='Titulos' style='width:100%; height:45px;'>{0}<br/>Estado de Flujo de Efectivo<br/>Al {1}</div>", UsuarioActual.Empresa.Empresa, FechaAl)
' HeaderCell.ColumnSpan = GvDatos.Columns.Count
' HeaderCell.HorizontalAlign = HorizontalAlign.Center
' HeaderGridRow.Cells.Add(HeaderCell)
' GvDatos.Controls(0).Controls.AddAt(0, HeaderGridRow)
' End If
' If (e.Row.RowType = DataControlRowType.Footer) Then
' Dim HeaderGrid As GridView = DirectCast(sender, GridView)
' Dim HeaderGridRow As GridViewRow = New GridViewRow(0, 0, DataControlRowType.Footer, DataControlRowState.Insert)
' Dim HeaderCell As TableCell = New TableCell()
' HeaderCell.Text = "<table><tr> <td colspan='3' style='height:30px;'> <br/><br/><br/><br/></td></tr><tr><td >_________________________________<br/>C.P. Izelda Angulo Peraza</td><td style='width:75px'> </td><td > _________________________________<br/>Lic. Juan Fortino Leon Robinson</td></tr><tr><td>Subdirector de Contabilidad</td><td style='width:75px'> </td><td>Director General</td></table>"
' HeaderCell.ColumnSpan = GvDatos.Columns.Count
' HeaderCell.HorizontalAlign = HorizontalAlign.Center
' HeaderGridRow.Cells.Add(HeaderCell)
' e.Row.Cells.Clear()
' e.Row.Cells.Add(HeaderCell)
' End If
'End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel2("RepFlujosDeEfectivo.xlsx")
'GvDatos.ExportToExcel("ReporteFlujoEfectivo" & NowADS().ToShortDateString)
ImprimirReporte("Excel")
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
params.Add(New ReportParameter("pImg", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
params.Add(New ReportParameter("pAl", FechaAl))
params.Add(New ReportParameter("pTotalActual", TotalActual.ToString.FormatoNumero))
params.Add(New ReportParameter("pTotalAnterior", TotalAnterior.ToString.FormatoNumero))
params.Add(New ReportParameter("pFirma1", String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de Contabilidad", vbCrLf)))
params.Add(New ReportParameter("pFirma2", String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", vbCrLf)))
ImprimirPDF("AC/Reportes/RepFlujoEfectivo.rdlc", DtDatos, params, "EdoFlujoEfectivo", Formato)
End Sub
End Class