From b0eea1a30f873124b51e2521b6a4272a53a49849 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 10 Jun 2015 14:38:25 +0300 Subject: [PATCH] Bug fixes --- app/Console/Commands/CheckData.php | 20 +------------------ config/former.php | 2 +- .../views/reports/chart_builder.blade.php | 2 +- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 2974316124..292ba0a9f3 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -49,24 +49,6 @@ class CheckData extends Command { $today = new DateTime(); if (!$this->option('client_id')) { - // update client deletion activities with the client's current balance - $activities = DB::table('activities') - ->join('clients', 'clients.id', '=', 'activities.client_id') - ->where('activities.activity_type_id', '=', ACTIVITY_TYPE_DELETE_CLIENT) - ->where('activities.balance', '=', 0) - ->where('clients.balance', '!=', 0) - ->get(['activities.id', 'clients.balance']); - - $this->info(count($activities) . ' delete client activities with zero balance'); - - if ($this->option('fix') == 'true') { - foreach ($activities as $activity) { - DB::table('activities') - ->where('id', $activity->id) - ->update(['balance' => $activity->balance]); - } - } - // update client paid_to_date value $clients = DB::table('clients') ->join('payments', 'payments.client_id', '=', 'clients.id') @@ -77,7 +59,7 @@ class CheckData extends Command { ->havingRaw('clients.paid_to_date != sum(payments.amount) and clients.paid_to_date != 999999999.9999') ->get(['clients.id', 'clients.paid_to_date', DB::raw('sum(payments.amount) as amount')]); $this->info(count($clients) . ' clients with incorrect paid to date'); - + if ($this->option('fix') == 'true') { foreach ($clients as $client) { DB::table('clients') diff --git a/config/former.php b/config/former.php index e6f0f3c77c..7279aaf78a 100644 --- a/config/former.php +++ b/config/former.php @@ -39,7 +39,7 @@ 'required_class' => 'required', // A facultative text to append to the labels of required fields - 'required_text' => '*', + 'required_text' => '', // Translations //////////////////////////////////////////////////////////////////// diff --git a/resources/views/reports/chart_builder.blade.php b/resources/views/reports/chart_builder.blade.php index ffe982908d..8275318bd1 100644 --- a/resources/views/reports/chart_builder.blade.php +++ b/resources/views/reports/chart_builder.blade.php @@ -28,7 +28,7 @@
- {!! Former::open()->addClass('warn-on-exit') !!} + {!! Former::open()->rules(['start_date' => 'required', 'end_date' => 'required'])->addClass('warn-on-exit') !!}
{!! Former::text('action') !!}