Skip to content

Commit

Permalink
Merge branch 'master' into aggregations
Browse files Browse the repository at this point in the history
  • Loading branch information
madbob committed Nov 9, 2024
2 parents 4c54912 + fdbee47 commit 4fc4066
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
7 changes: 5 additions & 2 deletions code/app/Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
use Illuminate\Database\Eloquent\Relations\MorphTo;
use GeneaLabs\LaravelModelCaching\Traits\Cachable;

use Log;
use Auth;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Auth;

/**
@property-read Gas|Invoice|Notification|Order|Supplier|null $attached
*/
class Attachment extends Model
{
use GASModel, Cachable;
Expand Down
3 changes: 3 additions & 0 deletions code/app/Balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
use Illuminate\Database\Eloquent\Relations\MorphTo;
use GeneaLabs\LaravelModelCaching\Traits\Cachable;

/**
@property-read Booking|Gas|Invoice|Order|Supplier|null $target
*/
class Balance extends Model
{
use Cachable;
Expand Down
3 changes: 3 additions & 0 deletions code/app/ModifiedValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Illuminate\Support\Facades\Log;
use Carbon\Carbon;

/**
@property-read BookedProduct|Booking|null $target
*/
class ModifiedValue extends Model
{
public function modifier(): BelongsTo
Expand Down
3 changes: 3 additions & 0 deletions code/app/Modifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

use App\Models\Concerns\TracksUpdater;

/**
@property-read Aggregate|Delivery|Order|Product|Supplier|null $target
*/
class Modifier extends Model
{
use GASModel, TracksUpdater, Cachable;
Expand Down
10 changes: 6 additions & 4 deletions code/app/Services/NotificationsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace App\Services;

use Illuminate\Support\Collection;

use App\Exceptions\AuthException;
use App\Notification;
use App\Date;
Expand Down Expand Up @@ -30,7 +32,7 @@ public function list($start, $end)
});
}

$notifications = collect($notifications_query->get()->all());
$notifications = $notifications_query->get();

$dates_query = Date::where('type', 'internal')->where('target_type', GAS::class)->where('target_id', $user->gas->id);

Expand All @@ -44,11 +46,11 @@ public function list($start, $end)

$dates = $dates_query->get();

$all = $notifications->merge($dates)->sort(function($a, $b) {
$all = new Collection();

return $all->concat($notifications)->concat($dates)->sort(function($a, $b) {
return $b->sorting_date <=> $a->sorting_date;
});

return $all;
}

public function show($id)
Expand Down
3 changes: 3 additions & 0 deletions code/resources/views/import/csvimportmovementsfinal.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<th>{{ _i('Valore') }}</th>
<th>{{ _i('Pagante') }}</th>
<th>{{ _i('Pagato') }}</th>
<th>{{ _i('Identificativo') }}</th>
</tr>
</thead>
<tbody>
Expand All @@ -33,6 +34,8 @@
{{ $m->target->printableName() }}
@endif
</td>

<td>{{ $m->identifier }}</td>
</tr>
@endforeach
</tbody>
Expand Down

0 comments on commit 4fc4066

Please sign in to comment.