--Validacion por permiso en cortes de caja

This commit is contained in:
2025-04-24 18:18:31 -07:00
parent 1ef3099b38
commit 745f15ddce

View File

@@ -673,9 +673,11 @@ Partial Class Ventas_PVCobranza
End If End If
End If End If
Dim tCveCorte As Integer = CveCorte Dim DebeTenerCorteCaja As Boolean = UsuarioActual.TienePermisoProceso(371) ' Usa Cortes de Caja - en Cajas
If tCveCorte <= 0 Then Dim tCveCorte As Integer = If(DebeTenerCorteCaja, Me.CveCorte, -1)
If DebeTenerCorteCaja AndAlso tCveCorte <= 0 Then
Alert("No se puede realizar el pago. Debe tener un corte activo", TipoMensaje.MsgAdvertencia) Alert("No se puede realizar el pago. Debe tener un corte activo", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
@@ -897,7 +899,7 @@ Partial Class Ventas_PVCobranza
MsgError = "Tiene saldo pendiente por aplicar" MsgError = "Tiene saldo pendiente por aplicar"
End If End If
If UsuarioActual.CveRol <> 1 Then If DebeTenerCorteCaja Then
If MsgError = "" AndAlso Not ObjVentas2.UpdateVentaCorte(CveVenta, UsuarioActual.CveEmpresa, tCveCorte) Then If MsgError = "" AndAlso Not ObjVentas2.UpdateVentaCorte(CveVenta, UsuarioActual.CveEmpresa, tCveCorte) Then
MsgError = "Error al aplicar el corte" MsgError = "Error al aplicar el corte"
End If End If