Merge pull request #6539 from turbo124/v5-develop
Fixes for auto billing
This commit is contained in:
commit
6648abdc68
3 changed files with 10 additions and 3 deletions
|
|
@ -69,6 +69,7 @@ class AutoBillCron
|
|||
} else {
|
||||
//multiDB environment, need to
|
||||
foreach (MultiDB::$dbs as $db) {
|
||||
|
||||
MultiDB::setDB($db);
|
||||
|
||||
$auto_bill_partial_invoices = Invoice::whereDate('partial_due_date', '<=', now())
|
||||
|
|
@ -96,6 +97,12 @@ class AutoBillCron
|
|||
private function runAutoBiller(Invoice $invoice)
|
||||
{
|
||||
info("Firing autobill for {$invoice->company_id} - {$invoice->number}");
|
||||
$invoice->service()->autoBill()->save();
|
||||
|
||||
try{
|
||||
$invoice->service()->autoBill()->save();
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
nlog("Failed to capture payment for {$invoice->company_id} - {$invoice->number} ->" . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class SendRecurring implements ShouldQueue
|
|||
}
|
||||
});
|
||||
|
||||
if ($invoice->client->getSetting('auto_bill_date') == 'on_send_date' && $this->recurring_invoice->auto_bill_enabled) {
|
||||
if ($invoice->client->getSetting('auto_bill_date') == 'on_send_date' && $invoice->auto_bill_enabled) {
|
||||
nlog("attempting to autobill {$invoice->number}");
|
||||
$invoice->service()->autoBill()->save();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class SupportMessageSent extends Mailable
|
|||
$db = str_replace("db-ninja-", "", $company->db);
|
||||
|
||||
if(Ninja::isHosted())
|
||||
$subject = "{$priority}Hosted-{$db} :: {$plan} :: ".date('M jS, g:ia');
|
||||
$subject = "{$priority}Hosted-{$db}-[{$company->is_large}] :: {$plan} :: ".date('M jS, g:ia');
|
||||
else
|
||||
$subject = "{$priority}Self Hosted :: {$plan} :: ".date('M jS, g:ia');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue