Skip to content

Commit

Permalink
Show unloaded depot orders
Browse files Browse the repository at this point in the history
  • Loading branch information
OniiCoder committed Feb 26, 2024
1 parent 1c8a68f commit 2055ec6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/views/models/orders/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
>
<option value="0">-- Choose Depot Order --</option>
@foreach($this->allDepotOrders() as $data)
<option value="{{ $data->id }}"> - {{ Carbon::parse($data->order_date)->toFormattedDateString() }} - {{ $data->product->type }} - {{ $data->depot->name }} - {{ number_format($data->volume) }}(LITRES - NGN{{ number_format($data->unit_price) }} / LITRE - Trucking EXP: NGN{{ number_format($data->trucking_expense) }}) | Balance: {{ number_format($this->balance($data->id)) }} LITRES</option>
<option value="{{ $data->id }}"> {{ $data->status }} | {{ Carbon::parse($data->order_date)->toFormattedDateString() }} - {{ $data->product->type }} - {{ $data->depot->name }} - {{ number_format($data->volume) }}(LITRES - NGN{{ number_format($data->unit_price) }} / LITRE - Trucking EXP: NGN{{ number_format($data->trucking_expense) }}) | Balance: {{ number_format($this->balance($data->id)) }} LITRES</option>
@endforeach
</x-fab::forms.select>

Expand Down
2 changes: 1 addition & 1 deletion src/Http/Livewire/OrdersForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public function balance($depotOrderId)

public function allDepotOrders()
{
return DepotOrder::where('status', 'LOADED')->orderBy('created_at', 'desc')->orWhere('id', $this->model->depot_order_id)->get();
return DepotOrder::where('status', 'LOADED')->where('status', 'UNLOADED')->orderBy('created_at', 'desc')->orWhere('id', $this->model->depot_order_id)->get();
}

public function allProducts()
Expand Down

0 comments on commit 2055ec6

Please sign in to comment.