Forward user to quote on conversion

This commit is contained in:
David Bomba 2022-02-12 11:17:36 +11:00
parent 53222244ac
commit 447dfc1f8c
2 changed files with 9 additions and 4 deletions

View File

@ -183,6 +183,11 @@ class QuoteController extends Controller
}
if(count($ids) == 1){
//forward client to the invoice if it exists
if($quote->invoice()->exists())
return redirect()->route('client.invoice.show', $quote->invoice->hashed_id);
return redirect()->route('client.quote.show', $quotes->first()->hashed_id);
}

View File

@ -159,10 +159,10 @@ class Quote extends BaseModel
return $this->belongsTo(Client::class)->withTrashed();
}
// public function contacts()
// {
// return $this->hasManyThrough(ClientContact::class, Client::class);
// }
public function invoice()
{
return $this->belongsTo(Invoice::class)->withTrashed();
}
public function assigned_user()
{