mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-19 04:23:59 +00:00
fix export arrival list
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Models\CompanyModule;
|
||||
use App\Models\PackingList;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
@@ -56,8 +55,7 @@ class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping,
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ReturnArray $returnArray
|
||||
*
|
||||
* @param $package
|
||||
* @return array
|
||||
*/
|
||||
public function map($package): array
|
||||
@@ -65,19 +63,10 @@ class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping,
|
||||
$packingList = $package->packingList;
|
||||
$order = $packingList->owner;
|
||||
|
||||
if($order instanceof CompanyModule){
|
||||
$companyModule = $order;
|
||||
$warehouse = $packingList->claimant_id;
|
||||
} else {
|
||||
$companyModule = $order->companyModule->first();
|
||||
$warehouse = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->reference;
|
||||
}
|
||||
|
||||
|
||||
$connection = $companyModule->inviters()->withPivot('invitee_reference')->first();
|
||||
$connection = $order->companyModule()->first()->inviters()->withPivot('invitee_reference')->first();
|
||||
$marking = $connection ? $connection->pivot->invitee_reference:'';
|
||||
|
||||
|
||||
$warehouse = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee;
|
||||
|
||||
$cbm = (($package->width / 100) * ($package->height / 100) * ($package->length / 100)) * $package->quantity;
|
||||
|
||||
@@ -86,7 +75,7 @@ class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping,
|
||||
return [
|
||||
$packingList->owner->reference,
|
||||
$marking,
|
||||
$warehouse,
|
||||
$warehouse->reference,
|
||||
$cbm,
|
||||
$package->description,
|
||||
$package->quantity,
|
||||
|
||||
Reference in New Issue
Block a user