Merge branch 'master' of https://github.com/brkcvn/akaunting into code-clean
This commit is contained in:
commit
cf5f65310e
@ -44,6 +44,26 @@ abstract class SettingController extends Controller
|
||||
|
||||
$total_companies = Company::count();
|
||||
|
||||
// Clear setting media
|
||||
foreach ($this->file_keys as $file_key) {
|
||||
$keys = explode('.', $file_key);
|
||||
|
||||
if ($prefix != $keys[0]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (! setting($file_key, false)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$file_old_key = 'uploaded_' . $keys[1];
|
||||
if (array_key_exists($file_old_key, $fields)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
setting()->forget($file_key);
|
||||
}
|
||||
|
||||
foreach ($fields as $key => $value) {
|
||||
$real_key = $prefix . '.' . $key;
|
||||
|
||||
|
@ -88,7 +88,7 @@ abstract class Index extends Component
|
||||
public $classBulkAction;
|
||||
|
||||
/** @var bool */
|
||||
public $showPicture;
|
||||
public $showLogo;
|
||||
|
||||
/** @var bool */
|
||||
public $hideName;
|
||||
@ -179,7 +179,7 @@ abstract class Index extends Component
|
||||
bool $hideEmptyPage = false, bool $hideSummary = false, $summaryItems = [], bool $hideSearchString = false, bool $hideBulkAction = false,
|
||||
string $searchStringModel = '', string $bulkActionClass = '', array $bulkActions = [], array $bulkActionRouteParameters = [], string $searchRoute = '',
|
||||
string $classBulkAction = '',
|
||||
bool $showPicture = false, bool $hideName = false, bool $hideTaxNumber = false, string $classNameAndTaxNumber = '', string $textName = '', string $textTaxNumber = '',
|
||||
bool $showLogo = false, bool $hideName = false, bool $hideTaxNumber = false, string $classNameAndTaxNumber = '', string $textName = '', string $textTaxNumber = '',
|
||||
bool $hideEmail = false, bool $hidePhone = false, string $classEmailAndPhone = '', string $textEmail = '', string $textPhone = '',
|
||||
bool $hideCountry = false, bool $hideCurrencyCode = false, string $classCountryAndCurrencyCode = '', string $textCountry = '', string $textCurrencyCode = '',
|
||||
bool $hideOpen = false, bool $hideOverdue = false, string $classOpenAndOverdue = '', string $textOpen = '', string $textOverdue = '',
|
||||
@ -229,7 +229,7 @@ abstract class Index extends Component
|
||||
|
||||
$this->classBulkAction = $this->getClassBulkAction($type, $classBulkAction);
|
||||
|
||||
$this->showPicture = $showPicture;
|
||||
$this->showLogo = $showLogo;
|
||||
$this->hideName = $hideName;
|
||||
$this->hideTaxNumber = $hideTaxNumber;
|
||||
$this->classNameAndTaxNumber = $this->getClassNameAndTaxNumber($type, $classNameAndTaxNumber);
|
||||
|
@ -54,6 +54,22 @@ class Companies extends Controller
|
||||
$file_keys = ['company.logo'];
|
||||
$uploaded_file_keys = ['company.uploaded_logo'];
|
||||
|
||||
// Clear setting media
|
||||
foreach ($file_keys as $file_key) {
|
||||
$keys = explode('.', $file_key);
|
||||
|
||||
if (! setting($file_key, false)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$file_old_key = 'uploaded_' . $keys[1];
|
||||
if (array_key_exists($file_old_key, $fields)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
setting()->forget($file_key);
|
||||
}
|
||||
|
||||
foreach ($fields as $key => $value) {
|
||||
// Don't process unwanted keys
|
||||
if (in_array($key, $skip_keys)) {
|
||||
|
@ -24,7 +24,7 @@ class UpdateTransaction extends Job implements ShouldUpdate
|
||||
|
||||
$this->model->attachMedia($media, 'attachment');
|
||||
}
|
||||
} elseif (!$this->request->file('attachment') && $this->model->attachment) {
|
||||
} elseif (! $this->request->file('attachment') && $this->model->attachment) {
|
||||
$this->deleteMediaModel($this->model, 'attachment', $this->request);
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,8 @@ class UpdateContact extends Job implements ShouldUpdate
|
||||
$media = $this->getMedia($this->request->file('logo'), Str::plural($this->model->type));
|
||||
|
||||
$this->model->attachMedia($media, 'logo');
|
||||
} elseif (! $this->request->file('logo') && $this->model->logo) {
|
||||
$this->deleteMediaModel($this->model, 'logo', $this->request);
|
||||
}
|
||||
|
||||
$this->model->update($this->request->all());
|
||||
|
@ -57,7 +57,7 @@ trait Uploads
|
||||
{
|
||||
$medias = $model->$parameter;
|
||||
|
||||
if (!$medias) {
|
||||
if (! $medias) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ trait Uploads
|
||||
}
|
||||
}
|
||||
|
||||
foreach ((array)$medias as $media) {
|
||||
foreach ((array) $medias as $media) {
|
||||
if (in_array($media->id, $already_uploaded)) {
|
||||
continue;
|
||||
}
|
||||
@ -86,7 +86,7 @@ trait Uploads
|
||||
|
||||
public function getMediaFolder($folder, $company_id = null)
|
||||
{
|
||||
if (!$company_id) {
|
||||
if (! $company_id) {
|
||||
$company_id = company_id();
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ trait Uploads
|
||||
|
||||
public function getMediaPathOnStorage($media)
|
||||
{
|
||||
if (!is_object($media)) {
|
||||
if (! is_object($media)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
5
public/css/app.css
vendored
5
public/css/app.css
vendored
@ -47909,6 +47909,11 @@ body{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
[dir="ltr"] .ltr\:text-xl{
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.75rem;
|
||||
}
|
||||
|
||||
[dir="rtl"] .rtl\:-left-1\.5{
|
||||
left: -0.375rem;
|
||||
}
|
||||
|
@ -17,6 +17,12 @@
|
||||
<span class="material-icons-outlined avatar hidden" data-dz-thumbnail-word>content_paste</span>
|
||||
<span class="material-icons-outlined avatar hidden" data-dz-thumbnail-excel>table_chart</span>
|
||||
<span class="mb-1 text-sm ml-3 text-gray-500 hidden" data-dz-name>...</span>
|
||||
|
||||
<div class="gap-x-1 relative">
|
||||
<button data-dz-remove="true" class="absolute group right-0">
|
||||
<span class="material-icons text-base text-red px-1.5 py-1 rounded-lg group-hover:bg-gray-100">delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -40,11 +46,11 @@
|
||||
</div>
|
||||
|
||||
<div class="gap-x-1">
|
||||
<button data-dz-remove="true" class="btn btn-danger btn-sm">
|
||||
<span class="material-icons text-base text-red">delete</span>
|
||||
<button data-dz-remove="true" class="group">
|
||||
<span class="material-icons text-base text-red px-1.5 py-1 rounded-lg group-hover:bg-gray-100">delete</span>
|
||||
</button>
|
||||
<a href="#" type="button" class="btn btn-sm btn-info hidden" data-dz-download>
|
||||
<span class="material-icons-round text-base">download</span>
|
||||
<a href="#" type="button" class="group hidden" data-dz-download>
|
||||
<span class="material-icons-round text-base text-red px-1.5 py-1 rounded-lg group-hover:bg-gray-100">download</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -867,8 +867,7 @@ export default {
|
||||
}
|
||||
|
||||
html[dir='rtl'] .searh-field .el-tag-option {
|
||||
border-radius: 0.50rem;
|
||||
margin-right: 10px;
|
||||
border-radius: 0 0.5rem 0.5rem 0;
|
||||
}
|
||||
|
||||
.searh-field .el-tag-operator {
|
||||
@ -883,12 +882,12 @@ export default {
|
||||
}
|
||||
|
||||
html[dir='rtl'] .searh-field .el-tag-value {
|
||||
border-radius: 0.50rem;
|
||||
border-radius: 0.5rem 0 0 0.5rem;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
html[dir='rtl'] .searh-field .el-tag-operator {
|
||||
border-radius: 0.50rem;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.searh-field .el-select.input-new-tag {
|
||||
|
@ -64,7 +64,7 @@
|
||||
@endif
|
||||
|
||||
@if (! $hideLogo)
|
||||
<x-form.group.file name="logo" label="{{ trans_choice('general.pictures', 1) }}" not-required />
|
||||
<x-form.group.file name="logo" label="{{ trans_choice('general.pictures', 1) }}" :value="! empty($contact) ? $contact->logo : false" not-required />
|
||||
@endif
|
||||
</div>
|
||||
</x-slot>
|
||||
|
@ -136,15 +136,15 @@
|
||||
@stack('name_td_start')
|
||||
@if (! $hideName)
|
||||
<x-slot name="first" class="flex items-center">
|
||||
@if ($showPicture)
|
||||
@if (is_object($item->picture))
|
||||
<img src="{{ Storage::url($item->picture->id) }}" class="absolute w-6 h-6 bottom-6 rounded-full mr-2 hidden lg:block" alt="{{ $item->name }}" title="{{ $item->name }}">
|
||||
@if ($showLogo)
|
||||
@if (is_object($item->logo))
|
||||
<img src="{{ Storage::url($item->logo->id) }}" class="absolute w-6 h-6 bottom-6 rounded-full mr-2 hidden lg:block" alt="{{ $item->name }}" title="{{ $item->name }}">
|
||||
@else
|
||||
<img src="{{ asset('public/img/user.svg') }}" class="absolute w-6 h-6 bottom-6 rounded-full mr-2 hidden lg:block" alt="{{ $item->name }}"/>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<div class="truncate {{ $showPicture ? ' ltr:pl-8 rtl:pr-8' : '' }}">
|
||||
<div class="truncate {{ $showLogo ? ' ltr:pl-8 rtl:pr-8' : '' }}">
|
||||
{{ $item->name }}
|
||||
</div>
|
||||
|
||||
@ -157,7 +157,7 @@
|
||||
|
||||
@stack('tax_number_td_start')
|
||||
@if (! $hideTaxNumber)
|
||||
<x-slot name="second" class="w-32 {{ $showPicture ? ' ltr:pl-8 rtl:pr-8' : '' }}">
|
||||
<x-slot name="second" class="w-32 {{ $showLogo ? ' ltr:pl-8 rtl:pr-8' : '' }}">
|
||||
{{ $item->tax_number }}
|
||||
</x-slot>
|
||||
@endif
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="w-full lg:w-6/12 lg:ltr:pl-24 lg:rtl:pr-24">
|
||||
<div class="relative mb-10" x-data="{ toggle: 'donut' }">
|
||||
<div class="flex border-b pb-2">
|
||||
<div class="w-full lg:w-11/12 text-xl text-left text-black-400">
|
||||
<div class="w-full lg:w-11/12 ltr:text-xl rtl:text-right text-left text-black-400">
|
||||
<h2 x-show="toggle === 'donut'">{{ trans('general.timeline') }}</h2>
|
||||
<h2 x-show="toggle === 'bar'">{{ trans('general.distribution') }}</h2>
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
<x-contacts.index.content type="vendor" :contacts="$vendors" show-picture />
|
||||
<x-contacts.index.content type="vendor" :contacts="$vendors" show-logo />
|
||||
</x-slot>
|
||||
|
||||
<x-contacts.script type="vendor" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user