FiltraPolizas, RegPoliza unificadas y RegPrePoliza validaciones de naturaleza de cargo abono.
This commit is contained in:
@@ -10,19 +10,173 @@ Partial Class Contabilidad_PolizasImpresion
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
|
||||
Public Property ContabilidadSIG As Boolean
|
||||
Get
|
||||
If ViewState("ContabilidadSIG") Is Nothing Then
|
||||
ViewState("ContabilidadSIG") = False
|
||||
End If
|
||||
|
||||
Return Boolean.Parse(ViewState("ContabilidadSIG").ToString)
|
||||
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("ContabilidadSIG") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.LoadComplete
|
||||
|
||||
If Not IsPostBack Then
|
||||
|
||||
ContabilidadSIG = UsuarioActual.Empresa.UsaContabilidadSIG
|
||||
|
||||
TxtFechaInicio.Text = Now.AddDays(-1).ToShortDateString
|
||||
TxtFechaFin.Text = Now.ToShortDateString
|
||||
|
||||
DdlUsuarioRegistro.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||
DdlUsuarioRegistro.DataBind()
|
||||
cargaddlpolizas()
|
||||
CargaSegmentoNeg()
|
||||
cargaCuentas()
|
||||
|
||||
|
||||
If ContabilidadSIG Then
|
||||
cargaddlpolizasSIG()
|
||||
CargaSubProyectosSIG()
|
||||
CargaCuentasSIG()
|
||||
|
||||
CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSegmentoNegocio)
|
||||
LblSegmentoNegocio.Attributes.Add("title", LblSegmentoNegocio.Text)
|
||||
|
||||
Else
|
||||
cargaddlpolizas()
|
||||
CargaSegmentoNeg()
|
||||
CargaCuentas()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub BtnConsultar_click(sender As Object, args As EventArgs) Handles BtnConsultar.Click
|
||||
|
||||
If ContabilidadSIG Then
|
||||
ConsultaSIIG()
|
||||
Else
|
||||
ConsultaCONTPAQi()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#Region "SIIG"
|
||||
|
||||
Private Sub ConsultaSIIG()
|
||||
|
||||
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 ObjConta As New ClsContabilidad
|
||||
If ObjConta.GetPrePolizasImpresion(UsuarioActual.CveEmpresa, TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, CveTipoPoliza:=ddlTipoPoliza.SelectedValue.ToEntero, FolioI:=foli,
|
||||
FolioF:=folf, CveUsuario:=DdlUsuarioRegistro.SelectedValue.ToEntero, CveSubProyecto:=DdlSegmentoNeg.SelectedValue.ToEntero,
|
||||
CveCuenta:=DdlCuenta.SelectedValue.ToEntero, CvePlantillaPoliza:=DdlGrupoPlantilla.SelectedValue.ToEntero,
|
||||
CveTipoProveedor:=DdlTipoProveedor.SelectedValue.ToEntero) Then
|
||||
If ObjConta.DtResultados.Rows.Count < 10000 Then
|
||||
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
Dim dr As DataRow
|
||||
dr = ObjConta.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", TxtFechaInicio.Text))
|
||||
params.Add(New ReportParameter("FFin", TxtFechaFin.Text))
|
||||
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", dr("NombreUsuario").ToString))
|
||||
End If
|
||||
|
||||
ImprimirPDF(ArchivoReporte, ObjConta.DtResultados, params)
|
||||
|
||||
Else
|
||||
Alert("Los Filtros Actuales no contienen datos")
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Los Filtros Actuales contienen muchos datos")
|
||||
End If
|
||||
End If
|
||||
ObjConta.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub cargaddlpolizasSIG()
|
||||
Dim objcont As New ClsContabilidad
|
||||
If objcont.GetTiposPoliza(-1, "-1", UsuarioActual.CveEmpresa) 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 CargaSubProyectosSIG()
|
||||
|
||||
DdlSegmentoNeg.DataValueField = "CveSubProyecto"
|
||||
DdlSegmentoNeg.DataTextField = "SubProyecto"
|
||||
|
||||
DdlSegmentoNeg.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)
|
||||
DdlSegmentoNeg.DataBind()
|
||||
DdlSegmentoNeg.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
DdlSegmentoNeg.Items.Insert(1, New ListItem("Sin Asignar", "-2"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCuentasSIG()
|
||||
|
||||
DdlCuenta.DataValueField = "CveCuenta"
|
||||
DdlCuenta.DataTextField = "CtaCodigo"
|
||||
|
||||
|
||||
|
||||
Dim objconta As New ClsContabilidad
|
||||
If objconta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
DdlCuenta.DataSource = objconta.DtResultados
|
||||
End If
|
||||
objconta.Dispose()
|
||||
DdlCuenta.DataBind()
|
||||
|
||||
DdlCuenta.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "CONTPAQi"
|
||||
Private Sub ConsultaCONTPAQi()
|
||||
Dim foli As Integer = -1
|
||||
Dim folf As Integer = -1
|
||||
If Not FolioInicio.Text = "" Then
|
||||
@@ -73,8 +227,8 @@ Partial Class Contabilidad_PolizasImpresion
|
||||
End If
|
||||
End If
|
||||
objcont.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub cargaddlpolizas()
|
||||
Dim objcont As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
If objcont.GetTiposPoliza(-1, "-1") Then
|
||||
@@ -119,5 +273,10 @@ Partial Class Contabilidad_PolizasImpresion
|
||||
DdlCuenta.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user