Merge pull request #7655 from turbo124/v5-develop

Fixes for invoice status if balance changes to negative
This commit is contained in:
David Bomba 2022-07-19 20:09:05 +10:00 committed by GitHub
commit 4ef33a4c80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 10 deletions

View File

@ -1 +1 @@
5.4.10 5.4.11

View File

@ -21,7 +21,7 @@ class InvoiceArchivedActivity implements ShouldQueue
{ {
protected $activity_repo; protected $activity_repo;
public $delay = 5; public $delay = 15;
/** /**
* Create the event listener. * Create the event listener.

View File

@ -21,7 +21,7 @@ class InvoicePaidActivity implements ShouldQueue
{ {
protected $activity_repo; protected $activity_repo;
public $delay = 5; public $delay = 10;
/** /**
* Create the event listener. * Create the event listener.

View File

@ -71,22 +71,22 @@ class Task extends BaseModel
public function client() public function client()
{ {
return $this->belongsTo(Client::class); return $this->belongsTo(Client::class)->withTrashed();
} }
public function status() public function status()
{ {
return $this->belongsTo(TaskStatus::class); return $this->belongsTo(TaskStatus::class)->withTrashed();
} }
public function invoice() public function invoice()
{ {
return $this->belongsTo(Invoice::class); return $this->belongsTo(Invoice::class)->withTrashed();
} }
public function project() public function project()
{ {
return $this->belongsTo(Project::class); return $this->belongsTo(Project::class)->withTrashed();
} }

View File

@ -310,6 +310,9 @@ class InvoiceService
elseif ($this->invoice->balance > 0 && $this->invoice->balance < $this->invoice->amount) { elseif ($this->invoice->balance > 0 && $this->invoice->balance < $this->invoice->amount) {
$this->invoice->status_id = Invoice::STATUS_PARTIAL; $this->invoice->status_id = Invoice::STATUS_PARTIAL;
} }
elseif ($this->invoice->balance < 0) {
$this->invoice->status_id = Invoice::STATUS_SENT;
}
return $this; return $this;
} }

View File

@ -89,8 +89,9 @@ trait ClientGroupSettingsSaver
if(property_exists($settings, 'translations')) if(property_exists($settings, 'translations'))
unset($settings->translations); unset($settings->translations);
//18-07-2022 removed || empty($settings->{$key}) from this check to allow "0" values to persist
foreach ($settings as $key => $value) { foreach ($settings as $key => $value) {
if (! isset($settings->{$key}) || empty($settings->{$key}) || (! is_object($settings->{$key}) && strlen($settings->{$key}) == 0)) { if (! isset($settings->{$key}) || (! is_object($settings->{$key}) && strlen($settings->{$key}) == 0)) {
unset($settings->{$key}); unset($settings->{$key});
} }
} }

View File

@ -14,8 +14,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true), 'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => '5.4.10', 'app_version' => '5.4.11',
'app_tag' => '5.4.10', 'app_tag' => '5.4.11',
'minimum_client_version' => '5.0.16', 'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1', 'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''), 'api_secret' => env('API_SECRET', ''),