From d0590411c49d256520c55705b1dacebb51958fbe Mon Sep 17 00:00:00 2001 From: PixelTux Date: Sat, 16 Nov 2024 17:15:47 +0100 Subject: [PATCH 1/3] gestione null di gas durante la prima installazione --- code/app/Helpers/Permissions.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/app/Helpers/Permissions.php b/code/app/Helpers/Permissions.php index a37639e7..3f9a2c4d 100644 --- a/code/app/Helpers/Permissions.php +++ b/code/app/Helpers/Permissions.php @@ -42,10 +42,13 @@ function allPermissions() */ try { $gas = currentAbsoluteGas(); - $gas = $gas->fresh(); - if ($gas->multigas) { - $ret['App\Gas']['gas.multi'] = _i('Amministrare la modalità Multi-GAS su questa istanza'); + if (isset($gas)) { + $gas = $gas->fresh(); + + if ($gas->multigas) { + $ret['App\Gas']['gas.multi'] = _i('Amministrare la modalità Multi-GAS su questa istanza'); + } } } catch(\Exception $e) { From eddf5c2436f0610c682fe7c0096f83ec13029f9f Mon Sep 17 00:00:00 2001 From: Roberto Guido Date: Sun, 17 Nov 2024 00:55:32 +0100 Subject: [PATCH 2/3] fix job invio notifica reminder --- code/app/Jobs/NotifyRemindOrder.php | 42 +++++++++++++++-------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/code/app/Jobs/NotifyRemindOrder.php b/code/app/Jobs/NotifyRemindOrder.php index d3705125..10844e7f 100644 --- a/code/app/Jobs/NotifyRemindOrder.php +++ b/code/app/Jobs/NotifyRemindOrder.php @@ -25,9 +25,6 @@ public function __construct($orders_id) public function handle() { $hub = app()->make('GlobalScopeHub'); - $gas = $hub->getGasObj(); - - $aggregate_users = []; foreach($this->orders_id as $order_id) { $order = Order::find($order_id); @@ -36,26 +33,31 @@ public function handle() continue; } - $users = $order->notifiableUsers($gas); + foreach($order->aggregate->gas as $gas) { + $hub->setGas($gas->id); - foreach($users as $user) { - if (isset($aggregate_users[$user->id]) == false) { - $aggregate_users[$user->id] = (object) [ - 'user' => $user, - 'orders' => [], - ]; - } + $aggregate_users = []; + $users = $order->notifiableUsers($gas); - $aggregate_users[$user->id]->orders[] = $order; - } - } + foreach($users as $user) { + if (isset($aggregate_users[$user->id]) == false) { + $aggregate_users[$user->id] = (object) [ + 'user' => $user, + 'orders' => [], + ]; + } - foreach($aggregate_users as $auser) { - try { - $auser->user->notify(new RemindOrderNotification($auser->orders)); - } - catch(\Exception $e) { - \Log::error('Impossibile inoltrare mail di promemoria ordine: ' . $e->getMessage()); + $aggregate_users[$user->id]->orders[] = $order; + } + + foreach($aggregate_users as $auser) { + try { + $auser->user->notify(new RemindOrderNotification($auser->orders)); + } + catch(\Exception $e) { + \Log::error('Impossibile inoltrare mail di promemoria ordine: ' . $e->getMessage()); + } + } } } } From c4246679985a2e6aead87919725d2572e395b63b Mon Sep 17 00:00:00 2001 From: Roberto Guido Date: Sun, 17 Nov 2024 01:10:18 +0100 Subject: [PATCH 3/3] identificativo in importazione movimenti. closes #292 --- code/resources/views/import/csvmovementsselect.blade.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/resources/views/import/csvmovementsselect.blade.php b/code/resources/views/import/csvmovementsselect.blade.php index 456823d3..8eb6fdbb 100644 --- a/code/resources/views/import/csvmovementsselect.blade.php +++ b/code/resources/views/import/csvmovementsselect.blade.php @@ -49,6 +49,7 @@ {{ _i('Data') }} {{ _i('Utente') }} {{ _i('Fornitore') }} + {{ _i('Identificativo') }} {{ _i('Note') }} @@ -78,6 +79,9 @@ + + + @@ -91,7 +95,6 @@ {{ printablePriceCurrency($mov->amount) }} -