1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Fixes for invoice status if balance changes to negative

This commit is contained in:
David Bomba 2022-07-19 19:36:55 +10:00
parent 7ceb280bdf
commit c5b8c97b57
2 changed files with 5 additions and 1 deletions

View File

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

View File

@ -89,8 +89,9 @@ trait ClientGroupSettingsSaver
if(property_exists($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) {
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});
}
}