mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-18 07:52:23 +01:00
Notify all admins on the creation of a refund invoice
This commit is contained in:
parent
510c802ab1
commit
6aa3c0caeb
@ -10,6 +10,7 @@
|
|||||||
- Configuration of phone number in members registration forms: can be required or optional, depending on `PHONE_REQUIRED` configuration
|
- Configuration of phone number in members registration forms: can be required or optional, depending on `PHONE_REQUIRED` configuration
|
||||||
- Improved user experience in defining slots in the calendar management
|
- Improved user experience in defining slots in the calendar management
|
||||||
- Improved notification email to the member when a rolling subscription is taken
|
- Improved notification email to the member when a rolling subscription is taken
|
||||||
|
- Notify all admins on the creation of a refund invoice
|
||||||
- Calendar management: improved legend display and visual behavior
|
- Calendar management: improved legend display and visual behavior
|
||||||
- Handle Ctrl^C in upgrade scripts
|
- Handle Ctrl^C in upgrade scripts
|
||||||
- Updated moment-timezone
|
- Updated moment-timezone
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
class Avoir < Invoice
|
class Avoir < Invoice
|
||||||
belongs_to :invoice
|
belongs_to :invoice
|
||||||
|
|
||||||
|
after_create :notify_admins_refund_created
|
||||||
|
|
||||||
validates :payment_method, inclusion: { in: %w[stripe cheque transfer none cash wallet] }
|
validates :payment_method, inclusion: { in: %w[stripe cheque transfer none cash wallet] }
|
||||||
|
|
||||||
attr_accessor :invoice_items_ids
|
attr_accessor :invoice_items_ids
|
||||||
@ -16,4 +18,12 @@ class Avoir < Invoice
|
|||||||
def expire_subscription
|
def expire_subscription
|
||||||
user.subscription.expire(DateTime.current)
|
user.subscription.expire(DateTime.current)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def notify_admins_refund_created
|
||||||
|
NotificationCenter.call type: 'notify_admin_refund_created',
|
||||||
|
receiver: User.admins,
|
||||||
|
attached_object: self
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -47,6 +47,7 @@ class NotificationType
|
|||||||
notify_admin_archive_complete
|
notify_admin_archive_complete
|
||||||
notify_privacy_policy_changed
|
notify_privacy_policy_changed
|
||||||
notify_admin_import_complete
|
notify_admin_import_complete
|
||||||
|
notify_admin_refund_created
|
||||||
]
|
]
|
||||||
# deprecated:
|
# deprecated:
|
||||||
# - notify_member_subscribed_plan_is_changed
|
# - notify_member_subscribed_plan_is_changed
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
json.title notification.notification_type
|
||||||
|
json.description t('.refund_created',
|
||||||
|
AMOUNT: number_to_currency(notification.attached_object.total / 100.00),
|
||||||
|
USER: notification.attached_object.invoicing_profile&.full_name)
|
||||||
|
json.url notification_url(notification, format: :json)
|
@ -0,0 +1,8 @@
|
|||||||
|
<%= render 'notifications_mailer/shared/hello', recipient: @recipient %>
|
||||||
|
|
||||||
|
<p><%= t('.body.refund_created',
|
||||||
|
AMOUNT: number_to_currency(@attached_object.total / 100.00),
|
||||||
|
INVOICE: @attached_object.invoice.reference,
|
||||||
|
USER: @attached_object.invoicing_profile&.full_name) %>
|
||||||
|
</p>
|
||||||
|
<p><a href="<%= "#{root_url}api/invoices/#{@attached_object.id}/download" %>" target="_blank"><%= t('.body.download') %></a></p>
|
@ -351,6 +351,9 @@ en:
|
|||||||
notify_privacy_policy_changed:
|
notify_privacy_policy_changed:
|
||||||
policy_updated: "Privacy policy updated."
|
policy_updated: "Privacy policy updated."
|
||||||
click_to_show: "Click here to consult"
|
click_to_show: "Click here to consult"
|
||||||
|
notify_admin_refund_created:
|
||||||
|
refund_created: "A refund of %{AMOUNT} has been created for user %{USER}"
|
||||||
|
|
||||||
statistics:
|
statistics:
|
||||||
# statistics tools for admins
|
# statistics tools for admins
|
||||||
subscriptions: "Subscriptions"
|
subscriptions: "Subscriptions"
|
||||||
|
@ -351,6 +351,9 @@ es:
|
|||||||
notify_privacy_policy_changed:
|
notify_privacy_policy_changed:
|
||||||
policy_updated: "Privacy policy updated." # missing translation
|
policy_updated: "Privacy policy updated." # missing translation
|
||||||
click_to_show: "Click here to consult" # missing translation
|
click_to_show: "Click here to consult" # missing translation
|
||||||
|
notify_admin_refund_created:
|
||||||
|
refund_created: "A refund of %{AMOUNT} has been created for user %{USER}" # missing translation
|
||||||
|
|
||||||
statistics:
|
statistics:
|
||||||
# statistics tools for admins
|
# statistics tools for admins
|
||||||
subscriptions: "Suscripciones"
|
subscriptions: "Suscripciones"
|
||||||
|
@ -351,6 +351,8 @@ fr:
|
|||||||
notify_privacy_policy_changed:
|
notify_privacy_policy_changed:
|
||||||
policy_updated: "Nouvelle mise à jour de la Politique de confidentialité."
|
policy_updated: "Nouvelle mise à jour de la Politique de confidentialité."
|
||||||
click_to_show: "Cliquez ici pour la consulter"
|
click_to_show: "Cliquez ici pour la consulter"
|
||||||
|
notify_admin_refund_created:
|
||||||
|
refund_created: "Un avoir de %{AMOUNT} a été généré pour l'utilisateur %{USER}"
|
||||||
|
|
||||||
statistics:
|
statistics:
|
||||||
# outil de statistiques pour les administrateurs
|
# outil de statistiques pour les administrateurs
|
||||||
|
@ -313,5 +313,11 @@ en:
|
|||||||
content_html: "<p>We wish to inform you that we have just updated our privacy policy.</p><p>We may change our privacy policy regularly. In accordance with the regulations, you will receive a notification for each update.</p><p>By accessing or using our services after the privacy policy update, we will consider that you agree its terms, updates included.</p>"
|
content_html: "<p>We wish to inform you that we have just updated our privacy policy.</p><p>We may change our privacy policy regularly. In accordance with the regulations, you will receive a notification for each update.</p><p>By accessing or using our services after the privacy policy update, we will consider that you agree its terms, updates included.</p>"
|
||||||
link_to_policy: "Cliquez ici pour consultez la politique de confidentialité."
|
link_to_policy: "Cliquez ici pour consultez la politique de confidentialité."
|
||||||
|
|
||||||
|
notify_admin_refund_created:
|
||||||
|
subject: "A refund has been generated"
|
||||||
|
body:
|
||||||
|
refund_created: "A refund of %{AMOUNT} has been generated on invoice %{INVOICE} of user %{USER}"
|
||||||
|
download: "Click here to download this refund invoice"
|
||||||
|
|
||||||
shared:
|
shared:
|
||||||
hello: "Hello %{user_name}"
|
hello: "Hello %{user_name}"
|
||||||
|
@ -313,5 +313,11 @@ es:
|
|||||||
content_html: "<p>We wish to inform you that we have just updated our privacy policy.</p><p>We may change our privacy policy regularly. In accordance with the regulations, you will receive a notification for each update.</p><p>By accessing or using our services after the privacy policy update, we will consider that you agree its terms, updates included.</p>"
|
content_html: "<p>We wish to inform you that we have just updated our privacy policy.</p><p>We may change our privacy policy regularly. In accordance with the regulations, you will receive a notification for each update.</p><p>By accessing or using our services after the privacy policy update, we will consider that you agree its terms, updates included.</p>"
|
||||||
link_to_policy: "Cliquez ici pour consultez la politique de confidentialité."
|
link_to_policy: "Cliquez ici pour consultez la politique de confidentialité."
|
||||||
|
|
||||||
|
notify_admin_refund_created: #translation_missing
|
||||||
|
subject: "A refund has been generated"
|
||||||
|
body:
|
||||||
|
refund_created: "A refund of %{AMOUNT} has been generated on invoice %{INVOICE} of user %{USER}"
|
||||||
|
download: "Click here to download this refund invoice"
|
||||||
|
|
||||||
shared:
|
shared:
|
||||||
hello: "¡Hola %{user_name}!"
|
hello: "¡Hola %{user_name}!"
|
||||||
|
@ -313,5 +313,11 @@ fr:
|
|||||||
content_html: "<p>Nous souhaitons vous signaler que nous venons de mettre à jour notre politique de confidentialité.</p><p>Nous pouvons apporter régulièrement des modifications à notre politique de confidentialité. Conformément à la réglementation, une notification vous sera envoyée à chaque mise à jour.</p><p>En accédant ou en utilisant nos services après la mise à jour de la Politique de confidentialité, nous considérerons que vous acceptez les termes de celle-ci, mises à jour comprises.</p>"
|
content_html: "<p>Nous souhaitons vous signaler que nous venons de mettre à jour notre politique de confidentialité.</p><p>Nous pouvons apporter régulièrement des modifications à notre politique de confidentialité. Conformément à la réglementation, une notification vous sera envoyée à chaque mise à jour.</p><p>En accédant ou en utilisant nos services après la mise à jour de la Politique de confidentialité, nous considérerons que vous acceptez les termes de celle-ci, mises à jour comprises.</p>"
|
||||||
link_to_policy: "Cliquez ici pour consultez la politique de confidentialité."
|
link_to_policy: "Cliquez ici pour consultez la politique de confidentialité."
|
||||||
|
|
||||||
|
notify_admin_refund_created:
|
||||||
|
subject: "Un avoir a été généré"
|
||||||
|
body:
|
||||||
|
refund_created: "Un avoir de %{AMOUNT} a été généré sur la facture %{INVOICE} de l'utilisateur %{USER}"
|
||||||
|
download: "Cliquez ici pour télécharger cet avoir"
|
||||||
|
|
||||||
shared:
|
shared:
|
||||||
hello: "Bonjour %{user_name}"
|
hello: "Bonjour %{user_name}"
|
||||||
|
@ -313,5 +313,11 @@ pt:
|
|||||||
content_html: "<p>We wish to inform you that we have just updated our privacy policy.</p><p>We may change our privacy policy regularly. In accordance with the regulations, you will receive a notification for each update.</p><p>By accessing or using our services after the privacy policy update, we will consider that you agree its terms, updates included.</p>"
|
content_html: "<p>We wish to inform you that we have just updated our privacy policy.</p><p>We may change our privacy policy regularly. In accordance with the regulations, you will receive a notification for each update.</p><p>By accessing or using our services after the privacy policy update, we will consider that you agree its terms, updates included.</p>"
|
||||||
link_to_policy: "Cliquez ici pour consultez la politique de confidentialité."
|
link_to_policy: "Cliquez ici pour consultez la politique de confidentialité."
|
||||||
|
|
||||||
|
notify_admin_refund_created: #translation_missing
|
||||||
|
subject: "A refund has been generated"
|
||||||
|
body:
|
||||||
|
refund_created: "A refund of %{AMOUNT} has been generated on invoice %{INVOICE} of user %{USER}"
|
||||||
|
download: "Click here to download this refund invoice"
|
||||||
|
|
||||||
shared:
|
shared:
|
||||||
hello: "Olá %{user_name}"
|
hello: "Olá %{user_name}"
|
||||||
|
@ -351,6 +351,8 @@ pt:
|
|||||||
notify_privacy_policy_changed:
|
notify_privacy_policy_changed:
|
||||||
policy_updated: "Privacy policy updated." # missing translation
|
policy_updated: "Privacy policy updated." # missing translation
|
||||||
click_to_show: "Click here to consult" # missing translation
|
click_to_show: "Click here to consult" # missing translation
|
||||||
|
notify_admin_refund_created:
|
||||||
|
refund_created: "A refund of %{AMOUNT} has been created for user %{USER}" # missing translation
|
||||||
|
|
||||||
statistics:
|
statistics:
|
||||||
# statistics tools for admins
|
# statistics tools for admins
|
||||||
|
Loading…
x
Reference in New Issue
Block a user