mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 11:14:40 -04:00
Clarify message for future recurring invoices
This commit is contained in:
parent
a5ce4bce95
commit
62aaa65aa4
@ -2517,6 +2517,7 @@ $LANG = array(
|
||||
'set_phone_for_two_factor' => 'Set your phone number to enable.',
|
||||
'enabled_two_factor' => 'Successfully enabled Two-Factor Authentication',
|
||||
'add_product' => 'Add Product',
|
||||
'email_will_be_sent_on' => 'Note: the email will be sent on :date.',
|
||||
|
||||
);
|
||||
|
||||
|
@ -1303,21 +1303,29 @@
|
||||
return false;
|
||||
}
|
||||
if (!isSaveValid()) {
|
||||
model.showClientForm();
|
||||
return false;
|
||||
}
|
||||
// warn invoice will be emailed when saving new recurring invoice
|
||||
var text = '\n' + getSendToEmails();
|
||||
model.showClientForm();
|
||||
return false;
|
||||
}
|
||||
|
||||
var title = "{!! trans("texts.confirm_recurring_email_invoice") !!}";
|
||||
var text = '\n' + getSendToEmails();
|
||||
var startDate = moment($('#start_date').datepicker('getDate'));
|
||||
|
||||
// warn invoice will be emailed when saving new recurring invoice
|
||||
if (model.invoice().start_date() == "{{ Utils::fromSqlDate(date('Y-m-d')) }}") {
|
||||
text += '\n\n' + "{!! trans("texts.confirm_recurring_timing") !!}";
|
||||
// check if the start date is in the future
|
||||
} else if (startDate.isAfter(moment(), 'day')) {
|
||||
var message = "{!! trans("texts.email_will_be_sent_on") !!}";
|
||||
text += '\n\n' + message.replace(':date', model.invoice().start_date());
|
||||
}
|
||||
var title = "{!! trans("texts.confirm_recurring_email_$entityType") !!}";
|
||||
sweetConfirm(function() {
|
||||
|
||||
sweetConfirm(function() {
|
||||
model.invoice().is_public(true);
|
||||
submitAction('');
|
||||
}, text, title);
|
||||
return;
|
||||
} else {
|
||||
submitAction('');
|
||||
}, text, title);
|
||||
return;
|
||||
} else {
|
||||
model.invoice().is_public(true);
|
||||
onSaveClick();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user