-- libro de diario conta sig

This commit is contained in:
rrene
2020-08-07 11:42:24 -07:00
parent f75b0aedfb
commit 860348d7b0
2 changed files with 248 additions and 0 deletions

View File

@@ -0,0 +1,144 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Contabilidad2_RepLibroDiario
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property DtDatos As DataTable
Get
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
Private Property FechaInicio As Date
Get
FechaInicio = ViewState("FechaInicio").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicio") = value
End Set
End Property
Private Property FechaFin As Date
Get
FechaFin = ViewState("FechaFin").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFin") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
InicializaValores()
BtnConsultar.Enabled = True
End If
End Sub
Private Sub InicializaValores()
TxtFechaDel.Text = $"01/01/{Now.Year}"
TxtFechaAl.Text = Now.ToShortDateString
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
#Region "C A R G A - D A T O S"
Private Sub CargaDatos()
FechaInicio = If(IsDate(TxtFechaDel.Text), TxtFechaDel.Text.ToDate, MinFecha)
FechaFin = If(IsDate(TxtFechaAl.Text), TxtFechaAl.Text.ToDate, MaxFecha)
'FechaInicio = New Date(2016, 1, 1)
'FechaFin = New Date(2016, 1, 31)
Dim ObjConta As New ClsContabilidad
If ObjConta.GetLibroDiario(FechaInicio, FechaFin, UsuarioActual.CveEmpresa) Then
DtDatos = ObjConta.DtResultados
Else
DtDatos = Nothing
End If
ObjConta.Dispose()
GvDatos.DataSource = DtDatos
GvDatos.DataBind()
UpDatos.Update()
If DtDatos IsNot Nothing Then
ImgExcel.Visible = True
Imprimir.Visible = True
Else
ImgExcel.Visible = False
Imprimir.Visible = False
End If
End Sub
#End Region
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
''CABECERA
'If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 1 Then
' e.Row.Font.Bold = True
' e.Row.Cells(4).Text = ""
' e.Row.Cells(5).Text = ""
' e.Row.Cells(6).Text = ""
' e.Row.Cells(7).Text = ""
' e.Row.Cells(8).Text = ""
' e.Row.CssClass = "SubTotales" '
'End If
'DETALLE
If e.Row.DBCampo("Codigo") <> "" Then
e.Row.Cells(0).Text = ""
e.Row.Cells(1).Text = ""
e.Row.Cells(2).Text = ""
e.Row.Cells(3).Text = ""
End If
'SUBTOTAL
If e.Row.DBCampo("Codigo") = "" Then
e.Row.Font.Bold = True
e.Row.Cells(0).Text = ""
e.Row.Cells(1).Text = ""
e.Row.Cells(2).Text = ""
e.Row.Cells(3).Text = ""
e.Row.Cells(4).Text = ""
e.Row.Cells(5).Text = ""
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(6).Text = "Total:"
e.Row.CssClass = "SubTotales"
End If
'TOTAL
If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 4 Then
e.Row.Font.Bold = True
e.Row.Cells(0).Text = ""
e.Row.Cells(1).Text = ""
e.Row.Cells(2).Text = ""
e.Row.Cells(3).Text = ""
e.Row.Cells(4).Text = ""
e.Row.Cells(5).Text = ""
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(6).Text = "Total:"
e.Row.CssClass = "Totales"
End If
End If
End Sub
End Class