Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.

Commit

Permalink
added new email link
Browse files Browse the repository at this point in the history
  • Loading branch information
Camel Aissani committed May 19, 2019
1 parent 1523693 commit 3d6775a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/pages/rent/view/rent.ejs
Expand Up @@ -46,6 +46,10 @@
<h4 class="list-group-item-heading"><i class="fa fa-envelope-o"></i> <%= t('Rent notice reminder') %></h4>
<p class="list-group-item-text"><%= t('Friendly reminder for rent payment') %></p>
</a>
<a id="emaillastrentcallreminder" href="#" class="list-group-item">
<h4 class="list-group-item-heading"><i class="fa fa-envelope-o"></i> <%= t('Last rent notice reminder') %></h4>
<p class="list-group-item-text"><%= t('Unfriendly reminder for rent payment') %></p>
</a>
<a id="emailinvoice" href="#" class="list-group-item">
<h4 class="list-group-item-heading"><i class="fa fa-envelope-o"></i> <%= t('Rental invoice') %></h4>
<p class="list-group-item-text"><%= t('Invoice stating the payment of the rent') %></p>
Expand Down
17 changes: 17 additions & 0 deletions frontend/js/rent/middleware.js
Expand Up @@ -140,6 +140,23 @@ class RentMiddleware extends ViewController {
return false;
});

$(document).on('click', '#view-rent #emaillastrentcallreminder', () => {
const tenantIds = this.getSelectedIds();
bootbox.confirm(i18next.t('Are you sure to send rent notices by email?'), (result) => {
if (!result) {
return;
}
application.sendEmail(tenantIds, 'rentcall_last_reminder', LOCA.currentYear, LOCA.currentMonth, status => {
bootbox.alert(this.emailStatus({results: status}), () => {
this.closeForm(() => {
this.loadList();
});
});
});
});
return false;
});

$(document).on('click', '#view-rent #printinvoices', () => {
const selection = this.getSelectedIds();
application.openPrintPreview(`/print/invoice/occupants/${selection}/${LOCA.currentYear}/${LOCA.currentMonth}`);
Expand Down
1 change: 1 addition & 0 deletions frontend/locales/en.json
Expand Up @@ -114,6 +114,7 @@
"Landloard": "Landloard",
"Landloard information": "Landloard information",
"Last name": "Last name",
"Last rent notice reminder": "Last rent notice reminder",
"late month": "{{count}} month late",
"late month_plural": "{{count}} months late",
"Late rent - First reminder": "Late rent - First reminder",
Expand Down
1 change: 1 addition & 0 deletions frontend/locales/fr.json
Expand Up @@ -114,6 +114,7 @@
"Landloard": "Propriétaire",
"Landloard information": "Information sur le propriétaire",
"Last name": "Nom",
"Last rent notice reminder": "Dernier rappel d'avis d'échéance",
"late month": "{{count}} mois de retard",
"late month_plural": "{{count}} mois de retard",
"Late rent - First reminder": "Loyer en retard - 1er rappel",
Expand Down

0 comments on commit 3d6775a

Please sign in to comment.