Cheques 141 iniciales quien genero movimiento, UsuarioDetalles Glbal -1 de Usaurios
This commit is contained in:
@@ -5986,189 +5986,211 @@ Partial Class PopUpVerFactura
|
||||
params.Add(New ReportParameter("Observaciones", Observacion))
|
||||
params.Add(New ReportParameter("Tipo", If(ObjIE.EsAbonoEnCuenta, "PARA ABONO EN CUENTA DEL BENEFICIARIO", "")))
|
||||
|
||||
Dim DtMovimientosPoliza As DataTable = Nothing
|
||||
If UsuarioActual.CveEmpresa = 48 Then
|
||||
'Movimientos del IE
|
||||
If ObjIE.IDPoliza > 0 Then
|
||||
|
||||
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
If Not ObjConta.GetPoliza(ObjIE.IDPoliza, -1, -1, -1, -1) Then
|
||||
Alert("Ocurrio un error al cargar los datos del cheque", TipoMensaje.MsgError)
|
||||
Else
|
||||
DtMovimientosPoliza = ObjConta.DtResultados.AsEnumerable().Take(27).CopyToDataTable
|
||||
If UsuarioActual.CveEmpresa.Contiene(141) Then
|
||||
|
||||
|
||||
Dim InicialesUsuarioGenero As String = ""
|
||||
|
||||
Try
|
||||
Dim NombreUsuarioRenero As String = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("Nombre", $"CveUsuario ={ObjIE.CveUsuario}")
|
||||
If NombreUsuarioRenero.Trim.Length > 0 Then
|
||||
NombreUsuarioRenero.Split(" "c).ToList().ForEach(Sub(i) InicialesUsuarioGenero += i(0))
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
ObjConta.Dispose()
|
||||
Else
|
||||
DtMovimientosPoliza = New DataTable
|
||||
DtMovimientosPoliza.Columns.Add("CODIGO", GetType(String))
|
||||
DtMovimientosPoliza.Columns.Add("Cuenta", GetType(String))
|
||||
DtMovimientosPoliza.Columns.Add("Cargo", GetType(Double))
|
||||
DtMovimientosPoliza.Columns.Add("Abono", GetType(Double))
|
||||
End Try
|
||||
|
||||
Dim Dr = DtMovimientosPoliza.NewRow
|
||||
Dr("CODIGO") = ""
|
||||
Dr("Cuenta") = ""
|
||||
Dr("Cargo") = 0
|
||||
Dr("Abono") = 0
|
||||
DtMovimientosPoliza.Rows.Add(Dr)
|
||||
|
||||
params.Add(New ReportParameter("InicialesUsuarioGenero", InicialesUsuarioGenero))
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Dim DtMovimientosPoliza As DataTable = Nothing
|
||||
If UsuarioActual.CveEmpresa = 48 Then
|
||||
'Movimientos del IE
|
||||
If ObjIE.IDPoliza > 0 Then
|
||||
|
||||
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
If Not ObjConta.GetPoliza(ObjIE.IDPoliza, -1, -1, -1, -1) Then
|
||||
Alert("Ocurrio un error al cargar los datos del cheque", TipoMensaje.MsgError)
|
||||
Else
|
||||
DtMovimientosPoliza = ObjConta.DtResultados.AsEnumerable().Take(27).CopyToDataTable
|
||||
End If
|
||||
|
||||
ObjConta.Dispose()
|
||||
Else
|
||||
DtMovimientosPoliza = New DataTable
|
||||
DtMovimientosPoliza.Columns.Add("CODIGO", GetType(String))
|
||||
DtMovimientosPoliza.Columns.Add("Cuenta", GetType(String))
|
||||
DtMovimientosPoliza.Columns.Add("Cargo", GetType(Double))
|
||||
DtMovimientosPoliza.Columns.Add("Abono", GetType(Double))
|
||||
|
||||
Dim Dr = DtMovimientosPoliza.NewRow
|
||||
Dr("CODIGO") = ""
|
||||
Dr("Cuenta") = ""
|
||||
Dr("Cargo") = 0
|
||||
Dr("Abono") = 0
|
||||
DtMovimientosPoliza.Rows.Add(Dr)
|
||||
End If
|
||||
ElseIf UsuarioActual.CveEmpresa.Contiene(119, 141) Then
|
||||
Dim PreP As New ClsContabilidad
|
||||
If PreP.GetPrePolizasDetalle(-1, UsuarioActual.CveEmpresa, CveIE:=CveIE) Then
|
||||
DtMovimientosPoliza = New DataTable
|
||||
DtMovimientosPoliza.Columns.Add("CODIGO", GetType(String))
|
||||
DtMovimientosPoliza.Columns.Add("Cuenta", GetType(String))
|
||||
DtMovimientosPoliza.Columns.Add("Cargo", GetType(Double))
|
||||
DtMovimientosPoliza.Columns.Add("Abono", GetType(Double))
|
||||
|
||||
If PreP.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
For Each drt As DataRow In PreP.DtResultados.Rows
|
||||
Dim Dr = DtMovimientosPoliza.NewRow
|
||||
Dr("CODIGO") = drt("CuentaCodigo")
|
||||
Dr("Cuenta") = drt("CuentaNombre")
|
||||
Dr("Cargo") = If(drt("TipoMovto").ToString = "False", drt("ImporteMN"), "0")
|
||||
Dr("Abono") = If(drt("TipoMovto").ToString = "True", drt("ImporteMN"), "0")
|
||||
DtMovimientosPoliza.Rows.Add(Dr)
|
||||
|
||||
Next
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
PreP.Dispose()
|
||||
End If
|
||||
ElseIf UsuarioActual.CveEmpresa.Contiene(119, 141) Then
|
||||
|
||||
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/CHQ-{1}.rdlc", UsuarioActual.Empresa.Ruta, CveCuenta))
|
||||
|
||||
If Archivo.Exists Then
|
||||
ImprimirPDF(String.Format("{0}Formatos/CHQ-{1}.rdlc", UsuarioActual.Empresa.Ruta, CveCuenta), DtMovimientosPoliza, params, String.Format("Cheque-{0}", Folio))
|
||||
Else
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
|
||||
ImprimirPDF(String.Format("Empresas\Grales\Formatos\CHQ.rdlc"), DtMovimientosPoliza, params, String.Format("Cheque-{0}", Folio))
|
||||
End If
|
||||
|
||||
|
||||
ElseIf CveTipoTransaccion.Contiene(2, 8, 9, 10) Then
|
||||
|
||||
Dim Folio, Observacion, UsuarioRegistro, TextoImporte, PagueseA, Ruta, Banco, NumCuenta, AbonoCuenta, SubProyecto, NotificarA, RefCrediproveedor As String
|
||||
Dim FechaExpedicion As Date = Now
|
||||
Dim Importe As Double
|
||||
Dim FormatoCheque As String = ""
|
||||
|
||||
Dim CveProveedor, CvePersonal, CveCuentaDeposito As Integer
|
||||
Dim tIdPoliza As Integer
|
||||
Dim DtMovimientosPoliza As DataTable = Nothing
|
||||
Dim RFC As String = ""
|
||||
Dim Correo As String = ""
|
||||
Dim CLABE As String = ""
|
||||
Dim NoSucursal As String = ""
|
||||
Dim Telefono As String = ""
|
||||
Dim IVA As Double = 0
|
||||
|
||||
Folio = ""
|
||||
TextoImporte = "" : Observacion = "" : PagueseA = "" : UsuarioRegistro = "" : Banco = "" : NumCuenta = "" : AbonoCuenta = "" : SubProyecto = "" : NotificarA = "" : RefCrediproveedor = ""
|
||||
CveProveedor = -1 : CvePersonal = -1 : CveCuentaDeposito = 0
|
||||
Ruta = UsuarioActual.Empresa.Ruta
|
||||
|
||||
PagueseA = ObjIE.PagueseA
|
||||
Folio = ObjIE.Folio
|
||||
Importe = ObjIE.Importe
|
||||
CveTipoTransaccion = ObjIE.CveTipoTransaccion
|
||||
Banco = ObjIE.Banco
|
||||
NumCuenta = ObjIE.DepositoCuenta
|
||||
If NumCuenta = "" Then NumCuenta = ObjIE.DepositoCIE
|
||||
CLABE = ObjIE.DepositoCLABE
|
||||
If CLABE = "" Then CLABE = ObjIE.DepositoReferencia
|
||||
NoSucursal = ObjIE.DepositoSucursal
|
||||
RefCrediproveedor = ObjIE.DepositoRefCrediProveedor
|
||||
TextoImporte = String.Format("--- {0} ---", Importe.Texto2Letras(ObjIE.CveMoneda))
|
||||
FechaExpedicion = ObjIE.FechaDocumento
|
||||
Observacion = ObjIE.Observaciones
|
||||
UsuarioRegistro = ObjIE.UsuarioNombre
|
||||
SubProyecto = ObjIE.SubProyecto
|
||||
AbonoCuenta = If(ObjIE.EsAbonoEnCuenta, "PARA ABONO EN CUENTA DEL BENEFICIARIO", "")
|
||||
NotificarA = ObjIE.NotificarA
|
||||
tIdPoliza = ObjIE.IDPoliza
|
||||
|
||||
Dim PreP As New ClsContabilidad
|
||||
If PreP.GetPrePolizasDetalle(-1, UsuarioActual.CveEmpresa, CveIE:=CveIE) Then
|
||||
DtMovimientosPoliza = New DataTable
|
||||
DtMovimientosPoliza.Columns.Add("CODIGO", GetType(String))
|
||||
DtMovimientosPoliza.Columns.Add("Cuenta", GetType(String))
|
||||
DtMovimientosPoliza.Columns.Add("Cargo", GetType(Double))
|
||||
DtMovimientosPoliza.Columns.Add("Abono", GetType(Double))
|
||||
|
||||
If PreP.DtResultados.Rows.Count > 0 Then
|
||||
CveProveedor = PreP.DtResultados.Rows(0)("CveProveedor").ToString.ToEntero
|
||||
CvePersonal = PreP.DtResultados.Rows(0)("CvePersonal").ToString.ToEntero
|
||||
|
||||
For Each drt As DataRow In PreP.DtResultados.Rows
|
||||
Dim Dr = DtMovimientosPoliza.NewRow
|
||||
Dr("CODIGO") = drt("CuentaCodigo")
|
||||
Dr("Cuenta") = drt("CuentaNombre")
|
||||
Dr("Cargo") = If(drt("TipoMovto").ToString = "False", drt("ImporteMN"), "0")
|
||||
Dr("Abono") = If(drt("TipoMovto").ToString = "True", drt("ImporteMN"), "0")
|
||||
DtMovimientosPoliza.Rows.Add(Dr)
|
||||
IVA = PreP.DtResultados.SUM("Importe", "CveConceptoContable = 19") ' concepto de IVA
|
||||
|
||||
Next
|
||||
If CveProveedor > 0 Then
|
||||
Dim Prov As New ClsCompProveedores
|
||||
If Prov.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
|
||||
If Prov.DtResultados.Rows.Count > 0 Then
|
||||
RFC = Prov.DtResultados.Rows(0)("RFC").ToString
|
||||
Correo = Prov.DtResultados.Rows(0)("ContactoMail").ToString
|
||||
End If
|
||||
End If
|
||||
Prov.Dispose()
|
||||
End If
|
||||
|
||||
If CvePersonal > 0 Then
|
||||
Dim RH As New ClsRH
|
||||
If RH.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
If RH.DtResultados.Rows.Count > 0 Then
|
||||
Correo = RH.DtResultados.Rows(0)("Correo").ToString
|
||||
Banco = RH.DtResultados.Rows(0)("Banco").ToString
|
||||
NumCuenta = RH.DtResultados.Rows(0)("BancoNumCuenta").ToString
|
||||
CLABE = RH.DtResultados.Rows(0)("CLABE").ToString
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
RH.Dispose()
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
PreP.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/CHQ-{1}.rdlc", UsuarioActual.Empresa.Ruta, CveCuenta))
|
||||
params.Add(New ReportParameter("Fecha", FechaExpedicion.ToString("dd-MM-yyyy")))
|
||||
params.Add(New ReportParameter("Folio", String.Format("Folio: {0}", Folio)))
|
||||
params.Add(New ReportParameter("PagueseA", PagueseA))
|
||||
params.Add(New ReportParameter("Importe", $"$ {Importe.ToString("N2")}"))
|
||||
params.Add(New ReportParameter("ImporteTexto", TextoImporte.ToUpper))
|
||||
params.Add(New ReportParameter("Banco", Banco))
|
||||
params.Add(New ReportParameter("NumCuenta", NumCuenta))
|
||||
params.Add(New ReportParameter("CLABE", CLABE))
|
||||
params.Add(New ReportParameter("Concepto", Observacion))
|
||||
params.Add(New ReportParameter("Factura", ""))
|
||||
params.Add(New ReportParameter("RFC", RFC))
|
||||
params.Add(New ReportParameter("IVA", $"$ {IVA.ToString("N2")}"))
|
||||
params.Add(New ReportParameter("NumSucursal", NoSucursal))
|
||||
params.Add(New ReportParameter("Correo", Correo))
|
||||
params.Add(New ReportParameter("Telefono", Telefono))
|
||||
params.Add(New ReportParameter("NotifiqueA", NotificarA))
|
||||
params.Add(New ReportParameter("Obra", SubProyecto))
|
||||
params.Add(New ReportParameter("UsuarioRegistro", UsuarioRegistro))
|
||||
params.Add(New ReportParameter("TipoTransaccion", CveTipoTransaccion.ToString))
|
||||
|
||||
If Archivo.Exists Then
|
||||
ImprimirPDF(String.Format("{0}Formatos/CHQ-{1}.rdlc", UsuarioActual.Empresa.Ruta, CveCuenta), DtMovimientosPoliza, params, String.Format("Cheque-{0}", Folio))
|
||||
Else
|
||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
|
||||
ImprimirPDF(String.Format("Empresas\Grales\Formatos\CHQ.rdlc"), DtMovimientosPoliza, params, String.Format("Cheque-{0}", Folio))
|
||||
End If
|
||||
|
||||
|
||||
ElseIf CveTipoTransaccion.Contiene(2, 8, 9, 10) Then
|
||||
|
||||
Dim Folio, Observacion, UsuarioRegistro, TextoImporte, PagueseA, Ruta, Banco, NumCuenta, AbonoCuenta, SubProyecto, NotificarA, RefCrediproveedor As String
|
||||
Dim FechaExpedicion As Date = Now
|
||||
Dim Importe As Double
|
||||
Dim FormatoCheque As String = ""
|
||||
|
||||
Dim CveProveedor, CvePersonal, CveCuentaDeposito As Integer
|
||||
Dim tIdPoliza As Integer
|
||||
Dim DtMovimientosPoliza As DataTable = Nothing
|
||||
Dim RFC As String = ""
|
||||
Dim Correo As String = ""
|
||||
Dim CLABE As String = ""
|
||||
Dim NoSucursal As String = ""
|
||||
Dim Telefono As String = ""
|
||||
Dim IVA As Double = 0
|
||||
|
||||
Folio = ""
|
||||
TextoImporte = "" : Observacion = "" : PagueseA = "" : UsuarioRegistro = "" : Banco = "" : NumCuenta = "" : AbonoCuenta = "" : SubProyecto = "" : NotificarA = "" : RefCrediproveedor = ""
|
||||
CveProveedor = -1 : CvePersonal = -1 : CveCuentaDeposito = 0
|
||||
Ruta = UsuarioActual.Empresa.Ruta
|
||||
|
||||
PagueseA = ObjIE.PagueseA
|
||||
Folio = ObjIE.Folio
|
||||
Importe = ObjIE.Importe
|
||||
CveTipoTransaccion = ObjIE.CveTipoTransaccion
|
||||
Banco = ObjIE.Banco
|
||||
NumCuenta = ObjIE.DepositoCuenta
|
||||
If NumCuenta = "" Then NumCuenta = ObjIE.DepositoCIE
|
||||
CLABE = ObjIE.DepositoCLABE
|
||||
If CLABE = "" Then CLABE = ObjIE.DepositoReferencia
|
||||
NoSucursal = ObjIE.DepositoSucursal
|
||||
RefCrediproveedor = ObjIE.DepositoRefCrediProveedor
|
||||
TextoImporte = String.Format("--- {0} ---", Importe.Texto2Letras(ObjIE.CveMoneda))
|
||||
FechaExpedicion = ObjIE.FechaDocumento
|
||||
Observacion = ObjIE.Observaciones
|
||||
UsuarioRegistro = ObjIE.UsuarioNombre
|
||||
SubProyecto = ObjIE.SubProyecto
|
||||
AbonoCuenta = If(ObjIE.EsAbonoEnCuenta, "PARA ABONO EN CUENTA DEL BENEFICIARIO", "")
|
||||
NotificarA = ObjIE.NotificarA
|
||||
tIdPoliza = ObjIE.IDPoliza
|
||||
|
||||
Dim PreP As New ClsContabilidad
|
||||
If PreP.GetPrePolizasDetalle(-1, UsuarioActual.CveEmpresa, CveIE:=CveIE) Then
|
||||
If PreP.DtResultados.Rows.Count > 0 Then
|
||||
CveProveedor = PreP.DtResultados.Rows(0)("CveProveedor").ToString.ToEntero
|
||||
CvePersonal = PreP.DtResultados.Rows(0)("CvePersonal").ToString.ToEntero
|
||||
|
||||
IVA = PreP.DtResultados.SUM("Importe", "CveConceptoContable = 19") ' concepto de IVA
|
||||
|
||||
If CveProveedor > 0 Then
|
||||
Dim Prov As New ClsCompProveedores
|
||||
If Prov.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
|
||||
If Prov.DtResultados.Rows.Count > 0 Then
|
||||
RFC = Prov.DtResultados.Rows(0)("RFC").ToString
|
||||
Correo = Prov.DtResultados.Rows(0)("ContactoMail").ToString
|
||||
End If
|
||||
End If
|
||||
Prov.Dispose()
|
||||
End If
|
||||
|
||||
If CvePersonal > 0 Then
|
||||
Dim RH As New ClsRH
|
||||
If RH.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
|
||||
If RH.DtResultados.Rows.Count > 0 Then
|
||||
Correo = RH.DtResultados.Rows(0)("Correo").ToString
|
||||
Banco = RH.DtResultados.Rows(0)("Banco").ToString
|
||||
NumCuenta = RH.DtResultados.Rows(0)("BancoNumCuenta").ToString
|
||||
CLABE = RH.DtResultados.Rows(0)("CLABE").ToString
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
RH.Dispose()
|
||||
|
||||
End If
|
||||
If UsuarioActual.CveEmpresa = 66 Then
|
||||
params.Add(New ReportParameter("RefCrediproveedor", RefCrediproveedor))
|
||||
End If
|
||||
End If
|
||||
PreP.Dispose()
|
||||
|
||||
|
||||
params.Add(New ReportParameter("Fecha", FechaExpedicion.ToString("dd-MM-yyyy")))
|
||||
params.Add(New ReportParameter("Folio", String.Format("Folio: {0}", Folio)))
|
||||
params.Add(New ReportParameter("PagueseA", PagueseA))
|
||||
params.Add(New ReportParameter("Importe", $"$ {Importe.ToString("N2")}"))
|
||||
params.Add(New ReportParameter("ImporteTexto", TextoImporte.ToUpper))
|
||||
params.Add(New ReportParameter("Banco", Banco))
|
||||
params.Add(New ReportParameter("NumCuenta", NumCuenta))
|
||||
params.Add(New ReportParameter("CLABE", CLABE))
|
||||
params.Add(New ReportParameter("Concepto", Observacion))
|
||||
params.Add(New ReportParameter("Factura", ""))
|
||||
params.Add(New ReportParameter("RFC", RFC))
|
||||
params.Add(New ReportParameter("IVA", $"$ {IVA.ToString("N2")}"))
|
||||
params.Add(New ReportParameter("NumSucursal", NoSucursal))
|
||||
params.Add(New ReportParameter("Correo", Correo))
|
||||
params.Add(New ReportParameter("Telefono", Telefono))
|
||||
params.Add(New ReportParameter("NotifiqueA", NotificarA))
|
||||
params.Add(New ReportParameter("Obra", SubProyecto))
|
||||
params.Add(New ReportParameter("UsuarioRegistro", UsuarioRegistro))
|
||||
params.Add(New ReportParameter("TipoTransaccion", CveTipoTransaccion.ToString))
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\Transferencia.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
If Archivo.Exists Then
|
||||
ImprimirPDF(String.Format("{0}Formatos\Transferencia.rdlc", UsuarioActual.Empresa.Ruta), DtDetalle, params, String.Format("Transferencia-{0}", CveIE))
|
||||
Else
|
||||
ImprimirPDF("Empresas\Grales\Formatos\Transferencia.rdlc", DtDetalle, params, String.Format("Transferencia-{0}", CveIE))
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 66 Then
|
||||
params.Add(New ReportParameter("RefCrediproveedor", RefCrediproveedor))
|
||||
End If
|
||||
|
||||
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\Transferencia.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
If Archivo.Exists Then
|
||||
ImprimirPDF(String.Format("{0}Formatos\Transferencia.rdlc", UsuarioActual.Empresa.Ruta), DtDetalle, params, String.Format("Transferencia-{0}", CveIE))
|
||||
Else
|
||||
ImprimirPDF("Empresas\Grales\Formatos\Transferencia.rdlc", DtDetalle, params, String.Format("Transferencia-{0}", CveIE))
|
||||
End If
|
||||
|
||||
ElseIf CveTipoTransaccion.Contiene(6) Then
|
||||
'IMPRESION DE FORMATO DE IE PAGO EN EFECTIVO PARA COMPU - VIATICOS
|
||||
Dim Folio As String = "", Observacion As String = "", UsuarioRegistro As String = "", TextoImporte As String = "", PagueseA As String = ""
|
||||
ElseIf CveTipoTransaccion.Contiene(6) Then
|
||||
'IMPRESION DE FORMATO DE IE PAGO EN EFECTIVO PARA COMPU - VIATICOS
|
||||
Dim Folio As String = "", Observacion As String = "", UsuarioRegistro As String = "", TextoImporte As String = "", PagueseA As String = ""
|
||||
Dim Ruta As String = UsuarioActual.Empresa.Ruta
|
||||
Dim FechaExpedicion As Date = Now
|
||||
Dim Importe As Double
|
||||
|
||||
Reference in New Issue
Block a user