E13.Totales de mercacia y unidad de peso en carta porte

This commit is contained in:
2022-06-18 14:33:43 -07:00
parent 2b5e7c9b61
commit 9521b6b677
3 changed files with 397 additions and 387 deletions

View File

@@ -1001,9 +1001,10 @@ Partial Class PopUpVerFactura
'IMPRIME FACTURA
If UrlParametros("OP").ToString = "VTA" Then
If UrlParametros("CVEVENTA") IsNot Nothing AndAlso UrlParametros("CVEVENTA").ToString.ToEntero > 0 Then
Dim AplicaPagare As String = If(UrlParametros("PAG") IsNot Nothing AndAlso UrlParametros("PAG").ToString <> "", UrlParametros("PAG").ToString, "0")
Dim Guardar As Boolean = UrlParametros("GUARDAR") IsNot Nothing AndAlso UrlParametros("GUARDAR").ToString() = "1"
imprimirFacturaVenta(UrlParametros("CVEVENTA").ToString.ToEntero, If(UrlParametros("PAG") IsNot Nothing AndAlso UrlParametros("PAG").ToString <> "", UrlParametros("PAG").ToString, "0"), GuardarPDF:=Guardar)
Dim RegenerarPDF As Boolean = UrlParametros("REGENERAR") IsNot Nothing AndAlso UrlParametros("REGENERAR").ToString() = "1"
imprimirFacturaVenta(UrlParametros("CVEVENTA").ToString.ToEntero, AplicaPagare, GuardarPDF:=Guardar, RegenerarPDF:=RegenerarPDF)
End If
End If
@@ -1825,7 +1826,12 @@ Partial Class PopUpVerFactura
Dim nodeMercanciaPadre As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Mercancias", "cartaporte20"), namespaces)
If UsuarioActual.CveEmpresa = 13 AndAlso nodeMercanciaPadre IsNot Nothing Then
Dim PesoNetoTotal = ValorXML(nodeMercanciaPadre(0), "PesoNetoTotal", "")
Dim UnidadPeso = ValorXML(nodeMercanciaPadre(0), "UnidadPeso", "")
Dim NumTotalMercancias = ValorXML(nodeMercanciaPadre(0), "NumTotalMercancias", "")
params.Add(New ReportParameter("PesoNetoTotal", PesoNetoTotal))
params.Add(New ReportParameter("UnidadPeso", UnidadPeso))
params.Add(New ReportParameter("NumTotalMercancias", NumTotalMercancias))
End If
Dim nodeOperadores As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:TiposFigura", "cartaporte20"), namespaces)
@@ -2359,6 +2365,9 @@ Partial Class PopUpVerFactura
Dim ObjVentas As New ClsVentas
Dim Vta As Modelos.Factura = Nothing
Dim PathArchivo As String = "" 'String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio)
Dim TmpDTImpuestos = New DataTable
TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String))
TmpDTImpuestos.Columns.Add("Importe", GetType(Double))
@@ -2377,233 +2386,254 @@ Partial Class PopUpVerFactura
Vta = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.Factura)
Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString
'se rellena la sucursal
'Vta.Subproyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SucursalModel)
Dim CveSubProyecto As Integer = dtVentas(0)("CveSubProyecto").ToString().ToEntero()
PathArchivo = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio)
Dim Archivo As New System.IO.FileInfo(PathArchivo)
Dim DtSubProyecto = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyecto, CveEmpresa:=dtVentas(0)("CveEmpresa").ToString().ToEntero())
'SI EL ARCHIVO NO EXISTE O SE VA REGENERA EL PDF, SE DEBEN LLENAR LOS DATOS
If Not Archivo.Exists OrElse RegenerarPDF Then
Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString
'se rellena la sucursal
'Vta.Subproyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SucursalModel)
Dim CveSubProyecto As Integer = dtVentas(0)("CveSubProyecto").ToString().ToEntero()
Vta.SubProyecto = DtSubProyecto.Rows(0).DataRowToObject(Of Modelos.SubProyectoModel)
'Vta.SubProyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SubProyectoModel)
Vta.Cliente = New Modelos.ClienteModel
Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString
Vta.Cliente.Telefono = dtVentas(0)("Telefono").ToString
Vta.Cliente.Direccion = dtVentas(0)("ClienteDireccion").ToString
Vta.Cliente.CP = dtVentas(0)("CPCliente").ToString
Vta.Cliente.Ciudad = dtVentas(0)("ClienteCiudad").ToString
Vta.Cliente.Localidad = dtVentas(0)("ClienteLocalidad").ToString
Vta.Cliente.Estado = dtVentas(0)("ClienteEstado").ToString
Vta.Cliente.Pais = dtVentas(0)("ClientePais").ToString
Vta.Cliente.RFC = dtVentas(0)("ClienteRFC").ToString
Vta.Cliente.Colonia = dtVentas(0)("ColoniaCliente").ToString
Vta.AtencionA = dtVentas(0)("AtencionA").ToString
Vta.Cliente.NoExt = dtVentas(0)("ClienteNoExt").ToString
Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString
Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString
Vta.Cliente.Mail = dtVentas(0)("Mail").ToString
Vta.Cliente.MailCotizacion = dtVentas(0)("SucClienteCorreo").ToString
Vta.Cliente.CodigoRegimenFiscal = dtVentas(0)("CodigoRegimenFiscal").ToString
Vta.Cliente.RegimenFiscal = dtVentas(0)("RegimenFiscal").ToString
Dim DtSubProyecto = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyecto, CveEmpresa:=dtVentas(0)("CveEmpresa").ToString().ToEntero())
Vta.SubProyecto = DtSubProyecto.Rows(0).DataRowToObject(Of Modelos.SubProyectoModel)
'Vta.SubProyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SubProyectoModel)
Vta.Cliente = New Modelos.ClienteModel
Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString
Vta.Cliente.Telefono = dtVentas(0)("Telefono").ToString
Vta.Cliente.Direccion = dtVentas(0)("ClienteDireccion").ToString
Vta.Cliente.CP = dtVentas(0)("CPCliente").ToString
Vta.Cliente.Ciudad = dtVentas(0)("ClienteCiudad").ToString
Vta.Cliente.Localidad = dtVentas(0)("ClienteLocalidad").ToString
Vta.Cliente.Estado = dtVentas(0)("ClienteEstado").ToString
Vta.Cliente.Pais = dtVentas(0)("ClientePais").ToString
Vta.Cliente.RFC = dtVentas(0)("ClienteRFC").ToString
Vta.Cliente.Colonia = dtVentas(0)("ColoniaCliente").ToString
Vta.AtencionA = dtVentas(0)("AtencionA").ToString
Vta.Cliente.NoExt = dtVentas(0)("ClienteNoExt").ToString
Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString
Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString
Vta.Cliente.Mail = dtVentas(0)("Mail").ToString
Vta.Cliente.MailCotizacion = dtVentas(0)("SucClienteCorreo").ToString
Vta.Cliente.CodigoRegimenFiscal = dtVentas(0)("CodigoRegimenFiscal").ToString
Vta.Cliente.RegimenFiscal = dtVentas(0)("RegimenFiscal").ToString
Vta.RefDocto = dtVentas(0)("Ref").ToString
Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero
Vta.NumeroCuenta = dtVentas(0)("NumCtaPago").ToString
Vta.Version = dtVentas(0)("CFDIVersion").ToString
Vta.RefDocto = dtVentas(0)("Ref").ToString
Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero
Vta.NumeroCuenta = dtVentas(0)("NumCtaPago").ToString
Vta.Version = dtVentas(0)("CFDIVersion").ToString
Vta.NumeroContrato = dtVentas(0)("NumeroContrato").ToString
Vta.DescripcionContrato = dtVentas(0)("DescripcionContrato").ToString
Vta.NumeroDescripcionContrato = If($"{dtVentas(0)("NumeroContrato").ToString} - {dtVentas(0)("NumeroLicitacion").ToString}" = " - ", "", $"{dtVentas(0)("NumeroContrato").ToString} {If(dtVentas(0)("NumeroLicitacion").ToString = "", "", $" - Licitación: {dtVentas(0)("NumeroLicitacion").ToString}")}")
Vta.NumeroContrato = dtVentas(0)("NumeroContrato").ToString
Vta.DescripcionContrato = dtVentas(0)("DescripcionContrato").ToString
Vta.NumeroDescripcionContrato = If($"{dtVentas(0)("NumeroContrato").ToString} - {dtVentas(0)("NumeroLicitacion").ToString}" = " - ", "", $"{dtVentas(0)("NumeroContrato").ToString} {If(dtVentas(0)("NumeroLicitacion").ToString = "", "", $" - Licitación: {dtVentas(0)("NumeroLicitacion").ToString}")}")
Vta.PedidoContrato = If(dtVentas(0)("PedidoContrato").ToString = "", Vta.NumeroDescripcionContrato, $"{dtVentas(0)("PedidoContrato").ToString} {If(Vta.NumeroDescripcionContrato = "", "", $" / {Vta.NumeroDescripcionContrato}") }")
Vta.Kilometraje = If(dtVentas(0)("Kilometraje").ToString = "", -1, dtVentas(0)("Kilometraje").ToString.ToDecimal)
'Vta.PedidoContrato = dtVentas(0)("PedidoContrato").ToString
Vta.PedidoContrato = If(dtVentas(0)("PedidoContrato").ToString = "", Vta.NumeroDescripcionContrato, $"{dtVentas(0)("PedidoContrato").ToString} {If(Vta.NumeroDescripcionContrato = "", "", $" / {Vta.NumeroDescripcionContrato}") }")
Vta.Kilometraje = If(dtVentas(0)("Kilometraje").ToString = "", -1, dtVentas(0)("Kilometraje").ToString.ToDecimal)
'Vta.PedidoContrato = dtVentas(0)("PedidoContrato").ToString
Vta.ClienteSucursal = New Modelos.SucursalModel
Vta.ClienteSucursal.Direccion = dtVentas(0)("SucClienteDireccion").ToString
Vta.ClienteSucursal.NoExt = dtVentas(0)("SucClienteNoExt").ToString
Vta.ClienteSucursal.NoInt = dtVentas(0)("SucClienteNoInt").ToString
Vta.ClienteSucursal.Colonia = dtVentas(0)("SucClienteColonia").ToString
Vta.ClienteSucursal.CP = dtVentas(0)("SucClienteCP").ToString
Vta.ClienteSucursal.Municipio = dtVentas(0)("SucClienteCiudad").ToString
Vta.ClienteSucursal.Estado = dtVentas(0)("SucClienteEstado").ToString
Vta.ClienteSucursal.Pais = dtVentas(0)("SucClientePais").ToString
Vta.ClienteSucursal.Localidad = dtVentas(0)("SucClienteLocalidad").ToString
Vta.ClienteSucursal.CorreoSucursal = dtVentas(0)("SucClienteCorreo").ToString
Vta.ClienteSucursal.TelefonoSucursal = dtVentas(0)("SucClienteTelefono").ToString
Vta.ClienteSucursal.Sucursal = dtVentas(0)("SucursalCliente").ToString
Vta.ClienteSucursal.ImprimeNombreSucursal = dtVentas(0)("ImprimeNombreSucursal").ToString
Vta.ClienteSucursal = New Modelos.SucursalModel
Vta.ClienteSucursal.Direccion = dtVentas(0)("SucClienteDireccion").ToString
Vta.ClienteSucursal.NoExt = dtVentas(0)("SucClienteNoExt").ToString
Vta.ClienteSucursal.NoInt = dtVentas(0)("SucClienteNoInt").ToString
Vta.ClienteSucursal.Colonia = dtVentas(0)("SucClienteColonia").ToString
Vta.ClienteSucursal.CP = dtVentas(0)("SucClienteCP").ToString
Vta.ClienteSucursal.Municipio = dtVentas(0)("SucClienteCiudad").ToString
Vta.ClienteSucursal.Estado = dtVentas(0)("SucClienteEstado").ToString
Vta.ClienteSucursal.Pais = dtVentas(0)("SucClientePais").ToString
Vta.ClienteSucursal.Localidad = dtVentas(0)("SucClienteLocalidad").ToString
Vta.ClienteSucursal.CorreoSucursal = dtVentas(0)("SucClienteCorreo").ToString
Vta.ClienteSucursal.TelefonoSucursal = dtVentas(0)("SucClienteTelefono").ToString
Vta.ClienteSucursal.Sucursal = dtVentas(0)("SucursalCliente").ToString
Vta.ClienteSucursal.ImprimeNombreSucursal = dtVentas(0)("ImprimeNombreSucursal").ToString
Vta.EnviarA = New Modelos.EnviarAModel
Vta.EnviarA.CveDireccionEnvio = dtVentas(0)("CveDireccionEnvio").ToString.ToEntero
Vta.EnviarA.EnvioDireccion = dtVentas(0)("EnvioDireccion").ToString
Vta.EnviarA.EnvioColonia = dtVentas(0)("EnvioColonia").ToString
Vta.EnviarA.EnvioCiudad = dtVentas(0)("EnvioCiudad").ToString
Vta.EnviarA.EnvioEstado = dtVentas(0)("EnvioEstado").ToString
Vta.EnviarA.EnvioCP = dtVentas(0)("EnvioCP").ToString
Vta.EnviarA.EnvioTel = dtVentas(0)("EnvioTel").ToString
Vta.EnviarA = New Modelos.EnviarAModel
Vta.EnviarA.CveDireccionEnvio = dtVentas(0)("CveDireccionEnvio").ToString.ToEntero
Vta.EnviarA.EnvioDireccion = dtVentas(0)("EnvioDireccion").ToString
Vta.EnviarA.EnvioColonia = dtVentas(0)("EnvioColonia").ToString
Vta.EnviarA.EnvioCiudad = dtVentas(0)("EnvioCiudad").ToString
Vta.EnviarA.EnvioEstado = dtVentas(0)("EnvioEstado").ToString
Vta.EnviarA.EnvioCP = dtVentas(0)("EnvioCP").ToString
Vta.EnviarA.EnvioTel = dtVentas(0)("EnvioTel").ToString
Vta.EnviarA.EnvioNoExt = dtVentas(0)("EnvioNoExt").ToString
Vta.EnviarA.EnvioNoInt = dtVentas(0)("EnvioNoInt").ToString
Vta.EnviarA.EnvioContacto = dtVentas(0)("EnvioContacto").ToString
Vta.EnviarA.EnvioDepartamento = dtVentas(0)("EnvioDepartamento").ToString
Vta.EnviarA.EnvioNoExt = dtVentas(0)("EnvioNoExt").ToString
Vta.EnviarA.EnvioNoInt = dtVentas(0)("EnvioNoInt").ToString
Vta.EnviarA.EnvioContacto = dtVentas(0)("EnvioContacto").ToString
Vta.EnviarA.EnvioDepartamento = dtVentas(0)("EnvioDepartamento").ToString
'Vta.EnviarA.EnvioPedidoContrato = dtVentas(0)("EnvioPedidoContrato").ToString
'Vta.EnviarA.EnvioPedidoContrato = dtVentas(0)("EnvioPedidoContrato").ToString
'INE COMPLEMENTO
If dtVentas(0)("TipoComite").ToString <> "" Then
Dim INE As New Modelos.ComplementoINE
INE.INETipoComite = dtVentas(0)("TipoComite").ToString
INE.INETipoProceso = dtVentas(0)("TipoProceso").ToString
INE.INEIdContabilidad = dtVentas(0)("IdContabilidad").ToString.ToEntero
Vta.ComplementoINE = INE
End If
'INE COMPLEMENTO
If dtVentas(0)("TipoComite").ToString <> "" Then
Dim INE As New Modelos.ComplementoINE
INE.INETipoComite = dtVentas(0)("TipoComite").ToString
INE.INETipoProceso = dtVentas(0)("TipoProceso").ToString
INE.INEIdContabilidad = dtVentas(0)("IdContabilidad").ToString.ToEntero
Vta.ComplementoINE = INE
End If
Dim DR As DataRow = TmpDTImpuestos.NewRow()
If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("IVA").ToString.ToDouble >= 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR)
Dim DR As DataRow = TmpDTImpuestos.NewRow()
If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("IVA").ToString.ToDouble >= 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR)
'solo para eclipse, que muesre un subtotal debajo de IVA
If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
'solo para eclipse, que muesre un subtotal debajo de IVA
If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("IEPS").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IEPS" : DR("Importe") = dtVentas(0)("IEPS").ToString.ToDouble : DR("Orden") = 80 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("IEPS").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IEPS" : DR("Importe") = dtVentas(0)("IEPS").ToString.ToDouble : DR("Orden") = 80 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 100 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 100 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If ObjVentas.GetVentaDetalle(CveVenta) Then 'Obtenemos el Detalle de la Oorden de Compra
Vta.DtDetalle = ObjVentas.DtResultados
End If
If ObjVentas.GetVentaDetalle(CveVenta) Then 'Obtenemos el Detalle de la Oorden de Compra
Vta.DtDetalle = ObjVentas.DtResultados
End If
If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
Dim dtImpuesto As DataTable = ObjVentas.DtResultados
If dtImpuesto.Rows.Count > 0 Then
For Each Row As DataRow In dtImpuesto.Rows
Dim Orden = 80
If Row("Importe").ToString.ToDouble <> 0 Then
DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString
DR("Importe") = Row("Importe").ToString.ToDouble
DR("Orden") = Orden
TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
Orden = Orden + 1
Dim dtImpuesto As DataTable = ObjVentas.DtResultados
If dtImpuesto.Rows.Count > 0 Then
For Each Row As DataRow In dtImpuesto.Rows
Dim Orden = 80
If Row("Importe").ToString.ToDouble <> 0 Then
DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString
DR("Importe") = Row("Importe").ToString.ToDouble
DR("Orden") = Orden
TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
Orden = Orden + 1
End If
Next
End If
Vta.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC")
End If
'TmpDT DESGLOSE DE IMPUESTOS 3.3
For Each dr1 As DataRow In Vta.DtDetalle.Rows
Dim DrIVA As DataRow = Nothing
Dim DrIEPS As DataRow = Nothing
Try
DrIVA = TmpDTImpuestosIVAIEPS.Select("Impuesto = 'IVA'")(0)
Catch ex As Exception
DrIVA = Nothing
End Try
If DrIVA IsNot Nothing Then
DrIVA("Importe") = DrIVA("Importe").ToString.ToDouble + dr1("ImporteIVA").ToString.ToDouble
TmpDTImpuestosIVAIEPS.AcceptChanges()
Else
Dim DR2 As DataRow = TmpDTImpuestosIVAIEPS.NewRow()
If dr1("PorcentajeIVA").ToString.ToDouble > 0 Then
DR2("Impuesto") = "IVA" : DR2("tasa") = String.Format("{0} %", dr1("PorcentajeIVA").ToString.ToDouble() * 100) : DR2("Importe") = dr1("ImporteIVA").ToString.ToDouble : DR2("Orden") = "1"
TmpDTImpuestosIVAIEPS.Rows.Add(DR2)
TmpDTImpuestosIVAIEPS.AcceptChanges()
End If
Next
End If
Vta.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC")
End If
End If
Try
DrIEPS = TmpDTImpuestosIVAIEPS.Select($"Impuesto = 'IEPS' AND tasa = '{dr1("PorcentajeIEPS").ToString.ToDouble * 100} %'")(0)
Catch ex As Exception
DrIEPS = Nothing
End Try
'TmpDT DESGLOSE DE IMPUESTOS 3.3
For Each dr1 As DataRow In Vta.DtDetalle.Rows
Dim DrIVA As DataRow = Nothing
Dim DrIEPS As DataRow = Nothing
Try
DrIVA = TmpDTImpuestosIVAIEPS.Select("Impuesto = 'IVA'")(0)
Catch ex As Exception
DrIVA = Nothing
End Try
If DrIVA IsNot Nothing Then
DrIVA("Importe") = DrIVA("Importe").ToString.ToDouble + dr1("ImporteIVA").ToString.ToDouble
TmpDTImpuestosIVAIEPS.AcceptChanges()
Else
Dim DR2 As DataRow = TmpDTImpuestosIVAIEPS.NewRow()
If dr1("PorcentajeIVA").ToString.ToDouble > 0 Then
DR2("Impuesto") = "IVA" : DR2("tasa") = String.Format("{0} %", dr1("PorcentajeIVA").ToString.ToDouble() * 100) : DR2("Importe") = dr1("ImporteIVA").ToString.ToDouble : DR2("Orden") = "1"
TmpDTImpuestosIVAIEPS.Rows.Add(DR2)
If DrIEPS IsNot Nothing Then
DrIEPS("Importe") = DrIEPS("Importe").ToString.ToDouble + dr1("ImporteIEPS").ToString.ToDouble
TmpDTImpuestosIVAIEPS.AcceptChanges()
Else
Dim DR2 As DataRow = TmpDTImpuestosIVAIEPS.NewRow()
If dr1("PorcentajeIEPS").ToString.ToDouble > 0 Then
DR2("Impuesto") = "IEPS" : DR2("tasa") = String.Format("{0} {1}", dr1("PorcentajeIEPS").ToString.ToDouble * 100, "%") : DR2("Importe") = dr1("ImporteIEPS").ToString.ToDouble : DR2("Orden") = If(dr1("PorcentajeIEPS").ToString.ToDecimal = 0.03, "2", If(dr1("PorcentajeIEPS").ToString.ToDecimal = 0.06, "3", If(dr1("PorcentajeIEPS").ToString.ToDecimal = 0.07, "4", If(dr1("PorcentajeIEPS").ToString.ToDecimal = 0.09, "5", ""))))
TmpDTImpuestosIVAIEPS.Rows.Add(DR2)
TmpDTImpuestosIVAIEPS.AcceptChanges()
End If
End If
Next
Vta.DtDesgloseImpuestos = TmpDTImpuestosIVAIEPS.FiltraParametros("", Orderby:="Orden ASC")
If ObjVentas.GetVentasFirmas(CveVenta) Then
Vta.DtFirmas = ObjVentas.DtResultados
End If
Try
DrIEPS = TmpDTImpuestosIVAIEPS.Select($"Impuesto = 'IEPS' AND tasa = '{dr1("PorcentajeIEPS").ToString.ToDouble * 100} %'")(0)
Catch ex As Exception
DrIEPS = Nothing
End Try
If DrIEPS IsNot Nothing Then
DrIEPS("Importe") = DrIEPS("Importe").ToString.ToDouble + dr1("ImporteIEPS").ToString.ToDouble
TmpDTImpuestosIVAIEPS.AcceptChanges()
Else
Dim DR2 As DataRow = TmpDTImpuestosIVAIEPS.NewRow()
If dr1("PorcentajeIEPS").ToString.ToDouble > 0 Then
DR2("Impuesto") = "IEPS" : DR2("tasa") = String.Format("{0} {1}", dr1("PorcentajeIEPS").ToString.ToDouble * 100, "%") : DR2("Importe") = dr1("ImporteIEPS").ToString.ToDouble : DR2("Orden") = If(dr1("PorcentajeIEPS").ToString.ToDecimal = 0.03, "2", If(dr1("PorcentajeIEPS").ToString.ToDecimal = 0.06, "3", If(dr1("PorcentajeIEPS").ToString.ToDecimal = 0.07, "4", If(dr1("PorcentajeIEPS").ToString.ToDecimal = 0.09, "5", ""))))
TmpDTImpuestosIVAIEPS.Rows.Add(DR2)
TmpDTImpuestosIVAIEPS.AcceptChanges()
'CFDI RELACIONADO
If dtVentas(0)("CveTipoRelacion").ToString.ToEntero > 0 Then
Vta.Timbre.Comprobante.TipoComprobante = If(Vta.TipoDocto.Contiene("Ing", "Ant"), "I", If(Vta.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
If Vta.Timbre.Comprobante.TipoComprobante = "E" Then
If Vta.TipoDocto.Contiene("Egs") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "01"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
End If
If Vta.TipoDocto.Contiene("Dev") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "03"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
End If
Vta.Timbre.CFDIRelacionados.UUID.Add(dtVentas(0)("FolioFiscalPadre").ToString)
End If
' cuando es refacturacoin es cfdirelacionado, con relacion 04
If Vta.Timbre.Comprobante.TipoComprobante = "I" Then 'AndAlso (dtVentas(0)("Total").ToString.ToDouble = dtVentas(0)("TotalPadre").ToString.ToDouble) Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "04"
Vta.Timbre.CFDIRelacionados.UUID.Add(dtVentas(0)("FolioFiscalPadre").ToString)
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Sustitución de los CFDI Previos"
End If
If UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {dtVentas(0)("CveTipoRelacion").ToString.ToEntero}")
Vta.Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
End If
End If
End If
Next
Vta.DtDesgloseImpuestos = TmpDTImpuestosIVAIEPS.FiltraParametros("", Orderby:="Orden ASC")
If ObjVentas.GetVentasFirmas(CveVenta) Then
Vta.DtFirmas = ObjVentas.DtResultados
End If
'CFDI RELACIONADO
If dtVentas(0)("CveTipoRelacion").ToString.ToEntero > 0 Then
Vta.Timbre.Comprobante.TipoComprobante = If(Vta.TipoDocto.Contiene("Ing", "Ant"), "I", If(Vta.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
If Vta.Timbre.Comprobante.TipoComprobante = "E" Then
If Vta.TipoDocto.Contiene("Egs") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "01"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
End If
If Vta.TipoDocto.Contiene("Dev") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "03"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
End If
Vta.Timbre.CFDIRelacionados.UUID.Add(dtVentas(0)("FolioFiscalPadre").ToString)
End If
' cuando es refacturacoin es cfdirelacionado, con relacion 04
'If UsuarioActual.CveEmpresa.Contiene(72, 80, 119) Then
If Vta.Timbre.Comprobante.TipoComprobante = "I" Then 'AndAlso (dtVentas(0)("Total").ToString.ToDouble = dtVentas(0)("TotalPadre").ToString.ToDouble) Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "04"
Vta.Timbre.CFDIRelacionados.UUID.Add(dtVentas(0)("FolioFiscalPadre").ToString)
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Sustitución de los CFDI Previos"
End If
If UsuarioActual.Empresa.Funcionalidad(592) = "1" Then
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {dtVentas(0)("CveTipoRelacion").ToString.ToEntero}")
Vta.Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
If ObjVentas.GetVentaRefacturacion(dtVentas(0)("CveVentaPadre").ToString.ToEntero) Then
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
ObjVentas.DtResultados.Columns.Add("Importe", GetType(Decimal))
ObjVentas.DtResultados.Rows(0)("Importe") = ObjVentas.DtResultados.Rows(0)("Total")
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtNCVinculadas = ObjVentas.DtResultados
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
If Vta.DtDocumentosRelacionados.Rows.Count > 0 Then
If Vta.TipoDocto.Contiene("Dev") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "03"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
End If
End If
End If
End If
End If
Else
End If
If dtVentas(0)("TipoDocto").ToString.Contiene("Egs", "Dev", "Ant") Then
End If
'If UsuarioActual.CveEmpresa.Contiene(72, 80, 119) Then
If Vta.Timbre.Comprobante.TipoComprobante = "I" Then 'AndAlso (dtVentas(0)("Total").ToString.ToDouble = dtVentas(0)("TotalPadre").ToString.ToDouble) Then
If ObjVentas.GetVentaRefacturacion(dtVentas(0)("CveVentaPadre").ToString.ToEntero) Then
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
ObjVentas.DtResultados.Columns.Add("Importe", GetType(Decimal))
ObjVentas.DtResultados.Rows(0)("Importe") = ObjVentas.DtResultados.Rows(0)("Total")
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtNCVinculadas = ObjVentas.DtResultados
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
@@ -2616,20 +2646,22 @@ Partial Class PopUpVerFactura
End If
End If
End If
Else
'If dtVentas(0)("TipoDocto").ToString.Contiene("Ing", "Ant", "Rem") Then
' 'carga as notas de credito vinculadas
' If ObjVentas.GetVentasAntNC(CveVenta, -1) Then
' Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
' End If
'End If
If dtVentas(0)("TipoDocto").ToString.Contiene("Egs", "Dev", "Ant") Then
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso (Vta.DtDocumentosRelacionados Is Nothing OrElse Vta.DtDocumentosRelacionados.Rows.Count = 0) Then
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtNCVinculadas = ObjVentas.DtResultados
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados '.FiltraParametros("FolioFiscal IS NOT NULL")
If Vta.DtDocumentosRelacionados.Rows.Count > 0 Then
If Vta.TipoDocto.Contiene("Ing") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "01"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
End If
If Vta.TipoDocto.Contiene("Egs") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "01"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
End If
If Vta.TipoDocto.Contiene("Dev") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "03"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
@@ -2637,96 +2669,50 @@ Partial Class PopUpVerFactura
End If
End If
End If
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso (Vta.DtDocumentosRelacionados Is Nothing OrElse Vta.DtDocumentosRelacionados.Rows.Count = 0) Then
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtNCVinculadas = ObjVentas.DtResultados
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados '.FiltraParametros("FolioFiscal IS NOT NULL")
If Vta.DtDocumentosRelacionados.Rows.Count > 0 Then
If Vta.TipoDocto.Contiene("Ing") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "01"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
End If
'SI ES TIPO RELACION 07- APLICACION DE ANTICIPOS
If dtVentas(0)("CveTipoRelacion").ToString.ToEntero = 7 Then
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {dtVentas(0)("CveTipoRelacion").ToString.ToEntero}")
If Vta.TipoDocto.Contiene("Egs") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "01"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
End If
Vta.Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
If Vta.TipoDocto.Contiene("Dev") Then
Vta.Timbre.CFDIRelacionados.TipoRelacion = "03"
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
End If
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
End If
End If
End If
'SI ES TIPO RELACION 07- APLICACION DE ANTICIPOS
If dtVentas(0)("CveTipoRelacion").ToString.ToEntero = 7 Then
Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {dtVentas(0)("CveTipoRelacion").ToString.ToEntero}")
Vta.Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
End If
End If
'End If
'If Vta.TipoDocto.Contiene("Egs", "Dev", "Ant") Then
' 'If ObjVentas.GetVentasAntNC(-1, CveVenta) Then
' ' Vta.DtNCVinculadas = ObjVentas.DtResultados
' 'End If
' If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
' Vta.DtNCVinculadas = ObjVentas.DtResultados
' End If
'End If
End If
ObjVentas.Dispose()
Dim CveTimbreCartaPorteVenta As Integer = -1
Dim CartaPorte As Modelos.MSubReportData = Nothing
If UsuarioActual.CveEmpresa = 13 AndAlso Vta.TipoDocto = "Ing" Then
Using ObjGral As New ClsGenerales
If ObjGral.GetGralTimbre(-1, "Ing", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Dim RowCP As DataRow = ObjGral.DtResultados.Rows(0)
CveTimbreCartaPorteVenta = RowCP("CveTimbre").ToString().ToEntero()
End If
End Using
If CveTimbreCartaPorteVenta > 0 Then
'CartaPorte = New Modelos.MSubReportData
'CartaPorte.Parametros.Add(New ReportParameter("SRP_ParametroPrueba", "Rarametro pasado"))
'Dim dt As New DataTable()
'dt.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
'dt.Columns.Add(New DataColumn("Unidad", GetType(String)))
'Dim row As DataRow = dt.NewRow()
'row("Cantidad") = 2.3D
'row("Unidad") = "PIEZAS"
'dt.Rows.Add(row)
'CartaPorte.DataSources.Add(New ReportDataSource() With {.Name = "DataSet1", .Value = dt})
CartaPorte = PreParaImpresionCartaPorte(CveTimbreCartaPorteVenta, AplicaSubReporte:=True)
Else
CartaPorte = New Modelos.MSubReportData()
CartaPorte.Parametros.Add(New ReportParameter($"TieneCartaPorte", "False"))
End If
End If
Dim Guardar As Boolean = If(GuardarPDF, True, If(AplicaPagare = "1", False, True))
If Not IsNothing(Vta) Then
Dim PathArchivo As String = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio)
Dim Archivo As New System.IO.FileInfo(PathArchivo)
Dim Guardar As Boolean = If(GuardarPDF, True, If(AplicaPagare = "1", False, True))
Dim CveTimbreCartaPorteVenta As Integer = -1
Dim CartaPorte As Modelos.MSubReportData = Nothing
'SI EL ARCHIVO NO EXISTE O SE VA REGENERA EL PDF, SE DEBEN LLENAR LOS DATOS
If Not Archivo.Exists OrElse RegenerarPDF Then
If UsuarioActual.CveEmpresa = 13 AndAlso Vta.TipoDocto = "Ing" Then
Using ObjGral As New ClsGenerales
If ObjGral.GetGralTimbre(-1, "Ing", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Dim RowCP As DataRow = ObjGral.DtResultados.Rows(0)
CveTimbreCartaPorteVenta = RowCP("CveTimbre").ToString().ToEntero()
End If
End Using
If CveTimbreCartaPorteVenta > 0 Then
CartaPorte = PreParaImpresionCartaPorte(CveTimbreCartaPorteVenta, AplicaSubReporte:=True)
Else
CartaPorte = New Modelos.MSubReportData()
CartaPorte.Parametros.Add(New ReportParameter($"TieneCartaPorte", "False"))
End If
End If
End If
If Archivo.Exists Then
If RegenerarPDF Then
Archivo.Delete()

View File

@@ -92,11 +92,6 @@
<Border>
<Style>None</Style>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -131,11 +126,6 @@
<Border>
<Style>None</Style>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -170,11 +160,6 @@
<Border>
<Style>None</Style>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -209,11 +194,6 @@
<Border>
<Style>None</Style>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -248,11 +228,6 @@
<Border>
<Style>None</Style>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -430,7 +405,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Peso (KG)</Value>
<Value>Peso </Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>7pt</FontSize>
@@ -491,11 +466,6 @@
<Border>
<Style>None</Style>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -553,6 +523,10 @@
<Color>White</Color>
<Style>Solid</Style>
</Border>
<BottomBorder>
<Color>Black</Color>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -650,22 +624,9 @@
<Style>
<Border>
<Color>White</Color>
<Style>Solid</Style>
<Style>None</Style>
<Width>2pt</Width>
</Border>
<TopBorder>
<Style>None</Style>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Style>None</Style>
</LeftBorder>
<RightBorder>
<Style>None</Style>
</RightBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -699,22 +660,9 @@
<Style>
<Border>
<Color>White</Color>
<Style>Solid</Style>
<Style>None</Style>
<Width>2pt</Width>
</Border>
<TopBorder>
<Style>None</Style>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Style>None</Style>
</LeftBorder>
<RightBorder>
<Style>None</Style>
</RightBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -751,11 +699,6 @@
<Style>None</Style>
<Width>5pt</Width>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -793,11 +736,6 @@
<Style>None</Style>
<Width>5pt</Width>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -834,11 +772,6 @@
<Style>None</Style>
<Width>5pt</Width>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<RightBorder>
<Style>Solid</Style>
<Width>1pt</Width>
@@ -1097,8 +1030,7 @@
<Style>None</Style>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Width>1pt</Width>
<Style>None</Style>
</BottomBorder>
<LeftBorder>
<Width>1pt</Width>
@@ -1163,6 +1095,10 @@
<Color>White</Color>
<Style>Solid</Style>
</Border>
<BottomBorder>
<Color>Black</Color>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -1251,22 +1187,9 @@
<Style>
<Border>
<Color>White</Color>
<Style>Solid</Style>
<Style>None</Style>
<Width>2pt</Width>
</Border>
<TopBorder>
<Style>None</Style>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Width>1pt</Width>
</BottomBorder>
<LeftBorder>
<Style>None</Style>
</LeftBorder>
<RightBorder>
<Style>None</Style>
</RightBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -1303,11 +1226,6 @@
<Style>None</Style>
<Width>5pt</Width>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<RightBorder>
<Style>Solid</Style>
<Width>1pt</Width>
@@ -1446,8 +1364,7 @@
<Style>None</Style>
</TopBorder>
<BottomBorder>
<Color>Black</Color>
<Width>1pt</Width>
<Style>None</Style>
</BottomBorder>
<LeftBorder>
<Width>1pt</Width>
@@ -1512,6 +1429,10 @@
<Color>White</Color>
<Style>Solid</Style>
</Border>
<BottomBorder>
<Color>Black</Color>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -1662,6 +1583,11 @@
<Border>
<Style>None</Style>
</Border>
<BottomBorder>
<Color>Black</Color>
<Style>Solid</Style>
<Width>1pt</Width>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
@@ -3500,7 +3426,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Pesto Neto Total (KG):</Value>
<Value>Total Mercancías:</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>7pt</FontSize>
@@ -3508,9 +3434,11 @@
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!PesoNetoTotal.Value</Value>
<Value>=Parameters!NumTotalMercancias.Value</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>7pt</FontSize>
<Format>#,0.00;(#,0.00)</Format>
</Style>
</TextRun>
</TextRuns>
@@ -3757,6 +3685,72 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox54">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Peso Neto Total :</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!PesoNetoTotal.Value</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>7pt</FontSize>
<Format>#,0.00;(#,0.00)</Format>
</Style>
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
<TextRun>
<Value>Unidad de peso :</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>7pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!UnidadPeso.Value</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox46</rd:DefaultName>
<Top>5.72244cm</Top>
<Left>13.28458cm</Left>
<Height>0.3768cm</Height>
<Width>7.09598cm</Width>
<ZIndex>18</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Height>7.00495in</Height>
<Style />
@@ -4008,7 +4002,7 @@
<PrintOnLastPage>true</PrintOnLastPage>
<ReportItems>
<Line Name="Line1">
<Top>0.03523cm</Top>
<Top>0.03522cm</Top>
<Left>0.06623cm</Left>
<Height>0cm</Height>
<Width>20.38566cm</Width>
@@ -4038,7 +4032,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox13</rd:DefaultName>
<Top>0.14106cm</Top>
<Top>0.14105cm</Top>
<Left>0.71425cm</Left>
<Height>0.54708cm</Height>
<Width>1.55632cm</Width>
@@ -4072,7 +4066,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName>
<Top>0.14106cm</Top>
<Top>0.14105cm</Top>
<Left>2.27057cm</Left>
<Height>0.54708cm</Height>
<Width>4.96223cm</Width>
@@ -4107,7 +4101,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox13</rd:DefaultName>
<Top>0.14106cm</Top>
<Top>0.14105cm</Top>
<Left>7.33864cm</Left>
<Height>0.54708cm</Height>
<Width>2.84562cm</Width>
@@ -4142,7 +4136,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName>
<Top>0.14106cm</Top>
<Top>0.14105cm</Top>
<Left>10.18425cm</Left>
<Height>0.54708cm</Height>
<Width>4.68641cm</Width>
@@ -4176,7 +4170,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName>
<Top>0.14459cm</Top>
<Top>0.14458cm</Top>
<Left>14.99343cm</Left>
<Height>0.54708cm</Height>
<Width>4.04906cm</Width>
@@ -4208,7 +4202,7 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox14</rd:DefaultName>
<Top>0.68814cm</Top>
<Top>0.68813cm</Top>
<Left>0.71425cm</Left>
<Height>0.54708cm</Height>
<Width>6.21751cm</Width>
@@ -4679,6 +4673,18 @@
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="UnidadPeso">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="NumTotalMercancias">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters>
<Language>es-MX</Language>
<ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>

View File

@@ -3263,6 +3263,12 @@
<Parameter Name="DistanciaTotal">
<Value>=Parameters!SRP_DistanciaTotal.Value</Value>
</Parameter>
<Parameter Name="UnidadPeso">
<Value>=Parameters!SRP_UnidadPeso.Value</Value>
</Parameter>
<Parameter Name="NumTotalMercancias">
<Value>=Parameters!SRP_NumTotalMercancias.Value</Value>
</Parameter>
</Parameters>
<Top>0.06863cm</Top>
<Height>1.11461cm</Height>
@@ -4644,6 +4650,18 @@
<Nullable>true</Nullable>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="SRP_UnidadPeso">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="SRP_NumTotalMercancias">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters>
<EmbeddedImages>
<EmbeddedImage Name="Logo">