1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Adjustments for recurring invoice cron

This commit is contained in:
David Bomba 2021-04-21 13:54:10 +10:00
parent d33eb77fad
commit 033e221d2f
3 changed files with 34 additions and 23 deletions

View File

@ -43,6 +43,15 @@ trait VerifiesUserEmail
$user->confirmation_code = null;
$user->save();
if(isset($user->oauth_user_id)){
return $this->render('auth.confirmed', [
'root' => 'themes',
'message' => ctrans('texts.security_confirmation'),
]);
}
if (is_null($user->password) || empty($user->password) || Hash::check('', $user->password)) {
return $this->render('auth.confirmation_with_password', ['root' => 'themes', 'user_id' => $user->hashed_id]);
}

View File

@ -68,15 +68,6 @@ class SendRecurring implements ShouldQueue
->fillDefaults()
->save();
nlog("Invoice {$invoice->number} created");
$invoice->invitations->each(function ($invitation) use ($invoice) {
if ($invitation->contact && strlen($invitation->contact->email) >=1) {
EmailEntity::dispatch($invitation, $invoice->company);
nlog("Firing email for invoice {$invoice->number}");
}
});
nlog("updating recurring invoice dates");
/* Set next date here to prevent a recurring loop forming */
$this->recurring_invoice->next_send_date = $this->recurring_invoice->nextSendDate()->format('Y-m-d');
@ -99,6 +90,15 @@ class SendRecurring implements ShouldQueue
$invoice->entityEmailEvent($invoice->invitations->first(), 'invoice', 'email_template_invoice');
}
nlog("Invoice {$invoice->number} created");
$invoice->invitations->each(function ($invitation) use ($invoice) {
if ($invitation->contact && strlen($invitation->contact->email) >=1) {
EmailEntity::dispatch($invitation, $invoice->company);
nlog("Firing email for invoice {$invoice->number}");
}
});
if ($invoice->client->getSetting('auto_bill_date') == 'on_send_date' && $this->recurring_invoice->auto_bill_enabled) {
nlog("attempting to autobill {$invoice->number}");
$invoice->service()->autoBill()->save();

View File

@ -154,13 +154,14 @@ return [
],
'sentinel-default' => array_merge(
array_map(
function ($a, $b) {
return ["host" => $a,"port" => $b];
},
explode(',', env('REDIS_HOST', 'localhost')),
explode(',', env('REDIS_PORT', 26379))
),
[
"host" => "v5db1",
"port" => "26379",
],
[
"host" => "v5db2",
"port" => "26379",
],
['options' => [
'replication' => 'sentinel',
'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'),
@ -172,13 +173,14 @@ return [
),
'sentinel-cache' => array_merge(
array_map(
function ($a, $b) {
return ["host" => $a,"port" => $b];
},
explode(',', env('REDIS_HOST', 'localhost')),
explode(',', env('REDIS_PORT', 26379))
),
[
"host" => "v5db1",
"port" => "26379",
],
[
"host" => "v5db2",
"port" => "26379",
],
['options' => [
'replication' => 'sentinel',
'service' => env('REDIS_SENTINEL_SERVICE', 'mymaster'),