1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Fixes for recurring crons

This commit is contained in:
David Bomba 2021-10-02 11:10:12 +10:00
parent f39681e419
commit 5ddbc0f507
5 changed files with 17 additions and 2 deletions

View File

@ -50,7 +50,7 @@ class PostUpdate extends Command
info("I wasn't able to migrate the data.");
}
nlog("finished migrating");
info("finished migrating");
$output = [];

View File

@ -72,6 +72,11 @@ class SendRecurring implements ShouldQueue
// Generate Standard Invoice
$invoice = RecurringInvoiceToInvoiceFactory::create($this->recurring_invoice, $this->recurring_invoice->client);
if($this->recurring_invoice->auto_bill == "always")
$invoice->auto_bill_enabled = true;
elseif($this->recurring_invoice->auto_bill == "off")
$invoice->auto_bill_enabled = false;
$invoice->date = now()->format('Y-m-d');
$invoice->due_date = $this->recurring_invoice->calculateDueDate(now()->format('Y-m-d'));
$invoice->recurring_id = $this->recurring_invoice->id;

View File

@ -64,7 +64,7 @@ class SupportMessageSent extends Mailable
$db = str_replace("db-ninja-", "", $company->db);
$is_large = $company->is_large ? "L" : "S";
$platform = array_key_exists('platform', $this->data) ? $this->data['platform'] : "U";
$migrated = strlen($company->company_key) == 32 ? "M" : "";
$migrated = strlen($company->company_key) == 32 ? "M" : "T";
if(Ninja::isHosted())
$subject = "{$priority}Hosted-{$db}-{$is_large}{$platform}{$migrated} :: {$plan} :: ".date('M jS, g:ia');

View File

@ -34,6 +34,8 @@ class InvoiceObserver
->where('event_id', Webhook::EVENT_CREATE_INVOICE)
->exists();
$invoice->load('client');
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_CREATE_INVOICE, $invoice, $invoice->company);
}
@ -51,6 +53,9 @@ class InvoiceObserver
->where('event_id', Webhook::EVENT_UPDATE_INVOICE)
->exists();
$invoice->load('client');
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_UPDATE_INVOICE, $invoice, $invoice->company);
}

View File

@ -30,6 +30,8 @@ class QuoteObserver
->where('event_id', Webhook::EVENT_CREATE_QUOTE)
->exists();
$quote->load('client');
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_CREATE_QUOTE, $quote, $quote->company);
}
@ -47,6 +49,9 @@ class QuoteObserver
->where('event_id', Webhook::EVENT_UPDATE_QUOTE)
->exists();
$quote->load('client');
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_UPDATE_QUOTE, $quote, $quote->company);
}