Merge branch 'master' of github.com:akaunting/akaunting
This commit is contained in:
commit
2e695865bc
@ -76,6 +76,10 @@ class Money
|
||||
logger($e->getMessage());
|
||||
|
||||
$amount = 0;
|
||||
|
||||
if ($money_format === null) {
|
||||
$amount = $money_format;
|
||||
}
|
||||
}
|
||||
|
||||
return $amount;
|
||||
|
@ -6,6 +6,7 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class User extends FormRequest
|
||||
{
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
@ -29,12 +30,22 @@ class User extends FormRequest
|
||||
$picture = 'mimes:' . config('filesystems.mimes') . '|between:0,' . config('filesystems.max_size') * 1024;
|
||||
}
|
||||
|
||||
$email = 'required|email';
|
||||
|
||||
if ($this->getMethod() == 'PATCH') {
|
||||
// Updating user
|
||||
$id = is_numeric($this->user) ? $this->user : $this->user->getAttribute('id');
|
||||
$password = '';
|
||||
$companies = $this->user->can('read-common-companies') ? 'required' : '';
|
||||
$roles = $this->user->can('read-auth-roles') ? 'required' : '';
|
||||
|
||||
if ($this->user->contact) {
|
||||
$email .= '|unique:contacts,NULL,'
|
||||
. $this->user->contact->id . ',id'
|
||||
. ',company_id,' . company_id()
|
||||
. ',type,customer'
|
||||
. ',deleted_at,NULL';
|
||||
}
|
||||
} else {
|
||||
// Creating user
|
||||
$id = null;
|
||||
@ -43,9 +54,11 @@ class User extends FormRequest
|
||||
$roles = 'required';
|
||||
}
|
||||
|
||||
$email .= '|unique:users,email,' . $id . ',id,deleted_at,NULL';
|
||||
|
||||
return [
|
||||
'name' => 'required|string',
|
||||
'email' => 'required|email|unique:users,email,' . $id . ',id,deleted_at,NULL',
|
||||
'email' => $email,
|
||||
'password' => $password . 'confirmed',
|
||||
'companies' => $companies,
|
||||
'roles' => $roles,
|
||||
|
@ -43,7 +43,15 @@ class Contact extends FormRequest
|
||||
}
|
||||
|
||||
if (!empty($this->request->get('email'))) {
|
||||
$email = 'email|unique:contacts,NULL,' . $id . ',id,company_id,' . $company_id . ',type,' . $type . ',deleted_at,NULL';
|
||||
$email .= 'email|unique:contacts,NULL,'
|
||||
. $id . ',id'
|
||||
. ',company_id,' . $company_id
|
||||
. ',type,' . $type
|
||||
. ',deleted_at,NULL';
|
||||
|
||||
if (isset($model) && $this->$model->user_id) {
|
||||
$email .= '|unique:users,NULL,' . $this->$model->user_id . ',id,deleted_at,NULL';
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
|
@ -31,9 +31,19 @@ class Profile extends FormRequest
|
||||
$picture = 'mimes:' . config('filesystems.mimes') . '|between:0,' . config('filesystems.max_size') * 1024;
|
||||
}
|
||||
|
||||
$email = 'required|email|unique:users,email,' . $id . ',id,deleted_at,NULL';
|
||||
|
||||
if (user()->contact) {
|
||||
$email .= '|unique:contacts,NULL,'
|
||||
. user()->contact->id . ',id'
|
||||
. ',company_id,' . company_id()
|
||||
. ',type,customer'
|
||||
. ',deleted_at,NULL';
|
||||
}
|
||||
|
||||
return [
|
||||
'name' => 'required|string',
|
||||
'email' => 'required|email|unique:users,email,' . $id . ',id,deleted_at,NULL',
|
||||
'email' => $email,
|
||||
'password' => 'confirmed',
|
||||
'picture' => $picture,
|
||||
];
|
||||
|
@ -44,6 +44,8 @@ class Suggestions
|
||||
continue;
|
||||
}
|
||||
|
||||
$s_module->action_url = company_id() . '/' . $s_module->action_url;
|
||||
|
||||
$modules[] = $s_module;
|
||||
}
|
||||
|
||||
|
@ -55,6 +55,10 @@ class UpdateUser extends Job
|
||||
if ($this->request->has('companies')) {
|
||||
$this->user->companies()->sync($this->request->get('companies'));
|
||||
}
|
||||
|
||||
if ($this->user->contact) {
|
||||
$this->user->contact->update($this->request->input());
|
||||
}
|
||||
});
|
||||
|
||||
return $this->user;
|
||||
|
@ -38,6 +38,8 @@ class UpdateContact extends Job
|
||||
\DB::transaction(function () {
|
||||
if ($this->request->get('create_user', 'false') === 'true') {
|
||||
$this->createUser();
|
||||
} elseif ($this->contact->user) {
|
||||
$this->contact->user->update($this->request->all());
|
||||
}
|
||||
|
||||
// Upload logo
|
||||
|
@ -2,11 +2,6 @@
|
||||
// Backgrounds
|
||||
//
|
||||
|
||||
|
||||
@each $color, $value in $colors {
|
||||
@include bg-variant(".bg-#{$color}", $value);
|
||||
}
|
||||
|
||||
@each $color, $value in $theme-colors {
|
||||
@include bg-gradient-variant(".bg-gradient-#{$color}", $value);
|
||||
}
|
||||
@ -25,10 +20,6 @@
|
||||
|
||||
// Sections backgrounds
|
||||
|
||||
@each $color, $value in $section-colors {
|
||||
@include bg-variant(".section-#{$color}", $value);
|
||||
}
|
||||
|
||||
@each $color, $value in $theme-colors {
|
||||
@include bg-gradient-variant(".bg-gradient-#{$color}", $value);
|
||||
}
|
||||
|
@ -41,9 +41,3 @@
|
||||
.ls-1 { letter-spacing: .0625rem; }
|
||||
.ls-15 { letter-spacing: .09375rem; }
|
||||
.ls-2 { letter-spacing: 0.125rem; }
|
||||
|
||||
// Color variations
|
||||
|
||||
@each $color, $value in $colors {
|
||||
@include text-emphasis-variant(".text-#{$color}", $value);
|
||||
}
|
||||
|
@ -160,6 +160,8 @@
|
||||
@endif
|
||||
|
||||
<div class="list-group list-group-flush">
|
||||
@stack('notification_bills_start')
|
||||
|
||||
@can('read-purchases-bills')
|
||||
@if (count($bills))
|
||||
<a href="{{ route('users.read.bills', $user->id) }}" class="list-group-item list-group-item-action">
|
||||
@ -177,6 +179,10 @@
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@stack('notification_bills_end')
|
||||
|
||||
@stack('notification_invoices_start')
|
||||
|
||||
@can('read-sales-invoices')
|
||||
@if (count($invoices))
|
||||
<a href="{{ route('users.read.invoices', $user->id) }}" class="list-group-item list-group-item-action">
|
||||
@ -193,6 +199,8 @@
|
||||
</a>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@stack('notification_invoices_end')
|
||||
</div>
|
||||
|
||||
@if ($notifications)
|
||||
|
@ -28,6 +28,8 @@
|
||||
@endif
|
||||
|
||||
<div class="list-group list-group-flush">
|
||||
@stack('notification_bills_start')
|
||||
|
||||
@if (count($bills))
|
||||
<a href="{{ route('users.read.bills', $user->id) }}" class="list-group-item list-group-item-action">
|
||||
<div class="row align-items-center">
|
||||
@ -43,6 +45,10 @@
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@stack('notification_bills_end')
|
||||
|
||||
@stack('notification_invoices_start')
|
||||
|
||||
@if (count($invoices))
|
||||
<a href="{{ route('users.read.invoices', $user->id) }}" class="list-group-item list-group-item-action">
|
||||
<div class="row align-items-center">
|
||||
@ -57,6 +63,8 @@
|
||||
</div>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@stack('notification_invoices_end')
|
||||
</div>
|
||||
|
||||
@if ($notifications)
|
||||
|
Loading…
x
Reference in New Issue
Block a user