diff --git a/app/Classes/Modules/Exports/Services/ExportsPendingArrangementDeliveryList.php b/app/Classes/Modules/Exports/Services/ExportsPendingArrangementDeliveryList.php
new file mode 100644
index 00000000..bd46f9d0
--- /dev/null
+++ b/app/Classes/Modules/Exports/Services/ExportsPendingArrangementDeliveryList.php
@@ -0,0 +1,81 @@
+whereHas('containers', function ($query){
+ $query->where('containers.status', ApprovalStatus::COMPLETED);
+ })->whereDoesntHave('transports');
+ }
+
+ /**
+ * @param PackingList $packingList
+ *
+ * @return array
+ */
+ public function map($packingList): array
+ {
+ $container = $packingList->containers()->first();
+ $ContainerTransport = $container->transports()->first();
+ $order = $packingList->owner;
+ $marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
+ $address = $order->addresses()->where('status', ApprovalStatus::APPROVED)->first();
+ $contacts = $address->contacts->first() ? $address->contacts->first(): '';
+ $originalPackingList = $packingList->owner instanceof PackingList ? $packingList->owner : $packingList;
+ $transport = $originalPackingList->containers()->first()->transports()->first();
+
+ return [
+ $container->reference,
+ $ContainerTransport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()->eta,
+ $ContainerTransport->drop_date,
+ $marking,
+ $order->reference,
+ $transport ? Carbon::now()->diffInDays($transport->drop_date, false) . ' Days' : '',
+ $packingList->packages()->sum('quantity'),
+ $address->state->name,
+ $address->postcode,
+ $address->street_one.', '.$address->street_two.' '.$address->district->name.' '.$address->postcode.' '.$address->state->name.' '.$address->country->name,
+ $address->remarks->first() ? $address->remarks->first()->content: '',
+ $contacts ? $contacts ->reference : '',
+ $contacts ? $contacts ->phone : '',
+ ];
+ }
+}
\ No newline at end of file
diff --git a/app/Http/Controllers/Exports/ExportPendingArrangementPackingListController.php b/app/Http/Controllers/Exports/ExportPendingArrangementPackingListController.php
new file mode 100644
index 00000000..8575e88c
--- /dev/null
+++ b/app/Http/Controllers/Exports/ExportPendingArrangementPackingListController.php
@@ -0,0 +1,29 @@
+headers->set('Authorization', 'Bearer '.$token);
+ }
+
+ public function export(Request $request) {
+ $exportsPendingArrangementDeliveryList = new ExportsPendingArrangementDeliveryList($request);
+ $response = $exportsPendingArrangementDeliveryList->download('pending-arrangement-packing-list.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
+ ob_end_clean();
+ return $response;
+ }
+}
diff --git a/app/Http/Resources/TransportResource.php b/app/Http/Resources/TransportResource.php
index 2677782f..c69bfd06 100644
--- a/app/Http/Resources/TransportResource.php
+++ b/app/Http/Resources/TransportResource.php
@@ -16,6 +16,7 @@ class TransportResource extends JsonResource
*/
public function toArray($request)
{
+ $currentSchedule = $this->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first();
return [
'id' => $this->id,
'type' => $this->type,
@@ -24,9 +25,10 @@ class TransportResource extends JsonResource
'dispatch_date' => $this->dispatch_date ? $this->dispatch_date->format('d-m-Y') : $this->dispatch_date,
'drop_date' => $this->drop_date ? $this->drop_date->format('d-m-Y') : $this->drop_date,
'status' => $this->status,
- 'current_schedule' => new ScheduleResource($this->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()),
+ 'current_schedule' => new ScheduleResource($currentSchedule),
'schedule_history' => ScheduleResource::collection($this->schedules()->where('status', '=', ApprovalStatus::EXPIRED)->get()),
- 'dropped_days' => Carbon::now()->diffInDays($this->drop_date, false)
+ 'dropped_days' => Carbon::now()->diffInDays($this->drop_date, false),
+ 'schedule_complete' => $currentSchedule ? $currentSchedule->eta <= Carbon::now() : false
];
}
}
diff --git a/resources/assets/vue/components/companies/sections/CustomerProfileSectionComponent.vue b/resources/assets/vue/components/companies/sections/CustomerProfileSectionComponent.vue
index 7d943d0b..1a148c73 100644
--- a/resources/assets/vue/components/companies/sections/CustomerProfileSectionComponent.vue
+++ b/resources/assets/vue/components/companies/sections/CustomerProfileSectionComponent.vue
@@ -6,37 +6,6 @@
[清明节仓库放假通知 Qing Ming Warehouse Holiday Notice]
-
- 尊敬的客户们:
-
- 仓库将为 2022年清明节假期做出如下安排 :
-
- 广州仓库 : 2022 年 4月 4日 - 2022 年 4月 5日 (4月6日复工)
- 义乌仓库 : 2022 年 4月 3日 - 2022 年 4月 4日 (4月5日复工)
-
- *放假期间没有仓库人员值班, 请大家安排好送货时间, 感谢
-
- Dear Customers :
-
- Our warehouse holiday for Qing Ming is as below :
-
- Guangzhou : 4 April 2022 - 5 April 2022 (Resume date : 6 April)
- Yiwu : 3 April 2022 - 4 April 2022 (Resume date : 5 April)
-
- *Warehouse personnel are on leave during the holiday period, please arrange delivery date in advance, thank you
{{status}}
+{{item.container ? item.container.transport.schedule_complete && status === 'Shipping' ? 'Custom Clearance' : status : status}}