Skip to content

Commit

Permalink
Add Redirection for Invoice/Quotes that do not have client_id
Browse files Browse the repository at this point in the history
  • Loading branch information
zanechua committed Jan 2, 2019
1 parent 341a5e9 commit 9dfcc15
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/Http/Controllers/InvoiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ public function edit(Company $company, Invoice $invoice)
return redirect()->route('invoice.show', [ 'invoice' => $invoice, 'company' => $company ]);
}

if(is_null($invoice->client_id)) {
return redirect()->route('invoice.adhoc.edit', ['invoice' => $invoice, 'company' => Unicorn::getCompanyKey()]);
};

$clients = $company->clients;
$itemtemplates = $company->itemtemplates;
$recurrence = ($invoice->recurrence) ? $invoice->recurrence : null;
Expand Down
3 changes: 3 additions & 0 deletions app/Http/Controllers/QuoteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ public function download(Company $company, Quote $quote)
*/
public function edit(Company $company, Quote $quote)
{
if(is_null($quote->client_id)) {
return redirect()->route('quote.adhoc.edit', ['quote' => $quote, 'company' => Unicorn::getCompanyKey()]);
};
$clients = $company->clients;
$itemtemplates = $company->itemtemplates;

Expand Down
6 changes: 3 additions & 3 deletions resources/views/partials/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
@if(Auth::check())
<li class="sidenav-profile">
<div class="user-view">
<div class="background">
<img src="images/office.jpg">
</div>
{{--<div class="background">--}}
{{--<img src="images/office.jpg">--}}
{{--</div>--}}
<a href="#user"><img class="circle" src="{{ auth()->user()->gravatar }}"></a>
<a href="#name"><span class="white-text name">{{ auth()->user()->full_name }}</span></a>
<a href="#email"><span class="white-text email">{{ auth()->user()->email }}</span></a>
Expand Down

0 comments on commit 9dfcc15

Please sign in to comment.