Fixes identified by CI testing

This commit is contained in:
Deon George
2022-04-20 17:05:49 +10:00
parent 16b7e0b493
commit 3fb6c0a052
4 changed files with 26 additions and 23 deletions

View File

@@ -42,15 +42,19 @@ class InvoiceTest extends TestCase
$this->site_setup();
$this->account_setup();
dump($this->setup['site']);
// Create two services for the same account
// First service was billed a month ago, so this invoice will have 1 service charge
$po = Product::factory()->notStrict()->create([
'site_id'=>Arr::get($this->setup,'site.a')->site_id,
]);
dump($po);
$o = Service::factory()->create([
'site_id'=>Arr::get($this->setup,'site.a')->site_id,
'account_id'=>Arr::get($this->setup,'account.a')->id,
'product_id'=>$po->id,
]);
$po = Product::factory()->notStrict()->make();
$o->product_id = $po->id;
$o->setRelation('product',$po);
$this->assertEquals(110,$o->next_invoice_items(FALSE)->sum('total'),'Invoice Equals 110');