Commit inicial Ventas Productivo
This commit is contained in:
123
Contabilidad/PolizasImpresion.aspx.vb
Normal file
123
Contabilidad/PolizasImpresion.aspx.vb
Normal file
@@ -0,0 +1,123 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports System.Activities.Statements
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Contabilidad_PolizasImpresion
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.LoadComplete
|
||||
If Not IsPostBack Then
|
||||
TxtFechaInicio.Text = Now.AddDays(-1).ToShortDateString
|
||||
TxtFechaFin.Text = Now.ToShortDateString
|
||||
|
||||
DdlUsuarioRegistro.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlUsuarioRegistro.DataBind()
|
||||
cargaddlpolizas()
|
||||
CargaSegmentoNeg()
|
||||
cargaCuentas()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub BtnConsultar_click(sender As Object, args As EventArgs) Handles BtnConsultar.Click
|
||||
Dim foli As Integer = -1
|
||||
Dim folf As Integer = -1
|
||||
If Not FolioInicio.Text = "" Then
|
||||
foli = FolioInicio.Text.ToEntero()
|
||||
End If
|
||||
If Not FolioFin.Text = "" Then
|
||||
folf = FolioFin.Text.ToEntero()
|
||||
End If
|
||||
|
||||
Dim ArchivoReporte As String = "Empresas/Grales/Formatos/Polizas.rdlc"
|
||||
|
||||
If IO.File.Exists(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) Then
|
||||
ArchivoReporte = String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)
|
||||
End If
|
||||
|
||||
|
||||
Dim objcont As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
If objcont.GetPolizasMasivo(TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, foli, folf, ddlTipoPoliza.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlSegmentoNeg.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero) Then
|
||||
If objcont.DtResultados.Rows.Count < 10000 Then
|
||||
|
||||
If objcont.DtResultados.Rows.Count > 0 Then
|
||||
Dim dr As DataRow
|
||||
dr = objcont.DtResultados.Rows(0)
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString))
|
||||
params.Add(New ReportParameter("Finicio", dr("Fecha").ToString.ToDate.ToShortDateString))
|
||||
params.Add(New ReportParameter("FFin", dr("Fecha").ToString.ToDate.ToShortDateString))
|
||||
params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToShortDateString))
|
||||
'params.Add(New ReportParameter("Nombre", dr("Cuenta").ToString))
|
||||
'params.Add(New ReportParameter("Cuenta", dr("Codigo").ToString))
|
||||
params.Add(New ReportParameter("Numero", dr("Folio").ToString))
|
||||
params.Add(New ReportParameter("Moneda", ""))
|
||||
params.Add(New ReportParameter("CodigoPostal", ""))
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
params.Add(New ReportParameter("UsuarioRegistro", GlobalDTUsuarios(dr("IdUsuario").ToString.ToEntero).FiltroPrimeroValor("Nombre")))
|
||||
End If
|
||||
|
||||
ImprimirPDF(ArchivoReporte, objcont.DtResultados, params)
|
||||
|
||||
Else
|
||||
Alert("Los Filtros Actuales no contienen datos")
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Los Filtros Actuales contienen muchos datos")
|
||||
End If
|
||||
End If
|
||||
objcont.Dispose()
|
||||
|
||||
End Sub
|
||||
Private Sub cargaddlpolizas()
|
||||
Dim objcont As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
If objcont.GetTiposPoliza(-1, "-1") Then
|
||||
ddlTipoPoliza.DataSource = objcont.DtResultados
|
||||
ddlTipoPoliza.DataBind()
|
||||
ddlTipoPoliza.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
End If
|
||||
objcont.Dispose()
|
||||
DdlUsuarioRegistro.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSegmentoNeg()
|
||||
Dim ObjContPAQ As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
If ObjContPAQ.GetSegmentosNegocio(-1, "-1") Then
|
||||
DdlSegmentoNeg.DataSource = ObjContPAQ.DtResultados
|
||||
DdlSegmentoNeg.DataBind()
|
||||
End If
|
||||
ObjContPAQ.Dispose()
|
||||
DdlSegmentoNeg.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSegmentoNeg.Items.Insert(1, New ListItem("Sin Asignar", "-2"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCuentas()
|
||||
If UsuarioActual.Empresa.UsaContabilidad Then
|
||||
Dim DtTable As New DataTable
|
||||
DtTable.Columns.Add("Id", GetType(Integer))
|
||||
DtTable.Columns.Add("CodigoNombre", GetType(String))
|
||||
|
||||
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
If ObjConta.GetCuentas(-1, "-1", 1) Then
|
||||
For Each dr As DataRow In ObjConta.DtResultados.Rows
|
||||
Dim DrC = DtTable.NewRow
|
||||
DrC("Id") = dr("Id").ToString
|
||||
DrC("CodigoNombre") = dr("Codigo").ToString + " - " + dr("Nombre").ToString
|
||||
DtTable.Rows.Add(DrC)
|
||||
Next
|
||||
DdlCuenta.DataSource = DtTable
|
||||
DdlCuenta.DataBind()
|
||||
End If
|
||||
ObjConta.Dispose()
|
||||
DdlCuenta.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user