From 6a884d6f4fe8021151e3600e538742655b719baf Mon Sep 17 00:00:00 2001 From: Du Peng Date: Tue, 3 Sep 2024 17:28:05 +0200 Subject: [PATCH] (bug) manager cannot pay a subscription(payment schedule) with a wallet --- CHANGELOG.md | 2 ++ app/frontend/src/javascript/directives/cart.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0337dafb2..01574ac19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next release +- Fix a bug: manager cannot pay a subscription(payment schedule) with a wallet + ## v6.3.31 2024 July 22 - updates translations diff --git a/app/frontend/src/javascript/directives/cart.js b/app/frontend/src/javascript/directives/cart.js index 5e89d5bc5..b301d4ffe 100644 --- a/app/frontend/src/javascript/directives/cart.js +++ b/app/frontend/src/javascript/directives/cart.js @@ -840,7 +840,7 @@ Application.Directives.directive('cart', ['$rootScope', '$uibModal', 'dialogs', return Wallet.getWalletByUser({ user_id: $scope.user.id }, function (wallet) { const amountToPay = helpers.getAmountToPay($scope.amountTotal, wallet.amount); if ((AuthService.isAuthorized(['member']) && (amountToPay > 0 || (amountToPay === 0 && hasOtherDeadlines()))) || - ($scope.user.id === $rootScope.currentUser.id && amountToPay > 0)) { + (AuthService.isAuthorized(['admin', 'manager']) && $scope.user.id === $rootScope.currentUser.id && (amountToPay > 0 || (amountToPay === 0 && hasOtherDeadlines())))) { return payOnline(items); } else { if ((AuthService.isAuthorized(['admin', 'manager']) && $scope.user.id !== $rootScope.currentUser.id) ||