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