1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

unwind reminder changes

This commit is contained in:
David Bomba 2022-05-16 20:38:04 +10:00
parent fa3110f23d
commit b398154ebc
3 changed files with 21 additions and 29 deletions

View File

@ -46,7 +46,7 @@ TRUSTED_PROXIES=
NINJA_ENVIRONMENT=selfhost
#options - snappdf / phantom / hosted_ninja
PDF_GENERATOR=phantom
PDF_GENERATOR=hosted_ninja
PHANTOMJS_KEY='a-demo-key-with-low-quota-per-ip-address'
PHANTOMJS_SECRET=secret

View File

@ -29,6 +29,7 @@ class WePayController extends BaseController
*/
public function signup(string $token)
{
return render('gateways.wepay.signup.finished');
$hash = Cache::get($token);

View File

@ -51,92 +51,83 @@ class UpdateReminder extends AbstractService
if (is_null($this->invoice->reminder1_sent) &&
$this->settings->schedule_reminder1 == 'after_invoice_date' &&
$this->settings->enable_reminder1 &&
$this->settings->num_days_reminder1 != 0) {
$this->settings->enable_reminder1) {
$reminder_date = Carbon::parse($this->invoice->date)->startOfDay()->addDays($this->settings->num_days_reminder1)->addSeconds($offset);
if ($reminder_date->gt(Carbon::parse($this->invoice->next_send_date)))
$date_collection->push($reminder_date); nlog("settings reminder 1 after due date");
$date_collection->push($reminder_date);
}
if (is_null($this->invoice->reminder1_sent) &&
$this->settings->schedule_reminder1 == 'before_due_date' &&
$this->settings->enable_reminder1 &&
$this->settings->num_days_reminder1 != 0) {
$this->settings->enable_reminder1) {
$reminder_date = Carbon::parse($this->invoice->due_date)->startOfDay()->subDays($this->settings->num_days_reminder1)->addSeconds($offset);
if ($reminder_date->gt(Carbon::parse($this->invoice->next_send_date)))
$date_collection->push($reminder_date); nlog("settings reminder 1 before_due_date");
$date_collection->push($reminder_date);
}
if (is_null($this->invoice->reminder1_sent) &&
$this->settings->schedule_reminder1 == 'after_due_date' &&
$this->settings->enable_reminder1 &&
$this->settings->num_days_reminder1 != 0) {
$this->settings->enable_reminder1) {
$reminder_date = Carbon::parse($this->invoice->due_date)->startOfDay()->addDays($this->settings->num_days_reminder1)->addSeconds($offset);
if ($reminder_date->gt(Carbon::parse($this->invoice->next_send_date)))
$date_collection->push($reminder_date); nlog("settings reminder 1 after_due_date");
$date_collection->push($reminder_date);
}
if (is_null($this->invoice->reminder2_sent) &&
$this->settings->schedule_reminder2 == 'after_invoice_date' &&
$this->settings->enable_reminder2 &&
$this->settings->num_days_reminder2 != 0) {
$this->settings->enable_reminder2) {
$reminder_date = Carbon::parse($this->invoice->date)->startOfDay()->addDays($this->settings->num_days_reminder2)->addSeconds($offset);
if ($reminder_date->gt(Carbon::parse($this->invoice->next_send_date)))
$date_collection->push($reminder_date); nlog("settings reminder 2 after_invoice_date = ".$reminder_date->format('Y-m-d'));
$date_collection->push($reminder_date);
}
if (is_null($this->invoice->reminder2_sent) &&
$this->settings->schedule_reminder2 == 'before_due_date' &&
$this->settings->enable_reminder2 &&
$this->settings->num_days_reminder2 != 0) {
$this->settings->enable_reminder2) {
$reminder_date = Carbon::parse($this->invoice->due_date)->startOfDay()->subDays($this->settings->num_days_reminder2)->addSeconds($offset);
if ($reminder_date->gt(Carbon::parse($this->invoice->next_send_date)))
$date_collection->push($reminder_date); nlog("settings reminder 2 before_due_date");
$date_collection->push($reminder_date);
}
if (is_null($this->invoice->reminder2_sent) &&
$this->settings->schedule_reminder2 == 'after_due_date' &&
$this->settings->enable_reminder2 &&
$this->settings->num_days_reminder2 != 0) {
$this->settings->enable_reminder2) {
$reminder_date = Carbon::parse($this->invoice->due_date)->startOfDay()->addDays($this->settings->num_days_reminder2)->addSeconds($offset);
if ($reminder_date->gt(Carbon::parse($this->invoice->next_send_date)))
$date_collection->push($reminder_date); nlog("settings reminder 2 after_due_date");
$date_collection->push($reminder_date);
}
if (is_null($this->invoice->reminder3_sent) &&
$this->settings->schedule_reminder3 == 'after_invoice_date' &&
$this->settings->enable_reminder3 &&
$this->settings->num_days_reminder3 != 0) {
$this->settings->enable_reminder3) {
$reminder_date = Carbon::parse($this->invoice->date)->startOfDay()->addDays($this->settings->num_days_reminder3)->addSeconds($offset);
if ($reminder_date->gt(Carbon::parse($this->invoice->next_send_date)))
$date_collection->push($reminder_date); nlog("settings reminder 3 after_invoice_date");
$date_collection->push($reminder_date);
}
if (is_null($this->invoice->reminder3_sent) &&
$this->settings->schedule_reminder3 == 'before_due_date' &&
$this->settings->enable_reminder3 &&
$this->settings->num_days_reminder3 != 0) {
$this->settings->enable_reminder3) {
$reminder_date = Carbon::parse($this->invoice->due_date)->startOfDay()->subDays($this->settings->num_days_reminder3)->addSeconds($offset);
if ($reminder_date->gt(Carbon::parse($this->invoice->next_send_date)))
$date_collection->push($reminder_date); nlog("settings reminder 3 before_due_date");
$date_collection->push($reminder_date);
}
if (is_null($this->invoice->reminder3_sent) &&
$this->settings->schedule_reminder3 == 'after_due_date' &&
$this->settings->enable_reminder3 &&
$this->settings->num_days_reminder3 != 0) {
$this->settings->enable_reminder3) {
$reminder_date = Carbon::parse($this->invoice->due_date)->startOfDay()->addDays($this->settings->num_days_reminder3)->addSeconds($offset);
if ($reminder_date->gt(Carbon::parse($this->invoice->next_send_date)))
$date_collection->push($reminder_date); nlog("settings reminder 3 after_due_date");
$date_collection->push($reminder_date);
}
if ($this->invoice->last_sent_date &&
@ -149,7 +140,7 @@ class UpdateReminder extends AbstractService
$reminder_date->addSeconds($offset);
if ($reminder_date->gt(Carbon::parse($this->invoice->next_send_date)))
$date_collection->push($reminder_date); nlog("settings endless reminder");
$date_collection->push($reminder_date);
}