1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

[bug] extend a current subscription for a member, does not reset his credits

This commit is contained in:
Sylvain 2019-09-12 11:37:03 +02:00
parent 53e02622b9
commit 52afb6ef07
7 changed files with 18 additions and 6 deletions

View File

@ -7,6 +7,7 @@
- Fix a bug: Wallet credit inputs does not allow to put zeros at the end of the decimal part of the amount
- 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 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)

View File

@ -3,12 +3,14 @@
</div>
<div class="modal-body m-lg">
<div class="alert alert-danger">
<p ng-show="free" translate>
{{ 'you_intentionally_decide_to_extend_the_user_s_subscription_by_offering_him_free_days' }}
</p>
<p ng-hide="free" translate>
{{ 'you_intentionally_decide_to_extend_the_user_s_subscription_by_charging_him_again_for_his_current_subscription' }}
</p>
<div ng-show="free">
<p translate>{{ 'you_intentionally_decide_to_extend_the_user_s_subscription_by_offering_him_free_days' }}</p>
<p translate>{{ 'credits_will_remain_unchanged' }}</p>
</div>
<div ng-hide="free">
<p translate>{{ 'you_intentionally_decide_to_extend_the_user_s_subscription_by_charging_him_again_for_his_current_subscription' }}</p>
<p translate>{{ 'credits_will_be_reset' }}</p>
</div>
</div>
<form role="form" name="subscriptionForm" novalidate>
<div class="form-group">

View File

@ -26,6 +26,7 @@ class Subscriptions::Subscribe
)
if new_sub.save
new_sub.user.generate_subscription_invoice(operator_profile_id)
UsersCredits::Manager.new(user: new_sub.user).reset_credits
return new_sub
end
false

View File

@ -521,7 +521,9 @@ en:
download_the_refund_invoice: "Download the refund invoice"
expiration_date: "Expiration date"
you_intentionally_decide_to_extend_the_user_s_subscription_by_offering_him_free_days: "You intentionally decide to extend the user's subscription by offering him free days."
credits_will_remain_unchanged: "The balance of free credits (training / machines / spaces) of the user will remain unchanged."
you_intentionally_decide_to_extend_the_user_s_subscription_by_charging_him_again_for_his_current_subscription: "You intentionally decide to extend the user's subscription by charging him again for his current subscription."
credits_will_be_reset: "The balance of free credits (training / machines / spaces) of the user will be reset, unused credits will be lost."
until_expiration_date: "Until (expiration date):"
you_successfully_changed_the_expiration_date_of_the_user_s_subscription: "You successfully changed the expiration date of the user's subscription"
a_problem_occurred_while_saving_the_date: "A problem occurred while saving the date."

View File

@ -521,7 +521,9 @@ es:
download_the_refund_invoice: "Descargar la factura de reembolso"
expiration_date: "Fecha de caducidad"
you_intentionally_decide_to_extend_the_user_s_subscription_by_offering_him_free_days: "Usted intencionalmente decide extender la suscripción del usuario ofreciéndole días libres."
credits_will_remain_unchanged: "El saldo de créditos gratuitos (entrenamiento / máquinas / espacios) del usuario permanecerá sin cambios."
you_intentionally_decide_to_extend_the_user_s_subscription_by_charging_him_again_for_his_current_subscription: "Usted intencionalmente decide extender la suscripción del usuario al cobrarle de nuevo por su suscripción actual."
credits_will_be_reset: "Se restablecerá el saldo de créditos gratuitos (entrenamiento / máquinas / espacios) del usuario, se perderán los créditos no utilizados."
until_expiration_date: "Until (expiration date):" # translation_missing
you_successfully_changed_the_expiration_date_of_the_user_s_subscription: "Ha cambiado correctamente la fecha de caducidad de la suscripción del usuario"
a_problem_occurred_while_saving_the_date: "Se ha producido un problema al guardar la fecha."

View File

@ -521,7 +521,9 @@ fr:
download_the_refund_invoice: "Télécharger l'avoir"
expiration_date: "Date d'expiration"
you_intentionally_decide_to_extend_the_user_s_subscription_by_offering_him_free_days: "Vous décidez délibérément d'étendre l'abonnement de l'utilisateur en lui offrant des jours gratuits."
credits_will_remain_unchanged: "Le solde de crédits gratuits (formations/machines/espaces) de l'utilisateur restera inchangé."
you_intentionally_decide_to_extend_the_user_s_subscription_by_charging_him_again_for_his_current_subscription: "Vous décidez délibérément d'étendre l'abonnement de l'utilisateur en lui faisant repayer le prix de l'abonnement qu'il possède actuellement."
credits_will_be_reset: "Le solde de crédits gratuits (formations/machines/espaces) de l'utilisateur sera remis à zéro, ses crédits non utilisés seront perdu."
until_expiration_date: "Jusqu'à (date d'expiration) :"
you_successfully_changed_the_expiration_date_of_the_user_s_subscription: "Vous avez bien modifié la date d'expiration de l'abonnement de l'utilisateur"
a_problem_occurred_while_saving_the_date: "Il y a eu un problème lors de l'enregistrement de la date."

View File

@ -522,7 +522,9 @@ pt:
expiration_date: "Data de expiração"
you_intentionally_decide_to_extend_the_user_s_subscription_by_offering_him_free_days: "Você intencionalmente decidir estender a inscrição do usuário, oferecendo-lhe dias livres."
you_intentionally_decide_to_extend_the_user_s_subscription_by_charging_him_again_for_his_current_subscription: "Você decide intencionalmente estender a assinatura do usuário cobrando-o novamente por sua assinatura atual."
credits_will_remain_unchanged: "O saldo de créditos gratuitos (treinamento / máquinas / espaços) do usuário permanecerá inalterado."
until_expiration_date: "Até (data de expiração):"
credits_will_be_reset: "O saldo de créditos gratuitos (treinamento / máquinas / espaços) do usuário será redefinido, os créditos não utilizados serão perdidos."
you_successfully_changed_the_expiration_date_of_the_user_s_subscription: "Você alterou com êxito a data de expiração da assinatura do usuário"
a_problem_occurred_while_saving_the_date: "Um erro ocorreu ao salvar a data."
new_subscription: "Nova inscrição"