Validacion de aplicacion de anticipos y pagos de contado, no validar movimiento de almacen al refacturar.

This commit is contained in:
2022-05-25 12:41:27 -07:00
parent b661cf5822
commit 37166a80a0

View File

@@ -5322,6 +5322,11 @@ Partial Class Ventas
BtnsFacturar.Visible = True BtnsFacturar.Visible = True
End If 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 'VERIFICA SI TIENE USADOS O GARANTIAS PENDIENTES
If BtnsFacturar.Visible Then If BtnsFacturar.Visible Then
If (Not EsGarantia AndAlso (DtUsadosPendientes IsNot Nothing AndAlso DtUsadosPendientes.Rows.Count > 0)) Then If (Not EsGarantia AndAlso (DtUsadosPendientes IsNot Nothing AndAlso DtUsadosPendientes.Rows.Count > 0)) Then
@@ -14387,11 +14392,10 @@ Partial Class Ventas
End If End If
End If '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)
Dim DebeGenerarMovimiento As Boolean = TmpDT.COUNT("CvePS", "CveTipoPS = 2") > 0
'VERIFICA QUE SE REALIZO EL MOVIMIENTO DE ALMACEN '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 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 If Not (ObjInventario.GetInv_Mov(factura.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0) Then
OcurrioError = True OcurrioError = True
ErrorList.Add("Ocurrió un error al verificar inventario.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al verificar inventario.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
@@ -14400,6 +14404,8 @@ Partial Class Ventas
End If End If
End If
Catch ex As Exception Catch ex As Exception
OcurrioError = True OcurrioError = True
OnError("Ocurrió un error al guardar el inventario", ex) OnError("Ocurrió un error al guardar el inventario", ex)
@@ -22237,10 +22243,10 @@ Partial Class Ventas
Return Retorno Return Retorno
End If 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 Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC
If TotalPago < TxtTotal.Text.ToDecimal Then If TotalPago <> TxtTotal.Text.ToDecimal Then
If MostrarAlertas Then If MostrarAlertas Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
End If End If
@@ -22315,7 +22321,7 @@ Partial Class Ventas
If Not PermiteCredito AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then If Not PermiteCredito AndAlso TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC
If TotalPago < TxtTotal.Text.ToDecimal Then If TotalPago <> TxtTotal.Text.ToDecimal Then
If MostrarAlertas Then If MostrarAlertas Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia) Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
End If End If