Skip to content

Commit

Permalink
fix: Index Retina Pallet Return: show more data
Browse files Browse the repository at this point in the history
  • Loading branch information
aqordeon committed Feb 14, 2025
1 parent 12aae38 commit 826d208
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ public function tableStructure(FulfilmentCustomer $parent, ?array $modelOperatio
->withModelOperations($modelOperations)
->withGlobalSearch()
->column(key: 'state', label: ['fal', 'fa-yin-yang'], type: 'icon')
->column(key: 'type', label: __('type'), canBeHidden: false, type: 'icon')
->column(key: 'created_at', label: __('Created at'), canBeHidden: false, type: 'date')
->column(key: 'reference', label: __('reference number'), canBeHidden: false, sortable: true, searchable: true)
->column(key: 'pallets', label: __('pallets'), canBeHidden: false, sortable: true, searchable: true);
->column(key: 'customer', label: __('Customer'), canBeHidden: false, sortable: true, searchable: true)
->column(key: 'pallets', label: __('pallets'), canBeHidden: false, sortable: true, searchable: true, type: 'number')
->column(key: 'total_amount', label: __('total amount'), canBeHidden: false, sortable: false, searchable: false, type: 'currency');
};
}

Expand Down Expand Up @@ -120,6 +122,7 @@ public function htmlResponse(LengthAwarePaginator $palletReturns, ActionRequest
'title' => __('returns'),
'pageHead' => [
'title' => __('returns'),
'model' => __('storage'),
'icon' => [
'icon' => ['fal', 'fa-truck-ramp'],
'title' => __('return')
Expand Down
8 changes: 6 additions & 2 deletions app/Http/Resources/Fulfilment/PalletReturnsResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ public function toArray($request): array
{
/** @var \App\Models\Fulfilment\PalletReturn $palletReturn */
$palletReturn = $this;

// dd($this->fulfilmentCustomer->customer->contact_name);
return [
'id' => $palletReturn->id,
'created_at' => $palletReturn->created_at,
'slug' => $palletReturn->slug,
'reference' => $palletReturn->reference,
'state' => $palletReturn->state,
Expand All @@ -31,7 +32,10 @@ public function toArray($request): array
'number_pallets' => $palletReturn->stats->number_pallets,
'number_services' => $palletReturn->stats->number_services,
'number_physical_goods' => $palletReturn->stats->number_physical_goods,
'dispatched_at' => $palletReturn->dispatched_at
'dispatched_at' => $palletReturn->dispatched_at,
'total_amount' => $palletReturn->total_amount,
'currency_code' => $palletReturn->currency->code,
'customer' => $palletReturn->fulfilmentCustomer->customer,
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Icon from "@/Components/Icon.vue"
import { inject } from "vue"
import { layoutStructure } from "@/Composables/useLayoutStructure"
import { useFormatTime } from "@/Composables/useFormatTime"
import AddressLocation from "@/Components/Elements/Info/AddressLocation.vue"

library.add(faPlus)

Expand Down Expand Up @@ -126,12 +127,17 @@ function storedItemReturnRoute(palletReturn: PalletDelivery) {

<!-- Column: State -->
<template #cell(state)="{ item: palletReturn }">
<Icon :data="palletReturn['type_icon']" class="px-1"/>
<TagPallet v-if="layout.app.name == 'retina'" :stateIcon="palletReturn.state_icon" />
<Icon v-else :data="palletReturn['state_icon']" class="px-1"/>
</template>

<template #cell(type)="{ item: palletReturn }">
<Icon :data="palletReturn['type_icon']" class="px-1"/>
<template #cell(customer)="{ item: palletReturn }">
{{ palletReturn.customer.contact_name || '-' }} <span v-if="palletReturn.customer.company_name">({{ palletReturn.customer.company_name }})</span>
<span class="text-xs text-gray-500">
<AddressLocation :data="palletReturn.customer.location" />
</span>
<!-- <pre>{{ palletReturn.customer }}</pre> -->
</template>

<!-- Column: Pallets -->
Expand Down

0 comments on commit 826d208

Please sign in to comment.