formatting
This commit is contained in:
parent
0d53067f7b
commit
a8c5aa7efd
@ -84,7 +84,7 @@ class Login extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if is customer
|
// Check if is customer
|
||||||
if ($user->contact) {
|
if ($user->can('read-client-portal')) {
|
||||||
$path = session('url.intended', 'portal');
|
$path = session('url.intended', 'portal');
|
||||||
|
|
||||||
// Path must start with 'portal' prefix
|
// Path must start with 'portal' prefix
|
||||||
|
@ -81,7 +81,7 @@ class Users extends Controller
|
|||||||
*/
|
*/
|
||||||
public function edit(User $user)
|
public function edit(User $user)
|
||||||
{
|
{
|
||||||
if ($user->contact) {
|
if ($user->can('read-client-portal')) {
|
||||||
// Show only roles with customer permission
|
// Show only roles with customer permission
|
||||||
$roles = Role::all()->reject(function ($r) {
|
$roles = Role::all()->reject(function ($r) {
|
||||||
return !$r->hasPermission('read-client-portal');
|
return !$r->hasPermission('read-client-portal');
|
||||||
|
@ -65,7 +65,7 @@ class Bills extends Controller
|
|||||||
|
|
||||||
$currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code')->toArray();
|
$currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code')->toArray();
|
||||||
|
|
||||||
$currency = Currency::where('code', $bil->currency_code)->first();
|
$currency = Currency::where('code', $bill->currency_code)->first();
|
||||||
|
|
||||||
$account_currency_code = Account::where('id', setting('default.account'))->pluck('currency_code')->first();
|
$account_currency_code = Account::where('id', setting('default.account'))->pluck('currency_code')->first();
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ class Header
|
|||||||
$company = null;
|
$company = null;
|
||||||
|
|
||||||
// Get customer company
|
// Get customer company
|
||||||
if ($user->contact) {
|
if ($user->can('read-client-portal')) {
|
||||||
$company = (object)[
|
$company = (object) [
|
||||||
'company_name' => setting('company.name'),
|
'company_name' => setting('company.name'),
|
||||||
'company_email' => setting('company.email'),
|
'company_email' => setting('company.email'),
|
||||||
'company_address' => setting('company.address'),
|
'company_address' => setting('company.address'),
|
||||||
|
@ -26,21 +26,19 @@ class CreateInvoiceTransaction
|
|||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
|
|
||||||
$user = user();
|
if (!$user = user()) {
|
||||||
|
flash($message)->error();
|
||||||
|
|
||||||
if ($user) {
|
redirect()->route('signed.invoices.show', $invoice->id)->send();
|
||||||
if ($user->contact) {
|
|
||||||
flash($message)->error();
|
|
||||||
|
|
||||||
redirect()->route('portal.invoices.show', $invoice->id)->send();
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \Exception($message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
flash($message)->error();
|
if ($user->can('read-client-portal')) {
|
||||||
|
flash($message)->error();
|
||||||
|
|
||||||
redirect()->route('signed.invoices.show', $invoice->id)->send();
|
redirect()->route('portal.invoices.show', $invoice->id)->send();
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \Exception($message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user