Compare commits

..

6 Commits

Author SHA1 Message Date
edmondlang 2f98dc976a add file RescheduleTransportDateFormComponent 2022-04-21 21:42:32 +08:00
edmondlang 20237d69fb update 2022-04-21 21:02:25 +08:00
edmondlang 22f1548eac update delivery date 2022-04-21 20:58:27 +08:00
omair saleh 4e4475ad12 switch back to temp warehouse 2022-04-21 14:12:23 +08:00
omair saleh a287a1193a allow admin to add arrived parcels 2022-04-21 12:19:57 +08:00
omair saleh a80b3013c3 go to previous yd warehouse 2022-04-21 10:31:24 +08:00
35 changed files with 349 additions and 1027 deletions
@@ -56,28 +56,23 @@ class ReschedulePackingListLogic extends AbstractControllerLogic
*/
public function logic(Request $request) : JsonResponse
{
try {
$packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$transport = $packing_list->transports()->first();
$transport = $packing_list->transports()->first();
$old_sechedule = $transport->schedules()->first();
$old_sechedule = $transport->schedules()->first();
$this->updatesScheduleStatus->execute($old_sechedule, ApprovalStatus::REJECTED);
$this->updatesScheduleStatus->execute($old_sechedule, ApprovalStatus::REJECTED);
$scheduleObject = new ScheduleObject(
Carbon::parse($request->input('eta')),
Carbon::parse($request->input('etd')),
ApprovalStatus::APPROVED
);
$schedule = $this->createsSchedule->execute($transport, $scheduleObject);
return $this->resourceResponse(new PackingListResource($packing_list));
} catch (\Exception $exception){
throw new ErrorException($exception->getMessage(), $exception->getCode());
}
$scheduleObject = new ScheduleObject(
Carbon::parse($request->input('eta')),
Carbon::parse($request->input('etd')),
ApprovalStatus::APPROVED
);
$schedule = $this->createsSchedule->execute($transport, $scheduleObject);
return $this->resourceResponse(new PackingListResource($packing_list));
}
}
@@ -1,121 +0,0 @@
<?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));
}
}
@@ -1,68 +0,0 @@
<?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));
}
}
@@ -5,9 +5,7 @@ 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;
@@ -17,7 +15,6 @@ 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
{
@@ -50,11 +47,6 @@ class UpdateConstantLogic extends AbstractControllerLogic
/** @var CreatesConstant */
private $createsConstant;
/** @var CreatesSegment */
private $createsSegment;
/** @var UpdatesConstantValue */
private $updatesConstantValue;
/**
* UpdateConstantLogic constructor.
@@ -64,19 +56,8 @@ 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,
UpdatesConstantValue $updatesConstantValue,
CreatesSegment $createsSegment
)
public function __construct(CanUpdateConstant $canUpdateConstant, UpdatesConstant $updatesConstant, FetchesSegment $fetchesSegment, FetchesConstant $fetchesConstant, CanCreateConstant $canCreateConstant, CreatesConstant $createsConstant)
{
$this->canUpdateConstant = $canUpdateConstant;
$this->updatesConstant = $updatesConstant;
@@ -84,8 +65,6 @@ class UpdateConstantLogic extends AbstractControllerLogic
$this->fetchesConstant = $fetchesConstant;
$this->canCreateConstant = $canCreateConstant;
$this->createsConstant = $createsConstant;
$this->updatesConstantValue = $updatesConstantValue;
$this->createsSegment = $createsSegment;
}
/**
* @param Request $request
@@ -96,33 +75,28 @@ 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' => $request->input('reference')]);
$constantValue = $this->updatesConstantValue->execute($constant->value, $request->input('id'), $request->input('rate'));
$object = new ConstantObject($request->input('reference'), $constantValue);
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $object->getReference()]);
$this->canUpdateConstant->passes($object);
/** @var SegmentConstant $constant */
$constant = $this->updatesConstant->execute($constant, $object);
} catch (ResourceNotFoundException $exception){
$constantObject = [];
$constantObject[$request->input('id')] = $request->input('rate');
$object = new ConstantObject(
$request->input('reference'),
$constantObject
);
$this->canCreateConstant->passes($object);
/** @var SegmentConstant $constant */
$constant = $this->createsConstant->execute($segment, $object);
}
$constant = $this->updatesConstant->execute($constant, $object);
return $this->resourceResponse(new ConstantResource($constant));
}
@@ -14,8 +14,6 @@ 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
{
@@ -48,8 +46,6 @@ class UpdateConstantPostcodeLogic extends AbstractControllerLogic
/** @var RemoveItemFromConstantValueArray */
private $removeItemFromConstantValueArray;
/** @var CreatesConstant */
private $createsConstant;
/**
* UpdateConstantLogic constructor.
@@ -58,18 +54,9 @@ 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,
CreatesConstant $createsConstant
)
public function __construct(CanUpdateConstant $canUpdateConstant, UpdatesConstant $updatesConstant, FetchesSegment $fetchesSegment, FetchesConstant $fetchesConstant,AddItemToConstantValueArray $addItemToConstantValueArray, RemoveItemFromConstantValueArray $removeItemFromConstantValueArray)
{
$this->canUpdateConstant = $canUpdateConstant;
$this->updatesConstant = $updatesConstant;
@@ -77,7 +64,6 @@ class UpdateConstantPostcodeLogic extends AbstractControllerLogic
$this->fetchesConstant = $fetchesConstant;
$this->addItemToConstantValueArray = $addItemToConstantValueArray;
$this->removeItemFromConstantValueArray = $removeItemFromConstantValueArray;
$this->createsConstant = $createsConstant;
}
/**
* @param Request $request
@@ -90,42 +76,24 @@ class UpdateConstantPostcodeLogic extends AbstractControllerLogic
{
$segment = $this->fetchesSegment->execute(['id' => $request->route('id')]);
try {
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $request->input('reference')]);
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $request->input('reference')]);
$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
}
$object = new ConstantObject($constant->reference, $this->addItemToConstantValueArray->execute($constant->value, $request->input('postcode')));
$this->canUpdateConstant->passes($object);
$constant = $this->updatesConstant->execute($constant, $object);
return $this->resourceResponse(new ConstantResource($constant));
$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),
]);
}
}
@@ -0,0 +1,87 @@
<?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));
}
}
@@ -1,29 +0,0 @@
<?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;
}
}
@@ -1,23 +0,0 @@
<?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;
}
}
@@ -0,0 +1,32 @@
<?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;
}
}
@@ -1,20 +0,0 @@
<?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);
}
}
@@ -1,20 +0,0 @@
<?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);
}
}
@@ -0,0 +1,20 @@
<?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,8 +5,6 @@ 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
{
@@ -19,14 +17,6 @@ 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,
@@ -35,7 +25,6 @@ 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 -5
View File
@@ -32,9 +32,6 @@ 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,
@@ -43,8 +40,7 @@ class CompanyModuleResource extends JsonResource
'address' => new AddressResource($defaultAddress),
'company' => new CompanyResource($this->whenLoaded('company')),
'remarks' => RemarkResource::collection($this->remarks),
'marking' => $marking,
'warehouseCharges' => array_key_exists($this->id, $segmentConstant) ? $segmentConstant[$this->id] : null,
'marking' => $marking
];
}
-1
View File
@@ -20,7 +20,6 @@ class DistrictResource extends JsonResource
'state' => $this->state,
'country' => $this->country,
'postcode' => $this->postcode,
'postcodeArray' => PostcodeResource::collection(json_decode($this->postcode)),
];
}
}
-33
View File
@@ -1,33 +0,0 @@
<?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,
];
}
}
+1 -7
View File
@@ -1,9 +1,8 @@
<?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
{
@@ -15,15 +14,10 @@ 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,
];
}
}
@@ -64,19 +64,13 @@
</div>
</div>
</div>
<packing-list-section-component :section="section" :data="item" v-if="expanded"></packing-list-section-component>
<packing-list-section-component :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,13 +18,17 @@
{{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 :section="section" :data="{postcode: item.order.address.post_code, postcodeArea: item.order.address.post_code_area}"></declare-postcode-area-form-component>
<declare-postcode-area-form-component :data="item.order.address.post_code"></declare-postcode-area-form-component>
</modal-component>
</div>
</div>
<div class="col">
<p class="no-margin" v-if="item.transport">{{ item.transport.current_schedule.eta }}</p>
<p class="no-margin text-danger" v-if="!item.transport">{{ item.packages[0].container.transport ? item.packages[0].container.transport.dropped_days+' Days': 'n/a'}}</p>
<div class="btn btn-xs btn-primary pointer m-t-10 requestModal" data-type="rescheduleTransport">Reschedule Transport</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="rescheduleTransport">
<reschedule-transport-date-form-component :data="item"></reschedule-transport-date-form-component>
</modal-component>
</div>
<div class="col-auto text-right" v-if="!item.transport">
<div class="row m-b-5">
@@ -59,12 +63,6 @@
<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;">
<div class="row" style="width: 450px; margin: auto;" @keyup.enter="submitForm">
<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.postcode}}</h2>
<p class="text-center" v-show="parameters.reference=== ''">This postcode is yet to be declare. Plase choose the area.</p>
<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>
</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': parameters.reference === 'CENTER_POSTCODE', 'b-grey': parameters.reference !== 'CENTER_POSTCODE' }" @click="parameters.reference = 'CENTER_POSTCODE'">
<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="row">
<div class="col">
<h5 class="no-margin" :class="{ 'text-primary': parameters.reference === 'CENTER_POSTCODE', 'semi-bold': parameters.reference === 'CENTER_POSTCODE' }">City Center</h5>
<h5 class="no-margin" :class="{ 'text-primary': postcodeArea === 'city_center', 'semi-bold': postcodeArea === 'city_center' }">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': parameters.reference === 'OUTSTATION_POSTCODE', 'b-grey': parameters.reference !== 'OUTSTATION_POSTCODE' }" @click="parameters.reference = 'OUTSTATION_POSTCODE'">
<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="row">
<div class="col">
<h5 class="no-margin" :class="{ 'text-primary': parameters.reference === 'OUTSTATION_POSTCODE', 'semi-bold': parameters.reference === 'OUTSTATION_POSTCODE'}">Outskirt</h5>
<h5 class="no-margin" :class="{ 'text-primary': postcodeArea === 'outskirt', 'semi-bold': postcodeArea === 'outskirt'}">Outskirt</h5>
</div>
</div>
</div>
@@ -32,7 +32,8 @@
<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.postcode', 1), 'put', section, true, true)">Confirm</div>
<!-- <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>
</div>
</div>
@@ -45,7 +46,7 @@
export default {
props: {
data: {
type: Object,
type: String,
required: false
},
section: {
@@ -54,12 +55,13 @@
},
data() {
return {
parameters: {
reference: this.data.postcodeArea,
postcode: this.data.postcode
}
postcodeArea: '',
};
},
validations: {
orderNo: '',
},
mixins: [modalFormHandler]
}
@@ -0,0 +1,66 @@
<template>
<div class="row" style="width: 450px; margin: auto;" @keyup.enter="submitForm">
<div class="col bg-white padding-40 b-rad-lg">
<div class="row m-b-10">
<div class="col text-center">
<p>Plese set the approximate 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.etd">
<label class="text-primary">Etd</label>
<date-picker-component v-model="parameters.etd"></date-picker-component>
</validation-wrapper-component>
</div>
<div class="col p-r-0 p-l-10">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.eta">
<label class="text-primary">Eta</label>
<date-picker-component v-model="parameters.eta"></date-picker-component>
</validation-wrapper-component>
</div>
</div>
</div>
</div>
<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.packing_list.reschedule', 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: {
section:{
type: String,
default: ''
},
},
data() {
return {
parameters: {
etd: this.etd,
eta: this.eta,
}
};
},
validations: {
parameters: {
etd: { required },
eta: { required },
}
},
mixins: [modalFormHandler]
}
</script>
@@ -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 :section="section" :data="packingList"></packing-list-component>
<packing-list-component :data="packingList"></packing-list-component>
</div>
</div>
</div>
@@ -42,12 +42,6 @@
import PackingListComponent from "../elements/PackingListComponent";
export default {
components: {PackingListComponent, LoadingComponent},
props: {
section:{
type: String,
default: ''
}
},
data(){
return {
isLoading: true,
File diff suppressed because one or more lines are too long
@@ -15,19 +15,7 @@
</div>
<div class="row">
<div class="col">
<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 class="font-heading all-caps">{{data}}</div>
</div>
</div>
</div>
@@ -36,7 +24,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" section="allPostcodesSection"></declare-postcode-area-form-component>
<declare-postcode-area-form-component :data="data"></declare-postcode-area-form-component>
</modal-component>
</div>
</div>
@@ -52,7 +40,7 @@
export default {
props: {
data: {
type: Object,
type: String,
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 {{ data.stateCharges === null ? '0.00' : data.stateCharges.center }}</div>
<div class="font-heading all-caps">MYR 0.00</div>
</div>
</div>
</div>
@@ -39,7 +39,7 @@
</div>
<div class="row">
<div class="col">
<div class="font-heading all-caps">MYR {{ data.stateCharges === null ? '0.00' : data.stateCharges.outstation }}</div>
<div class="font-heading all-caps">MYR 0.00</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" :section="section"></edit-state-charges-form-component>
<edit-state-charges-form-component :data="data"></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 {{ 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>
<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>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="editWarehouseCharges">
<edit-warehouse-charges-form-component :data="data" section="warhouseListSection"></edit-warehouse-charges-form-component>
<edit-warehouse-charges-form-component :data="data"></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>
@@ -1,80 +0,0 @@
<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>
@@ -1,60 +0,0 @@
<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>
@@ -1,60 +0,0 @@
<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.rate.center">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.cityCenterCharges">
<label class="text-primary">City Center Charges (MYR)</label>
<div class="controls">
<input type="text" class="form-control fs-12" v-model.trim="parameters.rate.center" v-money="money">
<input type="text" class="form-control fs-12" v-model="cityCenterCharges">
</div>
</validation-wrapper-component>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.rate.outstation">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.outskirtCharges">
<label class="text-primary">Outskirt Charges (MYR)</label>
<div class="controls">
<input type="text" class="form-control fs-12" v-model.trim="parameters.rate.outstation" v-money="money">
<input type="text" class="form-control fs-12" v-model="outskirtCharges">
</div>
</validation-wrapper-component>
<div class="row m-t-15">
@@ -23,7 +23,8 @@
<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="submitForm()">Confirm</div>
<!-- <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>
</div>
</div>
@@ -45,31 +46,16 @@
},
data() {
return {
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,
}
}
cityCenterCharges: '',
outskirtCharges : '',
};
},
validations: {
parameters: {
rate: {
center: { required },
outstation: { required }
}
cityCenterCharges: { required },
outskirtCharges: { 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.rate.amount">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.extraCharges">
<label class="text-primary">Extra Charges (MYR)</label>
<div class="controls">
<input type="text" class="form-control fs-12" v-model.trim="parameters.rate.amount" v-money="money">
<input type="text" class="form-control fs-12" v-model="extraCharges">
</div>
</validation-wrapper-component>
<div class="row m-t-15">
@@ -17,7 +17,8 @@
<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="submitForm()">Confirm</div>
<!-- <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>
</div>
</div>
@@ -39,27 +40,14 @@
},
data() {
return {
parameters: {
reference: 'WAREHOUSE_RATE',
id: this.data.id,
rate : {
amount: this.data.warehouseCharges == null ? 0 : this.data.warehouseCharges.amount,
}
}
extraCharges: '',
};
},
validations: {
parameters: {
rate: {
amount: { required }
}
extraCharges: { required },
}
},
methods: {
submitForm(){
this.submit(this.route('api.segment.constant.update', 1), 'put', this.section, true, true)
},
},
mixins: [modalFormHandler]
}
+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 section="activeContainerListSection" :data="data"></container-component>
<container-component :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 section="arrivedContainerListSection" :data="data"></container-component>
<container-component :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 section="completeContainerListSection" :data="data"></container-component>
<container-component :data="data"></container-component>
</template>
</list-component>
</div>
File diff suppressed because one or more lines are too long
+1 -3
View File
@@ -13,9 +13,7 @@ Route::group(['prefix' => 'segment', 'as' => 'segment.', 'namespace' => 'Segment
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');
});
});