Fixes for tests

This commit is contained in:
David Bomba 2021-02-23 09:47:54 +11:00
parent 1b3a9e6398
commit 47a2ff7df3
3 changed files with 15 additions and 2 deletions

View File

@ -406,9 +406,9 @@ class ProductController extends BaseController
*/
public function destroy(DestroyProductRequest $request, Product $product)
{
$product = $this->product_repo->delete($product);
$this->product_repo->delete($product);
return $this->itemResponse($product);
return $this->itemResponse($product->fresh());
}
/**

View File

@ -150,6 +150,16 @@ class Invoice extends BaseModel
return $this->belongsTo(Company::class);
}
public function project()
{
return $this->belongsTo(Project::class);
}
public function design()
{
return $this->belongsTo(Design::class);
}
public function user()
{
return $this->belongsTo(User::class)->withTrashed();

View File

@ -125,6 +125,9 @@ class HtmlEngine
$data['$terms'] = &$data['$entity.terms'];
$data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_invoice').'</a>', 'label' => ctrans('texts.view_invoice')];
$data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_invoice')];
if($this->entity->project()->exists())
$data['$project.name'] = ['value' => $this->entity->project->name, 'label' => ctrans('texts.project_name')];
}
if ($this->entity_string == 'quote') {