diff --git a/app/Http/Controllers/Banking/Accounts.php b/app/Http/Controllers/Banking/Accounts.php index d1c0de026..9ae9aa7d6 100644 --- a/app/Http/Controllers/Banking/Accounts.php +++ b/app/Http/Controllers/Banking/Accounts.php @@ -42,7 +42,20 @@ class Accounts extends Controller ->orWhereHas('income_transaction', fn ($query) => $query->where('account_id', $account->id)) ->collect(['expense_transaction.paid_at' => 'desc']); - return view('banking.accounts.show', compact('account', 'transactions', 'transfers')); + $incoming_amount = money($account->income_balance, $account->currency_code, true); + $outgoing_amount = money($account->expense_balance, $account->currency_code, true); + $current_amount = money($account->balance, $account->currency_code, true); + + $summary_amounts = [ + 'incoming_exact' => $incoming_amount->format(), + 'incoming_for_humans' => $incoming_amount->formatForHumans(), + 'outgoing_exact' => $outgoing_amount->format(), + 'outgoing_for_humans' => $outgoing_amount->formatForHumans(), + 'current_exact' => $current_amount->format(), + 'current_for_humans' => $current_amount->formatForHumans(), + ]; + + return view('banking.accounts.show', compact('account', 'transactions', 'transfers', 'summary_amounts')); } /** diff --git a/app/Http/Controllers/Modules/Tiles.php b/app/Http/Controllers/Modules/Tiles.php index 54d2c2ab6..8af4e94de 100644 --- a/app/Http/Controllers/Modules/Tiles.php +++ b/app/Http/Controllers/Modules/Tiles.php @@ -155,7 +155,7 @@ class Tiles extends Controller $modules = $this->getSearchModules($data); $installed = Module::all()->pluck('enabled', 'alias')->toArray(); - return view('modules.tiles.index', compact('title', 'modules', 'keyword', 'installed')); + return $this->response('modules.tiles.index', compact('modules', 'title', 'keyword', 'installed')); } public function loadMore($type, Request $request) diff --git a/app/Utilities/Overrider.php b/app/Utilities/Overrider.php index 1d8147d1a..12dd16dee 100644 --- a/app/Utilities/Overrider.php +++ b/app/Utilities/Overrider.php @@ -2,6 +2,7 @@ namespace App\Utilities; +use Akaunting\Money\Money; use App\Models\Setting\Currency; class Overrider @@ -58,6 +59,9 @@ class Overrider app()->setLocale($locale); } + // Set locale for Money package + Money::setLocale(app()->getLocale()); + // Set app url dynamically if empty if (! config('app.url')) { config(['app.url' => url('/')]); diff --git a/composer.lock b/composer.lock index a02752f94..30435d7da 100644 --- a/composer.lock +++ b/composer.lock @@ -413,16 +413,16 @@ }, { "name": "akaunting/laravel-money", - "version": "3.0.1", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/akaunting/laravel-money.git", - "reference": "22336631239eb008e26d322faa208cbc50757a38" + "reference": "a4a3a204250a1185080c9cf0fe6f7f50d0e144cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/akaunting/laravel-money/zipball/22336631239eb008e26d322faa208cbc50757a38", - "reference": "22336631239eb008e26d322faa208cbc50757a38", + "url": "https://api.github.com/repos/akaunting/laravel-money/zipball/a4a3a204250a1185080c9cf0fe6f7f50d0e144cf", + "reference": "a4a3a204250a1185080c9cf0fe6f7f50d0e144cf", "shasum": "" }, "require": { @@ -475,9 +475,9 @@ ], "support": { "issues": "https://github.com/akaunting/laravel-money/issues", - "source": "https://github.com/akaunting/laravel-money/tree/3.0.1" + "source": "https://github.com/akaunting/laravel-money/tree/3.1.0" }, - "time": "2022-05-11T06:34:38+00:00" + "time": "2022-07-19T11:23:57+00:00" }, { "name": "akaunting/laravel-mutable-observer", @@ -907,16 +907,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.231.6", + "version": "3.231.8", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "54c5fe6667c73010d954ce4c4d657d093f0bdcbf" + "reference": "99b3e4585ac82a6e9ab6d1944d90231456fefbea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/54c5fe6667c73010d954ce4c4d657d093f0bdcbf", - "reference": "54c5fe6667c73010d954ce4c4d657d093f0bdcbf", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/99b3e4585ac82a6e9ab6d1944d90231456fefbea", + "reference": "99b3e4585ac82a6e9ab6d1944d90231456fefbea", "shasum": "" }, "require": { @@ -993,9 +993,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.231.6" + "source": "https://github.com/aws/aws-sdk-php/tree/3.231.8" }, - "time": "2022-07-14T18:20:54+00:00" + "time": "2022-07-18T18:20:47+00:00" }, { "name": "balping/json-raw-encoder", @@ -5038,16 +5038,16 @@ }, { "name": "league/commonmark", - "version": "2.3.3", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "0da1dca5781dd3cfddbe328224d9a7a62571addc" + "reference": "155ec1c95626b16fda0889cf15904d24890a60d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/0da1dca5781dd3cfddbe328224d9a7a62571addc", - "reference": "0da1dca5781dd3cfddbe328224d9a7a62571addc", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/155ec1c95626b16fda0889cf15904d24890a60d5", + "reference": "155ec1c95626b16fda0889cf15904d24890a60d5", "shasum": "" }, "require": { @@ -5140,7 +5140,7 @@ "type": "tidelift" } ], - "time": "2022-06-07T21:28:26+00:00" + "time": "2022-07-17T16:25:47+00:00" }, { "name": "league/config", @@ -5226,16 +5226,16 @@ }, { "name": "league/flysystem", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "34a68067b7ae3b836ea5e57e1fc432478372a4f5" + "reference": "1a941703dfb649f9b821e7bc425e782f576a805e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/34a68067b7ae3b836ea5e57e1fc432478372a4f5", - "reference": "34a68067b7ae3b836ea5e57e1fc432478372a4f5", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/1a941703dfb649f9b821e7bc425e782f576a805e", + "reference": "1a941703dfb649f9b821e7bc425e782f576a805e", "shasum": "" }, "require": { @@ -5296,7 +5296,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.1.0" + "source": "https://github.com/thephpleague/flysystem/tree/3.1.1" }, "funding": [ { @@ -5312,25 +5312,25 @@ "type": "tidelift" } ], - "time": "2022-06-29T17:29:54+00:00" + "time": "2022-07-18T09:59:40+00:00" }, { "name": "league/flysystem-aws-s3-v3", - "version": "3.0.22", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git", - "reference": "e5fc508faf83df2fbd2a215d2b4bea9584906221" + "reference": "fa46ce9fbad9bfc73d8b160ffeb2c1793fe9c73b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/e5fc508faf83df2fbd2a215d2b4bea9584906221", - "reference": "e5fc508faf83df2fbd2a215d2b4bea9584906221", + "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/fa46ce9fbad9bfc73d8b160ffeb2c1793fe9c73b", + "reference": "fa46ce9fbad9bfc73d8b160ffeb2c1793fe9c73b", "shasum": "" }, "require": { "aws/aws-sdk-php": "^3.132.4", - "league/flysystem": "^2.0.0 || ^3.0.0", + "league/flysystem": "^3.0.0", "league/mime-type-detection": "^1.0.0", "php": "^8.0.2" }, @@ -5366,9 +5366,23 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues", - "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.0.22" + "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.1.1" }, - "time": "2022-06-29T07:09:46+00:00" + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "custom" + }, + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2022-07-18T09:31:34+00:00" }, { "name": "league/mime-type-detection", @@ -7522,16 +7536,16 @@ }, { "name": "phpoffice/phpspreadsheet", - "version": "1.24.0", + "version": "1.24.1", "source": { "type": "git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "ebe8745c92a7cac4514d040758393b5399633b83" + "reference": "69991111e05fca3ff7398e1e7fca9ebed33efec6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/ebe8745c92a7cac4514d040758393b5399633b83", - "reference": "ebe8745c92a7cac4514d040758393b5399633b83", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/69991111e05fca3ff7398e1e7fca9ebed33efec6", + "reference": "69991111e05fca3ff7398e1e7fca9ebed33efec6", "shasum": "" }, "require": { @@ -7620,9 +7634,9 @@ ], "support": { "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", - "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.24.0" + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.24.1" }, - "time": "2022-07-09T13:49:09+00:00" + "time": "2022-07-18T19:50:48+00:00" }, { "name": "phpoption/phpoption", @@ -14115,5 +14129,5 @@ "ext-zip": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } diff --git a/resources/assets/js/views/modules/apps.js b/resources/assets/js/views/modules/apps.js index 12ff89136..bffdda633 100644 --- a/resources/assets/js/views/modules/apps.js +++ b/resources/assets/js/views/modules/apps.js @@ -29,6 +29,10 @@ const app = new Vue({ AkauntingSlider }, + created() { + document.addEventListener('click', this.closeIfClickedOutside); + }, + mounted() { if (typeof app_slug !== 'undefined') { this.onReleases(1); @@ -84,6 +88,12 @@ const app = new Vue({ addToCartLoading: false, loadMoreLoading: false, + live_search: { + data: [], + modal: false, + not_found: false + }, + route_url: url } }, @@ -288,5 +298,34 @@ const app = new Vue({ this.loadMoreLoading = false; }); }, + + closeIfClickedOutside(event) { + let el = this.$refs.liveSearchModal; + let target = event.target; + + if (el !== target && target.contains(el)) { + this.live_search.modal = false; + } + }, + + onLiveSearch(event) { + let target_length = event.target.value.length; + + if (target_length > 2) { + window.axios.get(url + '/apps/search?keyword=' + event.target.value) + .then(response => { + this.live_search.data = response.data.data.data; + this.live_search.modal = true; + this.live_search.not_found = false; + }) + .catch(error => { + this.live_search.not_found = true; + this.live_search.data = []; + console.log(error); + }) + } else if (target_length == 0) { + this.live_search.modal = false; + } + } } }); diff --git a/resources/lang/en-GB/modules.php b/resources/lang/en-GB/modules.php index 12c1115e6..48f9b7501 100644 --- a/resources/lang/en-GB/modules.php +++ b/resources/lang/en-GB/modules.php @@ -50,6 +50,7 @@ return [ 'hosted_on_akaunting' => 'Hosted on akaunting.com', 'only_works_cloud' => 'This app is available only on Cloud.', 'only_premium_plan' => 'This app is available only on Premium Cloud.', + 'not_found' => 'No app found', 'about' => 'About', diff --git a/resources/views/banking/accounts/show.blade.php b/resources/views/banking/accounts/show.blade.php index 10418dc77..5bfa87706 100644 --- a/resources/views/banking/accounts/show.blade.php +++ b/resources/views/banking/accounts/show.blade.php @@ -116,15 +116,15 @@ @stack('summary_incoming_start') - + @stack('summary_incoming_end') @stack('summary_outgoing_start') - + @stack('summary_outgoing_end') @stack('summary_current_start') - + @stack('summary_current_end') diff --git a/resources/views/components/layouts/modules/bar.blade.php b/resources/views/components/layouts/modules/bar.blade.php index b5ba09a00..3e880a0c3 100644 --- a/resources/views/components/layouts/modules/bar.blade.php +++ b/resources/views/components/layouts/modules/bar.blade.php @@ -61,7 +61,7 @@
-
+
search @@ -73,12 +73,42 @@ value="{{ isset($keyword) ? $keyword : '' }}" placeholder="{{ trans('general.search_placeholder') }}" autocomplete="off" + v-on:keyup="onLiveSearch($event)" />
+ +
+ + +
+ {{ trans('modules.see_more') }} +
+
-
+
{{ trans('modules.home') }} @@ -104,4 +134,4 @@
-
+
\ No newline at end of file