diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index c7fcb1d25..377bcd8c7 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5254,7 +5254,7 @@ Partial Class Ventas If TienePermiso <> "" Then ' si tiene acceso en el subproyecto 'LkNotaCredito.Visible = UsuarioActual.TienePermisoProceso(175) If UsuarioActual.TienePermisoProceso(264) Then - InicializaAplicaDevolucion(TmpDT) + InicializaAplicaDevolucion(TmpDT, DbRowVenta("Fecha").ToString().ToDateTime()) End If End If @@ -32875,7 +32875,7 @@ Partial Class Ventas #End Region #Region " APLICA DEVOLUCION " - Private Sub InicializaAplicaDevolucion(DtDetalle As DataTable) + Private Sub InicializaAplicaDevolucion(DtDetalle As DataTable, FechaVenta As DateTime) 'If Not UsuarioActual.CveUsuario = 100 Then ' If Not UsuarioActual.CveEmpresa.Contiene(72, 80, 119, 140, 141, 146) Then ' Exit Sub @@ -32887,7 +32887,17 @@ Partial Class Ventas Exit Sub End If - LBAplicaDevolucion.Visible = True + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If FechaVenta.ToShortDateString.ToDate < Now.ToShortDateString.ToDate Then + LBAplicaDevolucion.Visible = True + Else + LBAplicaDevolucion.Visible = False + End If + Else + LBAplicaDevolucion.Visible = True + End If + + 'SOLO APLICA DEVOLUCION SI TIENE MOVIMIENTOS DE ALMACEN 'If VentaSaldoAlmacen < 0 Then