Merge pull request #2802 from brkcvn/master

Improvements brought back
This commit is contained in:
Burak Civan 2022-12-08 17:20:34 +03:00 committed by GitHub
commit c48f977a4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
40 changed files with 1250 additions and 897 deletions

View File

@ -0,0 +1,24 @@
<?php
namespace App\Events\Setting;
use App\Abstracts\Event;
class CategoryCreated extends Event
{
public $category;
public $request;
/**
* Create a new event instance.
*
* @param $category
* @param $request
*/
public function __construct($category, $request)
{
$this->category = $category;
$this->request = $request;
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Events\Setting;
use Illuminate\Queue\SerializesModels;
class CategoryCreating
{
use SerializesModels;
public $request;
/**
* Create a new event instance.
*
* @param $request
*/
public function __construct($request)
{
$this->request = $request;
}
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Events\Setting;
use App\Abstracts\Event;
class CategoryDeleted extends Event
{
public $category;
/**
* Create a new event instance.
*
* @param $category
*/
public function __construct($category)
{
$this->category = $category;
}
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Events\Setting;
use App\Abstracts\Event;
class CategoryDeleting extends Event
{
public $category;
/**
* Create a new event instance.
*
* @param $category
*/
public function __construct($category)
{
$this->category = $category;
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Events\Setting;
use App\Abstracts\Event;
class CategoryUpdated extends Event
{
public $category;
public $request;
/**
* Create a new event instance.
*
* @param $category
* @param $request
*/
public function __construct($category, $request)
{
$this->category = $category;
$this->request = $request;
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Events\Setting;
use App\Abstracts\Event;
class CategoryUpdating extends Event
{
public $category;
public $request;
/**
* Create a new event instance.
*
* @param $category
* @param $request
*/
public function __construct($category, $request)
{
$this->category = $category;
$this->request = $request;
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Exceptions\Settings;
use Exception;
use Throwable;
class LastCategoryDelete extends Exception
{
/*
100000000 => Akaunting charecters
800 => Setting category menu number
40 => CRUD (last item)
1 => First authorized exception
Code: 100000841
*/
public function __construct(string $message = '', int $code = 100000841, Throwable|null $previous = null)
{
parent::__construct($message, $code, $previous);
}
}

View File

@ -3,6 +3,8 @@
namespace App\Jobs\Setting; namespace App\Jobs\Setting;
use App\Abstracts\Job; use App\Abstracts\Job;
use App\Events\Setting\CategoryCreated;
use App\Events\Setting\CategoryCreating;
use App\Interfaces\Job\HasOwner; use App\Interfaces\Job\HasOwner;
use App\Interfaces\Job\HasSource; use App\Interfaces\Job\HasSource;
use App\Interfaces\Job\ShouldCreate; use App\Interfaces\Job\ShouldCreate;
@ -12,10 +14,14 @@ class CreateCategory extends Job implements HasOwner, HasSource, ShouldCreate
{ {
public function handle(): Category public function handle(): Category
{ {
event(new CategoryCreating($this->request));
\DB::transaction(function () { \DB::transaction(function () {
$this->model = Category::create($this->request->all()); $this->model = Category::create($this->request->all());
}); });
event(new CategoryCreated($this->model, $this->request));
return $this->model; return $this->model;
} }
} }

View File

@ -3,6 +3,9 @@
namespace App\Jobs\Setting; namespace App\Jobs\Setting;
use App\Abstracts\Job; use App\Abstracts\Job;
use App\Events\Setting\CategoryDeleted;
use App\Events\Setting\CategoryDeleting;
use App\Exceptions\Settings\LastCategoryDelete;
use App\Interfaces\Job\ShouldDelete; use App\Interfaces\Job\ShouldDelete;
use App\Models\Setting\Category; use App\Models\Setting\Category;
@ -12,10 +15,14 @@ class DeleteCategory extends Job implements ShouldDelete
{ {
$this->authorize(); $this->authorize();
event(new CategoryDeleting($this->model));
\DB::transaction(function () { \DB::transaction(function () {
$this->model->delete(); $this->model->delete();
}); });
event(new CategoryDeleted($this->model));
return true; return true;
} }
@ -28,7 +35,7 @@ class DeleteCategory extends Job implements ShouldDelete
if (Category::where('type', $this->model->type)->count() == 1) { if (Category::where('type', $this->model->type)->count() == 1) {
$message = trans('messages.error.last_category', ['type' => strtolower(trans_choice('general.' . $this->model->type . 's', 1))]); $message = trans('messages.error.last_category', ['type' => strtolower(trans_choice('general.' . $this->model->type . 's', 1))]);
throw new \Exception($message); throw new LastCategoryDelete($message);
} }
if ($relationships = $this->getRelationships()) { if ($relationships = $this->getRelationships()) {

View File

@ -3,6 +3,8 @@
namespace App\Jobs\Setting; namespace App\Jobs\Setting;
use App\Abstracts\Job; use App\Abstracts\Job;
use App\Events\Setting\CategoryUpdated;
use App\Events\Setting\CategoryUpdating;
use App\Interfaces\Job\ShouldUpdate; use App\Interfaces\Job\ShouldUpdate;
use App\Models\Setting\Category; use App\Models\Setting\Category;
@ -12,10 +14,14 @@ class UpdateCategory extends Job implements ShouldUpdate
{ {
$this->authorize(); $this->authorize();
event(new CategoryUpdating($this->model, $this->request));
\DB::transaction(function () { \DB::transaction(function () {
$this->model->update($this->request->all()); $this->model->update($this->request->all());
}); });
event(new CategoryUpdated($this->model, $this->request));
return $this->model; return $this->model;
} }

View File

@ -6,9 +6,11 @@ use App\Events\Module\Uninstalled as Event;
use App\Exceptions\Common\LastDashboard; use App\Exceptions\Common\LastDashboard;
use App\Jobs\Common\DeleteDashboard; use App\Jobs\Common\DeleteDashboard;
use App\Jobs\Common\DeleteReport; use App\Jobs\Common\DeleteReport;
use App\Jobs\Common\DeleteWidget;
use App\Jobs\Setting\DeleteEmailTemplate; use App\Jobs\Setting\DeleteEmailTemplate;
use App\Models\Common\Dashboard; use App\Models\Common\Dashboard;
use App\Models\Common\Report; use App\Models\Common\Report;
use App\Models\Common\Widget;
use App\Models\Setting\EmailTemplate; use App\Models\Setting\EmailTemplate;
use App\Traits\Jobs; use App\Traits\Jobs;
use Throwable; use Throwable;
@ -26,6 +28,7 @@ class FinishUninstallation
public function handle(Event $event) public function handle(Event $event)
{ {
$this->deleteDashboards($event->alias); $this->deleteDashboards($event->alias);
$this->deleteWidgets($event->alias);
$this->deleteEmailTemplates($event->alias); $this->deleteEmailTemplates($event->alias);
$this->deleteReports($event->alias); $this->deleteReports($event->alias);
} }
@ -51,6 +54,23 @@ class FinishUninstallation
}); });
} }
/**
* Delete any widget created by the module.
*
* @param string $alias
* @return void
*/
protected function deleteWidgets($alias)
{
Widget::alias($alias)->get()->each(function ($widget) {
try {
$this->dispatch(new DeleteWidget($widget));
} catch (Throwable $e) {
report($e);
}
});
}
/** /**
* Delete any email template created by the module. * Delete any email template created by the module.
* *

View File

@ -0,0 +1,31 @@
<?php
namespace App\Listeners\Setting;
use App\Events\Setting\CategoryDeleted as Event;
use App\Jobs\Setting\DeleteCategory;
use App\Traits\Jobs;
class DeleteCategoryDeletedSubCategories
{
use Jobs;
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(Event $event)
{
$category = $event->category;
if (empty($category->sub_categories)) {
return;
}
foreach ($category->sub_categories as $sub_category) {
$this->dispatch(new DeleteCategory($sub_category));
}
}
}

View File

@ -1,26 +0,0 @@
<?php
namespace App\Observers;
use App\Abstracts\Observer;
use App\Jobs\Setting\DeleteCategory;
use App\Models\Setting\Category as Model;
use App\Traits\Jobs;
class Category extends Observer
{
use Jobs;
/**
* Listen to the deleted event.
*
* @param Model $category
* @return void
*/
public function deleting(Model $category)
{
foreach ($category->sub_categories as $sub_category) {
$this->dispatch(new DeleteCategory($sub_category));
}
}
}

View File

@ -100,6 +100,9 @@ class Event extends Provider
'App\Events\Banking\TransactionCreated' => [ 'App\Events\Banking\TransactionCreated' => [
'App\Listeners\Banking\IncreaseNextTransactionNumber', 'App\Listeners\Banking\IncreaseNextTransactionNumber',
], ],
'App\Events\Setting\CategoryDeleted' => [
'App\Listeners\Setting\DeleteCategoryDeletedSubCategories',
],
]; ];
/** /**

View File

@ -3,7 +3,6 @@
namespace App\Providers; namespace App\Providers;
use App\Models\Banking\Transaction; use App\Models\Banking\Transaction;
use App\Models\Setting\Category;
use Illuminate\Support\ServiceProvider as Provider; use Illuminate\Support\ServiceProvider as Provider;
class Observer extends Provider class Observer extends Provider
@ -26,6 +25,5 @@ class Observer extends Provider
public function boot() public function boot()
{ {
Transaction::observe('App\Observers\Transaction'); Transaction::observe('App\Observers\Transaction');
Category::observe('App\Observers\Category');
} }
} }

View File

@ -36,14 +36,12 @@ class Actions extends Component
protected function getActions($actions) protected function getActions($actions)
{ {
if (! empty($actions)) { if (empty($actions)) {
return $actions; $actions = [];
}
$actions = []; if ($this->model && ! empty($this->model->line_actions)) {
$actions = $this->model->line_actions;
if ($this->model && ! empty($this->model->line_actions)) { }
$actions = $this->model->line_actions;
} }
foreach ($actions as $key => $action) { foreach ($actions as $key => $action) {

78
composer.lock generated
View File

@ -907,16 +907,16 @@
}, },
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.248.0", "version": "3.252.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/aws/aws-sdk-php.git", "url": "https://github.com/aws/aws-sdk-php.git",
"reference": "69a49ff367447d9753c068326b4ac0d437a230dd" "reference": "5cc35b5f66d026d99ba843dba6fe1783571c20af"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/69a49ff367447d9753c068326b4ac0d437a230dd", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5cc35b5f66d026d99ba843dba6fe1783571c20af",
"reference": "69a49ff367447d9753c068326b4ac0d437a230dd", "reference": "5cc35b5f66d026d99ba843dba6fe1783571c20af",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -995,9 +995,9 @@
"support": { "support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues", "issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.248.0" "source": "https://github.com/aws/aws-sdk-php/tree/3.252.1"
}, },
"time": "2022-11-28T02:55:22+00:00" "time": "2022-12-02T19:21:15+00:00"
}, },
{ {
"name": "balping/json-raw-encoder", "name": "balping/json-raw-encoder",
@ -4858,16 +4858,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v9.41.0", "version": "v9.42.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "cc902ce61b4ca08ca7449664cfab2fa96a1d1e28" "reference": "607d7867c93706eae20e28e46679f8a66e2a23ec"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/cc902ce61b4ca08ca7449664cfab2fa96a1d1e28", "url": "https://api.github.com/repos/laravel/framework/zipball/607d7867c93706eae20e28e46679f8a66e2a23ec",
"reference": "cc902ce61b4ca08ca7449664cfab2fa96a1d1e28", "reference": "607d7867c93706eae20e28e46679f8a66e2a23ec",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5040,7 +5040,7 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2022-11-22T15:10:46+00:00" "time": "2022-11-30T16:23:52+00:00"
}, },
{ {
"name": "laravel/sanctum", "name": "laravel/sanctum",
@ -5619,16 +5619,16 @@
}, },
{ {
"name": "league/flysystem", "name": "league/flysystem",
"version": "3.10.4", "version": "3.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/flysystem.git", "url": "https://github.com/thephpleague/flysystem.git",
"reference": "a7790f3dd1b27af81d380e6b2afa77c16ab7e181" "reference": "7e423e5dd240a60adfab9bde058d7668863b7731"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a7790f3dd1b27af81d380e6b2afa77c16ab7e181", "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/7e423e5dd240a60adfab9bde058d7668863b7731",
"reference": "a7790f3dd1b27af81d380e6b2afa77c16ab7e181", "reference": "7e423e5dd240a60adfab9bde058d7668863b7731",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5690,7 +5690,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/thephpleague/flysystem/issues", "issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/3.10.4" "source": "https://github.com/thephpleague/flysystem/tree/3.11.0"
}, },
"funding": [ "funding": [
{ {
@ -5706,7 +5706,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-11-26T19:48:01+00:00" "time": "2022-12-02T14:39:57+00:00"
}, },
{ {
"name": "league/flysystem-aws-s3-v3", "name": "league/flysystem-aws-s3-v3",
@ -6308,30 +6308,30 @@
}, },
{ {
"name": "markbaker/matrix", "name": "markbaker/matrix",
"version": "3.0.0", "version": "3.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git", "url": "https://github.com/MarkBaker/PHPMatrix.git",
"reference": "c66aefcafb4f6c269510e9ac46b82619a904c576" "reference": "728434227fe21be27ff6d86621a1b13107a2562c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/c66aefcafb4f6c269510e9ac46b82619a904c576", "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
"reference": "c66aefcafb4f6c269510e9ac46b82619a904c576", "reference": "728434227fe21be27ff6d86621a1b13107a2562c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1 || ^8.0" "php": "^7.1 || ^8.0"
}, },
"require-dev": { "require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.0", "phpcompatibility/php-compatibility": "^9.3",
"phpdocumentor/phpdocumentor": "2.*", "phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "^4.0", "phploc/phploc": "^4.0",
"phpmd/phpmd": "2.*", "phpmd/phpmd": "2.*",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.3", "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"sebastian/phpcpd": "^4.0", "sebastian/phpcpd": "^4.0",
"squizlabs/php_codesniffer": "^3.4" "squizlabs/php_codesniffer": "^3.7"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -6358,9 +6358,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/MarkBaker/PHPMatrix/issues", "issues": "https://github.com/MarkBaker/PHPMatrix/issues",
"source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.0" "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
}, },
"time": "2021-07-01T19:01:15+00:00" "time": "2022-12-02T22:17:43+00:00"
}, },
{ {
"name": "masterminds/html5", "name": "masterminds/html5",
@ -6925,16 +6925,16 @@
}, },
{ {
"name": "nesbot/carbon", "name": "nesbot/carbon",
"version": "2.63.0", "version": "2.64.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/briannesbitt/Carbon.git", "url": "https://github.com/briannesbitt/Carbon.git",
"reference": "ad35dd71a6a212b98e4b87e97389b6fa85f0e347" "reference": "889546413c97de2d05063b8cb7b193c2531ea211"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/ad35dd71a6a212b98e4b87e97389b6fa85f0e347", "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/889546413c97de2d05063b8cb7b193c2531ea211",
"reference": "ad35dd71a6a212b98e4b87e97389b6fa85f0e347", "reference": "889546413c97de2d05063b8cb7b193c2531ea211",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -6945,7 +6945,7 @@
"symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0"
}, },
"require-dev": { "require-dev": {
"doctrine/dbal": "^2.0 || ^3.0", "doctrine/dbal": "^2.0 || ^3.1.4",
"doctrine/orm": "^2.7", "doctrine/orm": "^2.7",
"friendsofphp/php-cs-fixer": "^3.0", "friendsofphp/php-cs-fixer": "^3.0",
"kylekatarnls/multi-tester": "^2.0", "kylekatarnls/multi-tester": "^2.0",
@ -7023,7 +7023,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-10-30T18:34:28+00:00" "time": "2022-11-26T17:36:00+00:00"
}, },
{ {
"name": "nette/schema", "name": "nette/schema",
@ -11989,16 +11989,16 @@
}, },
{ {
"name": "symfony/psr-http-message-bridge", "name": "symfony/psr-http-message-bridge",
"version": "v2.1.3", "version": "v2.1.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/psr-http-message-bridge.git", "url": "https://github.com/symfony/psr-http-message-bridge.git",
"reference": "d444f85dddf65c7e57c58d8e5b3a4dbb593b1840" "reference": "a125b93ef378c492e274f217874906fb9babdebb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/d444f85dddf65c7e57c58d8e5b3a4dbb593b1840", "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/a125b93ef378c492e274f217874906fb9babdebb",
"reference": "d444f85dddf65c7e57c58d8e5b3a4dbb593b1840", "reference": "a125b93ef378c492e274f217874906fb9babdebb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -12057,7 +12057,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/symfony/psr-http-message-bridge/issues", "issues": "https://github.com/symfony/psr-http-message-bridge/issues",
"source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.1.3" "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.1.4"
}, },
"funding": [ "funding": [
{ {
@ -12073,7 +12073,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-09-05T10:34:54+00:00" "time": "2022-11-28T22:46:34+00:00"
}, },
{ {
"name": "symfony/routing", "name": "symfony/routing",

1575
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,7 @@
"google-maps": "^3.2.1", "google-maps": "^3.2.1",
"json-schema": ">=0.4.0", "json-schema": ">=0.4.0",
"laravel-mix-tailwind": "^0.1.2", "laravel-mix-tailwind": "^0.1.2",
"lodash": "^4.17.15", "lodash": "^4.17.21",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"popper.js": "^1.16.1", "popper.js": "^1.16.1",
"swiper": "^7.3.1", "swiper": "^7.3.1",

17
public/css/app.css vendored
View File

@ -54051,6 +54051,7 @@ html[dir='rtl'] .el-scrollbar__wrap {
} }
.collapse-sub{ .collapse-sub{
display: block;
height: 0px; height: 0px;
overflow: hidden; overflow: hidden;
opacity: 0; opacity: 0;
@ -55570,6 +55571,12 @@ body{
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
[dir="ltr"] .ltr\:items-start{
-webkit-box-align: start;
-ms-flex-align: start;
align-items: flex-start;
}
[dir="ltr"] .ltr\:space-x-2 > :not([hidden]) ~ :not([hidden]){ [dir="ltr"] .ltr\:space-x-2 > :not([hidden]) ~ :not([hidden]){
--tw-space-x-reverse: 0; --tw-space-x-reverse: 0;
margin-right: calc(0.5rem * var(--tw-space-x-reverse)); margin-right: calc(0.5rem * var(--tw-space-x-reverse));
@ -56321,10 +56328,6 @@ body{
right: -2rem; right: -2rem;
} }
[dir="rtl"] .rtl\:float-left{
float: left;
}
[dir="rtl"] .rtl\:m-0{ [dir="rtl"] .rtl\:m-0{
margin: 0px; margin: 0px;
} }
@ -56581,6 +56584,12 @@ body{
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
} }
[dir="rtl"] .rtl\:items-end{
-webkit-box-align: end;
-ms-flex-align: end;
align-items: flex-end;
}
[dir="rtl"] .rtl\:space-x-reverse > :not([hidden]) ~ :not([hidden]){ [dir="rtl"] .rtl\:space-x-reverse > :not([hidden]) ~ :not([hidden]){
--tw-space-x-reverse: 1; --tw-space-x-reverse: 1;
} }

99
public/css/custom_loading.css vendored Normal file
View File

@ -0,0 +1,99 @@
@media (min-width: 1024px) {
.lg\:w-4\/5 {
width: 80%;
}
.lg\:-mt-16 {
margin-top: -4rem;
}
.lg\:flex {
display: flex;
}
}
[dir="ltr"] .ltr\:right-0 {
right: 0px;
}
[dir="rtl"] .ltr\:left-0 {
left: 0px;
}
.bg-body {
background-color: #fcfcfc;
}
.justify-center {
justify-content: center;
}
.items-center {
align-items: center;
}
.items-start {
align-items: flex-start;
}
.w-full {
width: 100%;
}
.h-screen {
height: 100vh;
}
.-mx-1 {
margin-left: -0.25rem;
margin-right: -0.25rem;
}
.bottom-0 {
bottom: 0px;
}
.top-0 {
top: 0px;
}
.left-0 {
left: 0px;
}
.right-0 {
right: 0px;
}
.fixed {
position: fixed;
}
.absolute {
position: absolute;
}
.w-28 {
width: 7rem;
}
.h-28 {
height: 7rem;
}
.material-icons-outlined {
font-family: 'Material Icons Outlined';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}

View File

@ -359,7 +359,7 @@ html[dir='rtl'] .text-right
.text-white .text-white
{ {
color: #ffffff; color: #ffffff !important;
} }
.mt-classic .mt-classic

View File

@ -256,7 +256,7 @@ export default {
onInputDateSelected(selectedDates, dateStr, instance) { onInputDateSelected(selectedDates, dateStr, instance) {
this.filtered[this.filter_index].value = dateStr; this.filtered[this.filter_index].value = dateStr;
let date = instance.formatDate(selectedDates[0], 'Y-m-d'); let date = selectedDates.length ? instance.formatDate(selectedDates[0], 'Y-m-d') : null;
if (selectedDates.length > 1) { if (selectedDates.length > 1) {
let dates = []; let dates = [];

View File

@ -114,7 +114,10 @@ const app = new Vue({
onRefFocus(ref) { onRefFocus(ref) {
let index = this.form.items.length - 1; let index = this.form.items.length - 1;
this.$refs['items-' + index + '-' + ref][0].focus(); if (this.$refs['items-' + index + '-' + ref] != undefined) {
let first_ref = this.$refs['items-' + index + '-' + ref];
first_ref != undefined ? first_ref[0].focus() : this.$refs[Object.keys(this.$refs)[0]][0].focus();
}
}, },
onCalculateTotal() { onCalculateTotal() {
@ -811,15 +814,20 @@ const app = new Vue({
watch: { watch: {
'form.discount': function (newVal, oldVal) { 'form.discount': function (newVal, oldVal) {
if (newVal != '' && newVal.search('^(?=.*?[0-9])[0-9.,]+$') !== 0) { if (newVal > 99) {
newVal = oldVal;
return;
}
if (newVal != '' && newVal.search('^[-+]?([0-9]|[1-9][0-9]|100)*\.?[0-9]+$') !== 0) {
this.form.discount = oldVal; this.form.discount = oldVal;
this.form.discount = this.form.discount.replace(',', '.'); this.form.discount = this.form.discount ? this.form.discount.replace(',', '.') : '';
return; return;
} }
for (let item of this.regex_condition) { for (let item of this.regex_condition) {
if (this.form.discount.includes(item)) { if (this.form.discount && this.form.discount.includes(item)) {
const removeLastChar = newVal.length - 1; const removeLastChar = newVal.length - 1;
const inputShown = newVal.slice(0, removeLastChar); const inputShown = newVal.slice(0, removeLastChar);
@ -827,7 +835,7 @@ const app = new Vue({
} }
} }
this.form.discount = this.form.discount.replace(',', '.'); this.form.discount = this.form.discount ? this.form.discount.replace(',', '.') : '';
}, },
'form.loading': function (newVal, oldVal) { 'form.loading': function (newVal, oldVal) {

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="relative bg-body z-10 rounded-lg shadow-2xl p-5 sm:py-10 sm:ltr:pl-10 sm:rtl:pr-10 overflow-hidden"> <div class="relative bg-body z-10 rounded-lg shadow-2xl p-5 ltr:pr-0 rtl:pl-0 sm:py-10 sm:ltr:pl-10 sm:rtl:pr-10 overflow-hidden">
<WizardSteps :active_state="active"></WizardSteps> <WizardSteps :active_state="active"></WizardSteps>
<div class="flex flex-col justify-between -mt-5 sm:mt-0" style="height:565px;"> <div class="flex flex-col justify-between -mt-5 sm:mt-0" style="height:565px;">
@ -43,14 +43,14 @@
</div> </div>
<div class="relative w-1/2 right-0 ltr:pl-10 rtl:pr-10 mt-3 hidden lg:flex lg:flex-col"> <div class="relative w-1/2 right-0 ltr:pl-10 rtl:pr-10 mt-3 hidden lg:flex lg:flex-col">
<div class="bg-purple rounded-tl-lg rounded-bl-lg p-6"> <div class="flex flex-col ltr:items-start rtl:items-end bg-purple ltr:rounded-tl-lg ltr:rounded-bl-lg rtl:rounded-tr-lg rtl:rounded-br-lg p-6">
<div class="w-48 text-white rtl:float-left rtl:text-left text-2xl font-semibold leading-9"> <div class="w-48 text-white text-left text-2xl font-semibold leading-9">
{{ translations.finish.apps_managing }} {{ translations.finish.apps_managing }}
</div> </div>
<div style="width:372px; height:372px;"></div> <div style="width:372px; height:372px;"></div>
<img :src="image_src" class="absolute top-0 right-2" alt="" /> <img :src="image_src" class="absolute top-3 right-2" alt="" />
</div> </div>
<base-button <base-button

View File

@ -561,7 +561,7 @@ html[dir='rtl'] .el-scrollbar__wrap {
} }
.collapse-sub { .collapse-sub {
@apply opacity-0 h-0 overflow-hidden; @apply block opacity-0 h-0 overflow-hidden;
} }
.collapse-sub-report.collapse-sub { .collapse-sub-report.collapse-sub {

View File

@ -143,7 +143,13 @@
<x-show.content> <x-show.content>
<x-show.content.left> <x-show.content.left>
@stack('account_number_start') @stack('type_input_start')
@stack('type_input_end')
@stack('name_input_start')
@stack('name_input_end')
@stack('number_input_start')
<div class="flex flex-col text-sm mb-5"> <div class="flex flex-col text-sm mb-5">
<div class="font-medium"> <div class="font-medium">
{{ trans('accounts.number') }} {{ trans('accounts.number') }}
@ -151,9 +157,9 @@
<span>{{ $account->number }}</span> <span>{{ $account->number }}</span>
</div> </div>
@stack('account_number_end') @stack('number_input_end')
@stack('account_currency_start') @stack('currency_code_input_start')
<div class="flex flex-col text-sm mb-5"> <div class="flex flex-col text-sm mb-5">
<div class="font-medium"> <div class="font-medium">
{{ trans_choice('general.currencies', 1) }} {{ trans_choice('general.currencies', 1) }}
@ -163,9 +169,9 @@
{{ $account->currency->name }} {{ $account->currency->name }}
</span> </span>
</div> </div>
@stack('account_currency_end') @stack('currency_code_input_end')
@stack('account_starting_balance_start') @stack('opening_balance_input_start')
<div class="flex flex-col text-sm mb-5"> <div class="flex flex-col text-sm mb-5">
<div class="font-medium"> <div class="font-medium">
{{ trans('accounts.opening_balance') }} {{ trans('accounts.opening_balance') }}
@ -175,9 +181,15 @@
<x-money :amount="$account->opening_balance" :currency="$account->currency_code" convert /> <x-money :amount="$account->opening_balance" :currency="$account->currency_code" convert />
</span> </span>
</div> </div>
@stack('account_starting_balance_end') @stack('opening_balance_input_end')
@stack('account_phone_start') @stack('default_account_input_start')
@stack('default_account_input_end')
@stack('bank_name_input_start')
@stack('bank_name_input_end')
@stack('bank_phone_input_start')
@if ($account->bank_phone) @if ($account->bank_phone)
<div class="flex flex-col text-sm mb-5"> <div class="flex flex-col text-sm mb-5">
<div class="font-medium"> <div class="font-medium">
@ -189,9 +201,9 @@
</span> </span>
</div> </div>
@endif @endif
@stack('account_phone_end') @stack('bank_phone_input_end')
@stack('account_address_start') @stack('bank_address_input_start')
@if ($account->bank_address) @if ($account->bank_address)
<div class="flex flex-col text-sm mb-5"> <div class="flex flex-col text-sm mb-5">
<div class="font-medium"> <div class="font-medium">
@ -203,7 +215,7 @@
</span> </span>
</div> </div>
@endif @endif
@stack('account_address_end') @stack('bank_address_input_end')
</x-show.content.left> </x-show.content.left>
<x-show.content.right> <x-show.content.right>

View File

@ -11,9 +11,9 @@
</div> </div>
</div> </div>
<div class="row modern-head pt-2 pb-2 mt-1 bg-{{ $backgroundColor }}" style="background-color:{{ $backgroundColor }} !important; -webkit-print-color-adjust: exact;"> <div class="row modern-head pt-2 pb-2 mt-1 bg-{{ $backgroundColor }} text-white" style="background-color:{{ $backgroundColor }} !important; -webkit-print-color-adjust: exact;">
<div class="col-58"> <div class="col-58">
<div class="text p-modern"> <div class="text text-white p-modern">
@stack('company_logo_input_start') @stack('company_logo_input_start')
@if (! $hideCompanyLogo) @if (! $hideCompanyLogo)
@if (! empty($document->contact->logo) && ! empty($document->contact->logo->id)) @if (! empty($document->contact->logo) && ! empty($document->contact->logo->id))
@ -27,7 +27,7 @@
</div> </div>
<div class="col-42"> <div class="col-42">
<div class="text p-modern right-column"> <div class="text text-white p-modern right-column">
@stack('company_details_start') @stack('company_details_start')
@if ($textDocumentSubheading) @if ($textDocumentSubheading)
<p class="text-normal font-semibold"> <p class="text-normal font-semibold">
@ -360,4 +360,4 @@
@stack('footer_input_end') @stack('footer_input_end')
@endif @endif
@endif @endif
</div> </div>

View File

@ -22,6 +22,9 @@
<x-layouts.admin.menu /> <x-layouts.admin.menu />
<!-- this line will refactor -->
<x-loading.content />
<div class="main-content xl:ltr:ml-64 xl:rtl:mr-64 transition-all ease-in-out" id="panel"> <div class="main-content xl:ltr:ml-64 xl:rtl:mr-64 transition-all ease-in-out" id="panel">
<div id="main-body"> <div id="main-body">
<div class="container"> <div class="container">

View File

@ -4,7 +4,7 @@
<head> <head>
@stack('head_start') @stack('head_start')
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
@ -15,6 +15,8 @@
<base href="{{ config('app.url') . '/' }}"> <base href="{{ config('app.url') . '/' }}">
<x-layouts.pwa.head /> <x-layouts.pwa.head />
<link rel="stylesheet" href="{{ asset('public/css/custom_loading.css?v=' . version('short')) }}" type="text/css">
<!-- Favicon --> <!-- Favicon -->
<link rel="icon" href="{{ asset('public/img/favicon.ico') }}" type="image/png"> <link rel="icon" href="{{ asset('public/img/favicon.ico') }}" type="image/png">

View File

@ -16,6 +16,8 @@
<x-layouts.pwa.head /> <x-layouts.pwa.head />
<link rel="stylesheet" href="{{ asset('public/css/custom_loading.css?v=' . version('short')) }}" type="text/css">
<!-- Favicon --> <!-- Favicon -->
<link rel="icon" href="{{ asset('public/img/favicon.ico') }}" type="image/png"> <link rel="icon" href="{{ asset('public/img/favicon.ico') }}" type="image/png">

View File

@ -16,6 +16,9 @@
<x-layouts.admin.menu /> <x-layouts.admin.menu />
<!-- this line will refactor -->
<x-loading.content />
<div class="main-content xl:ltr:ml-64 xl:rtl:mr-64 transition-all ease-in-out" id="panel"> <div class="main-content xl:ltr:ml-64 xl:rtl:mr-64 transition-all ease-in-out" id="panel">
<div id="main-body"> <div id="main-body">
<div class="container"> <div class="container">

View File

@ -16,6 +16,8 @@
<x-layouts.pwa.head /> <x-layouts.pwa.head />
<link rel="stylesheet" href="{{ asset('public/css/custom_loading.css?v=' . version('short')) }}" type="text/css">
<!-- Favicon --> <!-- Favicon -->
<link rel="icon" href="{{ asset('public/img/favicon.ico') }}" type="image/png"> <link rel="icon" href="{{ asset('public/img/favicon.ico') }}" type="image/png">

View File

@ -16,6 +16,8 @@
<x-layouts.pwa.head /> <x-layouts.pwa.head />
<link rel="stylesheet" href="{{ asset('public/css/custom_loading.css?v=' . version('short')) }}" type="text/css">
<!-- Favicon --> <!-- Favicon -->
<link rel="icon" href="{{ asset('public/img/favicon.ico') }}" type="image/png"> <link rel="icon" href="{{ asset('public/img/favicon.ico') }}" type="image/png">

View File

@ -16,6 +16,8 @@
<x-layouts.pwa.head /> <x-layouts.pwa.head />
<link rel="stylesheet" href="{{ asset('public/css/custom_loading.css?v=' . version('short')) }}" type="text/css">
<!-- Favicon --> <!-- Favicon -->
<link rel="icon" href="{{ asset('public/img/favicon.ico') }}" type="image/png"> <link rel="icon" href="{{ asset('public/img/favicon.ico') }}" type="image/png">

View File

@ -16,6 +16,8 @@
<x-layouts.pwa.head /> <x-layouts.pwa.head />
<link rel="stylesheet" href="{{ asset('public/css/custom_loading.css?v=' . version('short')) }}" type="text/css">
<!-- Favicon --> <!-- Favicon -->
<link rel="icon" href="{{ asset('public/img/favicon.ico') }}" type="image/png"> <link rel="icon" href="{{ asset('public/img/favicon.ico') }}" type="image/png">

View File

@ -2,7 +2,7 @@
x-data="{ }" x-data="{ }"
x-init="document.querySelector('[data-modal-handle]') ? document.querySelectorAll('[data-modal-handle]').forEach((item) => { item.classList.add('invisible') }) : null, setTimeout(() => $refs.loadingAbsoluteContent.remove(), 1000), setTimeout(() => document.querySelector('[data-modal-handle]') ? document.querySelectorAll('[data-modal-handle]').forEach((item) => { item.classList.remove('invisible') }) : null , 1010)" x-init="document.querySelector('[data-modal-handle]') ? document.querySelectorAll('[data-modal-handle]').forEach((item) => { item.classList.add('invisible') }) : null, setTimeout(() => $refs.loadingAbsoluteContent.remove(), 1000), setTimeout(() => document.querySelector('[data-modal-handle]') ? document.querySelectorAll('[data-modal-handle]').forEach((item) => { item.classList.remove('invisible') }) : null , 1010)"
x-ref="loadingAbsoluteContent" x-ref="loadingAbsoluteContent"
class="absolute w-full lg:flex items-start justify-center bg-body top-0 bottom-0 left-0 right-0" class="absolute w-full lg:flex items-start justify-center bg-body top-0 bottom-0 left-0 right-0 z-50"
style="z-index: 60;" style="z-index: 60;"
> >
<img src="{{ asset('public/img/akaunting-loading.gif') }}" class="w-28 h-28" alt="Akaunting" /> <img src="{{ asset('public/img/akaunting-loading.gif') }}" class="w-28 h-28" alt="Akaunting" />

View File

@ -2,8 +2,8 @@
x-data="{ }" x-data="{ }"
x-init="document.querySelector('[data-modal-handle]') ? document.querySelectorAll('[data-modal-handle]').forEach((item) => { item.classList.add('invisible') }) : null, setTimeout(() => $refs.loadingContent.remove(), 1000), setTimeout(() => document.querySelector('[data-modal-handle]') ? document.querySelectorAll('[data-modal-handle]').forEach((item) => { item.classList.remove('invisible') }) : null , 1010)" x-init="document.querySelector('[data-modal-handle]') ? document.querySelectorAll('[data-modal-handle]').forEach((item) => { item.classList.add('invisible') }) : null, setTimeout(() => $refs.loadingContent.remove(), 1000), setTimeout(() => document.querySelector('[data-modal-handle]') ? document.querySelectorAll('[data-modal-handle]').forEach((item) => { item.classList.remove('invisible') }) : null , 1010)"
x-ref="loadingContent" x-ref="loadingContent"
class="fixed w-full lg:w-4/5 h-screen flex items-center justify-center bg-body top-0 bottom-0 ltr:right-0 rtl:left-0 -mx-1" class="fixed w-full lg:w-4/5 h-screen flex items-center justify-center bg-body top-0 bottom-0 ltr:right-0 rtl:left-0 -mx-1 z-50"
style="position:fixed; z-index:60; top:0; bottom:0; background-color: #fcfcfc;" style="z-index: 60;"
> >
<img src="{{ asset('public/img/akaunting-loading.gif') }}" class="w-28 h-28 lg:-mt-16" alt="Akaunting" /> <img src="{{ asset('public/img/akaunting-loading.gif') }}" class="w-28 h-28 lg:-mt-16" alt="Akaunting" />
</div> </div>

View File

@ -82,9 +82,9 @@
@php $divider = false; @endphp @php $divider = false; @endphp
<div class="relative bg-white hover:bg-gray-100 border py-0.5 px-1 cursor-pointer index-actions"> <div class="relative bg-white hover:bg-gray-100 border py-0.5 px-1 cursor-pointer index-actions">
<button type="button" data-dropdown-toggle="dropdown-actions-{{ $loop->index }}" data-dropdown-placement="left" class="material-icons-outlined text-purple text-lg">more_horiz</button> <button type="button" data-dropdown-toggle="dropdown-actions-{{ $model->id }}-{{ $loop->index }}" data-dropdown-placement="left" class="material-icons-outlined text-purple text-lg">more_horiz</button>
<div id="dropdown-actions-{{ $loop->index }}" data-dropdown-actions class="absolute py-2 bg-white rounded-md border border-gray-200 shadow-xl z-20 hidden !mt-[50px]" style="left:auto; min-width:10rem;"> <div id="dropdown-actions-{{ $model->id }}-{{ $loop->index }}" data-dropdown-actions class="absolute py-2 bg-white rounded-md border border-gray-200 shadow-xl z-20 hidden !mt-[50px]" style="left:auto; min-width:10rem;">
@foreach ($more_actions as $action) @foreach ($more_actions as $action)
@php @php
$type = ! empty($action['type']) ? $action['type'] : 'link'; $type = ! empty($action['type']) ? $action['type'] : 'link';

View File

@ -167,6 +167,9 @@
</tr> </tr>
@endif @endif
@stack('description_input_end') @stack('description_input_end')
@stack('contact_id_input_start')
@stack('contact_id_input_end')
</table> </table>
<table class="border-top-1" style="margin-top:15px;"> <table class="border-top-1" style="margin-top:15px;">