diff --git a/app/Filament/Pages/Finances.php b/app/Filament/Pages/Finances.php new file mode 100644 index 000000000..04ae3968c --- /dev/null +++ b/app/Filament/Pages/Finances.php @@ -0,0 +1,61 @@ +filters = [ + 'start_date' => $this->filters['start_date'] ?? now()->subYear(), + 'end_date' => $this->filters['end_date'] ?? now(), + 'airline_id' => $this->filters['airline_id'] ?? Auth::user()->airline_id, + ]; + $this->fillForm(); + } + + protected function fillForm(): void + { + $this->callHook('beforeFill'); + + $this->form->fill($this->filters); + + $this->callHook('afterFill'); + } + + public function form(Form $form): Form + { + return $form->statePath('filters')->schema([ + Forms\Components\DatePicker::make('start_date')->native(false)->maxDate(fn (Get $get) => $get('end_date'))->live()->afterStateUpdated(function () { $this->filtersUpdated(); }), + Forms\Components\DatePicker::make('end_date')->native(false)->minDate(fn (Get $get) => $get('start_date'))->maxDate(now())->live()->afterStateUpdated(function () { $this->filtersUpdated(); }), + Forms\Components\Select::make('airline_id')->label('Airline')->options(app(AirlineRepository::class)->selectBoxList())->live()->afterStateUpdated(function (?string $state) { if (!$state || $state == '') { + $this->filters['airline_id'] = Auth::user()->airline_id; + } $this->filtersUpdated(); }), + ])->columns(3); + } + + public function filtersUpdated() + { + $this->dispatch('updateFinanceFilters', start_date: $this->filters['start_date'] ?? now()->subYear(), end_date: $this->filters['end_date'], airline_id: $this->filters['airline_id']); + } +} diff --git a/app/Filament/Widgets/AirlineFinanceChart.php b/app/Filament/Widgets/AirlineFinanceChart.php new file mode 100644 index 000000000..fda6b7086 --- /dev/null +++ b/app/Filament/Widgets/AirlineFinanceChart.php @@ -0,0 +1,80 @@ +airline_id = $airline_id; + $this->start_date = Carbon::createFromTimeString($start_date); + $this->end_date = Carbon::createFromTimeString($end_date); + $this->updateChartData(); + } + + protected function getData(): array + { + $airline = Airline::find($this->airline_id); + + $debit = Trend::query(JournalTransaction::where(['journal_id' => $airline->journal->id])) + ->between( + start: Carbon::createFromTimeString($this->start_date), + end: Carbon::createFromTimeString($this->end_date) + ) + ->perMonth() + ->sum('debit'); + + $credit = Trend::query(JournalTransaction::where(['journal_id' => $airline->journal->id])) + ->between( + start: Carbon::createFromTimeString($this->start_date), + end: Carbon::createFromTimeString($this->end_date) + ) + ->perMonth() + ->sum('credit'); + + return [ + 'datasets' => [ + [ + 'label' => 'Debit', + 'data' => $debit->map(fn (TrendValue $value) => money($value->aggregate, setting('units.currency'))->getValue()), + 'backgroundColor' => 'rgba('.Color::Red[400].', 0.1)', + 'borderColor' => 'rgb('.Color::Red[400].')', + ], + [ + 'label' => 'Credit', + 'data' => $credit->map(fn (TrendValue $value) => money($value->aggregate, setting('units.currency'))->getValue()), + 'backgroundColor' => 'rgba('.Color::Green[400].', 0.1)', + 'borderColor' => 'rgb('.Color::Green[400].')', + ], + ], + 'labels' => $debit->map(fn (TrendValue $value) => $value->date), + ]; + } + + protected function getType(): string + { + return 'bar'; + } + + public static function canView(): bool + { + return false; + } +} diff --git a/app/Filament/Widgets/AirlineFinanceTable.php b/app/Filament/Widgets/AirlineFinanceTable.php new file mode 100644 index 000000000..a68cc69ed --- /dev/null +++ b/app/Filament/Widgets/AirlineFinanceTable.php @@ -0,0 +1,73 @@ +airline_journal_id = Airline::find($this->airline_id)->journal->id; + $this->updateTransactions(); + } + + #[On('updateFinanceFilters')] + public function refresh(int $airline_id, string $start_date, string $end_date): void + { + if ($this->airline_id != $airline_id) { + $this->airline_id = $airline_id; + $this->airline_journal_id = Airline::find($airline_id)->journal->id; + } + + $this->start_date = Carbon::createFromTimeString($start_date); + $this->end_date = Carbon::createFromTimeString($end_date); + + $this->updateTransactions(); + } + + public function updateTransactions(): void + { + $this->transactions = JournalTransaction::groupBy('transaction_group', 'currency') + ->selectRaw('transaction_group, + currency, + SUM(credit) as sum_credits, + SUM(debit) as sum_debits') + ->where(['journal_id' => $this->airline_journal_id]) + ->whereBetween('created_at', [$this->start_date, $this->end_date], 'AND') + ->orderBy('sum_credits', 'desc') + ->orderBy('sum_debits', 'desc') + ->orderBy('transaction_group', 'asc') + ->get(); + + // Summate it so we can show it on the footer of the table + $this->sum_all_credits = 0; + $this->sum_all_debits = 0; + foreach ($this->transactions as $ta) { + $this->sum_all_credits += $ta->sum_credits ?? 0; + $this->sum_all_debits += $ta->sum_debits ?? 0; + } + } + + public static function canView(): bool + { + return false; + } +} diff --git a/composer.json b/composer.json index d2f1ee21a..b3debc533 100644 --- a/composer.json +++ b/composer.json @@ -89,7 +89,7 @@ "spatie/laravel-ignition": "^2.0", "kyslik/column-sortable": "^6.5", "jlorente/laravel-data-migrations": "^2.0", - "filament/filament": "^3.0.69", + "filament/filament": "^3.0.88", "coolsam/modules": "3.x-dev", "flowframe/laravel-trend": "^0.1.5" }, diff --git a/composer.lock b/composer.lock index 7ad35469b..726eca222 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "302d4349d6ac93ad76b095f67c82ae31", + "content-hash": "0a21e2c4fec905e9cd47f8ccbe534018", "packages": [ { "name": "akaunting/laravel-money", @@ -212,16 +212,16 @@ }, { "name": "blade-ui-kit/blade-icons", - "version": "1.5.2", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/blade-ui-kit/blade-icons.git", - "reference": "4d6b6b2548b1994a777211a985e18691701891e4" + "reference": "b5e6603218e2347ac81cb780bc6f71c8c3b31f5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/blade-ui-kit/blade-icons/zipball/4d6b6b2548b1994a777211a985e18691701891e4", - "reference": "4d6b6b2548b1994a777211a985e18691701891e4", + "url": "https://api.github.com/repos/blade-ui-kit/blade-icons/zipball/b5e6603218e2347ac81cb780bc6f71c8c3b31f5b", + "reference": "b5e6603218e2347ac81cb780bc6f71c8c3b31f5b", "shasum": "" }, "require": { @@ -283,9 +283,13 @@ { "url": "https://github.com/sponsors/driesvints", "type": "github" + }, + { + "url": "https://www.paypal.com/paypalme/driesvints", + "type": "paypal" } ], - "time": "2023-06-09T15:47:26+00:00" + "time": "2023-10-18T10:50:13+00:00" }, { "name": "brick/math", @@ -1527,16 +1531,16 @@ }, { "name": "danharrin/livewire-rate-limiting", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/danharrin/livewire-rate-limiting.git", - "reference": "a55996683cabf2e93893280d602191243b3b80b8" + "reference": "bc2cc0a0b5b517fdc5bba8671013dd71081f70a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/danharrin/livewire-rate-limiting/zipball/a55996683cabf2e93893280d602191243b3b80b8", - "reference": "a55996683cabf2e93893280d602191243b3b80b8", + "url": "https://api.github.com/repos/danharrin/livewire-rate-limiting/zipball/bc2cc0a0b5b517fdc5bba8671013dd71081f70a8", + "reference": "bc2cc0a0b5b517fdc5bba8671013dd71081f70a8", "shasum": "" }, "require": { @@ -1544,7 +1548,8 @@ "php": "^8.0" }, "require-dev": { - "livewire/livewire": "^2.3", + "livewire/livewire": "^3.0", + "livewire/volt": "^1.3", "orchestra/testbench": "^7.0|^8.0", "phpunit/phpunit": "^9.0|^10.0" }, @@ -1576,7 +1581,7 @@ "type": "github" } ], - "time": "2023-03-12T12:17:29+00:00" + "time": "2023-10-27T15:01:19+00:00" }, { "name": "dflydev/dot-access-data", @@ -2424,16 +2429,16 @@ }, { "name": "filament/actions", - "version": "v3.0.69", + "version": "v3.0.88", "source": { "type": "git", "url": "https://github.com/filamentphp/actions.git", - "reference": "1f9f945d78833eca82728fd22edfc04e3c0939aa" + "reference": "a8413d87256672c939ef82558ad01350617612a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/actions/zipball/1f9f945d78833eca82728fd22edfc04e3c0939aa", - "reference": "1f9f945d78833eca82728fd22edfc04e3c0939aa", + "url": "https://api.github.com/repos/filamentphp/actions/zipball/a8413d87256672c939ef82558ad01350617612a6", + "reference": "a8413d87256672c939ef82558ad01350617612a6", "shasum": "" }, "require": { @@ -2470,20 +2475,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-05T15:18:18+00:00" + "time": "2023-10-27T14:34:56+00:00" }, { "name": "filament/filament", - "version": "v3.0.69", + "version": "v3.0.88", "source": { "type": "git", "url": "https://github.com/filamentphp/panels.git", - "reference": "2b117b084052bfe81b23aadf090ddeba684ddcf5" + "reference": "dfe4b9ed7a5a5f8a3135a9789ee70946590ee11d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/panels/zipball/2b117b084052bfe81b23aadf090ddeba684ddcf5", - "reference": "2b117b084052bfe81b23aadf090ddeba684ddcf5", + "url": "https://api.github.com/repos/filamentphp/panels/zipball/dfe4b9ed7a5a5f8a3135a9789ee70946590ee11d", + "reference": "dfe4b9ed7a5a5f8a3135a9789ee70946590ee11d", "shasum": "" }, "require": { @@ -2535,20 +2540,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-06T15:56:56+00:00" + "time": "2023-10-30T09:52:34+00:00" }, { "name": "filament/forms", - "version": "v3.0.69", + "version": "v3.0.88", "source": { "type": "git", "url": "https://github.com/filamentphp/forms.git", - "reference": "81ee2d2ef6322f53442fd27c8e40d925e1594ce2" + "reference": "4403c0c047f8516b349edeb56ede07551e259c7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/forms/zipball/81ee2d2ef6322f53442fd27c8e40d925e1594ce2", - "reference": "81ee2d2ef6322f53442fd27c8e40d925e1594ce2", + "url": "https://api.github.com/repos/filamentphp/forms/zipball/4403c0c047f8516b349edeb56ede07551e259c7d", + "reference": "4403c0c047f8516b349edeb56ede07551e259c7d", "shasum": "" }, "require": { @@ -2591,20 +2596,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-06T15:56:53+00:00" + "time": "2023-10-30T09:52:24+00:00" }, { "name": "filament/infolists", - "version": "v3.0.69", + "version": "v3.0.88", "source": { "type": "git", "url": "https://github.com/filamentphp/infolists.git", - "reference": "76bd92dff0c7798e09bcd7b6905e76ecaef193d5" + "reference": "f74cc311ba0672c3f73b1cdd802185f8b41fd4cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/infolists/zipball/76bd92dff0c7798e09bcd7b6905e76ecaef193d5", - "reference": "76bd92dff0c7798e09bcd7b6905e76ecaef193d5", + "url": "https://api.github.com/repos/filamentphp/infolists/zipball/f74cc311ba0672c3f73b1cdd802185f8b41fd4cd", + "reference": "f74cc311ba0672c3f73b1cdd802185f8b41fd4cd", "shasum": "" }, "require": { @@ -2642,20 +2647,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-06T15:56:51+00:00" + "time": "2023-10-27T14:35:11+00:00" }, { "name": "filament/notifications", - "version": "v3.0.69", + "version": "v3.0.88", "source": { "type": "git", "url": "https://github.com/filamentphp/notifications.git", - "reference": "4fe60598157c53b712c46944614fb6a57fb93c04" + "reference": "b54eb25ec100e65b960fb8b90c9d38c132eb5bb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/notifications/zipball/4fe60598157c53b712c46944614fb6a57fb93c04", - "reference": "4fe60598157c53b712c46944614fb6a57fb93c04", + "url": "https://api.github.com/repos/filamentphp/notifications/zipball/b54eb25ec100e65b960fb8b90c9d38c132eb5bb6", + "reference": "b54eb25ec100e65b960fb8b90c9d38c132eb5bb6", "shasum": "" }, "require": { @@ -2694,20 +2699,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-05T15:18:17+00:00" + "time": "2023-10-27T14:34:57+00:00" }, { "name": "filament/support", - "version": "v3.0.69", + "version": "v3.0.88", "source": { "type": "git", "url": "https://github.com/filamentphp/support.git", - "reference": "6c4358cf11b8f09effcaaa995b4e553e7c1a94c8" + "reference": "5e5884f71d9529754d4f890319336535e42fc621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/support/zipball/6c4358cf11b8f09effcaaa995b4e553e7c1a94c8", - "reference": "6c4358cf11b8f09effcaaa995b4e553e7c1a94c8", + "url": "https://api.github.com/repos/filamentphp/support/zipball/5e5884f71d9529754d4f890319336535e42fc621", + "reference": "5e5884f71d9529754d4f890319336535e42fc621", "shasum": "" }, "require": { @@ -2717,7 +2722,7 @@ "illuminate/contracts": "^10.0", "illuminate/support": "^10.0", "illuminate/view": "^10.0", - "livewire/livewire": "^3.0", + "livewire/livewire": "^3.0.8", "php": "^8.1", "ryangjchandler/blade-capture-directive": "^0.2|^0.3", "spatie/color": "^1.5", @@ -2751,20 +2756,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-06T15:56:48+00:00" + "time": "2023-10-30T09:52:26+00:00" }, { "name": "filament/tables", - "version": "v3.0.69", + "version": "v3.0.88", "source": { "type": "git", "url": "https://github.com/filamentphp/tables.git", - "reference": "f661731442a1af2819f3581b05cca38c91db54d0" + "reference": "fa48a1a4abfb501417ed8e5abc71fb36d08ae51e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/tables/zipball/f661731442a1af2819f3581b05cca38c91db54d0", - "reference": "f661731442a1af2819f3581b05cca38c91db54d0", + "url": "https://api.github.com/repos/filamentphp/tables/zipball/fa48a1a4abfb501417ed8e5abc71fb36d08ae51e", + "reference": "fa48a1a4abfb501417ed8e5abc71fb36d08ae51e", "shasum": "" }, "require": { @@ -2804,20 +2809,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-06T15:57:10+00:00" + "time": "2023-10-30T09:52:30+00:00" }, { "name": "filament/widgets", - "version": "v3.0.69", + "version": "v3.0.88", "source": { "type": "git", "url": "https://github.com/filamentphp/widgets.git", - "reference": "017b070da641e3bde6940656475d81aeb1042f40" + "reference": "e550d4d60238ae0bee8be79908064e66d6d26712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/widgets/zipball/017b070da641e3bde6940656475d81aeb1042f40", - "reference": "017b070da641e3bde6940656475d81aeb1042f40", + "url": "https://api.github.com/repos/filamentphp/widgets/zipball/e550d4d60238ae0bee8be79908064e66d6d26712", + "reference": "e550d4d60238ae0bee8be79908064e66d6d26712", "shasum": "" }, "require": { @@ -2848,7 +2853,7 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-06T15:57:09+00:00" + "time": "2023-10-27T14:35:16+00:00" }, { "name": "fisharebest/ext-calendar", @@ -4115,16 +4120,16 @@ }, { "name": "kirschbaum-development/eloquent-power-joins", - "version": "3.2.4", + "version": "3.3.3", "source": { "type": "git", "url": "https://github.com/kirschbaum-development/eloquent-power-joins.git", - "reference": "fadc20d436b0693a34c4b611d07954818e46eb4d" + "reference": "e55fa70dfa4a5e897443454825b9d4ce6081786a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kirschbaum-development/eloquent-power-joins/zipball/fadc20d436b0693a34c4b611d07954818e46eb4d", - "reference": "fadc20d436b0693a34c4b611d07954818e46eb4d", + "url": "https://api.github.com/repos/kirschbaum-development/eloquent-power-joins/zipball/e55fa70dfa4a5e897443454825b9d4ce6081786a", + "reference": "e55fa70dfa4a5e897443454825b9d4ce6081786a", "shasum": "" }, "require": { @@ -4171,9 +4176,9 @@ ], "support": { "issues": "https://github.com/kirschbaum-development/eloquent-power-joins/issues", - "source": "https://github.com/kirschbaum-development/eloquent-power-joins/tree/3.2.4" + "source": "https://github.com/kirschbaum-development/eloquent-power-joins/tree/3.3.3" }, - "time": "2023-09-12T17:02:05+00:00" + "time": "2023-10-31T18:01:18+00:00" }, { "name": "kkszymanowski/traitor", @@ -4345,16 +4350,16 @@ }, { "name": "laravel/framework", - "version": "v10.28.0", + "version": "v10.30.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "09137f50f715c1efc649788a26092dcb1ec4ab6e" + "reference": "3dd85d9dbea82b937f8eaf344b50d613c5d1127a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/09137f50f715c1efc649788a26092dcb1ec4ab6e", - "reference": "09137f50f715c1efc649788a26092dcb1ec4ab6e", + "url": "https://api.github.com/repos/laravel/framework/zipball/3dd85d9dbea82b937f8eaf344b50d613c5d1127a", + "reference": "3dd85d9dbea82b937f8eaf344b50d613c5d1127a", "shasum": "" }, "require": { @@ -4387,7 +4392,7 @@ "symfony/console": "^6.2", "symfony/error-handler": "^6.2", "symfony/finder": "^6.2", - "symfony/http-foundation": "^6.2", + "symfony/http-foundation": "^6.3", "symfony/http-kernel": "^6.2", "symfony/mailer": "^6.2", "symfony/mime": "^6.2", @@ -4454,13 +4459,15 @@ "league/flysystem-read-only": "^3.3", "league/flysystem-sftp-v3": "^3.0", "mockery/mockery": "^1.5.1", + "nyholm/psr7": "^1.2", "orchestra/testbench-core": "^8.12", "pda/pheanstalk": "^4.0", "phpstan/phpstan": "^1.4.7", "phpunit/phpunit": "^10.0.7", "predis/predis": "^2.0.2", "symfony/cache": "^6.2", - "symfony/http-client": "^6.2.4" + "symfony/http-client": "^6.2.4", + "symfony/psr-http-message-bridge": "^2.0" }, "suggest": { "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", @@ -4541,7 +4548,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-10-10T13:01:37+00:00" + "time": "2023-10-31T13:19:45+00:00" }, { "name": "laravel/helpers", @@ -4601,23 +4608,23 @@ }, { "name": "laravel/prompts", - "version": "v0.1.11", + "version": "v0.1.13", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "cce65a90e64712909ea1adc033e1d88de8455ffd" + "reference": "e1379d8ead15edd6cc4369c22274345982edc95a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/cce65a90e64712909ea1adc033e1d88de8455ffd", - "reference": "cce65a90e64712909ea1adc033e1d88de8455ffd", + "url": "https://api.github.com/repos/laravel/prompts/zipball/e1379d8ead15edd6cc4369c22274345982edc95a", + "reference": "e1379d8ead15edd6cc4369c22274345982edc95a", "shasum": "" }, "require": { "ext-mbstring": "*", "illuminate/collections": "^10.0|^11.0", "php": "^8.1", - "symfony/console": "^6.2" + "symfony/console": "^6.2|^7.0" }, "conflict": { "illuminate/console": ">=10.17.0 <10.25.0", @@ -4652,22 +4659,22 @@ ], "support": { "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.1.11" + "source": "https://github.com/laravel/prompts/tree/v0.1.13" }, - "time": "2023-10-03T01:07:35+00:00" + "time": "2023-10-27T13:53:59+00:00" }, { "name": "laravel/serializable-closure", - "version": "v1.3.1", + "version": "v1.3.2", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "e5a3057a5591e1cfe8183034b0203921abe2c902" + "reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/e5a3057a5591e1cfe8183034b0203921abe2c902", - "reference": "e5a3057a5591e1cfe8183034b0203921abe2c902", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/076fe2cf128bd54b4341cdc6d49b95b34e101e4c", + "reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c", "shasum": "" }, "require": { @@ -4714,7 +4721,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2023-07-14T13:56:28+00:00" + "time": "2023-10-17T13:38:16+00:00" }, { "name": "laravel/ui", @@ -5128,16 +5135,16 @@ }, { "name": "league/flysystem", - "version": "3.17.0", + "version": "3.18.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "bd4c9b26849d82364119c68429541f1631fba94b" + "reference": "015633a05aee22490495159237a5944091d8281e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/bd4c9b26849d82364119c68429541f1631fba94b", - "reference": "bd4c9b26849d82364119c68429541f1631fba94b", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/015633a05aee22490495159237a5944091d8281e", + "reference": "015633a05aee22490495159237a5944091d8281e", "shasum": "" }, "require": { @@ -5166,7 +5173,7 @@ "google/cloud-storage": "^1.23", "microsoft/azure-storage-blob": "^1.1", "phpseclib/phpseclib": "^3.0.14", - "phpstan/phpstan": "^0.12.26", + "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.5.11|^10.0", "sabre/dav": "^4.3.1" }, @@ -5202,7 +5209,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.17.0" + "source": "https://github.com/thephpleague/flysystem/tree/3.18.0" }, "funding": [ { @@ -5214,20 +5221,20 @@ "type": "github" } ], - "time": "2023-10-05T20:15:05+00:00" + "time": "2023-10-20T17:59:40+00:00" }, { "name": "league/flysystem-local", - "version": "3.16.0", + "version": "3.18.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-local.git", - "reference": "ec7383f25642e6fd4bb0c9554fc2311245391781" + "reference": "e7381ef7643f658b87efb7dbe98fe538fb1bbf32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/ec7383f25642e6fd4bb0c9554fc2311245391781", - "reference": "ec7383f25642e6fd4bb0c9554fc2311245391781", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/e7381ef7643f658b87efb7dbe98fe538fb1bbf32", + "reference": "e7381ef7643f658b87efb7dbe98fe538fb1bbf32", "shasum": "" }, "require": { @@ -5262,7 +5269,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem-local/issues", - "source": "https://github.com/thephpleague/flysystem-local/tree/3.16.0" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.18.0" }, "funding": [ { @@ -5274,7 +5281,7 @@ "type": "github" } ], - "time": "2023-08-30T10:23:59+00:00" + "time": "2023-10-19T20:07:13+00:00" }, { "name": "league/geotools", @@ -5644,16 +5651,16 @@ }, { "name": "livewire/livewire", - "version": "v3.0.5", + "version": "v3.0.10", "source": { "type": "git", "url": "https://github.com/livewire/livewire.git", - "reference": "37f11583c61a75d51b2146c2fe38f506ad36014b" + "reference": "cae998aa9a474dc0de81869ab1536014c7b31a64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/livewire/zipball/37f11583c61a75d51b2146c2fe38f506ad36014b", - "reference": "37f11583c61a75d51b2146c2fe38f506ad36014b", + "url": "https://api.github.com/repos/livewire/livewire/zipball/cae998aa9a474dc0de81869ab1536014c7b31a64", + "reference": "cae998aa9a474dc0de81869ab1536014c7b31a64", "shasum": "" }, "require": { @@ -5662,15 +5669,15 @@ "illuminate/validation": "^10.0", "league/mime-type-detection": "^1.9", "php": "^8.1", - "symfony/http-kernel": "^5.0|^6.0" + "symfony/http-kernel": "^6.2" }, "require-dev": { "calebporzio/sushi": "^2.1", "laravel/framework": "^10.0", "laravel/prompts": "^0.1.6", "mockery/mockery": "^1.3.1", - "orchestra/testbench": "^7.0|^8.0", - "orchestra/testbench-dusk": "^7.0|^8.0", + "orchestra/testbench": "^8.0", + "orchestra/testbench-dusk": "^8.0", "phpunit/phpunit": "^9.0", "psy/psysh": "@stable" }, @@ -5706,7 +5713,7 @@ "description": "A front-end framework for Laravel.", "support": { "issues": "https://github.com/livewire/livewire/issues", - "source": "https://github.com/livewire/livewire/tree/v3.0.5" + "source": "https://github.com/livewire/livewire/tree/v3.0.10" }, "funding": [ { @@ -5714,7 +5721,7 @@ "type": "github" } ], - "time": "2023-09-16T11:51:32+00:00" + "time": "2023-10-18T11:18:12+00:00" }, { "name": "madnest/madzipper", @@ -5921,16 +5928,16 @@ }, { "name": "monolog/monolog", - "version": "3.4.0", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "e2392369686d420ca32df3803de28b5d6f76867d" + "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/e2392369686d420ca32df3803de28b5d6f76867d", - "reference": "e2392369686d420ca32df3803de28b5d6f76867d", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c915e2634718dbc8a4a15c61b0e62e7a44e14448", + "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448", "shasum": "" }, "require": { @@ -6006,7 +6013,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.4.0" + "source": "https://github.com/Seldaek/monolog/tree/3.5.0" }, "funding": [ { @@ -6018,7 +6025,7 @@ "type": "tidelift" } ], - "time": "2023-06-21T08:46:11+00:00" + "time": "2023-10-27T15:32:31+00:00" }, { "name": "myclabs/deep-copy", @@ -6290,16 +6297,16 @@ }, { "name": "nette/utils", - "version": "v4.0.2", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "cead6637226456b35e1175cc53797dd585d85545" + "reference": "a9d127dd6a203ce6d255b2e2db49759f7506e015" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/cead6637226456b35e1175cc53797dd585d85545", - "reference": "cead6637226456b35e1175cc53797dd585d85545", + "url": "https://api.github.com/repos/nette/utils/zipball/a9d127dd6a203ce6d255b2e2db49759f7506e015", + "reference": "a9d127dd6a203ce6d255b2e2db49759f7506e015", "shasum": "" }, "require": { @@ -6370,9 +6377,9 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.2" + "source": "https://github.com/nette/utils/tree/v4.0.3" }, - "time": "2023-09-19T11:58:07+00:00" + "time": "2023-10-29T21:02:13+00:00" }, { "name": "nikic/php-parser", @@ -9643,16 +9650,16 @@ }, { "name": "symfony/html-sanitizer", - "version": "v6.3.4", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/html-sanitizer.git", - "reference": "947492c7351d6b01a7b38e515c98fb1107dc357d" + "reference": "45e5a24b63d394fa6472c595df448aecfd1e1ea5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/html-sanitizer/zipball/947492c7351d6b01a7b38e515c98fb1107dc357d", - "reference": "947492c7351d6b01a7b38e515c98fb1107dc357d", + "url": "https://api.github.com/repos/symfony/html-sanitizer/zipball/45e5a24b63d394fa6472c595df448aecfd1e1ea5", + "reference": "45e5a24b63d394fa6472c595df448aecfd1e1ea5", "shasum": "" }, "require": { @@ -9692,7 +9699,7 @@ "sanitizer" ], "support": { - "source": "https://github.com/symfony/html-sanitizer/tree/v6.3.4" + "source": "https://github.com/symfony/html-sanitizer/tree/v6.3.7" }, "funding": [ { @@ -9708,7 +9715,7 @@ "type": "tidelift" } ], - "time": "2023-08-23T13:34:34+00:00" + "time": "2023-10-27T13:27:27+00:00" }, { "name": "symfony/http-client", @@ -9882,16 +9889,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "b50f5e281d722cb0f4c296f908bacc3e2b721957" + "reference": "59d1837d5d992d16c2628cd0d6b76acf8d69b33e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b50f5e281d722cb0f4c296f908bacc3e2b721957", - "reference": "b50f5e281d722cb0f4c296f908bacc3e2b721957", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/59d1837d5d992d16c2628cd0d6b76acf8d69b33e", + "reference": "59d1837d5d992d16c2628cd0d6b76acf8d69b33e", "shasum": "" }, "require": { @@ -9901,12 +9908,12 @@ "symfony/polyfill-php83": "^1.27" }, "conflict": { - "symfony/cache": "<6.2" + "symfony/cache": "<6.3" }, "require-dev": { - "doctrine/dbal": "^2.13.1|^3.0", + "doctrine/dbal": "^2.13.1|^3|^4", "predis/predis": "^1.1|^2.0", - "symfony/cache": "^5.4|^6.0", + "symfony/cache": "^6.3", "symfony/dependency-injection": "^5.4|^6.0", "symfony/expression-language": "^5.4|^6.0", "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", @@ -9939,7 +9946,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.3.5" + "source": "https://github.com/symfony/http-foundation/tree/v6.3.7" }, "funding": [ { @@ -9955,20 +9962,20 @@ "type": "tidelift" } ], - "time": "2023-09-04T21:33:54+00:00" + "time": "2023-10-28T23:55:27+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "9f991a964368bee8d883e8d57ced4fe9fff04dfc" + "reference": "6d4098095f93279d9536a0e9124439560cc764d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/9f991a964368bee8d883e8d57ced4fe9fff04dfc", - "reference": "9f991a964368bee8d883e8d57ced4fe9fff04dfc", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6d4098095f93279d9536a0e9124439560cc764d0", + "reference": "6d4098095f93279d9536a0e9124439560cc764d0", "shasum": "" }, "require": { @@ -10052,7 +10059,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.3.5" + "source": "https://github.com/symfony/http-kernel/tree/v6.3.7" }, "funding": [ { @@ -10068,7 +10075,7 @@ "type": "tidelift" } ], - "time": "2023-09-30T06:37:04+00:00" + "time": "2023-10-29T14:31:45+00:00" }, { "name": "symfony/mailer", @@ -11751,16 +11758,16 @@ }, { "name": "symfony/serializer", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "855fc058c8bdbb69f53834f2fdb3876c9bc0ab7c" + "reference": "641472dd3d6dc3c4d0fdd1496ebd1b55c72e43d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/855fc058c8bdbb69f53834f2fdb3876c9bc0ab7c", - "reference": "855fc058c8bdbb69f53834f2fdb3876c9bc0ab7c", + "url": "https://api.github.com/repos/symfony/serializer/zipball/641472dd3d6dc3c4d0fdd1496ebd1b55c72e43d9", + "reference": "641472dd3d6dc3c4d0fdd1496ebd1b55c72e43d9", "shasum": "" }, "require": { @@ -11825,7 +11832,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v6.3.5" + "source": "https://github.com/symfony/serializer/tree/v6.3.7" }, "funding": [ { @@ -11841,7 +11848,7 @@ "type": "tidelift" } ], - "time": "2023-09-29T16:18:53+00:00" + "time": "2023-10-26T18:15:14+00:00" }, { "name": "symfony/service-contracts", @@ -12014,16 +12021,16 @@ }, { "name": "symfony/translation", - "version": "v6.3.3", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd" + "reference": "30212e7c87dcb79c83f6362b00bde0e0b1213499" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd", - "reference": "3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd", + "url": "https://api.github.com/repos/symfony/translation/zipball/30212e7c87dcb79c83f6362b00bde0e0b1213499", + "reference": "30212e7c87dcb79c83f6362b00bde0e0b1213499", "shasum": "" }, "require": { @@ -12089,7 +12096,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.3.3" + "source": "https://github.com/symfony/translation/tree/v6.3.7" }, "funding": [ { @@ -12105,7 +12112,7 @@ "type": "tidelift" } ], - "time": "2023-07-31T07:08:24+00:00" + "time": "2023-10-28T23:11:45+00:00" }, { "name": "symfony/translation-contracts", @@ -12261,16 +12268,16 @@ }, { "name": "symfony/var-dumper", - "version": "v6.3.5", + "version": "v6.3.6", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "3d9999376be5fea8de47752837a3e1d1c5f69ef5" + "reference": "999ede244507c32b8e43aebaa10e9fce20de7c97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3d9999376be5fea8de47752837a3e1d1c5f69ef5", - "reference": "3d9999376be5fea8de47752837a3e1d1c5f69ef5", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/999ede244507c32b8e43aebaa10e9fce20de7c97", + "reference": "999ede244507c32b8e43aebaa10e9fce20de7c97", "shasum": "" }, "require": { @@ -12325,7 +12332,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.3.5" + "source": "https://github.com/symfony/var-dumper/tree/v6.3.6" }, "funding": [ { @@ -12341,7 +12348,7 @@ "type": "tidelift" } ], - "time": "2023-09-12T10:11:35+00:00" + "time": "2023-10-12T18:45:56+00:00" }, { "name": "symfony/yaml", diff --git a/resources/views/filament/pages/finances.blade.php b/resources/views/filament/pages/finances.blade.php new file mode 100644 index 000000000..9d044d217 --- /dev/null +++ b/resources/views/filament/pages/finances.blade.php @@ -0,0 +1,16 @@ + + {{ $this->form }} + + @livewire(\App\Filament\Widgets\AirlineFinanceChart::class, [ + 'airline_id' => $this->filters['airline_id'], + 'start_date' => $this->filters['start_date'], + 'end_date' => $this->filters['end_date'], + ]) + + @livewire(\App\Filament\Widgets\AirlineFinanceTable::class, [ + 'airline_id' => $this->filters['airline_id'], + 'start_date' => $this->filters['start_date'], + 'end_date' => $this->filters['end_date'], + ]) + + diff --git a/resources/views/filament/widgets/airline_finance_table.blade.php b/resources/views/filament/widgets/airline_finance_table.blade.php new file mode 100644 index 000000000..63c006253 --- /dev/null +++ b/resources/views/filament/widgets/airline_finance_table.blade.php @@ -0,0 +1,55 @@ + + + + Expense + Credit + Debit + + + @foreach($transactions as $ta) + + +
+
+
+
+ {{ $ta->transaction_group }} +
+
+
+
+
+ + +
+
+
+
+ {{ money($ta->sum_credits ?? 0, $ta->currency) }} +
+
+
+
+
+ + +
+
+
+
+ {{ money($ta->sum_debits ?? 0, $ta->currency) }} +
+
+
+
+
+
+ @endforeach + + + Total + {{ money($sum_all_credits, setting('units.currency')) }} + {{ money($sum_all_debits, setting('units.currency')) }} + +
+