Compare commits

..

19 Commits

Author SHA1 Message Date
edmondlang 86893efe3d update base price date range 2022-04-23 14:59:52 +08:00
edmondlang 3dfec9fd6d update list base price section component 2022-04-22 22:23:35 +08:00
edmondlang 0634fbf78e update constant base price 2022-04-22 21:41:02 +08:00
edmondlang 6375ac753e clean up error in console for settiongs page 2022-04-22 00:23:59 +08:00
edmondlang 3899dd8416 update base price api 2022-04-22 00:18:12 +08:00
edmondlang d0ee2473ac update section name 2022-04-21 22:07:50 +08:00
edmondlang 33124d6588 update declare postcode and implement api 2022-04-21 09:30:56 +08:00
edmondlang 86e257106a add code to check if postcode constant does not exist, insert new postcode constant 2022-04-21 01:13:46 +08:00
edmondlang edb644eaeb remove insert segment if segment does not exist 2022-04-21 01:12:32 +08:00
edmondlang 98dc43d23a update segment constant logic 2022-04-19 20:50:09 +08:00
edmondlang cfd6757a84 tidy up 2022-04-19 15:09:56 +08:00
edmondlang eb31291e25 update warehouse api 2022-04-19 14:57:38 +08:00
edmondlang 7b88fd5c3c update state charges 2022-04-19 13:28:56 +08:00
edmondlang 1814352780 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into api-intergration 2022-04-19 13:26:23 +08:00
edmondlang 5ba46a96a3 api intergration 2022-04-08 21:08:54 +08:00
edmondlang 1c79d88d8d remove service set up and add in base price 2022-04-08 19:05:18 +08:00
edmondlang 029f25a003 update state charges 2022-04-08 18:42:30 +08:00
edmondlang 557881104c implement api for warehouse charges 2022-04-08 18:23:54 +08:00
edmondlang d30dab61ea intergrate api for decalreing postcode area 2022-04-07 23:45:36 +08:00
51 changed files with 1064 additions and 990 deletions
@@ -2,18 +2,19 @@
namespace App\Classes\Modules\Exports\Services;
use App\Models\Order;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\PackingList;
use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Carbon\Carbon;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\RoleTypes;
class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize, FromQuery
class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize, FromCollection
{
use Exportable;
@@ -35,19 +36,31 @@ class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping,
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function query()
public function collection()
{
return PackingList::where('type', '=', 1)->where('status', '=', 2)->where('owner_type', Order::class)->whereHas('transports', function($query){
return $query->where('drop_date', '>=',Carbon::now()->subMonth());
});
$returnArray = collect();
$packingLists = PackingList::where('type', '=', 1)->where('status', '=', 2)->get();
$exceptionUsers = in_array(Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]);
foreach($packingLists as $packingList){
$packages = !$packingList->packingLists()->exists() || $exceptionUsers ? $packingList->packages : $packingList->packingLists->first()->packages;
foreach ($packages as $package) {
$returnArray->push($package);
}
}
return $returnArray;
}
/**
* @param $packingList
* @param ReturnArray $returnArray
*
* @return array
*/
public function map($packingList): array
public function map($package): array
{
$packingList = $package->packingList;
$order = $packingList->owner;
$connection = $order->companyModule()->first()->inviters()->withPivot('invitee_reference')->first();
@@ -55,9 +68,7 @@ class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping,
$warehouse = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee;
$cbm = $packingList->packages->sum(function($package){
return (($package->width / 100) * ($package->height / 100) * ($package->length / 100)) * $package->quantity;
});
$cbm = (($package->width / 100) * ($package->height / 100) * ($package->length / 100)) * $package->quantity;
$arrival_date = $packingList->transports()->first()->drop_date->format('d-m-Y');
@@ -66,8 +77,8 @@ class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping,
$marking,
$warehouse->reference,
$cbm,
$packingList->packages->implode('description', ', '),
$packingList->packages->sum('quantity'),
$package->description,
$package->quantity,
$arrival_date,
''
];
@@ -3,7 +3,6 @@
namespace App\Classes\Modules\Exports\Services;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\Order;
use App\Models\PackingList;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
@@ -47,7 +46,6 @@ class ExportsOnHoldPackingList implements FromQuery, WithHeadings, WithHeadingRo
$container = $packingList->containers()->first();
$ContainerTransport = $container->transports()->first();
$order = $packingList->owner;
if(!$order instanceof Order)return [];
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
return [
@@ -67,7 +67,7 @@ class CreateOrderLogic extends AbstractControllerLogic
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $request->input('warehouse_id')]);
if(!in_array($company->companyModules()->importers()->first()->id, WarehouseReferences::YD_EXEMPT_LIST)){
$originWarehouse = $this->fetchesCompanyModule->execute(['reference' => $originWarehouse->reference === WarehouseReferences::VT_GUANG_ZHOU ? WarehouseReferences::YD_GUANG_ZHOU : WarehouseReferences::YD_YIWU]);
$originWarehouse = $this->fetchesCompanyModule->execute(['reference' => $originWarehouse->reference === WarehouseReferences::VT_GUANG_ZHOU ? WarehouseReferences::YD_GUANG_ZHOU_2 : WarehouseReferences::YD_YIWU]);
}
if($originWarehouse->reference === WarehouseReferences::YD_YIWU && in_array($address->state_id, [5, 13, 14])) {
@@ -126,7 +126,7 @@ class FetchLoadedContainersFromVTPortalProcessor
DB::beginTransaction();
try {
$start = $start ? $start : Carbon::now()->subDays(30);
$start = $start ? $start : Carbon::now()->subDays(10);
$startLimit = Carbon::parse('11-08-2021');
@@ -142,27 +142,27 @@ class FetchLoadedContainersFromVTPortalProcessor
$containers = $this->fetchesDataFRomVTPortal->getResponseBody($containersRequest);
foreach ($containers->Rows as $container){
$filter = '["ContainerID:=%js%'.$container[12].'"]';
$containerDetailRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"ParcelInContainer","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":null,"Filter":'.$filter.'}}'), '');
$filter = '["ContainerID:=%js%'.$container[11].'"]';
$containerDetailRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"CreatedOn asc","Filter":'.$filter.'}}'), '');
$containerDetail = $this->fetchesDataFRomVTPortal->getResponseBody($containerDetailRequest);
$containerObject = new ContainerObject($container[0], str_replace(' ', '', $container[24]), str_replace(' ', '', $container[16]), ContainerTypes::FORTY_FEET_DRY_CONTAINER, Carbon::parse($container[6]), ApprovalStatus::PENDING_VERIFICATION);
$containerObject = new ContainerObject($container[0], str_replace(' ', '', $container[24]), str_replace(' ', '', $container[15]), ContainerTypes::FORTY_FEET_DRY_CONTAINER, Carbon::parse($container[5]), ApprovalStatus::PENDING_VERIFICATION);
try {
$container = $this->fetchesContainer->execute(['reference' => $containerObject->getReference()]);
} catch (ResourceNotFoundException $exception){
$warehouseId = $container[13];
$warehouseId = $container[12];
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $warehouseId === 11 ? 3 : 4]);
$container = $this->createContainerProcessor->execute($containerObject, $originWarehouse);
}
foreach($containerDetail->Rows as $packingList){
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $packingList[39]));
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $packingList[13]));
$orderNumber = $marking[array_key_last($marking)];
if(!$packingList[11]){
if(!$packingList[22]){
continue;
}
@@ -173,7 +173,7 @@ class FetchLoadedContainersFromVTPortalProcessor
continue;
}
$packingListReference = $packingList[6];
$packingListReference = $packingList[16];
try{
$this->fetchesPackingList->execute(['reference' => $packingListReference]);
@@ -136,7 +136,7 @@ class FetchOrderListsFromYdPortalProcessor
public function execute(?Carbon $start = null, ?Carbon $end = null)
{
try {
$start = $start ? $start : Carbon::now()->subMonths(1);
$start = $start ? $start : Carbon::now()->subMonths(2);
$startLimit = Carbon::parse('01-12-2021');
@@ -222,7 +222,7 @@ class FetchOrderListsFromYdPortalProcessor
$unstuffingDate = Carbon::parse($trackingRow->trackingtime);
}
if (Str::contains($trackingRow->tracking, ['派送中', '签收完成', ' 第三方提货', '货物已派送完成'])) {
if (Str::contains($trackingRow->tracking, ['派送中'])) {
$deliveryDate = Carbon::parse($trackingRow->trackingtime);
}
}
@@ -128,18 +128,19 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
$filter = '["ParcelDate:$between$%js%\"'.$start->format('Y-m-d').'T00:00:00.000\"$and$%js%\"'.$end->format('Y-m-d').'T00:00:00.000\"\u0000"]';
$warehouseListRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"Parcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ParcelDate asc","Filter":'.$filter.'}}'), '');
$warehouseListRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"WarehouseList","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ParcelDate asc","Filter":'.$filter.'}}'), '');
$response = $this->fetchesDataFRomVTPortal->getResponseBody($warehouseListRequest);
foreach ($response->Rows as $parcel){
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $parcel[29]));
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $parcel[5]));
$orderNumber = $marking[array_key_last($marking)];
if(!$parcel[3]){
if(!$parcel[9]){
continue;
}
try {
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
} catch (ResourceNotFoundException $exception) {
@@ -175,7 +176,7 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
}
$warehouseId = $parcel[44];
$warehouseId = $parcel[0];
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $warehouseId === 11 ? 3 : 4]);
$order = $this->createOrderProcessor->execute($companyModule->company, $originWarehouse, $address, $orderNumber);
@@ -185,11 +186,11 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
}
$packingListReference = $parcel[0];
$quantity = $parcel[3];
// $measurement = round(($parcel[10]/$quantity) ** (1/3) * 100, 2);
$description = $parcel[31];
$tracking = $parcel[38];
$packingListReference = $parcel[17];
$quantity = $parcel[9];
$measurement = round(($parcel[10]/$quantity) ** (1/3) * 100, 2);
$description = $parcel[7];
$tracking = $parcel[6];
$receiveDate = $parcel[1];
$packingListObject = new PackingListObject($packingListReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->id, PackingListType::WAREHOUSE_RECEIVE_LIST, ApprovalStatus::APPROVED);
@@ -215,7 +216,7 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
$packingList->packages()->delete();
if($replica) $replica->packages()->delete();
$packageObject = new PackageObject(PackageType::CARTON, $description, $parcel[10], $parcel[9], $parcel[8], 0, $quantity, ApprovalStatus::APPROVED);
$packageObject = new PackageObject(PackageType::CARTON, $description, $measurement, $measurement, $measurement, 0, $quantity, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
} catch (\Exception $exception){
@@ -0,0 +1,121 @@
<?php
namespace App\Classes\Modules\Segments\ControllersLogic;
use App\Classes\Exceptions\ResourceNotFoundException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Segments\DataTransferObjects\ConstantObject;
use App\Classes\Modules\Segments\Services\UpdatesBasePriceConstantByDates;
use App\Classes\Modules\Segments\Services\CreatesConstant;
use App\Classes\Modules\Segments\Services\FetchesConstant;
use App\Classes\Modules\Segments\Services\FetchesSegment;
use App\Classes\Modules\Segments\Standards\Rules\CanCreateConstant;
use App\Classes\Modules\Segments\Standards\Rules\CanUpdateConstant;
use App\Classes\Modules\Segments\Services\UpdatesConstant;
use App\Classes\ValueObjects\Constants\SegmentConstants;
use App\Http\Resources\ConstantResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateBasePriceLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Create Base Price',
'message' => 'You have successfully created a Base Price'
];
}
/** @var CanUpdateConstant */
private $canUpdateConstant;
/** @var UpdatesConstant */
private $updatesConstant;
/** @var FetchesSegment */
private $fetchesSegment;
/** @var FetchesConstant */
private $fetchesConstant;
/** @var CanCreateConstant */
private $canCreateConstant;
/** @var CreatesConstant */
private $createsConstant;
/** @var UpdatesBasePriceConstantByDates */
private $updatesBasePriceConstantByDates;
/**
* UpdateConstantLogic constructor.
* @param CanUpdateConstant $canUpdateConstant
* @param UpdatesConstant $updatesConstant
* @param FetchesSegment $fetchesSegment
* @param FetchesConstant $fetchesConstant
* @param CanCreateConstant $canCreateConstant
* @param CreatesConstant $createsConstant
* @param UpdatesBasePriceConstantByDates $updatesBasePriceConstantByDates
*/
public function __construct(
CanUpdateConstant $canUpdateConstant,
UpdatesConstant $updatesConstant,
FetchesSegment $fetchesSegment,
FetchesConstant $fetchesConstant,
CanCreateConstant $canCreateConstant,
CreatesConstant $createsConstant,
UpdatesBasePriceConstantByDates $updatesBasePriceConstantByDates
)
{
$this->canUpdateConstant = $canUpdateConstant;
$this->updatesConstant = $updatesConstant;
$this->fetchesSegment = $fetchesSegment;
$this->fetchesConstant = $fetchesConstant;
$this->canCreateConstant = $canCreateConstant;
$this->createsConstant = $createsConstant;
$this->updatesBasePriceConstantByDates = $updatesBasePriceConstantByDates;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
{
$segment = $this->fetchesSegment->execute(['id' => $request->route('id')]);
try {
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => SegmentConstants::BASE_PRICE]);
} catch (ResourceNotFoundException $exception){
$constantObject = [];
$object = new ConstantObject(
SegmentConstants::BASE_PRICE,
$constantObject
);
$constant = $this->createsConstant->execute($segment, $object);
}
$constantValue = $this->updatesBasePriceConstantByDates->execute($constant->value, $request->input('dateFrom'), $request->input('dateTo'), $request->input('rate'));
$object = new ConstantObject(SegmentConstants::BASE_PRICE, $constantValue);
$this->canUpdateConstant->passes($object);
$constant = $this->updatesConstant->execute($constant, $object);
return $this->resourceResponse(new ConstantResource($constant));
}
}
@@ -0,0 +1,68 @@
<?php
namespace App\Classes\Modules\Segments\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Segments\Services\FetchesConstant;
use App\Classes\ValueObjects\Constants\SegmentConstants;
use App\Http\Resources\ConstantResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Carbon\CarbonPeriod;
class FetchBasePriceLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Retrieved Base Price',
'message' => 'You have successfully retrieved the Base Price'
];
}
/** @var FetchesConstant */
private $fetchesConstant;
/**
* FetchConstantLogic constructor.
* @param FetchesConstant $fetchesConstant
*/
public function __construct(FetchesConstant $fetchesConstant)
{
$this->fetchesConstant = $fetchesConstant;
}
/**
* @param Request $request
* @return JsonResponse
*/
public function logic(Request $request) : JsonResponse
{
$constant = $this->fetchesConstant->execute(['segment_id' => $request->route('id'), 'reference' => SegmentConstants::BASE_PRICE]);
$constantObject = (array) $constant->value;
if ($request->input('dateFrom') !== null && $request->input('dateTo') !== null) {
$period = CarbonPeriod::create($request->input('dateFrom'), $request->input('dateTo'));
$returnObject = [];
foreach ($period as $date) {
array_key_exists($date->format('Y-m-d'), $constantObject) === true ? $returnObject[$date->format('Y-m-d')] = $constantObject[$date->format('Y-m-d')] : '';
}
$constant->value = json_encode($returnObject);
}
return $this->resourceResponse(new ConstantResource($constant));
}
}
@@ -1,145 +0,0 @@
<?php
namespace App\Classes\Modules\Segments\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Segments\Services\ListsSegments;
use App\Http\Resources\AirShipmentItemPriceResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ListAirShipmentPriceLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Retrieved Air Shipment Price List',
'message' => 'You have successfully retrieved a list of Air Shipment Price'
];
}
/** @var ListsSegments */
private $listsSegments;
/**
* ListSegmentLogic constructor.
* @param ListsSegments $listsSegments
*/
public function __construct(ListsSegments $listsSegments)
{
$this->listsSegments = $listsSegments;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function logic(Request $request) : JsonResponse
{
// $query = $this->listsSegments->execute($this->listsSegments->deserializeFilters($request->input('filters')));
// category - Dimension / perKg
$price = array(
[
'details' => json_encode([
'name' => 'Sound system speakers - MINI',
'pricePerKg' => '',
'pricePerPcs' => '',
'isProhibited' => '',
'hasGram' => '',
'hasDimensionCharges' => '',
'tax' => '50',
])
],
[
'details' => json_encode([
'name' => 'Sound system speakers - SMALL',
'pricePerKg' => '',
'pricePerPcs' => '',
'isProhibited' => '',
'hasGram' => '',
'hasDimensionCharges' => '',
'tax' => '200',
])
],
[
'details' => json_encode([
'name' => 'Sound system speakers - LARGE',
'pricePerKg' => '',
'pricePerPcs' => '',
'isProhibited' => '',
'hasGram' => '',
'hasDimensionCharges' => '',
'tax' => '400',
])
],
[
'details' => json_encode([
'name' => 'Washing Machine - Dimension',
'pricePerKg' => '',
'pricePerPcs' => '',
'isProhibited' => '',
'hasGram' => '',
'hasDimensionCharges' => 'true',
'tax' => '',
])
],
[
'details' => json_encode([
'name' => 'Oven, Balnder - perPcs',
'pricePerKg' => '',
'pricePerPcs' => '20',
'isProhibited' => '',
'hasGram' => '',
'hasDimensionCharges' => '',
'tax' => '',
])
],
[
'details' => json_encode([
'name' => 'Perfume - perKg',
'pricePerKg' => '33',
'pricePerPcs' => '',
'isProhibited' => '',
'hasGram' => '',
'hasDimensionCharges' => '',
'tax' => '',
])
],
[
'details' => json_encode([
'name' => 'Gold - Prohibited',
'pricePerKg' => '',
'pricePerPcs' => '',
'isProhibited' => 'true',
'hasGram' => '',
'hasDimensionCharges' => '',
'tax' => '',
])
],
[
'details' => json_encode([
'name' => 'Food - hasGram',
'pricePerKg' => '',
'pricePerPcs' => '',
'isProhibited' => '',
'hasGram' => 'true',
'hasDimensionCharges' => '',
'tax' => '',
])
],
);
return $this->collectionResponse(AirShipmentItemPriceResource::collection($price));
}
}
@@ -5,7 +5,9 @@ namespace App\Classes\Modules\Segments\ControllersLogic;
use App\Classes\Exceptions\ResourceNotFoundException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Segments\DataTransferObjects\ConstantObject;
use App\Classes\Modules\Segments\DataTransferObjects\SegmentObject;
use App\Classes\Modules\Segments\Services\CreatesConstant;
use App\Classes\Modules\Segments\Services\CreatesSegment;
use App\Classes\Modules\Segments\Services\FetchesConstant;
use App\Classes\Modules\Segments\Services\FetchesSegment;
use App\Classes\Modules\Segments\Standards\Rules\CanCreateConstant;
@@ -15,6 +17,7 @@ use App\Http\Resources\ConstantResource;
use App\Models\SegmentConstant;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Classes\Modules\Segments\Services\UpdatesConstantValue;
class UpdateConstantLogic extends AbstractControllerLogic
{
@@ -47,6 +50,11 @@ class UpdateConstantLogic extends AbstractControllerLogic
/** @var CreatesConstant */
private $createsConstant;
/** @var CreatesSegment */
private $createsSegment;
/** @var UpdatesConstantValue */
private $updatesConstantValue;
/**
* UpdateConstantLogic constructor.
@@ -56,8 +64,19 @@ class UpdateConstantLogic extends AbstractControllerLogic
* @param FetchesConstant $fetchesConstant
* @param CanCreateConstant $canCreateConstant
* @param CreatesConstant $createsConstant
* @param UpdatesConstantValueByState $updatesConstantValueByState
* @param CreatesSegment $createsSegment
*/
public function __construct(CanUpdateConstant $canUpdateConstant, UpdatesConstant $updatesConstant, FetchesSegment $fetchesSegment, FetchesConstant $fetchesConstant, CanCreateConstant $canCreateConstant, CreatesConstant $createsConstant)
public function __construct(
CanUpdateConstant $canUpdateConstant,
UpdatesConstant $updatesConstant,
FetchesSegment $fetchesSegment,
FetchesConstant $fetchesConstant,
CanCreateConstant $canCreateConstant,
CreatesConstant $createsConstant,
UpdatesConstantValue $updatesConstantValue,
CreatesSegment $createsSegment
)
{
$this->canUpdateConstant = $canUpdateConstant;
$this->updatesConstant = $updatesConstant;
@@ -65,6 +84,8 @@ class UpdateConstantLogic extends AbstractControllerLogic
$this->fetchesConstant = $fetchesConstant;
$this->canCreateConstant = $canCreateConstant;
$this->createsConstant = $createsConstant;
$this->updatesConstantValue = $updatesConstantValue;
$this->createsSegment = $createsSegment;
}
/**
* @param Request $request
@@ -75,28 +96,33 @@ class UpdateConstantLogic extends AbstractControllerLogic
*/
public function logic(Request $request) : JsonResponse
{
$object = new ConstantObject($request->input('reference'), $request->input('value'));
$segment = $this->fetchesSegment->execute(['id' => $request->route('id')]);
try {
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $object->getReference()]);
$this->canUpdateConstant->passes($object);
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $request->input('reference')]);
/** @var SegmentConstant $constant */
$constant = $this->updatesConstant->execute($constant, $object);
$constantValue = $this->updatesConstantValue->execute($constant->value, $request->input('id'), $request->input('rate'));
$object = new ConstantObject($request->input('reference'), $constantValue);
$this->canUpdateConstant->passes($object);
} catch (ResourceNotFoundException $exception){
$this->canCreateConstant->passes($object);
$constantObject = [];
$constantObject[$request->input('id')] = $request->input('rate');
$object = new ConstantObject(
$request->input('reference'),
$constantObject
);
/** @var SegmentConstant $constant */
$constant = $this->createsConstant->execute($segment, $object);
}
$constant = $this->updatesConstant->execute($constant, $object);
return $this->resourceResponse(new ConstantResource($constant));
}
@@ -14,6 +14,8 @@ use App\Classes\Modules\Segments\Standards\Rules\CanUpdateConstant;
use App\Classes\Modules\Segments\DataTransferObjects\ConstantObject;
use App\Classes\Modules\Segments\Services\AddItemToConstantValueArray;
use App\Classes\Modules\Segments\Services\RemoveItemFromConstantValueArray;
use App\Classes\Exceptions\ResourceNotFoundException;
use App\Classes\Modules\Segments\Services\CreatesConstant;
class UpdateConstantPostcodeLogic extends AbstractControllerLogic
{
@@ -46,6 +48,8 @@ class UpdateConstantPostcodeLogic extends AbstractControllerLogic
/** @var RemoveItemFromConstantValueArray */
private $removeItemFromConstantValueArray;
/** @var CreatesConstant */
private $createsConstant;
/**
* UpdateConstantLogic constructor.
@@ -54,9 +58,18 @@ class UpdateConstantPostcodeLogic extends AbstractControllerLogic
* @param FetchesSegment $fetchesSegment
* @param FetchesConstant $fetchesConstant
* @param AddItemToConstantValueArray $addItemToConstantValueArray
* @param CreatesConstant $createsConstant
* @param RemoveItemFromConstantValueArray $removeItemFromConstantValueArray
*/
public function __construct(CanUpdateConstant $canUpdateConstant, UpdatesConstant $updatesConstant, FetchesSegment $fetchesSegment, FetchesConstant $fetchesConstant,AddItemToConstantValueArray $addItemToConstantValueArray, RemoveItemFromConstantValueArray $removeItemFromConstantValueArray)
public function __construct(
CanUpdateConstant $canUpdateConstant,
UpdatesConstant $updatesConstant,
FetchesSegment $fetchesSegment,
FetchesConstant $fetchesConstant,
AddItemToConstantValueArray $addItemToConstantValueArray,
RemoveItemFromConstantValueArray $removeItemFromConstantValueArray,
CreatesConstant $createsConstant
)
{
$this->canUpdateConstant = $canUpdateConstant;
$this->updatesConstant = $updatesConstant;
@@ -64,6 +77,7 @@ class UpdateConstantPostcodeLogic extends AbstractControllerLogic
$this->fetchesConstant = $fetchesConstant;
$this->addItemToConstantValueArray = $addItemToConstantValueArray;
$this->removeItemFromConstantValueArray = $removeItemFromConstantValueArray;
$this->createsConstant = $createsConstant;
}
/**
* @param Request $request
@@ -76,24 +90,42 @@ class UpdateConstantPostcodeLogic extends AbstractControllerLogic
{
$segment = $this->fetchesSegment->execute(['id' => $request->route('id')]);
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $request->input('reference')]);
try {
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $request->input('reference')]);
$object = new ConstantObject($constant->reference, $this->addItemToConstantValueArray->execute($constant->value, $request->input('postcode')));
$this->canUpdateConstant->passes($object);
$constantValue = $this->addItemToConstantValueArray->execute($constant->value, $request->input('postcode'));
$object = new ConstantObject($request->input('reference'), $constantValue);
} catch (ResourceNotFoundException $exception){
$constantObject = [$request->input('postcode')];
$object = new ConstantObject(
$request->input('reference'),
$constantObject
);
$constant = $this->createsConstant->execute($segment, $object);
}
try {
// check if postcode exist in the opposite constant, and delete it
$oppositeConstant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $request->input('reference') == SegmentConstants::CENTER_POSTCODE ? SegmentConstants::OUTSTATION_POSTCODE : SegmentConstants::CENTER_POSTCODE]);
$oppositeConstantValue = $this->removeItemFromConstantValueArray->execute($oppositeConstant->value, $request->input('postcode'));
$oppositeObject = new ConstantObject($request->input('reference') == SegmentConstants::CENTER_POSTCODE ? SegmentConstants::OUTSTATION_POSTCODE : SegmentConstants::CENTER_POSTCODE, $oppositeConstantValue);
$this->updatesConstant->execute($oppositeConstant, $oppositeObject);
} catch (ResourceNotFoundException $exception){
// if opposite constant does not exist, do nothing
}
$constant = $this->updatesConstant->execute($constant, $object);
$oppositeConstant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $request->input('reference') == SegmentConstants::CENTER_POSTCODE ? SegmentConstants::OUTSTATION_POSTCODE : SegmentConstants::CENTER_POSTCODE]);
$oppositeObject = new ConstantObject($request->input('reference') == SegmentConstants::CENTER_POSTCODE ? SegmentConstants::OUTSTATION_POSTCODE : SegmentConstants::CENTER_POSTCODE, $this->removeItemFromConstantValueArray->execute($oppositeConstant->value, $request->input('postcode')));
$oppositeConstant = $this->updatesConstant->execute($oppositeConstant, $oppositeObject);
return $this->response([
'CENTER_POSTCODE' => $constant->reference == SegmentConstants::CENTER_POSTCODE ? new ConstantResource($constant) : New ConstantResource($oppositeConstant),
'OUTSTATION_POSTCODE' => $constant->reference == SegmentConstants::OUTSTATION_POSTCODE ? new ConstantResource($constant) : New ConstantResource($oppositeConstant),
]);
return $this->resourceResponse(new ConstantResource($constant));
}
}
@@ -1,87 +0,0 @@
<?php
namespace App\Classes\Modules\Segments\ControllersLogic;
use Illuminate\Http\Request;
use App\Models\SegmentConstant;
use Illuminate\Http\JsonResponse;
use App\Http\Resources\ConstantResource;
use App\Classes\ValueObjects\Constants\SegmentConstants;
use App\Classes\Modules\Segments\Services\FetchesSegment;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Segments\Services\FetchesConstant;
use App\Classes\Modules\Segments\Services\UpdatesConstant;
use App\Classes\Modules\Segments\Standards\Rules\CanUpdateConstant;
use App\Classes\Modules\Segments\DataTransferObjects\ConstantObject;
use App\Classes\Modules\Segments\Services\UpdatesConstantValueByState;
class UpdateConstantStateLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Updated Segment Constant',
'message' => 'You have successfully updated the Segment Constant'
];
}
/** @var CanUpdateConstant */
private $canUpdateConstant;
/** @var UpdatesConstant */
private $updatesConstant;
/** @var FetchesSegment */
private $fetchesSegment;
/** @var FetchesConstant */
private $fetchesConstant;
/** @var UpdatesConstantValueByState */
private $updatesConstantValueByState;
/**
* UpdateConstantLogic constructor.
* @param CanUpdateConstant $canUpdateConstant
* @param UpdatesConstant $updatesConstant
* @param FetchesSegment $fetchesSegment
* @param FetchesConstant $fetchesConstant
* @param UpdatesConstantValueByState $updatesConstantValueByState
*/
public function __construct(CanUpdateConstant $canUpdateConstant, UpdatesConstant $updatesConstant, FetchesSegment $fetchesSegment, FetchesConstant $fetchesConstant,UpdatesConstantValueByState $updatesConstantValueByState)
{
$this->canUpdateConstant = $canUpdateConstant;
$this->updatesConstant = $updatesConstant;
$this->fetchesSegment = $fetchesSegment;
$this->fetchesConstant = $fetchesConstant;
$this->updatesConstantValueByState = $updatesConstantValueByState;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request) : JsonResponse
{
$segment = $this->fetchesSegment->execute(['id' => $request->route('id')]);
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => SegmentConstants::STATE_RATE]);
$constantValue = $this->updatesConstantValueByState->execute($constant->value, $request->input('status_id'), $request->input('rate'));
$object = new ConstantObject(SegmentConstants::STATE_RATE, (array) $constantValue);
$this->canUpdateConstant->passes($object);
$constant = $this->updatesConstant->execute($constant, $object);
return $this->resourceResponse(new ConstantResource($constant));
}
}
@@ -0,0 +1,29 @@
<?php
namespace App\Classes\Modules\Segments\Services;
use Carbon\CarbonPeriod;
class UpdatesBasePriceConstantByDates
{
/**
* @param $json
* @param int $status_id
* @param Array $rate
* @return Array
*/
public function execute($json, String $date_from, String $date_to, String $rate) {
$objectArray = (array) $json;
$period = CarbonPeriod::create($date_from, $date_to);
foreach ($period as $date) {
$objectArray[$date->format('Y-m-d')] = $rate;
}
return $objectArray;
}
}
@@ -0,0 +1,23 @@
<?php
namespace App\Classes\Modules\Segments\Services;
class UpdatesConstantValue
{
/**
* @param $json
* @param int $status_id
* @param Array $rate
* @return Array
*/
public function execute($json, int $state_id, Array $rate) {
$objectArray = (array) $json;
$objectArray[$state_id] = $rate;
return $objectArray;
}
}
@@ -1,32 +0,0 @@
<?php
namespace App\Classes\Modules\Segments\Services;
class UpdatesConstantValueByState
{
/**
* @param $json
* @param int $status_id
* @param int $rate
* @return string
*/
public function execute($json, int $status_id, int $rate) {
$newArray = $json;
foreach($json->config as $key => $object){
if($object->status_id == $status_id){
$newArray->config[$key] = (object) [
'rate' => $rate,
'status_id' => $object->status_id,
'outstation_rate' => $object->outstation_rate,
];
}else{
$newArray->config[$key] = $object;
}
}
return $newArray;
}
}
@@ -43,7 +43,7 @@ final class WarehouseReferences {
public const YD_DESTINATION_WAREHOUSE = self::YD_KLANG;
public const YD_EXEMPT_LIST = [230, 294, 320, 652, 1248, 1726, 2349];
public const YD_EXEMPT_LIST = [230, 294, 320, 652, 1248, 1726];
public const REPLICA_WHITE_LIST = [502];
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Segments;
use App\Classes\Modules\Segments\ControllersLogic\CreateBasePriceLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateBasePriceController
{
/**
* @param Request $request
* @param CreateBasePriceLogic $logic
* @return JsonResponse
*/
public function create(Request $request, CreateBasePriceLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Segments;
use App\Classes\Modules\Segments\ControllersLogic\FetchBasePriceLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class FetchBasePriceController
{
/**
* @param Request $request
* @param FetchSegmentLogic $logic
* @return JsonResponse
*/
public function fetch(Request $request, FetchBasePriceLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -1,20 +0,0 @@
<?php
namespace App\Http\Controllers\Segments;
use App\Classes\Modules\Segments\ControllersLogic\ListAirShipmentPriceLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ListAirShipmentPriceController
{
/**
* @param Request $request
* @param ListSegmentLogic $logic
* @return JsonResponse
*/
public function list(Request $request, ListAirShipmentPriceLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -1,20 +0,0 @@
<?php
namespace App\Http\Controllers\Segments;
use App\Classes\Modules\Segments\ControllersLogic\UpdateConstantStateLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UpdateConstantStateController
{
/**
* @param Request $request
* @param UpdateConstantStateLogic $logic
* @return JsonResponse
*/
public function update(Request $request, UpdateConstantStateLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
+11
View File
@@ -5,6 +5,8 @@ namespace App\Http\Resources;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\Order;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\SegmentConstant;
use App\Classes\ValueObjects\Constants\SegmentConstants;
class AddressResource extends JsonResource
{
@@ -17,6 +19,14 @@ class AddressResource extends JsonResource
public function toArray($request)
{
$centerPostcodeConstantObject = SegmentConstant::where('reference', SegmentConstants::CENTER_POSTCODE)->get();
$centerPostcodeConstant = $centerPostcodeConstantObject->isEmpty() ? [] : (array)$centerPostcodeConstantObject->first()->value;
$postcodeArea = in_array($this->postcode, $centerPostcodeConstant) ? 'CENTER_POSTCODE' : '';
$outstationPostcodeConstantObject = SegmentConstant::where('reference', SegmentConstants::OUTSTATION_POSTCODE)->get();
$outstationPostcodeConstant = $outstationPostcodeConstantObject->isEmpty() ? [] : (array)$outstationPostcodeConstantObject->first()->value;
in_array($this->postcode, $outstationPostcodeConstant) ? $postcodeArea = 'OUTSTATION_POSTCODE' : '';
return [
'id' => $this->id,
'reference' => $this->reference,
@@ -25,6 +35,7 @@ class AddressResource extends JsonResource
'district' => $this->district,
'state' => $this->state,
'post_code' => $this->postcode,
'post_code_area' => $postcodeArea,
'country' => $this->country,
'default' => (int) $this->default,
'status' => (int) $this->status,
@@ -1,25 +0,0 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class AirShipmentItemPriceResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
$object = $this->resource;
$detailsArray = (array)json_decode($object['details']);
return [
'name' => $detailsArray['name'],
'details' => $object['details'],
];
}
}
+5 -1
View File
@@ -32,6 +32,9 @@ class CompanyModuleResource extends JsonResource
$connection = $this->inviters()->withPivot('invitee_reference')->first();
$marking = $connection ? $connection->pivot->invitee_reference:'';
$segmentConstantObject = SegmentConstant::where('reference', SegmentConstants::WAREHOUSE_RATE)->get();
$segmentConstant = $segmentConstantObject->isEmpty() ? [] : (array)$segmentConstantObject->first()->value;
return [
'id' => $this->id,
'type' => $this->type,
@@ -40,7 +43,8 @@ class CompanyModuleResource extends JsonResource
'address' => new AddressResource($defaultAddress),
'company' => new CompanyResource($this->whenLoaded('company')),
'remarks' => RemarkResource::collection($this->remarks),
'marking' => $marking
'marking' => $marking,
'warehouseCharges' => array_key_exists($this->id, $segmentConstant) ? $segmentConstant[$this->id] : null,
];
}
+1
View File
@@ -20,6 +20,7 @@ class DistrictResource extends JsonResource
'state' => $this->state,
'country' => $this->country,
'postcode' => $this->postcode,
'postcodeArray' => PostcodeResource::collection(json_decode($this->postcode)),
];
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Models\SegmentConstant;
use App\Classes\ValueObjects\Constants\SegmentConstants;
class PostcodeResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
$centerPostcodeConstantObject = SegmentConstant::where('reference', SegmentConstants::CENTER_POSTCODE)->get();
$centerPostcodeConstant = $centerPostcodeConstantObject->isEmpty() ? [] : (array)$centerPostcodeConstantObject->first()->value;
$postcodeArea = in_array($this->resource, $centerPostcodeConstant) ? 'CENTER_POSTCODE' : '';
$outstationPostcodeConstantObject = SegmentConstant::where('reference', SegmentConstants::OUTSTATION_POSTCODE)->get();
$outstationPostcodeConstant = $outstationPostcodeConstantObject->isEmpty() ? [] : (array)$outstationPostcodeConstantObject->first()->value;
in_array($this->resource, $outstationPostcodeConstant) ? $postcodeArea = 'OUTSTATION_POSTCODE' : '';
return [
'postcode' => $this->resource,
'postcodeArea' => $postcodeArea,
];
}
}
+7 -1
View File
@@ -1,8 +1,9 @@
<?php
namespace App\Http\Resources;
use App\Models\SegmentConstant;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Classes\ValueObjects\Constants\SegmentConstants;
class StateResource extends JsonResource
{
@@ -14,10 +15,15 @@ class StateResource extends JsonResource
*/
public function toArray($request)
{
$segmentConstantObject = SegmentConstant::where('reference', SegmentConstants::STATE_RATE)->get();
$segmentConstant = $segmentConstantObject->isEmpty() ? [] : (array)$segmentConstantObject->first()->value;
return [
'id' => $this->id,
'name' => $this->name,
'country' => $this->country,
'stateCharges' => array_key_exists($this->id, $segmentConstant) ? $segmentConstant[$this->id] : null,
];
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 959 KiB

@@ -70,23 +70,10 @@
<order-form-component v-show="$store.getters.isShowing('createOrderForm')" :company="company" :section="section"></order-form-component>
</div>
</div>
<component is="h1">{{children}}</component>
</template>
export function Heading({element: Element = 'h2', children, id}: HeadingProps) {
return (
<Element className={styles.Heading} id={id}>
{children}
</Element>
);
}
<script>
import styles from './Heading.scss';
export default {
props: {
element: {
type: String,
default: 'h2'
},
company_id: {
type: Number,
required: true,
@@ -64,13 +64,19 @@
</div>
</div>
</div>
<packing-list-section-component :data="item" v-if="expanded"></packing-list-section-component>
<packing-list-section-component :section="section" :data="item" v-if="expanded"></packing-list-section-component>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
props: {
section:{
type: String,
default: ''
}
},
data(){
return {
expanded: false,
@@ -18,7 +18,7 @@
{{item.order.address.street_one+' '+(item.order.address.street_two ? item.order.address.street_two : '')+', '+ item.order.address.district.name+', '+item.order.address.post_code+' '+item.order.address.state.name+', '+item.order.address.country.name}}<br>{{item.order.address.remark ? item.order.address.remark.content: ''}}
<div class="btn btn-xs btn-primary pointer m-t-10 requestModal" data-type="defineLocation">Define Location</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="defineLocation">
<declare-postcode-area-form-component :data="item.order.address.post_code"></declare-postcode-area-form-component>
<declare-postcode-area-form-component :section="section" :data="{postcode: item.order.address.post_code, postcodeArea: item.order.address.post_code_area}"></declare-postcode-area-form-component>
</modal-component>
</div>
</div>
@@ -59,6 +59,12 @@
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
props: {
section:{
type: String,
default: ''
}
},
data(){
return {
parameters: {
@@ -1,27 +1,27 @@
<template>
<div class="row" style="width: 450px; margin: auto;" @keyup.enter="submitForm">
<div class="row" style="width: 450px; margin: auto;">
<div class="col bg-white padding-40 b-rad-lg">
<div class="row m-b-10">
<div class="col">
<h2 class="text-center text-complete bold">{{data}}</h2>
<p class="text-center" v-show="postcodeArea=== ''">This postcode is yet to be declare. Plase choose the area.</p>
<h2 class="text-center text-complete bold">{{data.postcode}}</h2>
<p class="text-center" v-show="parameters.reference=== ''">This postcode is yet to be declare. Plase choose the area.</p>
</div>
</div>
<div class="row text-center justify-content-center">
<div class="col p-r-5">
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" :class="{ 'b-primary': postcodeArea === 'city_center', 'b-grey': postcodeArea !== 'city_center' }" @click="postcodeArea = 'city_center'">
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" :class="{ 'b-primary': parameters.reference === 'CENTER_POSTCODE', 'b-grey': parameters.reference !== 'CENTER_POSTCODE' }" @click="parameters.reference = 'CENTER_POSTCODE'">
<div class="row">
<div class="col">
<h5 class="no-margin" :class="{ 'text-primary': postcodeArea === 'city_center', 'semi-bold': postcodeArea === 'city_center' }">City Center</h5>
<h5 class="no-margin" :class="{ 'text-primary': parameters.reference === 'CENTER_POSTCODE', 'semi-bold': parameters.reference === 'CENTER_POSTCODE' }">City Center</h5>
</div>
</div>
</div>
</div>
<div class="col p-l-5">
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" :class="{ 'b-primary': postcodeArea === 'outskirt', 'b-grey': postcodeArea !== 'outskirt' }" @click="postcodeArea = 'outskirt'">
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" :class="{ 'b-primary': parameters.reference === 'OUTSTATION_POSTCODE', 'b-grey': parameters.reference !== 'OUTSTATION_POSTCODE' }" @click="parameters.reference = 'OUTSTATION_POSTCODE'">
<div class="row">
<div class="col">
<h5 class="no-margin" :class="{ 'text-primary': postcodeArea === 'outskirt', 'semi-bold': postcodeArea === 'outskirt'}">Outskirt</h5>
<h5 class="no-margin" :class="{ 'text-primary': parameters.reference === 'OUTSTATION_POSTCODE', 'semi-bold': parameters.reference === 'OUTSTATION_POSTCODE'}">Outskirt</h5>
</div>
</div>
</div>
@@ -32,8 +32,7 @@
<div class="btn btn-lg btn-default b-rad-none" data-dismiss="modal">Cancel</div>
</div>
<div class="col p-l-5">
<!-- <div class="btn btn-primary w-100 btn-lg" @click="submit(route('api.packing_list.assign.order', data, orderNo), 'put', section, true, true)">Confirm</div> -->
<div class="btn btn-primary w-100 btn-lg">Confirm</div>
<div class="btn btn-primary w-100 btn-lg" @click="submit(route('api.segment.constant.update.postcode', 1), 'put', section, true, true)">Confirm</div>
</div>
</div>
</div>
@@ -46,7 +45,7 @@
export default {
props: {
data: {
type: String,
type: Object,
required: false
},
section: {
@@ -55,13 +54,12 @@
},
data() {
return {
postcodeArea: '',
parameters: {
reference: this.data.postcodeArea,
postcode: this.data.postcode
}
};
},
validations: {
orderNo: '',
},
mixins: [modalFormHandler]
}
@@ -24,7 +24,7 @@
<div class="col">
<div class="row align-items-center p-t-10 p-b-10 b-t b-grey" v-for="packingList in packingLists">
<div class="col">
<packing-list-component :data="packingList"></packing-list-component>
<packing-list-component :section="section" :data="packingList"></packing-list-component>
</div>
</div>
</div>
@@ -42,6 +42,12 @@
import PackingListComponent from "../elements/PackingListComponent";
export default {
components: {PackingListComponent, LoadingComponent},
props: {
section:{
type: String,
default: ''
}
},
data(){
return {
isLoading: true,
@@ -52,7 +52,6 @@
</div>
<div class="row text-center justify-content-center">
<div class="col-8">
<p class="m-b-0 text-danger m-t-15" v-if="parameters.warehouse_id === 3">近期由于船期的安排和马来西亚海关的运作等一些不可控因数导致船期延迟请大家提前做好采购安排若有不便之处敬请谅解 <br>Due to inevitable circumstances, shipping arrangements and Malaysia custom clearance may have delays. Kindly plan your purchases in advance, thank you for your cooperation.</p>
<p class="m-b-0 text-danger m-t-15" v-if="parameters.warehouse_id === 4">由于义乌船期不稳定建议发广州仓库<br>Due to unexpected shipping delays for Yiwu warehouse, you may select an alternative warehouse.</p>
</div>
</div>
@@ -1,458 +0,0 @@
<template>
<div class="row">
<div class="col no-margin">
<loading-component style="height: 200px; top: 0;" key="1" color="success" v-show="$store.getters.isLoading(section)"></loading-component>
<div class="row align-content-center h-100" v-if="step === 1">
<div class="col-8">
<div class="row m-b-20">
<div class="col-12 col-md-7">
<div class="row m-b-10 text-info">
<div class="col">
<h5 class="m-b-0 m-t-0 bold">Service Type</h5>
</div>
</div>
<div class="row text-center justify-content-center">
<div class="col p-l-5">
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" :class="{ 'b-info': parameters.type === 1, 'b-grey': parameters.type !== 1 }" @click="parameters.type = 1">
<div class="row justify-content-center">
<div class="col-8">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABmJLR0QA/wD/AP+gvaeTAAAEJklEQVR4nO3aS6hVVRzH8c8tsUKvjWoQBGGPSZFGg0ot8+YgMBoKEQhBBBFNokFkUhOzGjSoUVnUMIugUQ8pe4gVRhFISpMI7UpGpuiN3vc0WOt0ttt93nufvW93fWFxNov9/6///p211l7rvzaJRCKRSCQSiUQikUgkEolEIpFIJBY5S/E0jqJVUZnDAWzHpZN5rMnxlOqEKyqncM9EnmxCzAoPdtOQdm1BBmEZbsbr0WYe9w7ZXmMZRogy7O4XBPwT60awbxyTFpAw57bwIy4Z0UdjqEPAc/FetP9UeJEtWOoQEC7Gkejj2TH81E5dAsIN+D362Tymr9qoU0B4IPo5jatL8Ddx6hYQXom+vsWFJfmcGE0Q8AJ8Gf29hamS/E6EJggIl+F49PlwiX4rpykCwp3CIvsvzJTpeEr5wS4EvsP7sbwrvGhGYjEK+Kuwh27zG/ZidywHhnVYxZAhBPXJBO0GZSk2YIfwgvnHmVmdo3gVdwuL8r5UJeBC4SLcJSx52hmkdpnHV0JqbgbnFTlY7ALmuQYP4R1huGcF/QlbsSRrUJScPIzbxwxknzAcx7XbWxDfKH5H4XxsxDP4OtP+m0LigoLgsiKOQ1lzYJGAVc6RvVgrpMpa2NKuLBrCaVh3Z7OgzWftiiRgbzZhP/5w9hkMqhvCZc2BdbJJ74Ms53QxPIL7xmx83mi9eFS7Kngi/j4iLGGmFCQk0nDtzilBm+W5+r49MBHYH38f1ON8paoe+H+YA2fwtxHmwG5sxE4hwzuHk8Lm+0XhLDY7PzRxDszHPxevd+K2gvv34A58IZw3FzJID7xc8YI2X3YLCcymMWj8H2PlAP7O0KyfgOuEntYSVuGPYpWQElqG1cL+sL1CP4HrB32yCTBs/Cexpo/PgQW8ShCkhdec/TbKMo1d8d6f8bn658BR4/8FV3SJZ5+OZqvoLuCU0KXbjQ9yIDOl86FPC28PYJOnrHzguPHv6RJPdir4nu4C3qrT7Xv9c3mmcSzarh/CrmzKiP+WHve10Or1Fm5nG54T3lZtsh9OzgqZ3ewa6TSez/mog4nF387C5ifOg7H+2lx90YeTT+buWR3rDw4SQI6y5sAy4v+mh///Ru6OAofZku/+WcHXxuvZ3D3TfXxOslQZ/+EleDwabTHcN3XZSbmqhW+VjBt/34RLtyFQ1GO35+4ZZAhUTe3xvxydbM3VL41BzOKH2Hh+o70t2r40TgBjUnv863WWAdND2K0QTq9awgfgddGI+D+KjnYZfCH6RrT5YNzGS6D2+K8UtjUtYYXe659ckWn8uLCBr5tGxL9GZz95DI/hOmF5sDxeb9Pp9idwY1mNl0Aj4l+pMxx6lQ81M53VmPhn8AIO6SQkD8W6DVU2XBILPf5EIpFIJBKJRCKRSCQSiUQiUSP/AlkkSdKJddQ3AAAAAElFTkSuQmCC" class="w-100">
</div>
</div>
<div class="row">
<div class="col">
<h5 class="no-margin" :class="{ 'text-info': parameters.type === 1, 'semi-bold': parameters.type === 1}">Pick Up</h5>
</div>
</div>
</div>
</div>
<div class="col p-r-5">
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" :class="{ 'b-info': parameters.type === 2, 'b-grey': parameters.type !== 2 }" @click="parameters.type = 2">
<div class="row justify-content-center">
<div class="col-8">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABmJLR0QA/wD/AP+gvaeTAAAG00lEQVR4nO2caYwURRSAv4VhOWRBZEEFQgAFFVFARcEjyEpQMCggCoZA/IEHcoioARUNlxKjiTEeqIhRJFFBEQHxwPgDMYCcaqIEMSDBoKKcyyEsO/54r1O9Pd09Bz073UN/yaSnql7XvC6qq1699xaIiYmJiYmJiYmJiSlKWgIzgc1AJXAY2ATMAFoUUK9IMBQ4BCQ9PgeBwQXTLuQMBaqRgVoM9AbO0s+NwKfadop4EFNoiZl5j/nITVGZA0B5LegVGWYiA/NJBrJLVXZ6XjWKGFuQQemdgWwfld2UV40ixmFkUBpnIFumsofyqpEHdQrxoxmQzEK2JId7AiOsA/ibXq/KQNaS2Z4nXXwJ6wAu0+vDGchOctwTg5wwDiKv5RQfuSdVZj/QvBb0ihRDECM5iZgqfZBNpQyoAJZjDOnbC6Rj6BmMGMleR7n9xIOXlnLEcbARMW8OARuAacSvbUxQVABzga2Iy8rtdT0AfAX0K5COoaQDsArvNc7r80QhlA0b/TAbxF/AVKAr4q5yozkycFWIm6uiFnQMLfcAJ5DBWwQ0zeLeSXrfijzoFQmexjhKZ2POsplSrvf+G7BeoScBzEMevgp4IMd+mmkfJ4AmwagWDeYjD14JDHRp7wQsAK5P089NmM3kpSAVDDMjMSeHHi7tfYF9KvNymr6ewgxgFXBlcGqGF8tUGenS9iBwEjMo96bpa4XK/ajX9UDdwDQNIQ2RmXJSv1skgFeQQajGbCyX+/RVBzNTLwJ26vfxgWsdInogD/mTra4e8KXWHwMm6vfD+M+mzir3u5YHYuLDrQLVOkNqw6HaTa9bbHW3IIb034ibyvImb0DcU15cq9c1el2GRO6aAKsR/2Cb01c5c2pjALvq9QdbnTWo84G1wDVaXpemr14uchOAbUB7YBbyWn8O3AnUz03lcLEaec362uoWa90ILa/U8qA0fW1VuY1Aqa2+jvY/HzhCTX/hG0R4py7BuObtiUDbta4L8vD7tey3jp2D2WiSwDM+cuOROLHdAbEJ8XJHigsQ5f+w1ZUhA3Ec2UwuUZldafq6FbOBVOn3j4ABeG883RBj+x/Mbn9HDs9RMIYgin9mq7sO8xqCOBYsp4IfszDn59HI7m3Nrj3AC8BlHvfWR7zaSWpuZqFnOqL0s7a6sVo3T8tztPxomr6+UbnbtNwKidj9TOqrOhFJULLTFHOUjAxLEKWH2ere1LoJWv5eyzf49JNAHrwa96TKqxGj3HpVLWfDUuSVLUN8iUnS7/ShYgei9MW2unXUTBzaQ+om4+QKldmW5vdKkUjeEoy/0f6pBvpn9QQF5iiiuOVlTiBmRjVwNmIAW7HfRj79jFOZd7L47RbILF+PrJdridjggZltjyNrkLWQW8e6fpjZ0dmnnwUqMyZvmoaUAdS03ZyZBNNs9X4pHK+pzEqy92BHngHITKxEdkj7acM6gSSRc3Ezjz7Kgb0qNypvmkaMupg86M2ktwVHqcxe4j9vAKA7MiC/IicWK8Q51kO+BDNj36sNBcOOc2cdquXjiNniRjtM5sIZn6HwPqku/Fe1bjveseLJKrMD7yD8GcEuUs2X+sgZOQks9LgvgfG0PJdPBcNMG2QA9pHq1LXiJH52Xw9MnKV7nnQMNcNI9dKA7Mx/YgbQbz18kTMkKuekHsaBMNnRVoE5886xfXfLQGiMicplkoxeNFh/xrWLVMPZ8tTMoOZ6+KFHX/21/QgSEyl6eiHrVhWp7qtGmNOG5RjtiDG27/fo8wPcl4OiowwTC5nt0m5tHhsc9cMx8eOuzpuAczHB9uFBKRtG3sZ4jEsdbTdj4iRug/Q65tTith6OxhzzivLPXgdhZlEXR1s5xqn6iMf9DTC2n9t6WAJ8re1vBaBvqGiFcbW7nXMXadsq/M2RCzEhUrcEpI7IP1A1kgJXFJQgi3sSyYVx+vLuwwTA22bQ312YmexmQE/FmD4NclM5XDyEWZvOd7R1wOywd2fRp2XquNmHCcwfa8/MQd+88h3wbRblTkhMZA+pKRsJJEEoibjrs+m/IZJnY7/XTi/ENfYfcOlp6J8R2SQXWa75TMtjkId9HomS2ZkK9ESM6XFZ9n8MeZUrkdya0Y6+1yBZrKXUPKFkq3/BsXZWZ75LT8SYPoX89yW5MkL7P0pqRkJbbdt9Gv0XHGvHtOfrNUZsuaBcUXMxOTL1bPWtMXGWyPIx8hDLkUFsB3yBiYE4jelcaIjJlV4GnIecTKyd3+sMHQk6UTPVwvrsRGy2oGgP/OLyO/uQnT7StEZmwUHE1nsXmSVB0xyJHe9GTKaFFMHgxcTExMTExMTExBQt/wPtRjB5yTmw/QAAAABJRU5ErkJggg==" class="w-100">
</div>
</div>
<div class="row">
<div class="col">
<h5 class="no-margin"></h5>
<h5 class="no-margin" :class="{ 'text-info': parameters.type === 2, 'semi-bold': parameters.type === 2}">Drop Off</h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row m-t-20" v-if="parameters.type !== ''">
<div class="col bg-master-lightest p-t-15">
<div class="row m-b-20 text-info">
<div class="col">
<h5 class="m-b-0 m-t-0 bold">Packing list</h5>
</div>
</div>
<div class="row">
<div class="col">
<validation-wrapper-component selectable class="m-b-15" :validator="$v.productType">
<label>Product Type</label>
<selectable-component :endpoint="route('api.segment.air_shipment.price.list')" :section="section" valueColumn="details" :labelColumn="['name']" v-model="productType"></selectable-component>
</validation-wrapper-component>
</div>
<div class="col">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.productDesc">
<label>Product Description</label>
<input class="form-control" v-model="parameters.product.productDesc">
</validation-wrapper-component>
</div>
</div>
<div class="row">
<div class="col">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.quantity">
<label>Quantity</label>
<input class="form-control" type="number" v-model="parameters.product.quantity">
</validation-wrapper-component>
</div>
<div class="col">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.totalWeight">
<label>Total Weight (KG)</label>
<input type="text" class="form-control fs-12" v-model.trim="parameters.product.totalWeight" v-money="weight">
</validation-wrapper-component>
</div>
<div class="col" v-if="productTypeArray['hasGram'] === 'true'">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.gram">
<label>Gram</label>
<input class="form-control" v-model="parameters.product.gram">
</validation-wrapper-component>
</div>
</div>
<div class="row" v-if="productTypeArray['hasDimensionCharges'] === 'true'">
<div class="col-4">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.width">
<label>Width</label>
<input class="form-control" v-model="parameters.product.width">
</validation-wrapper-component>
</div>
<div class="col-4">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.length">
<label>Length</label>
<input class="form-control" v-model="parameters.product.length">
</validation-wrapper-component>
</div>
<div class="col-4">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.height">
<label>Height</label>
<input class="form-control" v-model="parameters.product.height">
</validation-wrapper-component>
</div>
</div>
<p v-if="productTypeArray['isProhibited'] === 'true'" class="text-danger text-center">This item is blacklisted to ship to bangladish. <span class="text-underline text-complete">Black listed items list</span></p>
<div class="row">
<div class="col">
<div class="btn btn-complete w-100 m-b-15 padding-10" :class="{'disabled': productTypeArray['isProhibited'] === 'true', 'not-allowed': productTypeArray['isProhibited'] === 'true'}" @click="addProduct()">Add Product</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-4">
<div class="margin-15 padding-15 bg-master-lightest">
<p class="m-b-15 bold fs-18">Order Summary</p>
<p class="m-b-15 bold fs-15">Products</p>
<div class="row" v-if="productList.length != 0">
<div class="col">
<div class="row m-l-0 m-r-0 m-b-10" v-for="(cartItem, index) in productList">
<div class="col p-t-10 p-b-10 bg-white">
<div class="row">
<div class="col">
<p class="bold no-margin">{{cartItem.productDesc}}</p>
</div>
</div>
<div class="row">
<div class="col">
<p class="muted no-margin">{{ cartItem.quantity }} &nbsp; X &nbsp; {{ cartItem.productType }} - {{ cartItem.totalWeight }}KG</p>
</div>
</div>
</div>
<div class="col-auto bg-white pointer" @click="removeElement(index)">
<div class="row h-100 align-content-center justify-content-center">
<div class="col">
<i class="fa fa-times fs-12"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row m-l-0 m-r-0 m-b-10 b-a rounded b-primary-light" v-if="parameters.product.productDesc != '' || productType != ''">
<div class="col p-t-10 p-b-10 bg-white">
<div class="row">
<div class="col">
<p class="bold no-margin">{{parameters.product.productDesc}}</p>
</div>
</div>
<div class="row">
<div class="col">
<p class="muted no-margin">{{parameters.product.quantity}} &nbsp; X &nbsp; {{ productTypeArray['name'] }} - {{ parameters.product.totalWeight }}KG</p>
</div>
</div>
</div>
</div>
<div class="row" v-if="parameters.product.productDesc == '' && productType == '' && productList.length == 0">
<div class="col">
<p class="muted">There are no items added yet!</p>
</div>
</div>
<div class="row">
<div class="col">
<p class="bold fs-15">Quotation</p>
<div class="row justify-content-between m-b-5">
<div class="col">Total Weight</div>
<div class="col">{{ parameters.totalWeight }} kg</div>
</div>
<div class="row justify-content-between m-b-5">
<div class="col">Service Type</div>
<div class="col">{{ parameters.type === 1 ? 'Pick Up' : parameters.type === 2 ? 'Drop Off' : '' }}</div>
</div>
<div class="row justify-content-between m-b-5">
<div class="col">Price Per kg</div>
<div class="col">{{ parameters.pricePerKg }} RM</div>
</div>
<div class="row justify-content-between m-b-5">
<div class="col">Shipping Fee</div>
<div class="col">{{ parameters.totalShipping }} RM</div>
</div>
<div class="row justify-content-between">
<div class="col">Special Product Tax</div>
<div class="col">{{ parameters.totalTax }} RM</div>
</div>
<p class="text-complete text-underline pointer">What is this cost?</p>
<div class="row m-t-15 justify-content-between">
<div class="col fs-20 bold">Total</div>
<div class="col fs-20 bold">{{ parameters.totalCombine }} RM</div>
</div>
</div>
</div>
</div>
<div class="row m-t-15">
<div class="col">
<div class="btn btn-success w-100 m-b-15 padding-10" @click="step++">Procced Next</div>
</div>
</div>
</div>
</div>
<div class="row" v-if="step === 2">
<div class="col">
<new-registration-form-component section="loginSection"></new-registration-form-component>
<div class="row m-t-15">
<div class="col-auto">
<div class="btn btn-default w-100 m-b-15 padding-10" @click="step--">back</div>
</div>
<div class="col-auto">
<div class="btn btn-success w-100 m-b-15 padding-10" @click="step++">Procced Next</div>
</div>
</div>
</div>
</div>
<div class="row" v-if="step === 3">
<div class="col-8">
<div class="row m-t-20">
<div class="col bg-master-lightest p-t-15">
<div class="row">
<div class="col">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.pickUpAddress">
<label>Pick up address</label>
<input class="form-control" v-model="parameters.pickUpAddress">
</validation-wrapper-component>
</div>
<div class="col">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.pickUpDate">
<label>Pick up date</label>
<date-picker-component v-model.lazy="parameters.pickUpDate"></date-picker-component>
</validation-wrapper-component>
</div>
</div>
<div class="row">
<div class="col">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.deliveryAddress">
<label>Delivery address</label>
<input class="form-control" v-model="parameters.deliveryAddress">
</validation-wrapper-component>
</div>
</div>
</div>
</div>
<div class="row m-t-20">
<div class="col">
<p>Addon Wrapping service</p>
<div class="row m-l-5">
<div class="col-4 p-r-10 p-l-0">
<div class="padding-20 bg-master-light text-center pointer" @click="parameters.wrappingService = 'Pick Up' " :class="{'bg-complete-light': parameters.wrappingService === 'Pick Up', 'text-white': parameters.wrappingService === 'Pick Up',}">
Wrap my goods
</div>
</div>
<div class="col-4 p-l-10">
<div class="padding-20 bg-master-light text-center pointer" @click="parameters.wrappingService = 'Drop Off'" :class="{'bg-complete-light': parameters.wrappingService === 'Drop Off', 'text-white': parameters.wrappingService === 'Drop Off',}">
No Thanks
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-4">
<div class="margin-15 padding-15 bg-master-lightest">
<p class="m-b-15 bold fs-18">Order Summary</p>
<div class="row m-b-15">
<div class="col">
<p class="bold fs-15">Products</p>
<p>1x product1 </p>
</div>
</div>
<div class="row">
<div class="col">
<p class="bold fs-15">Quotation</p>
<div class="row justify-content-between m-b-5">
<div class="col">Total Weight</div>
<div class="col">15 kg</div>
</div>
<div class="row justify-content-between m-b-5">
<div class="col">Service Type</div>
<div class="col">{{ parameters.servicetype }}</div>
</div>
<div class="row justify-content-between m-b-5">
<div class="col">Price Per kg</div>
<div class="col">26 RM</div>
</div>
<div class="row justify-content-between m-b-5">
<div class="col">Shipping Fee</div>
<div class="col">200 RM</div>
</div>
<div class="row justify-content-between">
<div class="col">Special Product Tax</div>
<div class="col">50 RM</div>
</div>
<p class="text-complete text-underline pointer">What is this cost?</p>
<div class="row m-t-15 justify-content-between">
<div class="col fs-20 bold">Total</div>
<div class="col fs-20 bold">50 RM</div>
</div>
</div>
</div>
</div>
<div class="row m-t-15">
<div class="col">
<div class="btn btn-success w-100 m-b-15 padding-10" @click="step++">Procced Next</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
import { required } from "vuelidate/lib/validators";
import { VMoney } from 'v-money'
export default {
data(){
return {
section: 'createDelvieryOrderSectionComponent',
weight: {decimal: '.',thousands: ',', precision: 1},
step: 1,
productType: '',
productList: [],
parameters : {
type: '',
product: {
productType: '',
productDesc: '',
quantity: '1',
totalWeight: 10,
gram: '',
width: '',
length: '',
height: '',
},
pickUpAddress: '',
pickUpDate: '',
deliveryAddress: '',
wrappingService: '',
tax: 0,
totalWeight: 0,
pricePerKg: 0,
totalShipping: 0,
totalTax: 0,
totalCombine: 0,
}
}
},
validations: {
productType: { },
parameters: {
product: {
productDesc: { },
quantity: { },
totalWeight: { },
gram: { },
width: { },
length: { },
height: { },
},
pickUpAddress: { },
pickUpDate: { },
deliveryAddress: { },
wrappingService: { },
}
},
computed: {
productTypeArray() {
return this.productType === '' ? '' : JSON.parse(this.productType);
},
},
methods: {
addProduct() {
// todo: change this to vuelidate
if (this.parameters.product.productDesc != '' && this.productType != '') {
// add weight
this.parameters.totalWeight += parseInt(this.parameters.product.totalWeight);
// has tax
if (this.productTypeArray['tax']) {
this.parameters.totalTax += parseInt(this.productTypeArray['tax']);
}
var itemShippingFee = 0;
// pricePerKg * kg
if (this.productTypeArray['pricePerKg']) {
// add pricePerKg
this.parameters.pricePerKg += parseInt(this.productTypeArray['pricePerKg']);
itemShippingFee += parseInt(this.productTypeArray['pricePerKg']) * parseInt(this.parameters.product.totalWeight);
}
// pricePerPcs * quantity
if (this.productTypeArray['pricePerPcs']) {
itemShippingFee += parseInt(this.productTypeArray['pricePerPcs']) * this.parameters.product.quantity;
}
this.productList.push(
{
productType: this.productTypeArray['name'],
productDesc: this.parameters.product.productDesc,
quantity: this.parameters.product.quantity,
gram: '',
width: '',
length: '',
height: '',
totalWeight: this.parameters.product.totalWeight,
itemTax: this.productTypeArray['tax'],
pricePerKg: this.productTypeArray['pricePerKg'],
itemShippingFee: itemShippingFee,
}
);
this.parameters.totalShipping += itemShippingFee;
this.parameters.totalCombine += ( itemShippingFee + parseInt(this.productTypeArray['tax'] == '' ? 0 : this.productTypeArray['tax']) );
this.parameters.product.productDesc = '' ;
this.productType = '';
}
},
removeElement(index) {
var itemRemoved = this.productList.splice(index, 1)[0];
// remove weight
this.parameters.totalWeight -= parseInt(itemRemoved['totalWeight']);
// has tax
if (itemRemoved['itemTax']) {
this.parameters.totalTax -= parseInt(itemRemoved['itemTax']);
}
if (itemRemoved['itemShippingFee']) {
this.parameters.totalShipping -= parseInt(itemRemoved['itemShippingFee']);
}
// remove pricePerKg
if (itemRemoved['pricePerKg']) {
this.parameters.pricePerKg -= parseInt(itemRemoved['pricePerKg']);
}
this.parameters.totalCombine -= ( parseInt(itemRemoved['itemShippingFee']) + parseInt(itemRemoved['itemTax'] == '' ? 0 : parseInt(itemRemoved['itemTax'])) );
}
},
mixins: [componentHandler],
directives: {money: VMoney}
}
</script>
@@ -274,7 +274,7 @@
style=" fill:#000000;"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g fill="#000000"><path d="M8.6,23.65c-2.37676,0 -4.3,1.92324 -4.3,4.3c0,2.37676 1.92324,4.3 4.3,4.3c2.37676,0 4.3,-1.92324 4.3,-4.3c4.77031,0 8.6,3.82969 8.6,8.6v85.10137c0,8.28926 6.76074,15.05 15.05,15.05h0.50391c0.99941,2.98145 3.72051,5.19863 7.02109,5.19863h4.43438c-0.74746,1.26816 -1.20938,2.72949 -1.20938,4.3c0,4.72832 3.87168,8.6 8.6,8.6c4.72832,0 8.6,-3.87168 8.6,-8.6c0,-1.57051 -0.46191,-3.03184 -1.20938,-4.3h66.91875c-0.74746,1.26816 -1.20937,2.72949 -1.20937,4.3c0,4.72832 3.87168,8.6 8.6,8.6c4.72832,0 8.6,-3.87168 8.6,-8.6c0,-1.57051 -0.46191,-3.03184 -1.20937,-4.3h4.43437c3.36777,0 6.13926,-2.30117 7.08828,-5.375h0.43672v-2.15c0,-3.90527 -3.04863,-7.12188 -6.87832,-7.45781c0.26035,-0.69707 0.42832,-1.43613 0.42832,-2.21719v-40.85c0,-1.67129 -0.73066,-3.14941 -1.78887,-4.3c1.0582,-1.15059 1.78887,-2.62871 1.78887,-4.3v-43c0,-3.53574 -2.91426,-6.45 -6.45,-6.45h-94.6c-3.53574,0 -6.45,2.91426 -6.45,6.45v43c0,1.67129 0.73066,3.14941 1.78887,4.3c-1.0582,1.15059 -1.78887,2.62871 -1.78887,4.3v40.85c0,0.78105 0.16797,1.52012 0.42832,2.21719c-3.15781,0.27715 -5.75293,2.51953 -6.57598,5.48418h-0.30234c-5.96289,0 -10.75,-4.78711 -10.75,-10.75v-85.10137c0,-7.09668 -5.80332,-12.9 -12.9,-12.9zM49.45,30.1h94.6c1.21777,0 2.15,0.93223 2.15,2.15v43c0,1.21777 -0.93223,2.15 -2.15,2.15c-1.17578,0.0168 -2.11641,0.97422 -2.11641,2.15c0,1.17578 0.94062,2.1332 2.11641,2.15c1.21777,0 2.15,0.93223 2.15,2.15v40.85c0,1.21777 -0.93223,2.15 -2.15,2.15h-94.6c-1.21777,0 -2.15,-0.93223 -2.15,-2.15v-40.85c0,-1.21777 0.93223,-2.15 2.15,-2.15c1.17578,-0.0168 2.11641,-0.97422 2.11641,-2.15c0,-1.17578 -0.94063,-2.1332 -2.11641,-2.15c-1.21777,0 -2.15,-0.93223 -2.15,-2.15v-43c0,-1.21777 0.93223,-2.15 2.15,-2.15zM88.15,38.7c-0.77266,-0.0084 -1.49492,0.39473 -1.88965,1.0666c-0.38633,0.67188 -0.38633,1.49492 0,2.1668c0.39473,0.67188 1.11699,1.075 1.88965,1.0666h17.2c0.77266,0.0084 1.49492,-0.39473 1.88965,-1.0666c0.38633,-0.67187 0.38633,-1.49492 0,-2.1668c-0.39472,-0.67187 -1.11699,-1.075 -1.88965,-1.0666zM58.05,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM66.65,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM75.25,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM83.85,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM92.45,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM101.05,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM109.65,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM118.25,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM126.85,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM135.45,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM88.15,90.3c-0.77266,-0.0084 -1.49492,0.39473 -1.88965,1.0666c-0.38633,0.67188 -0.38633,1.49492 0,2.1668c0.39473,0.67188 1.11699,1.075 1.88965,1.0666h17.2c0.77266,0.0084 1.49492,-0.39473 1.88965,-1.0666c0.38633,-0.67187 0.38633,-1.49492 0,-2.1668c-0.39472,-0.67187 -1.11699,-1.075 -1.88965,-1.0666zM44.075,131.15h105.35c1.80566,0 3.225,1.41934 3.225,3.225c0,1.80566 -1.41934,3.225 -3.225,3.225h-105.35c-1.80566,0 -3.225,-1.41934 -3.225,-3.225c0,-1.80566 1.41934,-3.225 3.225,-3.225zM55.9,141.9c2.40195,0 4.3,1.89805 4.3,4.3c0,2.40195 -1.89805,4.3 -4.3,4.3c-2.40195,0 -4.3,-1.89805 -4.3,-4.3c0,-2.40195 1.89805,-4.3 4.3,-4.3zM137.6,141.9c2.40195,0 4.3,1.89805 4.3,4.3c0,2.40195 -1.89805,4.3 -4.3,4.3c-2.40195,0 -4.3,-1.89805 -4.3,-4.3c0,-2.40195 1.89805,-4.3 4.3,-4.3z"></path></g></g></svg>
</div>
</div>
<div class="row" v-if="$store.getters.isAdmin">
<div class="row" v-if="$store.getters.isSuperAdmin">
<div class="col">
<div data-type="createWarehousePackageList" class="text-complete pointer requestModal fs-11 all-caps text-underline">Add Arrived Parcel</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="stick-up" type="createWarehousePackageList" >
File diff suppressed because one or more lines are too long
@@ -15,7 +15,19 @@
</div>
<div class="row">
<div class="col">
<div class="font-heading all-caps">{{data}}</div>
<div class="font-heading all-caps">{{data.postcode}}</div>
</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col-auto p-r-10">
<div class="font-heading all-caps fs-8 muted">Location</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="font-heading all-caps">{{data.postcodeArea == '' ? '-' : data.postcodeArea.replaceAll('_', ' ') }}</div>
</div>
</div>
</div>
@@ -24,7 +36,7 @@
<div class="col">
<div class="btn btn-xs btn-primary pointer m-t-10 requestModal" data-type="defineLocation">Define Location</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="defineLocation">
<declare-postcode-area-form-component :data="data"></declare-postcode-area-form-component>
<declare-postcode-area-form-component :data="data" section="allPostcodesSection"></declare-postcode-area-form-component>
</modal-component>
</div>
</div>
@@ -40,7 +52,7 @@
export default {
props: {
data: {
type: String,
type: Object,
required: false
},
section: {
File diff suppressed because one or more lines are too long
@@ -27,7 +27,7 @@
</div>
<div class="row">
<div class="col">
<div class="font-heading all-caps">MYR 0.00</div>
<div class="font-heading all-caps">MYR {{ data.stateCharges === null ? '0.00' : data.stateCharges.center }}</div>
</div>
</div>
</div>
@@ -39,7 +39,7 @@
</div>
<div class="row">
<div class="col">
<div class="font-heading all-caps">MYR 0.00</div>
<div class="font-heading all-caps">MYR {{ data.stateCharges === null ? '0.00' : data.stateCharges.outstation }}</div>
</div>
</div>
</div>
@@ -48,7 +48,7 @@
<div class="col">
<div class="btn btn-xs btn-primary pointer m-t-10 requestModal" data-type="editCharges">Edit</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="editCharges">
<edit-state-charges-form-component :data="data"></edit-state-charges-form-component>
<edit-state-charges-form-component :data="data" :section="section"></edit-state-charges-form-component>
</modal-component>
</div>
</div>
@@ -27,9 +27,9 @@
</div>
<div class="row">
<div class="col">
<div class="font-heading all-caps">MYR 0.00 <i class="fa fa-edit pointer fa-fw m-l-5 requestModal text-primary" data-type="editWarehouseCharges"></i></div>
<div class="font-heading all-caps">MYR {{ data.warehouseCharges === null ? '0.00' : data.warehouseCharges.amount }} <i class="fa fa-edit pointer fa-fw m-l-5 requestModal text-primary" data-type="editWarehouseCharges"></i></div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="editWarehouseCharges">
<edit-warehouse-charges-form-component :data="data"></edit-warehouse-charges-form-component>
<edit-warehouse-charges-form-component :data="data" section="warhouseListSection"></edit-warehouse-charges-form-component>
</modal-component>
</div>
</div>
@@ -54,7 +54,7 @@
<modal-component class="animate__animated animate__fast animate__fadeIn" type="warehouseRemark">
<remark-form-component module_type="CompanyModule" :data="data" section="warhouseListSection"></remark-form-component>
</modal-component>
<modal-component class="animate__animated animate__fast animate__fadeIn" type="deleteWarehouseRemark">
<modal-component class="animate__animated animate__fast animate__fadeIn" type="deleteWarehouseRemark">
<delete-remark-form-component :section="section" :data="data.remarks[0]"></delete-remark-form-component>
</modal-component>
</div>
@@ -0,0 +1,80 @@
<template>
<div class="row" style="width: 450px; margin: auto;" @keyup.enter="submitForm">
<div class="col bg-white b-rad-lg">
<div class="row m-b-10">
<div class="col text-center">
<p>Plese set the approximate of base price and dates of below.</p>
</div>
</div>
<div class="row">
<div class="col">
<div class="row m-auto mt-10 mb-10">
<div class="col p-l-0 p-r-10">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.dateFrom">
<label class="text-primary">Date From</label>
<date-picker-component v-model="parameters.dateFrom"></date-picker-component>
</validation-wrapper-component>
</div>
</div>
<div class="row m-auto mt-10 mb-10">
<div class="col p-l-0 p-r-10">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.dateTo">
<label class="text-primary">Date To</label>
<date-picker-component v-model="parameters.dateTo"></date-picker-component>
</validation-wrapper-component>
</div>
</div>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.rate">
<label class="text-primary">Extra Charges (MYR)</label>
<div class="controls">
<input type="text" class="form-control fs-12" v-model.trim="parameters.rate" v-money="money">
</div>
</validation-wrapper-component>
</div>
</div>
<div class="row m-t-15">
<div class="col p-r-5">
<div class="btn btn-sm btn-default b-rad-none w-100" data-dismiss="modal">Cancel</div>
</div>
<div class="col p-l-5">
<div class="btn btn-sm btn-primary w-100" @click="submitForm()">Confirm</div>
</div>
</div>
</div>
</div>
</template>
<script>
import modalFormHandler from '../../../general/mixins/modalFormHandler';
import { required } from "vuelidate/lib/validators";
export default {
props: {
section: {
default: ''
},
},
data() {
return {
parameters: {
dateFrom: '',
dateTo: '',
rate: ''
},
};
},
validations: {
parameters: {
dateFrom: { required },
dateTo: { required },
rate: { required },
}
},
methods: {
submitForm(){
this.submit(this.route('api.segment.constant.basePrice.create', 1), 'post', this.section, true, true)
},
},
mixins: [modalFormHandler]
}
</script>
@@ -0,0 +1,60 @@
<template>
<div class="row parentContainer padding-40 bg-white b-rad-lg" style="width: 450px; margin: auto;" @keyup.enter="submitForm">
<div class="col">
<div class="row m-b-10">
<div class="col">
<h2 class="text-center">Edit Base Price</h2>
<p class="text-center">{{ parameters.dateFrom }}</p>
</div>
</div>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.rate">
<label class="text-primary">Base Price (MYR)</label>
<div class="controls">
<input type="text" class="form-control fs-12" v-model.trim="parameters.rate" v-money="money">
</div>
</validation-wrapper-component>
<div class="row m-t-15">
<div class="col-auto p-r-5">
<div class="btn btn-lg btn-default b-rad-none" data-dismiss="modal">Cancel</div>
</div>
<div class="col p-l-5">
<div class="btn btn-primary w-100 btn-lg" @click="submit(route('api.segment.constant.basePrice.create', 1), 'post', section, true, true)">Confirm</div>
</div>
</div>
</div>
</div>
</template>
<script>
import modalFormHandler from '../../../general/mixins/modalFormHandler';
import { required } from "vuelidate/lib/validators";
export default {
props: {
data: {
type: Object,
required: false
},
section: {
default: ''
},
},
data() {
return {
parameters: {
dateFrom: this.data.date,
dateTo: this.data.date,
rate: this.data.rate
},
};
},
validations: {
parameters: {
dateFrom: { required },
dateTo: { required },
rate: { required },
}
},
mixins: [modalFormHandler]
}
</script>
@@ -0,0 +1,60 @@
<template>
<div class="row" style="width: 450px; margin: auto;" @keyup.enter="submitForm">
<div class="col bg-white b-rad-lg">
<div class="row m-b-10">
<div class="col">
<h3 class="text-center">Edit {{data.name}} Price</h3>
</div>
</div>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.value.amount">
<label class="text-primary">Segment Price (MYR)</label>
<div class="controls">
<input type="text" class="form-control fs-12" v-model.trim="parameters.value.amount" v-money="money">
</div>
</validation-wrapper-component>
<div class="row m-t-15">
<div class="col-auto p-r-5">
<div class="btn btn-lg btn-default b-rad-none" data-dismiss="modal">Cancel</div>
</div>
<div class="col p-l-5">
<div class="btn btn-primary w-100 btn-lg" @click="submit(route('api.segment.constant.update', data.id), 'put', section, true, true)">Confirm</div>
</div>
</div>
</div>
</div>
</template>
<script>
import modalFormHandler from '../../../general/mixins/modalFormHandler';
import { required } from "vuelidate/lib/validators";
export default {
props: {
data: {
type: Object,
required: false
},
section: {
default: ''
},
},
data() {
return {
parameters: {
reference: 'CUSTOM_PRICE',
value : {
amount: 0
}
}
};
},
validations: {
parameters: {
value: {
amount: { required }
}
}
},
mixins: [modalFormHandler]
}
</script>
@@ -6,16 +6,16 @@
<h2 class="text-center bold">{{data.name}}</h2>
</div>
</div>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.cityCenterCharges">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.rate.center">
<label class="text-primary">City Center Charges (MYR)</label>
<div class="controls">
<input type="text" class="form-control fs-12" v-model="cityCenterCharges">
<input type="text" class="form-control fs-12" v-model.trim="parameters.rate.center" v-money="money">
</div>
</validation-wrapper-component>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.outskirtCharges">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.rate.outstation">
<label class="text-primary">Outskirt Charges (MYR)</label>
<div class="controls">
<input type="text" class="form-control fs-12" v-model="outskirtCharges">
<input type="text" class="form-control fs-12" v-model.trim="parameters.rate.outstation" v-money="money">
</div>
</validation-wrapper-component>
<div class="row m-t-15">
@@ -23,8 +23,7 @@
<div class="btn btn-lg btn-default b-rad-none" data-dismiss="modal">Cancel</div>
</div>
<div class="col p-l-5">
<!-- <div class="btn btn-primary w-100 btn-lg" @click="submit(route('api.packing_list.assign.order', data, orderNo), 'put', section, true, true)">Confirm</div> -->
<div class="btn btn-primary w-100 btn-lg">Confirm</div>
<div class="btn btn-primary w-100 btn-lg" @click="submitForm()">Confirm</div>
</div>
</div>
</div>
@@ -46,16 +45,31 @@
},
data() {
return {
cityCenterCharges: '',
outskirtCharges : '',
cityCenterCharges: '',
outskirtCharges : '',
parameters: {
reference: 'STATE_RATE',
id: this.data.id,
rate: {
center: this.data.stateCharges == null ? 0 : this.data.stateCharges.center,
outstation: this.data.stateCharges == null ? 0 : this.data.stateCharges.outstation,
}
}
};
},
validations: {
parameters: {
cityCenterCharges: { required },
outskirtCharges: { required },
rate: {
center: { required },
outstation: { required }
}
}
},
methods: {
submitForm(){
this.submit(this.route('api.segment.constant.update', 1), 'put', this.section, true, true)
},
},
mixins: [modalFormHandler]
}
@@ -6,10 +6,10 @@
<h2 class="text-center">{{data.name}}</h2>
</div>
</div>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.extraCharges">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.rate.amount">
<label class="text-primary">Extra Charges (MYR)</label>
<div class="controls">
<input type="text" class="form-control fs-12" v-model="extraCharges">
<input type="text" class="form-control fs-12" v-model.trim="parameters.rate.amount" v-money="money">
</div>
</validation-wrapper-component>
<div class="row m-t-15">
@@ -17,8 +17,7 @@
<div class="btn btn-lg btn-default b-rad-none" data-dismiss="modal">Cancel</div>
</div>
<div class="col p-l-5">
<!-- <div class="btn btn-primary w-100 btn-lg" @click="submit(route('api.packing_list.assign.order', data, orderNo), 'put', section, true, true)">Confirm</div> -->
<div class="btn btn-primary w-100 btn-lg">Confirm</div>
<div class="btn btn-primary w-100 btn-lg" @click="submitForm()">Confirm</div>
</div>
</div>
</div>
@@ -40,14 +39,27 @@
},
data() {
return {
extraCharges: '',
parameters: {
reference: 'WAREHOUSE_RATE',
id: this.data.id,
rate : {
amount: this.data.warehouseCharges == null ? 0 : this.data.warehouseCharges.amount,
}
}
};
},
validations: {
parameters: {
extraCharges: { required },
rate: {
amount: { required }
}
}
},
methods: {
submitForm(){
this.submit(this.route('api.segment.constant.update', 1), 'put', this.section, true, true)
},
},
mixins: [modalFormHandler]
}
+1 -2
View File
@@ -29,8 +29,7 @@ export default {
$crisp.push(["set", "user:nickname", getters.getDecodedAccessToken.user.company_marking]);
$crisp.push(["set", "session:data", [
[
["izyim-marking", getters.getDecodedAccessToken.user.company_marking],
["company-name", getters.getDecodedAccessToken.user.company_name]
["company name", getters.getDecodedAccessToken.user.company_name],
]
]]);
}
@@ -1,4 +0,0 @@
@extends('layouts.base_portal')
@section('inner_content')
<delivery-orders-section-component></delivery-orders-section-component>
@endsection
+3 -3
View File
@@ -82,7 +82,7 @@
<div class="col">
<list-component section="activeContainerListSection" :endpoint="route('api.packing_list.container.list')" :options="{'per_page': 5, 'status_in': [1], order_by: {column: 'loading_date', DESC: true}}">
<template slot="list" slot-scope="{data}">
<container-component :data="data"></container-component>
<container-component section="activeContainerListSection" :data="data"></container-component>
</template>
</list-component>
</div>
@@ -91,7 +91,7 @@
<div class="col">
<list-component section="arrivedContainerListSection" :endpoint="route('api.packing_list.container.list')" :options="{'per_page': 5, 'status_in': [3], 'has_pending_delivery': true, order_by: {column: 'loading_date', DESC: true}}">
<template slot="list" slot-scope="{data}">
<container-component :data="data"></container-component>
<container-component section="arrivedContainerListSection" :data="data"></container-component>
</template>
</list-component>
</div>
@@ -100,7 +100,7 @@
<div class="col">
<list-component section="completeContainerListSection" :endpoint="route('api.packing_list.container.list')" :options="{'per_page': 5, 'status_in': [3], 'has_pending_delivery': false, order_by: {column: 'loading_date', DESC: true}}">
<template slot="list" slot-scope="{data}">
<container-component :data="data"></container-component>
<container-component section="completeContainerListSection" :data="data"></container-component>
</template>
</list-component>
</div>
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -9,13 +9,13 @@ Route::group(['prefix' => 'segment', 'as' => 'segment.', 'namespace' => 'Segment
Route::put('/update/{id}', 'UpdateSegmentController@update')->name('update');
Route::get('/list', 'ListSegmentsController@list')->name('list');
Route::get('/air-shipment/item-price/list', 'ListAirShipmentPriceController@list')->name('air_shipment.price.list');
Route::group(['prefix' => '{id}/constant', 'as' => 'constant.'], function () {
Route::put('/service/update', 'UpdateCustomServiceConstantController@update')->name('service.update');
Route::put('/update', 'UpdateConstantController@update')->name('update');
Route::get('/show/{reference}', 'FetchConstantController@fetch')->name('show');
Route::put('/update/state', 'UpdateConstantStateController@update')->name('update.state');
Route::put('/update/postcode', 'UpdateConstantPostcodeController@update')->name('update.postcode');
Route::post('base-price/create', 'CreateBasePriceController@create')->name('basePrice.create');
Route::get('base-price/show', 'FetchBasePriceController@fetch')->name('basePrice.show');
});
});
+3 -13
View File
@@ -55,16 +55,6 @@ Route::group(['prefix'=> '/last_mile_delivery', 'as' => 'last_mile_delivery.'],
});
Route::group(['prefix'=> '/air_shipment', 'as' => 'air_shipment.'], function () {
// Route::get('/', function () {
// return view('pages.accounts.signup');
// })->name('login');
Route::get('/quotation', function () {
return view('pages.airShipment.quotation');
})->name('quotation');
});
Route::get('', function () {
return view('pages.accounts.login');
})->name('login');
@@ -163,7 +153,7 @@ Route::get('/orders/refresh', function(){
Route::get('/containers/refresh', function(){
dd((App()->make(\App\Classes\Modules\PackingLists\Processors\FetchLoadedContainersFromVTPortalProcessor::class))->execute());
(App()->make(\App\Classes\Modules\PackingLists\Processors\FetchWarehouseReceiveListFromVTPortalProcessor::class))->execute();
// FetchLoadedContainersFromVTPortalJob::dispatch();
// FetchContainersStatusUpdateFromVTPortalJob::dispatch();
@@ -281,8 +271,8 @@ Route::get('/settings', function () {
})->name('settings');
Route::get('/customer/summary/monthly', function () {
$containers = Container::whereMonth('loading_date', '>', ((float)\Carbon\Carbon::now()->format('m') - 1))->whereYear('loading_date', \Carbon\Carbon::now()->format('Y'))->get();
// $containers = Container::whereIn('reference', ['cs-6062', 'eps-3926', 'sh-1122', 'sh-1121', 'eps-3925', 'cs-6060', 'eps-3927', 'cs-6066', 'cs-6069'])->get();
// $containers = Container::whereMonth('loading_date', 1)->where('owner_id', 3)->get();
$containers = Container::whereIn('reference', ['EPS-3850', 'EPS-3863', 'WP-1331', 'EPS-3856'])->get();
foreach ($containers as $container){
$packingLists = $container->packingLists()->get()->filter(function ($packingList) {
return $packingList->owner->company_module_id === 248;