From d2846cf2d491723b7f33577c9f56112af299161b Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 16 Jun 2020 16:23:00 -0700 Subject: [PATCH] Correcion al generar cotizacion de factura --- Ventas/Ventas.aspx.vb | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index ae5e7372b..29a9887a9 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2306,9 +2306,9 @@ Partial Class Ventas ViewState("CveRemision") = IfNull(Request("CveRemision").ToEntero(), 0) ViewState("CveCotizacion") = IfNull(Request("CveCotizacion").ToEntero(), 0) - If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then - EsCreaApartirDe = True - End If + 'If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then + ' EsCreaApartirDe = True + 'End If If ViewState("CveRemision").ToString().ToEntero() > 0 Or ViewState("CveCotizacion").ToString().ToEntero() > 0 Then 'ViewState("CveRemision") = Request("CveRemision") @@ -2346,6 +2346,20 @@ Partial Class Ventas 'CargaDetalle de Almacen InventarioMov() + + If ViewState("CveCotizacion").ToString().ToEntero() > 0 Then + + CargaCotizaciones() + + If DtCotizaciones IsNot Nothing Then + For Each Row As DataRow In DtCotizaciones.Select($"CveVenta={ViewState("CveCotizacion").ToString().ToEntero()}") + Row("Aplicado") = True + Next + End If + + CargarCotizacionesAFacturar() + End If + End If If Not ExFolioFactura Then SetPermisos() @@ -16239,6 +16253,11 @@ Partial Class Ventas If Not OcurrioError Then OcurrioError = Not GeneroMovimientoAlmacen End If + + If OcurrioError Then + Exit For + End If + End If End If @@ -16250,6 +16269,10 @@ Partial Class Ventas Exit For End If End If + + If OcurrioError Then + Exit For + End If Next @@ -23598,6 +23621,15 @@ Partial Class Ventas 'MARCA LAS SELECCIONADAS VerificaCotizaciones(DtCotizaciones) + + CargarCotizacionesAFacturar() + + RegistraScript("$('#DivCotizaciones').modal('hide');") + + End Sub + + Private Sub CargarCotizacionesAFacturar() + Dim DTSeleccionadas = DtCotizaciones.FiltraParametros("Aplicado = True") If DTSeleccionadas.Rows.Count = 0 Then @@ -23684,9 +23716,6 @@ Partial Class Ventas UpFacturar.Update() UpPS.Update() UpParametros.Update() - - RegistraScript("$('#DivCotizaciones').modal('hide');") - End Sub Private Sub VerificaCotizaciones(ByRef dt As DataTable) If ChkCotProductos.Checked Then