Correcion al generar cotizacion de factura

This commit is contained in:
2020-06-16 16:23:00 -07:00
parent bcdbb65a6b
commit d2846cf2d4

View File

@@ -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