Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Jun 25, 2024
2 parents 3c643fc + 7b51dbd commit 7f57c68
Show file tree
Hide file tree
Showing 33 changed files with 2,833 additions and 3,876 deletions.
4 changes: 3 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class Kernel extends ConsoleKernel
protected function schedule(Schedule $schedule): void
{
$schedule->command('model:prune')
->daily();
->daily()
->onOneServer()
->sentryMonitor('model-prune');

$schedule->job(ProcessAuthorizedTransactionsJob::class)
->everyFourHours()
Expand Down
24 changes: 8 additions & 16 deletions app/Filament/Widgets/StatisticsCards.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,10 @@ private function getProjectCard(string $cardLabel): Card
$color = $currentGrandThanLast ? 'success' : 'danger';
$icon = $currentGrandThanLast ? 'heroicon-s-trending-up' : 'heroicon-s-trending-down';

$description = $cardLabel === 'year' ?
(
$currentGrandThanLast ?
__('statistics.labels.current_year_grand_than_last_year', ['number' => $currentAvg - $lastAvg]) :
__('statistics.labels.current_year_less_than_last_year', ['number' => $lastAvg - $currentAvg])
) :
(
$currentGrandThanLast ?
__('statistics.labels.current_month_grand_than_last_month', ['number' => $currentAvg - $lastAvg]) :
__('statistics.labels.current_month_less_than_last_month', ['number' => $lastAvg - $currentAvg])
);
$diffPercent = round(($currentAvg * 100 / $lastAvg) - 100, 2);
$description = $cardLabel === 'year'
? __('statistics.labels.current_year_vs_last_year', ['number' => $diffPercent])
: __('statistics.labels.current_month_vs_last_month', ['number' => $diffPercent]);

$chart = array_map(function () use ($currentAvg, $lastAvg) {
return rand(min((int) $currentAvg, (int) $lastAvg), max((int) $currentAvg, (int) $lastAvg));
Expand Down Expand Up @@ -118,14 +111,13 @@ private function getDonationCard(string $string)
$color = $currentGrandThanLast ? 'success' : 'danger';
$icon = $currentGrandThanLast ? 'heroicon-s-trending-up' : 'heroicon-s-trending-down';

$description =
$currentGrandThanLast ?
__('statistics.labels.donation_grand_than_last_year', ['amount' => $currentYear - $lastYear]) :
__('statistics.labels.donation_less_than_last_year', ['amount' => $lastYear - $currentYear]);
$diffPercent = round(($currentYear * 100 / $lastYear) - 100, 2);

$description = __('statistics.labels.donation_vs_last_year', ['amount' => $diffPercent]);

return Card::make(
__('statistics.labels.donations_amount'),
__('statistics.labels.amount_in_currency', ['amount' => $currentYear])
__('statistics.labels.amount_in_currency', ['amount' => number_format($currentYear)])
)
->descriptionColor($color)
->descriptionIcon($icon)
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/Dashboard/DonationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public function index(Request $request): Response
$dates = $donations
->pluck('created_at')
->map(fn ($date) => $date->format('Y-m'))
->unique();
->unique()
->values();

return Inertia::render('AdminOng/Donations/Index', [
'filter' => $request->query('filter'),
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"laravel/framework": "^10.20",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8",
"league/flysystem-aws-s3-v3": "^3.15",
"league/flysystem-aws-s3-v3": "^3.28",
"pxlrbt/filament-excel": "^1.1",
"sentry/sentry-laravel": "^3.8",
"spatie/laravel-activitylog": "^4.7",
Expand All @@ -36,7 +36,7 @@
"tpetry/laravel-query-expressions": "^1.1"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.9",
"barryvdh/laravel-debugbar": "^3.13",
"barryvdh/laravel-ide-helper": "^2.13",
"doctrine/dbal": "^3.6",
"fakerphp/faker": "^1.9",
Expand All @@ -48,7 +48,7 @@
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^7.8",
"phpunit/phpunit": "^10.3",
"spatie/laravel-ignition": "^2.3"
"spatie/laravel-ignition": "^2.8"
},
"autoload": {
"files": [
Expand Down
Loading

0 comments on commit 7f57c68

Please sign in to comment.