From 94a895af20c38ec2083e2b3daea6b935fff72f09 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 6 Jun 2022 18:14:20 -0700 Subject: [PATCH] Validacion para emision de carta porte, regeneracion del pdf al emitir,direccion del cliente y validacion de descuento negativo --- Ventas/Ventas.aspx.vb | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 135bb8ba9..025aaf2fe 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -6113,8 +6113,6 @@ Partial Class Ventas End If End If - CargaDireccionCP() - ViewState("Vendedor") = ObjCliente.Vendedor ViewState("CtaContable") = ObjCliente.CuentaContable ViewState("IdCtaContClientes") = ObjCliente.IdCtaContClientes @@ -7197,8 +7195,6 @@ Partial Class Ventas CargaVendedores() - CargaDireccionCP() - 'SI LA VENTA YA ESTA REGISTRADA NO DEBE HABILITAR ACCIONES If CveVenta <= 0 Then Dim EsModuloCotizacion As Boolean = False @@ -14972,7 +14968,7 @@ Partial Class Ventas 'TIMBRADO NUEVO Try - Dim ObjetoPDF As Byte() = DescargarFactura(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) + Dim ObjetoPDF As Byte() = DescargarFactura(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Regenerar:=True) If ObjetoPDF Is Nothing OrElse ObjetoPDF.Length = 0 Then PdfFactura(ObjFactura, AplicaPagare:=If(ObjFactura.TipoDocto.Contiene("Ing", "Rem", "Ant"), "1", "0")) @@ -16300,12 +16296,14 @@ Partial Class Ventas Dim TmpDTComplementosTimbrado As New DataTable PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado) - Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorteVenta, UsuarioActual) - If Not RespCartaPorte.TieneError Then - ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte - Else - Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia) - Exit Sub + If ChkEmitirCartaPorte.Checked Then + Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorteVenta, UsuarioActual) + If Not RespCartaPorte.TieneError Then + ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte + Else + Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia) + Exit Sub + End If End If If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then @@ -18039,6 +18037,11 @@ Partial Class Ventas End If End If + If Descuento < 0 Then + Descuento = 0 + Alert("No se calculó el descuento correctamente", TipoMensaje.MsgAdvertencia) + End If + ObjDescuento.ImporteDescuento = Descuento.RoundSQL(2) ObjDescuento.CvePromocionDetalle = CvePromocionDetalle If SeAjustoPU Then @@ -34220,14 +34223,6 @@ Partial Class Ventas #Region "C A R T A - P O R T E" - Public Sub CargaDireccionCP() - LblDireccion.Text = "Dirección" - LblColonia.Text = "Colonia" - LblCiudad.Text = "Ciudad" - LblEstado.Text = "Estado" - LblCP.Text = "00000" - End Sub - Public Sub CargarCamiones() TxtFechaEntregaCP.Text = Now.ToString("dd/MM/yyyy")