Commit inicial Ventas Productivo

This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-08-14 16:40:54 -07:00
commit c35cf91883
13328 changed files with 3711549 additions and 0 deletions

109
Bancos/FlujoDiario.aspx.vb Normal file
View File

@@ -0,0 +1,109 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Bancos_FlujoDiario
Inherits ClsPaginas
#Region "Propiedades"
Private Property TmpDTSaldosIniciales As DataTable
Get
Return CType(ViewState("TmpDTSaldosIniciales"), DataTable)
End Get
Set(value As DataTable)
ViewState("TmpDTSaldosIniciales") = value
End Set
End Property
Private Property TmpDTGastosDelDia As DataTable
Get
Return CType(ViewState("TmpDTGastosDelDia"), DataTable)
End Get
Set(value As DataTable)
ViewState("TmpDTGastosDelDia") = value
End Set
End Property
Private Property TmpDTIngresosDelDia As DataTable
Get
Return CType(ViewState("TmpDTIngresosDelDia"), DataTable)
End Get
Set(value As DataTable)
ViewState("TmpDTIngresosDelDia") = value
End Set
End Property
Private Property TmpDTSaldosActuales As DataTable
Get
Return CType(ViewState("TmpDTSaldosActuales"), DataTable)
End Get
Set(value As DataTable)
ViewState("TmpDTSaldosActuales") = value
End Set
End Property
#End Region
Private Sub Bancos_FlujoDiario_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
TxtFecha.Text = Now.ToString
End If
End Sub
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
Dim params As New List(Of ReportParameter)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
params.Add(New ReportParameter("Fecha", TxtFecha.Text.ToDate.ToLongDateString))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
'SE LLENA TmpDTSaldosIniciales
Dim Ban As New ClsBancos
If Ban.GetBancosSaldos(-1, -1, -1, MinFecha.ToString, TxtFecha.Text.ToDate.AddDays(-1).ToShortDateString, 0, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TmpDTSaldosIniciales = Ban.DtResultados
End If
'Se Llena TmpDTIngresosDelDia
If Ban.GetIngresoEgresosDelDia(TxtFecha.Text.ToDate, "Ing", UsuarioActual.CveEmpresa) Then
TmpDTIngresosDelDia = Ban.DtResultados'.FiltraParametros("CveTipoTransaccion <> 8")
End If
'Se Llena TmpDTGastosDelDia
If Ban.GetIngresoEgresosDelDia(TxtFecha.Text.ToDate, "Egs", UsuarioActual.CveEmpresa) Then
TmpDTGastosDelDia = Ban.DtResultados'.FiltraParametros("CveTipoTransaccion <> 2")
End If
'Se Llena TmpDTSaldosActuales
If Ban.GetBancosSaldos(-1, -1, -1, MinFecha.ToString, TxtFecha.Text, 0, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TmpDTSaldosActuales = Ban.DtResultados
End If
Ban.Dispose()
Dim lrds As New List(Of ReportDataSource)
Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = TmpDTSaldosIniciales}
Dim rds2 As New ReportDataSource With {.Name = "DataSet2", .Value = If(TmpDTIngresosDelDia IsNot Nothing, TmpDTIngresosDelDia, New DataTable)}
Dim rds3 As New ReportDataSource With {.Name = "DataSet3", .Value = If(TmpDTGastosDelDia IsNot Nothing, TmpDTGastosDelDia, New DataTable)}
Dim rds5 As New ReportDataSource With {.Name = "DataSet5", .Value = If(TmpDTGastosDelDia IsNot Nothing, TmpDTGastosDelDia, New DataTable)}
Dim rds4 As New ReportDataSource With {.Name = "DataSet4", .Value = If(TmpDTSaldosActuales IsNot Nothing, TmpDTSaldosActuales, New DataTable)}
lrds.Add(rds)
lrds.Add(rds2)
lrds.Add(rds3)
lrds.Add(rds4)
'lrds.Add(rds5)-
ImprimirPDF("Empresas/Grales/Formatos/FlujoDiario.rdlc", lrds, params, NombreArchivo:=String.Format("FlujoDiario-{0}", TxtFecha.Text.ToDate.ToShortDateString))
End Sub
End Class