From 37166a80a0baa3912723254c81d02cf58b457484 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 25 May 2022 12:41:27 -0700 Subject: [PATCH] Validacion de aplicacion de anticipos y pagos de contado, no validar movimiento de almacen al refacturar. --- Ventas/Ventas.aspx.vb | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 4eb92796f..c1fe6f050 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5322,6 +5322,11 @@ Partial Class Ventas BtnsFacturar.Visible = True End If + 'VERIFICA SI YA SE FACTURO COMPLETAMENTE + If TmpDT.SUM("CantidadFacturadaRem") = TmpDT.SUM("Cantidad") Then + BtnsFacturar.Visible = False + End If + 'VERIFICA SI TIENE USADOS O GARANTIAS PENDIENTES If BtnsFacturar.Visible Then If (Not EsGarantia AndAlso (DtUsadosPendientes IsNot Nothing AndAlso DtUsadosPendientes.Rows.Count > 0)) Then @@ -14387,15 +14392,16 @@ Partial Class Ventas End If - End If - - Dim DebeGenerarMovimiento As Boolean = TmpDT.COUNT("CvePS", "CveTipoPS = 2") > 0 - 'VERIFICA QUE SE REALIZO EL MOVIMIENTO DE ALMACEN - If DebeGenerarMovimiento AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then - If Not (ObjInventario.GetInv_Mov(factura.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0) Then - OcurrioError = True - ErrorList.Add("Ocurrió un error al verificar inventario.
Revise su factura y cualquier detalle comuníquese a Soporte Técnico") + 'DEBE GENERAR MOVIMIENTO SI SE FACTURAON PRODUCTOS, O NO SE REALIZA UNA REFACTURACION + Dim DebeGenerarMovimiento As Boolean = TmpDT.COUNT("CvePS", "CveTipoPS = 2") > 0 AndAlso (NuevaFactura <> 1) + 'VERIFICA QUE SE REALIZO EL MOVIMIENTO DE ALMACEN + If Not OcurrioError AndAlso DebeGenerarMovimiento AndAlso UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then + If Not (ObjInventario.GetInv_Mov(factura.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0) Then + OcurrioError = True + ErrorList.Add("Ocurrió un error al verificar inventario.
Revise su factura y cualquier detalle comuníquese a Soporte Técnico") + End If End If + End If End If @@ -22237,10 +22243,10 @@ Partial Class Ventas Return Retorno End If - If Not PermiteCredito AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then + If (Not PermiteCredito OrElse RBLPago.SelectedValue = "2") AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC - If TotalPago < TxtTotal.Text.ToDecimal Then + If TotalPago <> TxtTotal.Text.ToDecimal Then If MostrarAlertas Then Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) End If @@ -22315,7 +22321,7 @@ Partial Class Ventas If Not PermiteCredito AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC - If TotalPago < TxtTotal.Text.ToDecimal Then + If TotalPago <> TxtTotal.Text.ToDecimal Then If MostrarAlertas Then Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) End If