mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-29 18:52:22 +01:00
[bug] once a reservation was made, the reminder of the paid price is always 0 if a coupon was used
This commit is contained in:
parent
c676a1e833
commit
9d2e17d5d6
@ -11,6 +11,7 @@
|
||||
- Fix a bug: unable to create the first user because role member was missing
|
||||
- Fix a bug: disabled groups still appears as available in sign-up modal
|
||||
- Fix a bug: extend a current subscription for a member, does not reset his credits
|
||||
- Fix a bug: once a reservation was made, the reminder of the paid price is always 0 if a coupon was used
|
||||
- Fix a security issue: updated nokogiri to 1.10.4 to fix [CVE-2019-5477](https://nvd.nist.gov/vuln/detail/CVE-2019-5477)
|
||||
- Fix a security issue: updated eslint-utils to 1.4.2 to fix [GHSA-3gx7-xhv7-5mx3](https://github.com/mysticatea/eslint-utils/security/advisories/GHSA-3gx7-xhv7-5mx3)
|
||||
- Fix a security issue: updated devise to 4.7.1 to fix [CVE-2019-16109](https://nvd.nist.gov/vuln/detail/CVE-2019-16109)
|
||||
|
@ -48,6 +48,9 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs',
|
||||
// total amount of the elements in the cart, without considering any coupon
|
||||
$scope.totalNoCoupon = 0;
|
||||
|
||||
// once the cart was paid, retain the total amount paid by the customer
|
||||
$scope.amountPaid = 0;
|
||||
|
||||
// Discount coupon to apply to the basket, if any
|
||||
$scope.coupon = { applied: null };
|
||||
|
||||
@ -240,8 +243,8 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs',
|
||||
}
|
||||
});
|
||||
// watch when a coupon is applied to re-compute the total price
|
||||
return $scope.$watch('coupon.applied', function (newValue, oldValue) {
|
||||
if ((newValue !== null) || (oldValue !== null)) {
|
||||
$scope.$watch('coupon.applied', function (newValue, oldValue) {
|
||||
if (newValue !== oldValue) {
|
||||
return updateCartPrice();
|
||||
}
|
||||
});
|
||||
@ -588,6 +591,7 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs',
|
||||
var afterPayment = function (reservation) {
|
||||
// we set the cart content as 'paid' to display a summary of the transaction
|
||||
$scope.events.paid = $scope.events.reserved;
|
||||
$scope.amountPaid = $scope.amountTotal;
|
||||
// we call the external callback if present
|
||||
if (typeof $scope.afterPayment === 'function') { $scope.afterPayment(reservation); }
|
||||
// we reset the coupon and the cart content and we unselect the slot
|
||||
|
@ -78,7 +78,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="m-t-md font-sbold">{{ 'cart.total_' | translate }} {{amountTotal | currency}}</div>
|
||||
<div class="m-t-md font-sbold">{{ 'cart.total_' | translate }} {{amountPaid | currency}}</div>
|
||||
|
||||
<div class="alert alert-success" ng-if="user.subscribed_plan">{{ 'cart.thank_you_your_payment_has_been_successfully_registered' | translate }}<br>
|
||||
{{ 'cart.your_invoice_will_be_available_soon_from_your_' | translate }} <a ui-sref="app.logged.dashboard.invoices" translate>{{ 'cart.dashboard' }}</a>
|
||||
@ -164,4 +164,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user