mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Improve return types for vendor settings
This commit is contained in:
parent
8630acb412
commit
17e4e901bd
@ -471,7 +471,7 @@ class CheckData extends Command
|
||||
$ii->saveQuietly();
|
||||
});
|
||||
|
||||
collect([Invoice::class, Quote::class, Credit::class, PurchaseOrder::class])->each(function ($entity) {
|
||||
collect([Invoice::class, Quote::class, Credit::class, PurchaseOrder::class, RecurringInvoice::class])->each(function ($entity) {
|
||||
if ($entity::doesntHave('invitations')->count() > 0) {
|
||||
$entity::doesntHave('invitations')->cursor()->each(function ($entity) {
|
||||
$client_vendor_key = 'client_id';
|
||||
@ -694,7 +694,7 @@ class CheckData extends Command
|
||||
{
|
||||
$this->wrong_balances = 0;
|
||||
|
||||
Client::cursor()->where('is_deleted', 0)->where('clients.updated_at', '>', now()->subDays(2))->each(function ($client) {
|
||||
Client::query()->cursor()->where('is_deleted', 0)->where('clients.updated_at', '>', now()->subDays(2))->each(function ($client) {
|
||||
$client->invoices->where('is_deleted', false)->whereIn('status_id', '!=', Invoice::STATUS_DRAFT)->each(function ($invoice) use ($client) {
|
||||
$total_paid = $invoice->payments()
|
||||
->where('is_deleted', false)->whereIn('status_id', [Payment::STATUS_COMPLETED, Payment::STATUS_PENDING, Payment::STATUS_PARTIALLY_REFUNDED, Payment::STATUS_REFUNDED])
|
||||
@ -876,7 +876,7 @@ class CheckData extends Command
|
||||
$this->wrong_balances = 0;
|
||||
$this->wrong_paid_to_dates = 0;
|
||||
|
||||
foreach (Client::where('is_deleted', 0)->where('clients.updated_at', '>', now()->subDays(2))->cursor() as $client) {
|
||||
foreach (Client::query()->where('is_deleted', 0)->where('clients.updated_at', '>', now()->subDays(2))->cursor() as $client) {
|
||||
$invoice_balance = $client->invoices()->where('is_deleted', false)->whereIn('status_id', [2,3])->sum('balance');
|
||||
$ledger = CompanyLedger::where('client_id', $client->id)->orderBy('id', 'DESC')->first();
|
||||
|
||||
|
@ -707,6 +707,7 @@ class Company extends BaseModel
|
||||
|
||||
public function getSetting($setting)
|
||||
{
|
||||
//todo $this->setting ?? false
|
||||
if (property_exists($this->settings, $setting) != false) {
|
||||
return $this->settings->{$setting};
|
||||
}
|
||||
|
@ -230,9 +230,9 @@ class Vendor extends BaseModel
|
||||
* Returns a vendor settings proxying company setting
|
||||
*
|
||||
* @param string $setting
|
||||
* @return string
|
||||
* @return mixed
|
||||
*/
|
||||
public function getSetting($setting): string
|
||||
public function getSetting($setting): mixed
|
||||
{
|
||||
if ((property_exists($this->company->settings, $setting) != false) && (isset($this->company->settings->{$setting}) !== false)) {
|
||||
return $this->company->settings->{$setting};
|
||||
|
@ -22,8 +22,8 @@ return [
|
||||
*/
|
||||
'batch' => true,
|
||||
|
||||
'cache_connection' => 'sentinel-cache',
|
||||
|
||||
// 'cache_connection' => 'sentinel-cache',
|
||||
'cache_connection' => 'cache',
|
||||
/*
|
||||
* The default key used to store
|
||||
* metrics for batching
|
||||
|
Loading…
x
Reference in New Issue
Block a user