Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -995,9 +995,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
|
||||
|
||||
@@ -2055,7 +2056,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)
|
||||
@@ -2589,6 +2595,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))
|
||||
@@ -2607,233 +2616,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")
|
||||
@@ -2846,20 +2876,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"
|
||||
@@ -2867,96 +2899,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()
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -706,6 +706,20 @@ Partial Class PV
|
||||
ViewState("CveAutorizacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property ClienteCodigoRegimenFiscal As String
|
||||
Get
|
||||
|
||||
If ViewState("ClienteCodigoRegimenFiscal") Is Nothing Then
|
||||
ViewState("ClienteCodigoRegimenFiscal") = ""
|
||||
End If
|
||||
Return ViewState("ClienteCodigoRegimenFiscal").ToString
|
||||
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("ClienteCodigoRegimenFiscal") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
#Region "PROPIEDADES DE PUNTO DE VENTA"
|
||||
@@ -2428,8 +2442,10 @@ Partial Class PV
|
||||
'End If
|
||||
End Sub
|
||||
Private Sub CargaUsoCFDI()
|
||||
|
||||
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
|
||||
If UsuarioActual.Empresa.Funcionalidad(350) <> "1" Then
|
||||
ClienteCodigoRegimenFiscal = "-1"
|
||||
End If
|
||||
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=ClienteCodigoRegimenFiscal)
|
||||
DdlUsoCFDI.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaNuevaFactura(OVenta As ClsVentas)
|
||||
@@ -2632,6 +2648,7 @@ Partial Class PV
|
||||
ViewState("IdCtaContRetISR") = ObjCliente.IdCtaContRetISR
|
||||
ViewState("CodCliente") = ObjCliente.Codigo
|
||||
ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS
|
||||
ClienteCodigoRegimenFiscal = ObjCliente.DtResultados.Rows(0)("CodigoRegimenFiscal").ToString()
|
||||
|
||||
If (Boolean.Parse(ObjCliente.DtResultados(0)("EsDistribuidor").ToString)) Then
|
||||
TrEsDistribuidor.Visible = True
|
||||
@@ -2684,6 +2701,13 @@ Partial Class PV
|
||||
DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33.ToString)
|
||||
'DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString)
|
||||
DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString)
|
||||
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
|
||||
If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1") AndAlso LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then
|
||||
'S01 Sin efectos fiscales.
|
||||
DdlUsoCFDI.SelectedValueExist("23")
|
||||
DdlUsoCFDI.Enabled = False
|
||||
ClienteCodigoRegimenFiscal = "616"
|
||||
End If
|
||||
End If
|
||||
TxtFechaPago.Text = (Now.AddDays(ObjCliente.PlazoCobranza)).ToShortDateString
|
||||
|
||||
@@ -2862,6 +2886,13 @@ Partial Class PV
|
||||
DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString)
|
||||
DdlMetodoPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveMetodoPago33").ToString)
|
||||
DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString)
|
||||
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
|
||||
If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1") AndAlso LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then
|
||||
'S01 Sin efectos fiscales.
|
||||
DdlUsoCFDI.SelectedValueExist("23")
|
||||
DdlUsoCFDI.Enabled = False
|
||||
ClienteCodigoRegimenFiscal = "616"
|
||||
End If
|
||||
End If
|
||||
|
||||
If CveVenta < 0 Then TxtAtencionA.Text = ObjCliente.DtResultados.Rows(0)("Contacto").ToString
|
||||
@@ -2891,6 +2922,13 @@ Partial Class PV
|
||||
DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33)
|
||||
DdlMetodoPago33.SelectedValueExist(ObjCliente.CveMetodoPago33)
|
||||
DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI)
|
||||
'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES
|
||||
If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1") AndAlso LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then
|
||||
'S01 Sin efectos fiscales.
|
||||
DdlUsoCFDI.SelectedValueExist("23")
|
||||
DdlUsoCFDI.Enabled = False
|
||||
ClienteCodigoRegimenFiscal = "616"
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -4201,12 +4239,18 @@ Partial Class PV
|
||||
HdnDescuentoOriginal.Value = TxtDescuento.Text.ToDecimal().ToString()
|
||||
LblDescuentoIncluido.Text = TxtDescuento.Text.ToDecimal().FormatoNumero(2)
|
||||
|
||||
If PrecioSugerido > 0 AndAlso TxtDescuento.Text.ToDecimal() > 0 Then
|
||||
If PrecioSugerido > 0 Then
|
||||
TxtPrecio.Text = PrecioSugerido.FormatoNumero()
|
||||
LblPrecio1.Text = PrecioSugerido.FormatoNumero()
|
||||
'RegistraScript("$get('LblPrecio1').innerText = formato_numero(" + PrecioSugerido.ToString() + ", 2, '.', ',');", "A1")
|
||||
End If
|
||||
|
||||
If IsNumeric(TxtCantidad.Text.Trim) Then
|
||||
LblTotalPS.Text = (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.ToDouble).ToString.FormatoNumero(2)
|
||||
Else
|
||||
LblTotalPS.Text = "0.00"
|
||||
End If
|
||||
|
||||
If ChkAjuste.Checked Then
|
||||
CalculaMesesUso()
|
||||
UpAjuste.Update()
|
||||
@@ -4402,6 +4446,27 @@ Partial Class PV
|
||||
Descuento = 0
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
'LTH AA Paq. 2 baterias, LTH AAA Paq. 02 baterias, LTH AA Paq. 4 baterias, LTH AAA Paq. 4 Baterias
|
||||
If CvePS.Contiene(521445, 521448, 402917, 402918) Then
|
||||
'SI TIENE BATERIAS AGREGADAS CON LA MARCA LTH, APLICAR PROMOCION, LA CLASIFICACION DEBE SER ACUMULADORES
|
||||
If TmpDT.SUMD("Cantidad", "CveMarca IN (819,826,1085,1052) AND CveClasificacion IN (20520,20522,20513,20521,20512,20514,20229)") >= 1D Then
|
||||
Descuento = 0
|
||||
SeAjustoPU = True
|
||||
'Paq. 2 baterias
|
||||
If CvePS.Contiene(521445, 521448) Then
|
||||
PUPromocion = 25D
|
||||
End If
|
||||
'Paq. 4 baterias
|
||||
If CvePS.Contiene(402917, 402918) Then
|
||||
PUPromocion = 40D
|
||||
End If
|
||||
PUModificado = Math.Round(PUPromocion / (1 + If(IncluyeImpuestos, PorcentajeIVA, 0)), 6)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjDescuento.ImporteDescuento = Descuento
|
||||
ObjDescuento.CvePromocionDetalle = CvePromocionDetalle
|
||||
If SeAjustoPU Then
|
||||
@@ -4639,6 +4704,7 @@ Partial Class PV
|
||||
TmpDT.Columns("EliminarDB").DefaultValue = False
|
||||
|
||||
TmpDT.Columns.Add("AplicaSerie", GetType(Boolean))
|
||||
TmpDT.Columns.Add("CveMarca", GetType(Integer))
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -5011,6 +5077,11 @@ Partial Class PV
|
||||
|
||||
Row("EliminarDB") = EliminarDB
|
||||
|
||||
If TmpDT.Columns.Contains("CveMarca") Then
|
||||
Row("CveMarca") = DrPS("CveMarca")
|
||||
End If
|
||||
|
||||
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA
|
||||
|
||||
|
||||
@@ -2619,6 +2619,7 @@ Partial Class Ventas
|
||||
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
||||
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
|
||||
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CveMarca", GetType(Integer))
|
||||
GvPS.DataSource = ObjVentas.DtResultados
|
||||
GvPS.DataBind()
|
||||
|
||||
@@ -2640,6 +2641,7 @@ Partial Class Ventas
|
||||
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
|
||||
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
|
||||
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CveMarca", GetType(Integer))
|
||||
GvPS.DataSource = ObjVentas.DtResultados
|
||||
GvPS.DataBind()
|
||||
|
||||
@@ -7666,8 +7668,14 @@ Partial Class Ventas
|
||||
|
||||
'EN BDH NO DEBE PODER EDITAR LOS PS
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
e.Row.FCLinkButton("imgE").Visible = False
|
||||
e.Row.FCLinkButton("imgD").Visible = False
|
||||
If ModalidadEdicion Then
|
||||
e.Row.FCLinkButton("imgE").Visible = True
|
||||
e.Row.FCLinkButton("imgD").Visible = False
|
||||
Else
|
||||
e.Row.FCLinkButton("imgE").Visible = False
|
||||
e.Row.FCLinkButton("imgD").Visible = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -7707,6 +7715,22 @@ Partial Class Ventas
|
||||
If Me.CveVenta > 0 AndAlso UsuarioActual.CveEmpresa = 119 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot") Then
|
||||
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False
|
||||
End If
|
||||
|
||||
If CveVenta > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtCantidad").Enabled = False
|
||||
|
||||
GvPS.Rows(e.NewEditIndex).FCDropDownList("DdlUnidadMedida").Enabled = False
|
||||
GvPS.Rows(e.NewEditIndex).FCDropDownLost("DdlPS").Enabled = False
|
||||
GvPS.Rows(e.NewEditIndex).FCDropDownLost("DdlPS").ddlWS.Attributes.Add("disabled", "disabled")
|
||||
GvPS.Rows(e.NewEditIndex).FCDropDownList("DdlUnidadMedida").Enabled = False
|
||||
GvPS.Rows(e.NewEditIndex).FCDropDownList("DdlClasificacion").Enabled = False
|
||||
GvPS.Rows(e.NewEditIndex).FCDropDownList("DdlProyecto").Enabled = False
|
||||
GvPS.Rows(e.NewEditIndex).FCDropDownList("DdlSubProyecto").Enabled = False
|
||||
|
||||
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtObsPS").Enabled = True
|
||||
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = False
|
||||
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvPS_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvPS.RowCancelingEdit
|
||||
GvPS.EditIndex = -1
|
||||
@@ -9493,8 +9517,15 @@ Partial Class Ventas
|
||||
If File.Exists(ArchivoXML) Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
|
||||
End If
|
||||
GeneraPDFFactura(ChkEnviarFactura.Checked) 'MANDA CORREO
|
||||
|
||||
Try
|
||||
'MANDA CORREO
|
||||
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, CveVenta, UsuarioActual, strURLHOST))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al enviar el PDF", ex)
|
||||
End Try
|
||||
End If
|
||||
|
||||
'DESCARGA PDF
|
||||
@@ -14980,75 +15011,66 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region "¡ P D F R E P O R T V I E W E R !"
|
||||
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean)
|
||||
|
||||
'CASO ESPECIAL
|
||||
If UsuarioActual.CveEmpresa = 8 AndAlso ObjFactura.TipoDocto.Contiene("Cot") Then
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("Sucursal", DdlSubProyectoDatos.SelectedItem.Text))
|
||||
'params.Add(New ReportParameter("Fecha", FechaCotizacion.ToString()))
|
||||
params.Add(New ReportParameter("Folio", ObjFactura.Folio.ToString()))
|
||||
params.Add(New ReportParameter("Cliente", LtlCliente.Text))
|
||||
params.Add(New ReportParameter("PersonaDirige", TxtAtencionA.Text))
|
||||
params.Add(New ReportParameter("Total", TxtTotal.Text))
|
||||
params.Add(New ReportParameter("Observaciones", TxtObsFact.Text))
|
||||
params.Add(New ReportParameter("Vendedor", DdlVendedor.SelectedItem.Text))
|
||||
params.Add(New ReportParameter("PersonaDirige", TxtAtencionA.Text.Trim))
|
||||
'params.Add(New ReportParameter("Folio", ""))
|
||||
ImprimirPDF(String.Format("{0}Formatos\Cotizacion.rdlc", UsuarioActual.Empresa.Ruta), TmpDT, params, "Cotización", RDSName:="DsCotizacion")
|
||||
End If
|
||||
|
||||
'Dim pdf As Byte() = Nothing
|
||||
|
||||
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, CveVenta As Integer, UsuarioActual As Usuario, strURLHOST As String)
|
||||
'GUARDA PDF
|
||||
Dim LocalSerieFolio As String = String.Empty
|
||||
Dim LocalTipoDocto As String = String.Empty
|
||||
|
||||
|
||||
Dim Factura As Modelos.Factura
|
||||
'TIMBRADO NUEVO
|
||||
Try
|
||||
Dim ObjetoPDF As Byte() = DescargarFactura(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True)
|
||||
Dim ObjetoPDF As Byte() = DescargarFactura(CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True, strURLHOST:=strURLHOST)
|
||||
|
||||
If ObjetoPDF Is Nothing OrElse ObjetoPDF.Length = 0 Then
|
||||
PdfFactura(ObjFactura, AplicaPagare:=If(ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant"), "1", "0"))
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgError)
|
||||
OnError("Ocurrió un error al generar el PDF", ex)
|
||||
End Try
|
||||
|
||||
If CveVenta > 0 Then
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
End If
|
||||
Dim ErrorCorreo As Boolean = False
|
||||
|
||||
LocalSerieFolio = ObjFactura.SerieFolio
|
||||
LocalTipoDocto = ObjFactura.TipoDocto
|
||||
'End If
|
||||
|
||||
|
||||
'MANDA CORREO
|
||||
If EnviaCorreo Then
|
||||
Dim ArchivoAdjunto As String = ""
|
||||
Dim ArchivoXML = String.Format("{0}XML\{1}\{2}.xml", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio)
|
||||
Dim ArchivoPDF = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio)
|
||||
If Adjunto <> "" Then
|
||||
ArchivoAdjunto = String.Format("{0}Ventas\{1}", UsuarioActual.Empresa.Ruta, Adjunto)
|
||||
Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False)
|
||||
If Factura IsNot Nothing Then
|
||||
'MANDA CORREO
|
||||
If EnviaCorreo Then
|
||||
LocalSerieFolio = Factura.SerieFolio
|
||||
LocalTipoDocto = Factura.TipoDocto
|
||||
|
||||
Dim ArchivoAdjunto As String = ""
|
||||
Dim ArchivoXML = String.Format("{0}XML\{1}\{2}.xml", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio)
|
||||
Dim ArchivoPDF = String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, LocalTipoDocto, LocalSerieFolio)
|
||||
If Adjunto <> "" Then
|
||||
ArchivoAdjunto = String.Format("{0}Ventas\{1}", UsuarioActual.Empresa.Ruta, Adjunto)
|
||||
End If
|
||||
|
||||
Try
|
||||
Dim FIXML As New FileInfo(ArchivoXML)
|
||||
Dim FIPDF As New FileInfo(ArchivoPDF)
|
||||
If FIXML.Exists AndAlso FIPDF.Exists Then
|
||||
MandaMails(UsuarioActual, CveVenta, Factura.TipoDocto, LocalSerieFolio, EnviaCorreo, ArchivoXML, ArchivoPDF, ArchivoAdjunto)
|
||||
Else
|
||||
ErrorCorreo = True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ErrorCorreo = True
|
||||
End Try
|
||||
|
||||
End If
|
||||
Else
|
||||
ErrorCorreo = True
|
||||
End If
|
||||
|
||||
Try
|
||||
' BytesPdfCotizacion(CveVenta)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() MandaMails(UsuarioActual, CveVenta, DdlTipoComprobante.SelectedValue.ToString(), LocalSerieFolio, ChkEnviarFactura.Checked, ArchivoXML, ArchivoPDF, ArchivoAdjunto))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al mandar Mail", ex)
|
||||
If ErrorCorreo Then
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ChkEnviarFactura.Checked Then
|
||||
If EnviaCorreo Then
|
||||
ObjVentas.UpdateVentaMail(3, CveVenta)
|
||||
Else
|
||||
ObjVentas.UpdateVentaMail(0, CveVenta)
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -16351,7 +16373,14 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'IMPRESION
|
||||
GeneraPDFFactura(ChkEnviarFactura.Checked)
|
||||
Try
|
||||
'MANDA CORREO
|
||||
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, CveVenta, UsuarioActual, strURLHOST))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al enviar el PDF", ex)
|
||||
End Try
|
||||
|
||||
If ObjFactura.TipoDocto = "Ing" AndAlso ObjFactura.Timbre.CFDIRelacionados.TipoRelacion = "07" Then
|
||||
CreaObjetosVentaAmortizacion(Nothing, ObjTimbrado.UUID, ObjFactura.CveVentaRelacion, CveVenta)
|
||||
@@ -18059,6 +18088,27 @@ Partial Class Ventas
|
||||
Alert("No se calculó el descuento correctamente", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
'LTH AA Paq. 2 baterias, LTH AAA Paq. 02 baterias, LTH AA Paq. 4 baterias, LTH AAA Paq. 4 Baterias
|
||||
If CvePS.Contiene(521445, 521448, 402917, 402918) Then
|
||||
'SI TIENE BATERIAS AGREGADAS CON LA MARCA LTH, APLICAR PROMOCION, LA CLASIFICACION DEBE SER ACUMULADORES
|
||||
If TmpDT.SUMD("Cantidad", "CveMarca IN (819,826,1085,1052) AND CveClasificacion IN (20520,20522,20513,20521,20512,20514,20229)") >= 1D Then
|
||||
Descuento = 0
|
||||
SeAjustoPU = True
|
||||
'Paq. 2 baterias
|
||||
If CvePS.Contiene(521445, 521448) Then
|
||||
PUPromocion = 25D
|
||||
End If
|
||||
'Paq. 4 baterias
|
||||
If CvePS.Contiene(402917, 402918) Then
|
||||
PUPromocion = 40D
|
||||
End If
|
||||
PUModificado = Math.Round(PUPromocion / (1 + If(IncluyeImpuestos, PorcentajeIVA, 0)), 6)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
ObjDescuento.ImporteDescuento = Descuento.RoundSQL(2)
|
||||
ObjDescuento.CvePromocionDetalle = CvePromocionDetalle
|
||||
If SeAjustoPU Then
|
||||
@@ -18462,6 +18512,10 @@ Partial Class Ventas
|
||||
Row("EsOutSourcing") = DrPS("EsOutSourcing")
|
||||
Row("EsCargo") = EsCargo
|
||||
|
||||
If TmpDT.Columns.Contains("CveMarca") Then
|
||||
Row("CveMarca") = DrPS("CveMarca")
|
||||
End If
|
||||
|
||||
If ImporteProntoPago > 0 Then
|
||||
Row("ImporteProntoPago") = ImporteProntoPago
|
||||
Row("TieneProntoPago") = "Si"
|
||||
@@ -18701,6 +18755,7 @@ Partial Class Ventas
|
||||
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
|
||||
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CodigoObjetoImpuesto", GetType(String))
|
||||
TmpDT.Columns.Add("CveMarca", GetType(Integer))
|
||||
|
||||
TmpDT.Columns("EsOutSourcing").DefaultValue = False
|
||||
TmpDT.Columns("EsCargo").DefaultValue = False
|
||||
@@ -20595,13 +20650,12 @@ Partial Class Ventas
|
||||
Private Sub MandaMails(UsuarioActual As Usuario, CveVenta As Integer, TipoDocto As String, SerieFolio As String, EnviarFactura As Boolean, XML As String, PDF As String, Adjunto As String)
|
||||
|
||||
Dim ObjMail As New ClsSisMail()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim ResultadoMail As Integer = 0
|
||||
|
||||
Try
|
||||
|
||||
Dim Asunto As String = String.Empty
|
||||
Dim Cuerpo As String = String.Empty
|
||||
Dim ResultadoMail As Integer = 0
|
||||
|
||||
Dim TipoComprobante = ""
|
||||
|
||||
@@ -20631,7 +20685,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
If Not EnviarFactura Then
|
||||
ObjVentas.UpdateVentaMail(0, CveVenta)
|
||||
ResultadoMail = 0
|
||||
End If
|
||||
|
||||
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
||||
@@ -20654,7 +20708,7 @@ Partial Class Ventas
|
||||
Else
|
||||
ResultadoMail = 3
|
||||
End If
|
||||
ObjVentas.UpdateVentaMail(ResultadoMail, CveVenta)
|
||||
|
||||
|
||||
'CASO ESPECIAL
|
||||
If CveUsuarioActual = 1446 Then ' Flora
|
||||
@@ -20669,8 +20723,10 @@ Partial Class Ventas
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al mandar el Mail", ex)
|
||||
ObjVentas.UpdateVentaMail(3, CveVenta)
|
||||
ResultadoMail = 3
|
||||
Finally
|
||||
Dim ObjVentas As New ClsVentas
|
||||
ObjVentas.UpdateVentaMail(ResultadoMail, CveVenta)
|
||||
ObjVentas.Dispose()
|
||||
End Try
|
||||
|
||||
@@ -21148,7 +21204,7 @@ Partial Class Ventas
|
||||
'EN BDH NO DEBE PERMITIR EDITAR EL PU
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
For Each Gvr As GridViewRow In GvPS.Rows
|
||||
Gvr.FCLinkButton("imgE").Visible = False
|
||||
Gvr.FCLinkButton("imgE").Visible = True
|
||||
Gvr.FCLinkButton("imgD").Visible = False
|
||||
CantidadFacturadaRemision += Gvr.DataKey("CantidadFacturadaRem").ToString().ToDouble
|
||||
Next
|
||||
@@ -21396,9 +21452,23 @@ Partial Class Ventas
|
||||
|
||||
'REGENERAR EL PDF
|
||||
If Not OcurrioError Then
|
||||
DescargarFactura(CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True)
|
||||
Try
|
||||
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() RegenerarPDF(CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, strURLHOST))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al regenerar el PDF", ex)
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RegenerarPDF(CveVenta As Integer, CveEmpresa As Integer, CveUsuario As Integer, strURLHOST As String)
|
||||
Try
|
||||
DescargarFactura(CveVenta, CveEmpresa, CveUsuario, Regenerar:=True, strURLHOST:=strURLHOST)
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió error al regenerar el PDF", ex)
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub BtnActualizarCuentaTerminal_Click(sender As Object, e As EventArgs) Handles BtnActualizarCuentaTerminal.Click
|
||||
Dim ObjVentas As New ClsVentas
|
||||
ObjVentas.IniciaTransacSQL()
|
||||
@@ -32914,8 +32984,13 @@ Partial Class Ventas
|
||||
|
||||
' Return File
|
||||
'End Function
|
||||
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, CveUsuarioCreo As Integer, Optional GetBytes As Boolean = True, Optional Regenerar As Boolean = False) As Byte()
|
||||
Dim Url = New Uri(String.Format("{0}://{1}:{2}/Compras/PopUpVerFactura.aspx?P={3}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1®ENERAR={1}", CveVenta, If(Regenerar, "1", "0")))))
|
||||
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, CveUsuarioCreo As Integer, Optional GetBytes As Boolean = True, Optional Regenerar As Boolean = False, Optional strURLHOST As String = "") As Byte()
|
||||
|
||||
If String.IsNullOrEmpty(strURLHOST) Then
|
||||
strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||
End If
|
||||
|
||||
Dim Url = New Uri(String.Format("{0}/Compras/PopUpVerFactura.aspx?P={1}", strURLHOST, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1®ENERAR={1}", CveVenta, If(Regenerar, "1", "0")))))
|
||||
Dim File As Byte() = Nothing
|
||||
Try
|
||||
Using httpClient = New HttpClient()
|
||||
@@ -33681,6 +33756,7 @@ Partial Class Ventas
|
||||
TmpDT.Columns.Add("CodigoObjetoImpuesto", GetType(String))
|
||||
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||
TmpDT.Columns.Add("CveMarca", GetType(Integer))
|
||||
|
||||
Return TmpDT
|
||||
End Function
|
||||
|
||||
@@ -1150,6 +1150,44 @@ Public Class WSGPSApp
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
<WebMethod>
|
||||
Public Function GetGeoRutas(CveCliente As Integer, CveDispositivo As Integer) As String
|
||||
Dim CveGeoReferencia As Integer = -1
|
||||
Dim DtRutas As DataTable = Nothing
|
||||
Using ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetReferenciaDetalle(-1, -1, CveDispositivo, CveCliente) Then
|
||||
CveGeoReferencia = ObjGPS.DtResultados.FiltroPrimeroValor("CveGeoReferencia", "Tipo = 'Ruta'").ToEntero()
|
||||
End If
|
||||
If CveGeoReferencia > 0 Then
|
||||
If ObjGPS.GeoReferenciaGet(CveGeoReferencia, -1, "Ruta", CveCliente) Then
|
||||
DtRutas = ObjGPS.DtResultados.Copy()
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
|
||||
Dim Rutas As New List(Of Object)
|
||||
If CveGeoReferencia > 0 Then
|
||||
|
||||
For Each Row As DataRow In DtRutas.Rows
|
||||
Dim Coordenadas As List(Of MWSGeolocation2) = SQLToGmapsPolyline(Row("Coordenadas").ToString())
|
||||
|
||||
Rutas.Add(New With {
|
||||
.CveRuta = CveGeoReferencia,
|
||||
.Ruta = Row("GeoReferencia").ToString(),
|
||||
.Folio = "",
|
||||
.Fecha = Row("FechaInicio").ToString(),
|
||||
.CveDispositivo = CveDispositivo,
|
||||
.CveUsuarioIngreso = -1,
|
||||
.Coordenadas = Coordenadas
|
||||
})
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Return JsonConvert.SerializeObject(Rutas)
|
||||
|
||||
End Function
|
||||
<WebMethod>
|
||||
Public Function GetRutas(CveCliente As Integer, CveRuta As Integer, MostrarPuntos As Boolean) As String
|
||||
Dim DtRutas As DataTable = Nothing
|
||||
|
||||
Reference in New Issue
Block a user