diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 815e0d20..72869440 100755 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -2,6 +2,7 @@ namespace App\Console; +use App\Console\Commands\ManageDataTelescopeCommand; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; @@ -42,6 +43,11 @@ class Kernel extends ConsoleKernel $schedule->command("db:backup") ->weekly()->at('03:00')->appendOutputTo(storage_path('logs/mariadb-backup.log')); + + $schedule->command('telescope:prune --hours=48') + ->dailyAt('04:00') + ->appendOutputTo(storage_path('logs/telescope.log')); + } /** diff --git a/app/Http/Controllers/V3/Dashboard/Accident/AccidentReceiptController.php b/app/Http/Controllers/V3/Dashboard/Accident/AccidentReceiptController.php index eeece69e..ce0ae4a6 100644 --- a/app/Http/Controllers/V3/Dashboard/Accident/AccidentReceiptController.php +++ b/app/Http/Controllers/V3/Dashboard/Accident/AccidentReceiptController.php @@ -254,7 +254,7 @@ class AccidentReceiptController extends Controller { DB::transaction(function () use ($request, $accident) { - $final_amount = $accident->driver_share_amount - ($accident->deposit_insurance_amount + $accident->deposit_daghi_amount); + $final_amount = $accident->driver_share_amount - ($request->deposit_insurance_amount + $request->deposit_daghi_amount); throw_if($final_amount < 0, new ProhibitedAction('مبالغ داغی و بیمه از مبلغ کل بیشتر می باشد.')); diff --git a/config/logging.php b/config/logging.php index 3a6fc052..972f7be3 100644 --- a/config/logging.php +++ b/config/logging.php @@ -141,5 +141,11 @@ return [ 'path' => storage_path('logs/mariadb-backup.log'), 'level' => 'info', ], + + 'telescope' => [ + 'driver' => 'single', + 'path' => storage_path('logs/telescope.log'), + 'level' => 'info', + ], ], ];