Next/Future invoices for users

This commit is contained in:
Deon George
2020-02-08 22:51:50 +11:00
parent b61e00d80f
commit eb316f65fc
18 changed files with 277 additions and 96 deletions

View File

@@ -191,9 +191,6 @@ class Service extends Model
*/
public function type()
{
if (! $this->model)
abort(500,'Missing Model in',['service'=>$this]);
return $this->morphTo(null,'model','id','service_id');
}
@@ -772,7 +769,7 @@ class Service extends Model
$o->date_stop = $this->invoice_next_end;
$o->quantity = $this->invoice_next_quantity;
$o->addTaxes();
$o->addTaxes($this->account->country->taxes);
$result->push($o);
}
@@ -789,7 +786,7 @@ class Service extends Model
$o->date_stop = $this->invoice_next;
$o->quantity = 1;
$o->addTaxes();
$o->addTaxes($this->account->country->taxes);
$result->push($o);
}
@@ -807,7 +804,7 @@ class Service extends Model
$o->module_id = 30; // @todo This shouldnt be hard coded
$o->module_ref = $oo->id;
$o->addTaxes();
$o->addTaxes($this->account->country->taxes);
$result->push($o);
}