diff --git a/CHANGELOG.md b/CHANGELOG.md index 57bcbbf3f..41336cfd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - Fix a bug: exports to Excel are corrupted (#49) - Fix a bug: if a specialized VAT rate was defined when the VAT was disabled, the resulting VAT rate is wrong - Fix a bug: unable to rebuild the PDF for invoices without subscriptions +- Fix a bug: the switch to enable/disable the VAT does not reflect the current state of the VAT - [TODO DEPLOY] `rails db:seed` # v5.3.0 2021 December 29 diff --git a/app/frontend/src/javascript/controllers/admin/invoices.js b/app/frontend/src/javascript/controllers/admin/invoices.js index 960025762..c78f857ec 100644 --- a/app/frontend/src/javascript/controllers/admin/invoices.js +++ b/app/frontend/src/javascript/controllers/admin/invoices.js @@ -478,6 +478,13 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I $scope.isSelected = active; $scope.history = []; + // callback on "enable VAT" switch toggle + $scope.enableVATChanged = function (checked) { + setTimeout(() => { + $scope.isSelected = checked; + $scope.$apply(); + }, 1); + }; $scope.ok = function () { $uibModalInstance.close({ rate: $scope.rate, active: $scope.isSelected }); }; $scope.cancel = function () { $uibModalInstance.dismiss('cancel'); }; $scope.editMultiVAT = function () { diff --git a/app/frontend/templates/admin/invoices/settings/editVAT.html b/app/frontend/templates/admin/invoices/settings/editVAT.html index 5423aa74c..e6f253268 100644 --- a/app/frontend/templates/admin/invoices/settings/editVAT.html +++ b/app/frontend/templates/admin/invoices/settings/editVAT.html @@ -5,14 +5,11 @@