Autobill tweaks

This commit is contained in:
David Bomba 2021-08-19 07:41:34 +10:00
parent 386221cba8
commit 9fcaaf6302
2 changed files with 4 additions and 4 deletions

View File

@ -28,6 +28,7 @@ class SubdomainController extends BaseController
'custom_domain',
'preview',
'invoiceninja',
'cname',
];
public function __construct()

View File

@ -107,6 +107,7 @@ class StoreRecurringInvoiceRequest extends Request
} else {
if ($client = Client::find($input['client_id'])) {
$input['auto_bill'] = $client->getSetting('auto_bill');
$input['auto_bill_enabled'] = $this->setAutoBillFlag($input['auto_bill']);
}
}
@ -115,14 +116,12 @@ class StoreRecurringInvoiceRequest extends Request
private function setAutoBillFlag($auto_bill)
{
if ($auto_bill == 'always') {
if ($auto_bill == 'always' || $auto_bill == 'optout') {
return true;
}
//if ($auto_bill == 'off' || $auto_bill == 'optin') {
return false;
//}
}
public function messages()