Fix rendering of future charge items

This commit is contained in:
Deon George 2020-03-31 14:39:39 +11:00
parent 9ab30086fc
commit fb9ccd927d
2 changed files with 17 additions and 16 deletions

View File

@ -107,7 +107,7 @@ class InvoiceItem extends Model
);
default:
return Arr::get($types,$this->item_type,'Unknown');
return ($this->module_id == 30 ? 'Additional Charge: ' : '').Arr::get($types,$this->item_type,'Unknown');
}
}

View File

@ -840,6 +840,7 @@ class Service extends Model
}
// Add additional charges
if (! $this->invoice_items->filter(function($item) { return $item->module_id == 30 AND ! $item->exists; })->count())
foreach ($this->charges->filter(function($item) { return ! $item->processed; }) as $oo) {
$o = new InvoiceItem;
$o->active = TRUE;