--Cambios en autorizacion de anticipos

This commit is contained in:
2025-03-31 19:49:35 -07:00
parent 32ef9142e1
commit 419d6d2572
2 changed files with 11 additions and 30 deletions

View File

@@ -1156,18 +1156,13 @@ Partial Class Ventas_PVCobranza
If CveVenta > 0 OrElse CveIE > 0 Then
Dim Actualizo As Boolean = False
If Tipo.Contiene("NC", "Ant") Then
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Actualizo = True
End If
ElseIf Tipo.Contiene("IxC") Then
If ObjVentas.UpdateIxCAnticipoAutorizado(CveIE, False) Then
Actualizo = True
End If
If ObjVentas.UpdateAnticipoAutorizado(CveVenta, CveIE, Tipo.Trim(), False) Then
Actualizo = True
End If
If Actualizo Then
Retorno = ObjEventoBitacora.AddEventoBitacora($"El anticipo se desautorizó correctamente. Folio: <b>{Folio}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveIE, -1, CveCliente, -1, -1, -1, -1, -1, CveVenta:=CveVenta)
Retorno = ObjEventoBitacora.AddEventoBitacora($"El anticipo se aplicó correctamente. Folio: <b>{Folio}</b>", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveIE, -1, CveCliente, -1, -1, -1, -1, -1, CveVenta:=CveVenta)
End If
End If
@@ -2279,7 +2274,7 @@ Partial Class Ventas_PVCobranza
Dim CveIE As Integer = gvr.DataKey("CveIE").ToEntero()
Dim ObjVta As New ClsVentas
If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, Saldo, 0, UsuarioActual.CveUsuario, 1, TipoDocumento:="Ant", DiasVencidos:=1, CveVenta:=CveVenta, CveIE:=CveIE) Then
If ObjVta.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, Saldo, CveEstatus:=0, CveUsuario:=UsuarioActual.CveUsuario, TipoAutorizacion:=1, TipoDocumento:="Ant", DiasVencidos:=1, CveVenta:=CveVenta, CveIE:=CveIE) Then
Dim msgAlert = "La autorización se agregó correctamente."
If EnvioMsg Then
msgAlert = $"{msgAlert} Se envió una notificación de autorización a los usuarios"
@@ -2381,9 +2376,9 @@ Partial Class Ventas_PVCobranza
Dim AnticipoAutorizado = CBool(e.Row.DBCampo("AnticipoAutorizado"))
If Not EsProduccion AndAlso UsuarioActual.CveRol = 1 Then
AnticipoAutorizado = True
End If
'If Not EsProduccion AndAlso UsuarioActual.CveRol = 1 Then
' AnticipoAutorizado = True
'End If
If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then
If e.Row.DBCampo("Tipo").ToString().Contiene("NC", "Ant", "IxC") AndAlso Not AnticipoAutorizado Then