From cec031096bdc2081c9a741a07e168c45fd9fe3ae Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 9 Apr 2025 02:33:10 -0700 Subject: [PATCH 01/13] =?UTF-8?q?--Informaci=C3=B3n=20completa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsClientes.vb | 25 +++++++++++++++++++++++-- Ventas/Clientes.aspx | 4 ++++ Ventas/Clientes.aspx.vb | 22 ++++++++++++++++++++-- Ventas/Ventas.aspx.vb | 18 ++++++++++++++++++ 4 files changed, 65 insertions(+), 4 deletions(-) diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index ad042738c..f38080777 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -528,6 +528,25 @@ Public Class ClsClientes Return Retorno End Function + Public Function GetClienteInformacionCompleta(CveCliente As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_ClientesInformacionCompletaGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener la información completa.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function AddCliente(Nombre As String, NombreComercial As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, Estado As String, Pais As String, RFC As String, CP As String, Telefono As String, Contacto As String, Mail As String, MailCotizacion As String, Notificar As String, Pagina As String, Giro As String, CvePrecioLista As Integer, EnviarFactura As Boolean, RetIVA As Double, RetISR As Double, @@ -544,7 +563,7 @@ Public Class ClsClientes Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False, Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False, - Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False, Optional CveSubProyectoCobranza As Integer = -1) As Boolean + Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False, Optional CveSubProyectoCobranza As Integer = -1, Optional InformacionCompleta As Boolean = True) As Boolean Dim Retorno As Boolean = False @@ -683,6 +702,7 @@ Public Class ClsClientes .Add("@EsFilial", SqlDbType.VarChar).Value = EsFilial .Add("@Aseguradora", SqlDbType.Bit).Value = Aseguradora .Add("@CveSubProyectoCobranza", SqlDbType.Int).Value = CveSubProyectoCobranza + .Add("@InformacionCompleta", SqlDbType.Bit).Value = InformacionCompleta End With Try SqlAdapter.Fill(Data) @@ -729,7 +749,7 @@ Public Class ClsClientes Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional NoDesglosaIVA As Boolean = False, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False, Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional UsaProductoAlterno As Boolean = False, - Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False, Optional CveSubProyectoCobranza As Integer = -1) As Boolean + Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False, Optional CveSubProyectoCobranza As Integer = -1, Optional InformacionCompleta As Boolean = True) As Boolean Dim Retorno As Boolean = False @@ -878,6 +898,7 @@ Public Class ClsClientes .Add("@EsFilial", SqlDbType.VarChar).Value = EsFilial .Add("@Aseguradora", SqlDbType.Bit).Value = Aseguradora .Add("@CveSubProyectoCobranza", SqlDbType.Int).Value = CveSubProyectoCobranza + .Add("@InformacionCompleta", SqlDbType.Bit).Value = InformacionCompleta End With Try SqlAdapter.Fill(Data) diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index f99b79160..320c35caf 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -3785,6 +3785,10 @@ +
+ Información Completa: + +
Fecha de Captura: diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index daa096874..88a3b7885 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -682,6 +682,9 @@ Partial Class Clientes RegistraScript("CargaHeader();") CargaCombosDirecionesClientesSAT() + If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + DivInfoCompleta.Visible = True + End If If UsuarioActual.Empresa.CvePlataforma = 3 Then 'SI ES USUARIO GPS TabFiscalContable.Visible = True @@ -1760,6 +1763,8 @@ Partial Class Clientes End If + ChkInformacionCompleta.Checked = Boolean.Parse(ObjClientes.DtResultados(0)("InformacionCompleta").ToString()) + 'Horario TxtHorario.Text = ObjClientes.Horario TxtObsDiasRevision.Text = ObjClientes.ObservacionRevision @@ -2570,6 +2575,19 @@ Partial Class Clientes Alert("El uso del cfdi debe ser 'S01 - Sin efectos fiscales' cuando se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia) Exit Sub + End If + + Dim InformacionCompleta As Boolean = True + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + + If TxtRFC.Text.Trim() = "" Then + InformacionCompleta = False + End If + + If DivInfoCompleta.Visible Then + InformacionCompleta = ChkInformacionCompleta.Checked + End If End If 'CargaSucursal() @@ -2679,7 +2697,7 @@ Partial Class Clientes ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()), CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito, Genero:=GeneroCliente, - CveAlmacenAsignado:=DdlAlmacenAsignado.SelectedValue.ToEntero, CveAlmacenAlterno:=DdlAlmacenAlterno.SelectedValue.ToEntero, UsaProductoAlterno:=ChkProductoAlterno.Checked, EsFilial:=ChkEsFilial.Checked, GastosEnvio:=TxtGastosEnvio.Text.ToDecimal, Aseguradora:=ChkAseguradora.Checked, CveSubProyectoCobranza:=DdlSubProyectoCobranza.SelectedValue.ToEntero()) Then + CveAlmacenAsignado:=DdlAlmacenAsignado.SelectedValue.ToEntero, CveAlmacenAlterno:=DdlAlmacenAlterno.SelectedValue.ToEntero, UsaProductoAlterno:=ChkProductoAlterno.Checked, EsFilial:=ChkEsFilial.Checked, GastosEnvio:=TxtGastosEnvio.Text.ToDecimal, Aseguradora:=ChkAseguradora.Checked, CveSubProyectoCobranza:=DdlSubProyectoCobranza.SelectedValue.ToEntero(), InformacionCompleta:=InformacionCompleta) Then CveClienteNuevo = ObjClientes.CveCliente @@ -2764,7 +2782,7 @@ Partial Class Clientes CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()), NoDesglosaIVA:=Not ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, ComExtCalle:=TxtComExtCalle.Text.Trim(), ComExtNumExt:=TxtComExtNumero.Text.Trim(), ComExtCP:=TxtComExtCP.Text.Trim(), FechaLimiteCredito:=FechaLimiteCredito, Genero:=GeneroCliente, CveAlmacenAsignado:=DdlAlmacenAsignado.SelectedValue.ToEntero, CveAlmacenConsignacion:=DdlAlmacenConsignacion.SelectedValue.ToEntero, CveAlmacenAlterno:=DdlAlmacenAlterno.SelectedValue.ToEntero, UsaProductoAlterno:=ChkProductoAlterno.Checked, - EnQuebranto:=ChkEnQuebranto.Checked, EnDemanda:=ChkEnDemanda.Checked, CreditoRegistroFirmas:=TxtNombreFirmas.Text.Trim, EsFilial:=ChkEsFilial.Checked, GastosEnvio:=TxtGastosEnvio.Text.ToDecimal, Aseguradora:=ChkAseguradora.Checked, CveSubProyectoCobranza:=DdlSubProyectoCobranza.SelectedValue.ToEntero()) Then + EnQuebranto:=ChkEnQuebranto.Checked, EnDemanda:=ChkEnDemanda.Checked, CreditoRegistroFirmas:=TxtNombreFirmas.Text.Trim, EsFilial:=ChkEsFilial.Checked, GastosEnvio:=TxtGastosEnvio.Text.ToDecimal, Aseguradora:=ChkAseguradora.Checked, CveSubProyectoCobranza:=DdlSubProyectoCobranza.SelectedValue.ToEntero(), InformacionCompleta:=InformacionCompleta) Then If Not ObjClientes.LimpiaImpuestosLocales(Me.CveCliente) Then ErrorProceso = True diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index dbece0253..c7fcb1d25 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -8371,6 +8371,24 @@ Partial Class Ventas LblEnviarMail.Visible = True End If + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + Dim ObjClie As New ClsClientes + If ObjClie.GetClienteInformacionCompleta(CveCliente, UsuarioActual.CveEmpresa) Then + If Not CBool(ObjClie.DtResultados.FiltroPrimeroValor("InformacionCompleta")) Then + Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:

{0}", "Información incompleta") + Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) + + BtnEmitirImprimir.Visible = False + BtnsFacturar.Visible = False + BtnGenerarRemision.Visible = False + + TieneBloqueoPorCreditoVencimiento = 1 + End If + End If + ObjClie.Dispose() + End If + + End Sub From 012a6e44350d3422ab137bc9c25e23bc034a3a93 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 9 Apr 2025 02:35:23 -0700 Subject: [PATCH 02/13] --Formatos E153 --- Empresas/153/Formatos/Cotizacion.rdlc | 25 +++++++++++++++++-------- Empresas/153/Formatos/Factura.rdlc | 16 ++-------------- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/Empresas/153/Formatos/Cotizacion.rdlc b/Empresas/153/Formatos/Cotizacion.rdlc index d782ee15b..6a5cf12c3 100644 --- a/Empresas/153/Formatos/Cotizacion.rdlc +++ b/Empresas/153/Formatos/Cotizacion.rdlc @@ -1217,7 +1217,8 @@ - CAMELIA 619 LIBERTAD HERMOSILLO + CAMELIA No.Ext: 619, Col: Libertad, +CP: 83130, Hermosillo,Sonora, México - - + + + - - - + + + + + + MaterialPeligroso + + + + + 1pt + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -732,6 +781,46 @@ + + + 0.52062cm + + + true + true + + + + + Peligroso + + + + + + + Textbox53 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + @@ -795,9 +884,9 @@ true DataSet3 8.7754cm - 0.38395cm + 0.40259cm 1.12062cm - 19.15904cm + 19.17353cm @@ -4957,7 +5046,7 @@ - transporte + transporte @@ -5387,7 +5476,7 @@ Textbox57 - 12.60522cm + 12.57347cm 5.80743cm 1.99491cm 4.05859cm @@ -5558,7 +5647,6 @@ CERTIFICADO DE ARRUMAZÓN DEL CONTENEDOR/VEHÍCULO Declaro que las mercancías descritas más arriba han sido arrumadas/cargadas en el contenedor/vehículo de conformidad con el IMDG. - POR CADA CARGA DEL CONTENEDOR/VEHÍCULO LA PERSONA RESPONSABLE DE LA ARRUMAZÓN/CARGA HA DE LLENAR Y FIRMAR ESTA SECCIÓN. + + + + + + + + + + + + + + + + + ___________________________ + + + + + + + + + + + + + + Textbox57 14.60013cm 1.35021cm - 2.92513cm + 3.54602cm 8.52539cm 27 + + + + + + + + + + + + + + + + + + + + ___________________________ + + + + + + + + + + + + + + Textbox57 14.60013cm 9.86956cm - 2.92513cm + 3.54602cm 9.31662cm 28 - 21.86398cm + 22.49898cm 1.5cm 0cm 3.90544cm @@ -6156,7 +6374,7 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot - 21.86398cm + 22.49898cm 9.94339cm 0cm 3.90544cm @@ -6168,8 +6386,8 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot - 21.86398cm - 14.68568cm + 22.49898cm + 14.71743cm 0cm 3.90544cm 43 @@ -6197,7 +6415,7 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot Textbox120 - 22.10051cm + 22.67201cm 1.36431cm 0.45969cm 10.17692cm @@ -6212,11 +6430,85 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot 2pt + + true + true + + + + + =Parameters!SerieFolio.Value + + + + + + + SerieFolio + 0.67478cm + 15.20438cm + 0.6cm + 3.97474cm + 45 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + =Parameters!FechaCertificacion.Value + + + + + + + SerieFolio + 1.45117cm + 15.20438cm + 0.6cm + 3.97474cm + 46 + + + 2pt + 2pt + 2pt + 2pt + + true 23.161cm - 0.02115cm - 22.5602cm + 0.03979cm + 23.1317cm 19.53633cm 29 @@ -6437,7 +6729,7 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot true 19.47094cm - 0.10398cm + 0.12262cm 3.556cm 19.66645cm 30 @@ -6447,11 +6739,900 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot + + + + + End + + true + 0.46378cm + 0.10353cm + 18.12737cm + + + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.20936cm + 0.19973in + 0.76284in + 1.18285in + 1 + + + + + + true + true + + + + + Transporte de mercancías peligrosas + + + + + + + + + NOM-043-SCT-SEMAR-ARTF-2023 + + + + + + + Textbox2 + 0.20936cm + 5.26408cm + 0.94606cm + 9.73471cm + 2 + + + + true + + + + + 1. Expedidor + + + + + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 2. Número del documento de transporte + + + + =Parameters!SerieFolio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 3. Página 2 de 2 Páginas + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Referencia del expedidor + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Referencia del expedidor de la carga + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 7. Porteador/Transportista (debe llenarlo el porteador/transportista) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 6. Destinatario + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + 1.94544cm + + + 9.84993cm + + + 2.13881cm + + + 1.84139cm + + + 2.05903cm + + + + + 0.66035cm + + + + + true + true + + + + + 14 Marcas de + + + + + + + + + transporte + + + + + + + Textbox84 + + + + + + + + + + true + true + + + + + *Número y tipo de bultos: + + + + + + + + + Descripción de la mercancia + + + + + + + Textbox86 + + + + + + + + + + true + true + + + + + Peso Bruto (kg) + + + + + + + Textbox88 + + + + + + + + + + true + true + + + + + PesoNeto(Kg) + + + + + + + Textbox90 + + + + + + + + + + true + true + + + + + Volumen (m3) + + + + + + + Textbox92 + + + + + + + + + + 0.33965cm + + + + + true + true + + + + + Si + + + + + + + + + + + + + true + true + + + + + =Fields!Descripcion.Value + + + + + + + + + + + + + true + true + + + + + =Fields!PesoEnKg.Value + + + + + + + + + + + PesoEnKg1 + + + + + + + + + + true + true + + + + + =Fields!PesoEnKg.Value + + + + + + + + + + + PesoEnKg3 + + + + + + + + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSet3 + 0.06703cm + 1cm + 17.8346cm + + + + + + true + 4.45047cm + 1.33863cm + 1.06703cm + 17.8346cm + 11 + + + + + + true + true + + + + + =Parameters!SerieFolio.Value + + + + + + + SerieFolio + 0.67478cm + 15.20438cm + 0.6cm + 3.97474cm + 12 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + =Parameters!FechaCertificacion.Value + + + + + + + SerieFolio + 1.45117cm + 15.20438cm + 0.6cm + 3.97474cm + 13 + + + 2pt + 2pt + 2pt + 2pt + + + + true + 47.03985cm + 5.54925cm + 19.53633cm + 31 + + =Microsoft.VisualBasic.Interaction.IIF(Parameters!imprmirNom043.Value = "1", False, True) + + + + + - 18.0263in + 20.70437in @@ -129,6 +135,7 @@ font-size: 12px; + @@ -253,12 +260,12 @@ font-size: 12px; - + - + diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 52f588e8d..ba52a899c 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -7717,10 +7717,11 @@ Public Class ClsVentas Return Retorno End Function - Public Function AddPreciosVentaManifiesto(CveCultivo As Integer, CveTamaño As Integer, CveCultivoVariedad As Integer, Referencia As String, LdDate As Date, InvDate As Date, PDDate As Date, CantidadVendida As Decimal, PUVenta As Decimal, Observaciones As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function AddPreciosVentaManifiesto(PalletNum As String, CveCultivo As Integer, CveTamaño As Integer, CveCultivoVariedad As Integer, Referencia As String, LdDate As Date, InvDate As Date, PDDate As Date, CantidadVendida As Decimal, PUVenta As Decimal, Observaciones As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Agro_PreciosVentaManifiestoAdd") With SqlAdapter.SelectCommand.Parameters + .Add("@PalletNum", SqlDbType.VarChar).Value = PalletNum .Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo .Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño .Add("@CveCultivoVariedad", SqlDbType.Int).Value = CveCultivoVariedad @@ -7770,7 +7771,6 @@ Public Class ClsVentas Dim Retorno As Boolean = False DataAdapter("PA_Agro_PreciosVentaFechaAdd") With SqlAdapter.SelectCommand.Parameters - .Add("@CveCultivo", SqlDbType.Int).Value = CveCultivo .Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion diff --git a/Ashx/E158.ashx b/Ashx/E158.ashx index 84e067e77..cc6b92bc6 100644 --- a/Ashx/E158.ashx +++ b/Ashx/E158.ashx @@ -77,8 +77,8 @@ Public Class E158 : Implements IHttpHandler, IReadOnlySessionState End Sub Private Function PreciosVentaCultivo(ByVal CveEmpresa As Integer, ByVal context As HttpContext) As Boolean - Dim Respuesta As Boolean = False - Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa) + Dim Respuesta As Boolean = True + Dim UsuarioActual As Usuario = ValidaUsuarioSistema(100, CveEmpresa) ' Crear una instancia del servicio web Dim wsservice As New GrowerService.Service() @@ -94,13 +94,120 @@ Public Class E158 : Implements IHttpHandler, IReadOnlySessionState Dim Parametro6 As Integer = 0 Dim Parametro6Date As Date = Now.AddDays(-3) - Dim DTresp As DataTable = wsservice.GetSales(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6) - DTresp.WriteXml("C:\temp\GrowerService\Sales.xml", XmlWriteMode.WriteSchema) - DTresp.FiltraParametros("", "", {"CommodityDesc"}).WriteXml("C:\temp\GrowerService\CommodityDesc.xml", XmlWriteMode.WriteSchema) - DTresp.FiltraParametros("", "", {"VarietyDesc"}).WriteXml("C:\temp\GrowerService\VarietyDesc.xml", XmlWriteMode.WriteSchema) - DTresp.FiltraParametros("", "", {"SizeDesc"}).WriteXml("C:\temp\GrowerService\SizeDesc.xml", XmlWriteMode.WriteSchema) + Dim DTresp As DataTable = wsservice.GetSales(Parametro1, Parametro2, Parametro3, Parametro4, Parametro5, Parametro6) + 'DTresp.WriteXml("C:\temp\GrowerService\Sales.xml", XmlWriteMode.WriteSchema) + 'DTresp.FiltraParametros("", "", {"CommodityDesc"}).WriteXml("C:\temp\GrowerService\CommodityDesc.xml", XmlWriteMode.WriteSchema) + 'DTresp.FiltraParametros("", "", {"VarietyDesc"}).WriteXml("C:\temp\GrowerService\VarietyDesc.xml", XmlWriteMode.WriteSchema) + 'DTresp.FiltraParametros("", "", {"SizeDesc"}).WriteXml("C:\temp\GrowerService\SizeDesc.xml", XmlWriteMode.WriteSchema) + + + DTresp.Columns.Add("InvoiceDateReal", GetType(DateTime)) + + For Each row As DataRow In DTresp.Rows + Dim fechaTexto As String = row("InvoiceDate").ToString().Trim() + + If DateTime.TryParseExact(fechaTexto, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, Nothing) Then + row("InvoiceDateReal") = DateTime.ParseExact(fechaTexto, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture) + Else + row("InvoiceDateReal") = DBNull.Value + End If + Next + + DTresp = DTresp.FiltraParametros(" InvoiceDateReal >= #01/01/2025# ") + + + Dim ObjVentas As New ClsVentas + Dim DTCultivo As New DataTable + Dim DTCultivoVariedad As New DataTable + Dim DTTamaño As New DataTable + + If ObjVentas.GetCultivos(-1, CveEmpresa) Then + DTCultivo = ObjVentas.DtResultados + Else + Respuesta = False + End If + + If ObjVentas.GetCultivosVariedad(-1, -1, CveEmpresa) Then + DTCultivoVariedad = ObjVentas.DtResultados + Else + Respuesta = False + End If + + If ObjVentas.GetEmbarqueTamaño(-1, -1, CveEmpresa) Then + DTTamaño = ObjVentas.DtResultados + Else + Respuesta = False + End If + + If Respuesta Then + ObjVentas.IniciaTransacSQL() + + For Each dRow As DataRow In DTresp.Rows + + Dim PalletNum As String = dRow("PalletNum").ToString + + Try + Dim CveCultivo As Integer = DTCultivo.FiltroPrimeroValor("CveCultivo", $" Alias = '{dRow("CommodityDesc").ToString}' ").ToEntero + If Not CveCultivo > 0 Then + GuardaLog($"No se encontro el cultivo {dRow("CommodityDesc").ToString}") + Exit For + End If + + Dim CveCultivoVariedad As Integer = DTCultivoVariedad.FiltroPrimeroValor("CveCultivoVariedad", $" Alias = '{dRow("VarietyDesc").ToString}' ").ToEntero + If Not CveCultivoVariedad > 0 Then + GuardaLog($"No se encontro la variedad {dRow("VarietyDesc").ToString}") + Exit For + End If + + Dim CveTamaño As Integer = DTTamaño.FiltroPrimeroValor("CveTamaño", $" Alias = '{dRow("SizeDesc").ToString.Replace("'", "''")}' ").ToEntero + If Not CveTamaño > 0 Then + GuardaLog($"No se encontro el tamaño {dRow("SizeDesc").ToString}") + Exit For + End If + + Dim LoadDate As Date = DateTime.ParseExact(dRow("LoadDate").ToString, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture) + Dim InvoiceDate As Date = DateTime.ParseExact(dRow("InvoiceDate").ToString, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture) + + Dim PaidDate As Date = MinFecha + If dRow("PaidDate").ToString.Trim.Length > 0 Then + PaidDate = DateTime.ParseExact(dRow("PaidDate").ToString, "MM/dd/yy", System.Globalization.CultureInfo.InvariantCulture) + End If + + + + If Not ObjVentas.AddPreciosVentaManifiesto(dRow("PalletNum").ToString, CveCultivo, CveTamaño, CveCultivoVariedad, dRow("GroReference").ToString, + LoadDate, InvoiceDate, PaidDate, + dRow("InvPkgs").ToString.ToDecimal, dRow("NetProdPrice").ToString.ToDecimal, dRow("ProductDesc").ToString, + UsuarioActual.CveUsuario, CveEmpresa) Then + Respuesta = False + Exit For + End If + + Catch ex As Exception + + GuardaLog($"Error PalletNum: {PalletNum} {ex.Message} --> {ex.StackTrace}") + Respuesta = False + + End Try + + + + Next + + + If Respuesta Then + ObjVentas.Commit() + Else + ObjVentas.RollBack() + End If + End If + + + + ObjVentas.Dispose() + 'For Each dRow As DataRow In DTresp.Rows diff --git a/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc b/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc index 1d74af708..38000e5c8 100644 --- a/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc +++ b/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc @@ -522,7 +522,7 @@ 1pt - + 1pt 2pt @@ -7356,6 +7356,9 @@ Se ha recibido el número arriba indicado de bultos/contenedores/remolques/autot Textbox85 + + =IIF(Fields!MaterialPeligroso.Value = "No",true,false) +