mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for recurring invoices - restarting completed recurring invoices
This commit is contained in:
parent
b6d429e336
commit
bbcbfe9821
@ -884,7 +884,7 @@ class CheckData extends Command
|
|||||||
public function checkClientSettings()
|
public function checkClientSettings()
|
||||||
{
|
{
|
||||||
if ($this->option('fix') == 'true') {
|
if ($this->option('fix') == 'true') {
|
||||||
Client::query()->whereNull('country_id')->cursor()->each(function ($client) {
|
Client::query()->whereNull('country_id')->orWhere('country_id', 0)->cursor()->each(function ($client) {
|
||||||
$client->country_id = $client->company->settings->country_id;
|
$client->country_id = $client->company->settings->country_id;
|
||||||
$client->saveQuietly();
|
$client->saveQuietly();
|
||||||
|
|
||||||
|
@ -355,11 +355,13 @@ class RecurringInvoice extends BaseModel
|
|||||||
public function calculateStatus(bool $new_model = false) //15-02-2024 - $new_model needed
|
public function calculateStatus(bool $new_model = false) //15-02-2024 - $new_model needed
|
||||||
{
|
{
|
||||||
|
|
||||||
if($this->remaining_cycles == 0) {
|
if($this->remaining_cycles == 0)
|
||||||
return self::STATUS_COMPLETED;
|
return self::STATUS_COMPLETED;
|
||||||
} elseif ($new_model && $this->status_id == self::STATUS_ACTIVE && Carbon::parse($this->next_send_date)->isFuture())
|
elseif ($new_model && $this->status_id == self::STATUS_ACTIVE && Carbon::parse($this->next_send_date)->isFuture())
|
||||||
return self::STATUS_PENDING;
|
return self::STATUS_PENDING;
|
||||||
|
elseif($this->remaining_cycles != 0)
|
||||||
|
return self::STATUS_ACTIVE;
|
||||||
|
|
||||||
return $this->status_id;
|
return $this->status_id;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user