mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-02 16:44:36 -04:00
Tuning company settings for missing properties
This commit is contained in:
parent
e3d056ab0b
commit
c95e0c3d7e
@ -108,6 +108,7 @@ class CompanySettings extends BaseSettings
|
|||||||
public $project_number_counter = 1; //@implemented
|
public $project_number_counter = 1; //@implemented
|
||||||
|
|
||||||
public $shared_invoice_quote_counter = false; //@implemented
|
public $shared_invoice_quote_counter = false; //@implemented
|
||||||
|
public $shared_invoice_credit_counter = false; //@implemented
|
||||||
public $recurring_number_prefix = 'R'; //@implemented
|
public $recurring_number_prefix = 'R'; //@implemented
|
||||||
public $reset_counter_frequency_id = '0'; //@implemented
|
public $reset_counter_frequency_id = '0'; //@implemented
|
||||||
public $reset_counter_date = ''; //@implemented
|
public $reset_counter_date = ''; //@implemented
|
||||||
@ -262,6 +263,7 @@ class CompanySettings extends BaseSettings
|
|||||||
public $hide_empty_columns_on_pdf = false;
|
public $hide_empty_columns_on_pdf = false;
|
||||||
|
|
||||||
public static $casts = [
|
public static $casts = [
|
||||||
|
'shared_invoice_credit_counter' => 'bool',
|
||||||
'reply_to_name' => 'string',
|
'reply_to_name' => 'string',
|
||||||
'hide_empty_columns_on_pdf' => 'bool',
|
'hide_empty_columns_on_pdf' => 'bool',
|
||||||
'enable_reminder_endless' => 'bool',
|
'enable_reminder_endless' => 'bool',
|
||||||
|
@ -304,6 +304,10 @@ class Client extends BaseModel implements HasLocalePreference
|
|||||||
return $this->company->settings->{$setting};
|
return $this->company->settings->{$setting};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
elseif( property_exists(CompanySettings::defaults(), $setting) ) {
|
||||||
|
return CompanySettings::defaults()->{$setting};
|
||||||
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
// throw new \Exception("Settings corrupted", 1);
|
// throw new \Exception("Settings corrupted", 1);
|
||||||
|
@ -13,6 +13,7 @@ namespace App\Services\BillingSubscription;
|
|||||||
|
|
||||||
use App\DataMapper\InvoiceItem;
|
use App\DataMapper\InvoiceItem;
|
||||||
use App\Factory\InvoiceFactory;
|
use App\Factory\InvoiceFactory;
|
||||||
|
use App\Models\BillingSubscription;
|
||||||
use App\Models\ClientSubscription;
|
use App\Models\ClientSubscription;
|
||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
use App\Repositories\InvoiceRepository;
|
use App\Repositories\InvoiceRepository;
|
||||||
@ -41,7 +42,7 @@ class BillingSubscriptionService
|
|||||||
// 'line_items' => [],
|
// 'line_items' => [],
|
||||||
// ];
|
// ];
|
||||||
|
|
||||||
$invoice = $invoice_repo->save($data, InvoiceFactory::create($billing_subscription->company_id, $billing_subscription->user_id));
|
$invoice = $invoice_repo->save($data, InvoiceFactory::create($this->billing_subscription->company_id, $this->billing_subscription->user_id));
|
||||||
/*
|
/*
|
||||||
|
|
||||||
If trial_enabled -> return early
|
If trial_enabled -> return early
|
||||||
|
@ -313,7 +313,7 @@ trait GeneratesCounter
|
|||||||
*/
|
*/
|
||||||
public function hasSharedCounter(Client $client) : bool
|
public function hasSharedCounter(Client $client) : bool
|
||||||
{
|
{
|
||||||
return (bool) $client->getSetting('shared_invoice_quote_counter');
|
return (bool) $client->getSetting('shared_invoice_quote_counter') || (bool) $client->getSetting('shared_invoice_credit_counter');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user