--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
Dim tCveCorte As Integer = CveCorte
Dim DebeTenerCorteCaja As Boolean = UsuarioActual.TienePermisoProceso(371) ' Usa Cortes de Caja - en Cajas
Dim tCveCorte As Integer = If(DebeTenerCorteCaja, Me.CveCorte, -1)
If tCveCorte <= 0 Then
If DebeTenerCorteCaja AndAlso tCveCorte <= 0 Then
Alert("No se puede realizar el pago. Debe tener un corte activo", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -897,7 +899,7 @@ Partial Class Ventas_PVCobranza
MsgError = "Tiene saldo pendiente por aplicar"
End If
If UsuarioActual.CveRol <> 1 Then
If DebeTenerCorteCaja Then
If MsgError = "" AndAlso Not ObjVentas2.UpdateVentaCorte(CveVenta, UsuarioActual.CveEmpresa, tCveCorte) Then
MsgError = "Error al aplicar el corte"
End If
@@ -2291,26 +2293,26 @@ Partial Class Ventas_PVCobranza
If TipoDocto = "Ant" Then TipoAnticipo = " 'IxC' "
If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing Then
GVAnticipos.DataSource = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"ISTotal = 0 AND Saldo > 0 AND Tipo IN ({TipoAnticipo}) ")
Else
GVAnticipos.DataSource = Nothing
End If
GVAnticipos.Columns(5).Visible = False
GVAnticipos.Columns(9).Visible = False
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
GVAnticipos.Columns(7).Visible = True
End If
GVAnticipos.DataBind()
If ListaAnticiposAplicados IsNot Nothing Then
ListaAnticiposAplicados.Clear()
End If
TxtNCDev.Text = "0.00"
GVAnticipos.DataSource = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"ISTotal = 0 AND Saldo > 0 AND Tipo IN ({TipoAnticipo}) ")
Else
GVAnticipos.DataSource = Nothing
End If
UpAnticipos.Update()
GVAnticipos.Columns(5).Visible = False
GVAnticipos.Columns(9).Visible = False
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
GVAnticipos.Columns(7).Visible = True
End If
GVAnticipos.DataBind()
If ListaAnticiposAplicados IsNot Nothing Then
ListaAnticiposAplicados.Clear()
End If
TxtNCDev.Text = "0.00"
End If
UpAnticipos.Update()
End Sub
Protected Sub LnkRecargaAnticipos_Click(sender As Object, e As EventArgs)