From 9edf0b285a9a63ef4f591aedcc3571203435d91c Mon Sep 17 00:00:00 2001 From: rakcsle Date: Sat, 18 Jun 2022 13:26:47 -0700 Subject: [PATCH 1/5] Compras actualizacion de compra cambio de AF de insumo a AF Compra --- Compras/Compras.aspx.vb | 3 ++- Inventarios/EntradasSalidas.aspx.vb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index d024dcd69..110f122e6 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -10435,6 +10435,7 @@ Partial Class Compras_Compras (row1("NoDeducible").ToString <> row2("NoDeducible").ToString) Or (row1("CveActivoFijo").ToString.ToEntero <> row2("CveActivoFijo").ToString.ToEntero) Or (row1("AFMedida").ToString.ToEntero <> row2("AFMedida").ToString.ToEntero) Or + (row1("TipoAF").ToString.ToEntero <> row2("TipoAF").ToString.ToEntero) Or (row1("CvePS").ToString.ToEntero <> row2("CvePS").ToString.ToEntero) Then Return False End If @@ -10566,7 +10567,7 @@ Partial Class Compras_Compras 'AF DT = TmpDT.FiltraParametros("ISNULL(TipoAF,0) = 2") - If DT.Rows.Count > 0 AndAlso DdlTipoComprobante.SelectedValue <> "NC" And ConceptoContabilizacionAlmacen = 0 Then + If DT.Rows.Count > 0 AndAlso DdlTipoComprobante.SelectedValue <> "NC" Then For Each Row2 As DataRow In DT.Rows importeMovimiento = Row2("Total").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index e268312f5..717cf216b 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -3381,7 +3381,7 @@ Partial Class Inventarios_EntradasSalidas Private Sub CargaCultivos() DdlModalCultivosCuadro.Items.Clear() - DdlModalCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue} AND Estatus = 1 ") + DdlModalCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue} AND Estatus = 1 ", "TemporadaCuadro") DdlModalCultivosCuadro.DataBind() DdlModalCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) End Sub From 2b5e7c9b61106cfd49f5d1ec083db71173b9d131 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 18 Jun 2022 14:28:45 -0700 Subject: [PATCH 2/5] GPS. metodo para obtener rutas en webs service --- asmx/WSGPSApp.asmx | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/asmx/WSGPSApp.asmx b/asmx/WSGPSApp.asmx index 807de05e8..53f281618 100644 --- a/asmx/WSGPSApp.asmx +++ b/asmx/WSGPSApp.asmx @@ -1150,6 +1150,44 @@ Public Class WSGPSApp End Function + + + 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 Public Function GetRutas(CveCliente As Integer, CveRuta As Integer, MostrarPuntos As Boolean) As String Dim DtRutas As DataTable = Nothing From 9521b6b677a97677397092b94906eccfede843f4 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 18 Jun 2022 14:33:43 -0700 Subject: [PATCH 3/5] E13.Totales de mercacia y unidad de peso en carta porte --- Compras/PopUpVerFactura.aspx.vb | 548 +++++++++---------- Empresas/13/Formatos/CartaPorteTimbrado.rdlc | 218 ++++---- Empresas/13/Formatos/Factura.rdlc | 18 + 3 files changed, 397 insertions(+), 387 deletions(-) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index f54ffac71..b69298fea 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -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() diff --git a/Empresas/13/Formatos/CartaPorteTimbrado.rdlc b/Empresas/13/Formatos/CartaPorteTimbrado.rdlc index fabf967ac..1650e01ed 100644 --- a/Empresas/13/Formatos/CartaPorteTimbrado.rdlc +++ b/Empresas/13/Formatos/CartaPorteTimbrado.rdlc @@ -92,11 +92,6 @@ - - Black - - 1pt - 2pt 2pt 2pt @@ -131,11 +126,6 @@ - - Black - - 1pt - 2pt 2pt 2pt @@ -170,11 +160,6 @@ - - Black - - 1pt - 2pt 2pt 2pt @@ -209,11 +194,6 @@ - - Black - - 1pt - 2pt 2pt 2pt @@ -248,11 +228,6 @@ - - Black - - 1pt - 2pt 2pt 2pt @@ -430,7 +405,7 @@ - Peso (KG) + Peso - - Black - - 1pt - 2pt 2pt 2pt @@ -553,6 +523,10 @@ White + + Black + 1pt + 2pt 2pt 2pt @@ -650,22 +624,9 @@ + 2pt - - - - - Black - 1pt - - - - - - - 2pt 2pt 2pt @@ -699,22 +660,9 @@ + 2pt - - - - - Black - 1pt - - - - - - - 2pt 2pt 2pt @@ -751,11 +699,6 @@ 5pt - - Black - - 1pt - 2pt 2pt 2pt @@ -793,11 +736,6 @@ 5pt - - Black - - 1pt - 2pt 2pt 2pt @@ -834,11 +772,6 @@ 5pt - - Black - - 1pt - 1pt @@ -1097,8 +1030,7 @@ - Black - 1pt + 1pt @@ -1163,6 +1095,10 @@ White + + Black + 1pt + 2pt 2pt 2pt @@ -1251,22 +1187,9 @@ + 2pt - - - - - Black - 1pt - - - - - - - 2pt 2pt 2pt @@ -1303,11 +1226,6 @@ 5pt - - Black - - 1pt - 1pt @@ -1446,8 +1364,7 @@ - Black - 1pt + 1pt @@ -1512,6 +1429,10 @@ White + + Black + 1pt + 2pt 2pt 2pt @@ -1662,6 +1583,11 @@ + + Black + + 1pt + 2pt 2pt 2pt @@ -3500,7 +3426,7 @@ - Pesto Neto Total (KG): + Total Mercancías: - =Parameters!PesoNetoTotal.Value + =Parameters!NumTotalMercancias.Value @@ -3757,6 +3685,72 @@ 2pt + + true + true + + + + + Peso Neto Total : + + + + =Parameters!PesoNetoTotal.Value + + + + + + + + Unidad de peso : + + + + =Parameters!UnidadPeso.Value + + + + + + + Textbox46 + 5.72244cm + 13.28458cm + 0.3768cm + 7.09598cm + 18 + + + 2pt + 2pt + 2pt + 2pt + + 7.00495in + + + + Cierre de Cultivo + + + + + + +
  • + +
  • +
    +
    +
    + + + + + + + +
    +
    +
    + + "> + +
    +
    +
    + +
    Temporada:
    +
    + + +
    + +
    + +
    +
    +
    > 1 + +
    +
    +
    +
    + + + + + + + +
    +
    + + + + + + + +
    +
    + + + +
    +
    + + + + + + + + +
    + + + diff --git a/Agropecuaria/CierreCultivo.aspx.vb b/Agropecuaria/CierreCultivo.aspx.vb new file mode 100644 index 000000000..9b6b4f83e --- /dev/null +++ b/Agropecuaria/CierreCultivo.aspx.vb @@ -0,0 +1,78 @@ +Imports Extensiones +Partial Class Agrupecuaria_CierreCultivo + Inherits ClsPaginas + + Private Property CveCamion As Integer + Get + + If ViewState("CveCamion") Is Nothing Then + Return -1 + Else + Return ViewState("CveCamion").ToString().ToEntero() + End If + End Get + Set(ByVal value As Integer) + ViewState("CveCamion") = value + End Set + End Property + + Private Sub Agrupecuaria_CierreCultivo_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaCombos() + + End If + End Sub + + + Private Sub CargaCombos() + + Dim ObjGral As New ClsGenerales + + If ObjGral.GetTempordas(-1, UsuarioActual.CveEmpresa) Then + DdlTemporada.DataSource = ObjGral.DtResultados + End If + DdlTemporada.DataBind() + DdlTemporada.Items.Insert(0, New ListItem("Seleccione Una", "-1")) + + UpFiltros.Update() + + End Sub + + + + Public Sub CargaDatos() + + If Not DdlTemporada.SelectedValue.ToEntero > 0 Then + Alert("Debe de seleccionar una temporada", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim ObjGral As New ClsGenerales + + If ObjGral.GetCierreCultivos(DdlTemporada.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjGral.DtResultados + Else + GvDatos.DataSource = Nothing + End If + + ObjGral.Dispose() + GvDatos.DataBind() + UpDatos.Update() + + + End Sub + + + Private Sub CierraCultivo() + + End Sub + + + + + + + Protected Sub btConsultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub +End Class diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 069d43b09..25e840d47 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3602,6 +3602,48 @@ Public Class ClsGenerales + Public Function GetTempordas(CveTemporada As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_AgroTemporadaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@cveTemporada", SqlDbType.Int).Value = CveTemporada + .Add("@cveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError($"Ocurrió un error al obtener los datos de las temporadas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + + + Public Function GetCierreCultivos(CveTemporada As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Agro_CierreCultivosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTemporada", SqlDbType.Int).Value = CveTemporada + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError($"Ocurrió un error al obtener los datos de cultivo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + + #End Region @@ -4011,7 +4053,7 @@ Public Class ClsGenerales - Public Function AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer, CvePS As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, CveUsuario As Integer) As Boolean + Public Function AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen As Integer, CvePS As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, CveUsuario As Integer, Optional PesoKg As Decimal = -1D) As Boolean Dim Retorno As Boolean = False @@ -4025,6 +4067,7 @@ Public Class ClsGenerales .Add("@Cantidad", SqlDbType.Float).Value = Cantidad .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@PesoKg", SqlDbType.SmallMoney).Value = CveUsuario End With diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 9a65e56ef..7b7e0e607 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5602,6 +5602,8 @@ Public Class ClsPaginas PaginaDict.Add("/Planeacion/Presupuestos.aspx".ToUpper(), -1) PaginaDict.Add("/Contabilidad/OCDetalleAlmacen.aspx".ToUpper(), -1) + PaginaDict.Add("/Agropecuaria/CierreCultivo.aspx".ToUpper(), 1326) + PaginaDict.Add("/testApi.aspx".ToUpper(), -1) diff --git a/Inventarios/CartaPorteManual.aspx b/Inventarios/CartaPorteManual.aspx index e290b9bca..da661ee9e 100644 --- a/Inventarios/CartaPorteManual.aspx +++ b/Inventarios/CartaPorteManual.aspx @@ -456,6 +456,7 @@ Serie Lote Fecha Caducidad + Peso KG Comandos @@ -511,14 +512,17 @@ - + + + +
    - + @@ -535,12 +539,14 @@ + - + + diff --git a/Inventarios/CartaPorteManual.aspx.vb b/Inventarios/CartaPorteManual.aspx.vb index 9bca2d2ec..216757f0a 100644 --- a/Inventarios/CartaPorteManual.aspx.vb +++ b/Inventarios/CartaPorteManual.aspx.vb @@ -372,7 +372,7 @@ Partial Class Inventarios_CartaPorteManual tCaducidad = If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha) - AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, "", CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, ""), Lote:=If(tLote = "-1", "", tLote), FechaCaducidad:=tCaducidad, CveSeccionAlmacenDestino:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Limpia:=FuncionalidadSinSerie) + AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, "", CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, ""), Lote:=If(tLote = "-1", "", tLote), FechaCaducidad:=tCaducidad, CveSeccionAlmacenDestino:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Limpia:=FuncionalidadSinSerie, PesoKg:=TxtPesoKg.Text.ToDecimal) End If @@ -382,7 +382,7 @@ Partial Class Inventarios_CartaPorteManual - Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional CveSeccionAlmacen As Integer = -1, Optional SeccionAlmacen As String = "", Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha, Optional Limpia As Boolean = True, Optional CveSeccionAlmacenDestino As Integer = -1) + Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional CveSeccionAlmacen As Integer = -1, Optional SeccionAlmacen As String = "", Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha, Optional Limpia As Boolean = True, Optional CveSeccionAlmacenDestino As Integer = -1, Optional PesoKg As Decimal = 0D) If Cantidad <= 0 Then Alert("La cantidad debe ser mayor a cero (0). Por favor verifique y vuelva a intentar", TipoMensaje.MsgAdvertencia) RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") @@ -426,7 +426,7 @@ Partial Class Inventarios_CartaPorteManual registro.Item("PorcentajeIVA") = 0 registro("ClaveMaterialPeligroso") = DrPS("ClaveMaterialPeligroso") registro("ClaveEmbalaje") = DrPS("ClaveEmbalaje") - registro("PesoKg") = DrPS("PesoKg") + registro("PesoKg") = PesoKg DtMovimientos.Rows.Add(registro) RegistraScript("playsonidito('beep-07.wav')") @@ -456,6 +456,8 @@ Partial Class Inventarios_CartaPorteManual TxtnFechaCaducidad.Text = "" txtCantidad.Focus() + TxtPesoKg.Text = "" + 'If TxtCodigoPS.Visible Then ' TxtCodigoPS.Focus() 'End If @@ -567,7 +569,7 @@ Partial Class Inventarios_CartaPorteManual If CveEntregaAlmacen > 0 Then For Each GvRowPS As GridViewRow In GvDatos.Rows - If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, GvRowPS.DataKey("CvePS").ToEntero, GvRowPS.DataKey("Cantidad").ToEntero, GvRowPS.DataKey("CveUM").ToEntero, UsuarioActual.CveUsuario) Then + If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, GvRowPS.DataKey("CvePS").ToEntero, GvRowPS.DataKey("Cantidad").ToEntero, GvRowPS.DataKey("CveUM").ToEntero, UsuarioActual.CveUsuario, PesoKg:=GvRowPS.DataKey("PesoKg").ToDecimal) Then ErrorProceso = True Exit For End If @@ -630,31 +632,34 @@ Partial Class Inventarios_CartaPorteManual Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProducto2.SelectedValue.ToEntero).FiltroPrimero("", "PS") If drP IsNot Nothing Then - ThSeccionAlmacen.Visible = CBool(drP("AplicaSeccion")) - TdSeccionAlmacen.Visible = CBool(drP("AplicaSeccion")) - DdlSeccionAlmacen.Visible = CBool(drP("AplicaSeccion")) + 'ThSeccionAlmacen.Visible = CBool(drP("AplicaSeccion")) + 'TdSeccionAlmacen.Visible = CBool(drP("AplicaSeccion")) + 'DdlSeccionAlmacen.Visible = CBool(drP("AplicaSeccion")) 'GvDatos.Columns(5).Visible = CBool(drP("AplicaSeccion")) - ThSerie.Visible = CBool(drP("AplicaSerie")) - TdSerie.Visible = CBool(drP("AplicaSerie")) - TxtnSerie.Visible = CBool(drP("AplicaSerie")) + 'ThSerie.Visible = CBool(drP("AplicaSerie")) + 'TdSerie.Visible = CBool(drP("AplicaSerie")) + 'TxtnSerie.Visible = CBool(drP("AplicaSerie")) 'GvDatos.Columns(6).Visible = CBool(drP("AplicaSerie")) - TxtnLote.Visible = CBool(drP("AplicaLote")) - ThLote.Visible = CBool(drP("AplicaLote")) - TdLote.Visible = CBool(drP("AplicaLote")) + 'TxtnLote.Visible = CBool(drP("AplicaLote")) + 'ThLote.Visible = CBool(drP("AplicaLote")) + 'TdLote.Visible = CBool(drP("AplicaLote")) 'GvDatos.Columns(7).Visible = CBool(drP("AplicaLote")) - TxtnFechaCaducidad.Visible = CBool(drP("AplicaCaducidad")) - ThFechaCaducidad.Visible = CBool(drP("AplicaCaducidad")) - If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then ThFechaCaducidad.InnerText = UsuarioActual.Empresa.Funcionalidad(147) + 'TxtnFechaCaducidad.Visible = CBool(drP("AplicaCaducidad")) + 'ThFechaCaducidad.Visible = CBool(drP("AplicaCaducidad")) + 'If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then ThFechaCaducidad.InnerText = UsuarioActual.Empresa.Funcionalidad(147) 'ThFechaCaducidad.InnerText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad") - TdFechaCaducidad.Visible = CBool(drP("AplicaCaducidad")) + 'TdFechaCaducidad.Visible = CBool(drP("AplicaCaducidad")) 'GvDatos.Columns(8).Visible = CBool(drP("AplicaCaducidad")) + + TxtPesoKg.Text = drP("PesoKg").ToString.ToDecimal.ToString("###,###,###.00") + End If End If @@ -697,11 +702,11 @@ Partial Class Inventarios_CartaPorteManual Private Sub EscondeColumnasGVM(DtTemp As DataTable) - GvDatos.Columns(5).Visible = DtTemp.MAX("Serie").ToString <> "" - GvDatos.Columns(6).Visible = DtTemp.MAX("Lote").ToString <> "" - GvDatos.Columns(7).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad") - GvDatos.Columns(7).Visible = DtTemp.MAX("FechaCaducidad").ToString.ToDate > MinFecha - GvDatos.Columns(8).Visible = DtTemp.MAX("CveSeccionAlmacen").ToString.ToEntero > 0 + 'GvDatos.Columns(5).Visible = DtTemp.MAX("Serie").ToString <> "" + 'GvDatos.Columns(6).Visible = DtTemp.MAX("Lote").ToString <> "" + 'GvDatos.Columns(7).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) = "Fecha Elaboración", "Fecha Elaboración", "Fecha Caducidad") + 'GvDatos.Columns(7).Visible = DtTemp.MAX("FechaCaducidad").ToString.ToDate > MinFecha + 'GvDatos.Columns(8).Visible = DtTemp.MAX("CveSeccionAlmacen").ToString.ToEntero > 0 End Sub