1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

[bug] do not include fully used packs in user's packs

This commit is contained in:
Sylvain 2021-07-02 14:27:30 +02:00
parent e150e13227
commit 95d8f1d204
2 changed files with 2 additions and 0 deletions

View File

@ -4,6 +4,7 @@
- Fix a bug: missing invoice watermark for norwegian
- Fix a bug: prepaid hours not used if bought slot is longer than remaining prepaid time
- Fix a bug: cookies modal buttons are too small
- Fix a bug: do not include fully used packs in user's packs
## v5.1.2 2021 July 2

View File

@ -27,6 +27,7 @@ class PrepaidPackService
.where('expires_at > ?', DateTime.current)
.where('prepaid_packs.priceable_id = ?', priceable.id)
.where('prepaid_packs.priceable_type = ?', priceable.class.name)
.where('minutes_used < prepaid_packs.minutes')
end
# subtract the number of used prepaid minutes from the user's count