mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
Compare commits
93 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e7469f1cd | |||
| 32476afdd4 | |||
| 8b6db1fb68 | |||
| 43f3fbff07 | |||
| caf8624d4c | |||
| eb417cf389 | |||
| 276a87ff0d | |||
| 6d2f179025 | |||
| 8609c926f9 | |||
| 368a055bb4 | |||
| d617001412 | |||
| c932cb00cc | |||
| 1be62a5f77 | |||
| 445bcb3864 | |||
| d489775924 | |||
| fff428882d | |||
| 42205ddbc3 | |||
| 722e502b3b | |||
| 4f93569b4c | |||
| e1abebc66c | |||
| 2424882cfe | |||
| 23f50faa84 | |||
| edc510681e | |||
| db03836ef5 | |||
| 3a5f404294 | |||
| 9b79f16faa | |||
| 4ff4418f7f | |||
| 19c8f1e658 | |||
| e1c4d674b6 | |||
| 3326de9c4f | |||
| 54dd6d407d | |||
| 9ee81d9385 | |||
| aa1ba03415 | |||
| fb6b2173b5 | |||
| f18e4a882f | |||
| 8edc91bb61 | |||
| 6122c288df | |||
| 9650877819 | |||
| c65d875a3d | |||
| c1bc610549 | |||
| 82d406abfc | |||
| 701610978d | |||
| f7e1665a02 | |||
| d389b87609 | |||
| 987fdcfba2 | |||
| 6214a2b723 | |||
| fe00b1fab7 | |||
| 41df3e6ae7 | |||
| cf7d9ccca5 | |||
| 384d234b50 | |||
| 3fbfa44a04 | |||
| cbc294054e | |||
| 324556985a | |||
| 1b8c6ca317 | |||
| bbd09d300c | |||
| 47c97d6151 | |||
| 435e3a8f7a | |||
| 151032bb66 | |||
| f32335d57b | |||
| 2deddc4e03 | |||
| 32e665e4f7 | |||
| a987419040 | |||
| b0a65f870c | |||
| 33a75eca7d | |||
| deb68dc723 | |||
| 519408c2b5 | |||
| 53907e2463 | |||
| 10e6f6045e | |||
| c06cec5b41 | |||
| cfe611d05d | |||
| b9b79ca65a | |||
| 9a1562386f | |||
| 22700893a2 | |||
| 550c9480a4 | |||
| 48bab9998c | |||
| 3ff81d4f00 | |||
| cc7edfc784 | |||
| 72448d656c | |||
| c941f679b6 | |||
| 78f6c70cad | |||
| 1575d62e0f | |||
| 43f4bc533a | |||
| 9ae36dc400 | |||
| 02c55d97b7 | |||
| baeaa0f31a | |||
| dadc786f1f | |||
| bd9dab0029 | |||
| e2b795c872 | |||
| 9a79c6dd1d | |||
| d8e1c38429 | |||
| aa28afb9f0 | |||
| 7ec109eb3e | |||
| 7151616b04 |
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class OwnerId implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->where('owner_id', $value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class TargetId implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->where('target_type', User::class)->where('target_id', $value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,8 +26,6 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CallbackBillplzLogic
|
||||
{
|
||||
|
||||
|
||||
/** @var GetBillplzBill */
|
||||
private $getBillplzBill;
|
||||
|
||||
@@ -47,12 +45,11 @@ class CallbackBillplzLogic
|
||||
* @param UpdatesTransactionStatus $updatesTransactionStatus
|
||||
* @param UpdatesWalletBalance $updatesWalletBalance
|
||||
*/
|
||||
public function __construct(GetBillplzBill $getBillplzBill, FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, UpdatesWalletBalance $updatesWalletBalance)
|
||||
public function __construct(GetBillplzBill $getBillplzBill, FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus)
|
||||
{
|
||||
$this->getBillplzBill = $getBillplzBill;
|
||||
$this->fetchesTransaction = $fetchesTransaction;
|
||||
$this->updatesTransactionStatus = $updatesTransactionStatus;
|
||||
$this->updatesWalletBalance = $updatesWalletBalance;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,22 +81,11 @@ class CallbackBillplzLogic
|
||||
$status = $billplzXSignatureObject->getStatus() === 'failed' ? ApprovalStatus::REJECTED : ApprovalStatus::PENDING_VERIFICATION;
|
||||
}
|
||||
|
||||
if($transaction->status !== ApprovalStatus::COMPLETED){
|
||||
|
||||
if($transaction->owner instanceof Wallet && $transaction->status !== ApprovalStatus::APPROVED && $status === ApprovalStatus::APPROVED) {
|
||||
$this->updatesWalletBalance->execute($transaction->owner, $transaction->amount);
|
||||
}
|
||||
$this->updatesTransactionStatus->execute($transaction, $status);
|
||||
|
||||
}
|
||||
|
||||
|
||||
$token = Auth::fromUser(User::find(1));
|
||||
$request->headers->set('Authorization', 'Bearer '.$token);
|
||||
|
||||
$marking = $transaction->owner instanceof Booking ? $transaction->booking->marking : $transaction->owner->owner->bookings()->orderBy('id', 'DESC')->first()->marking;
|
||||
|
||||
return $request->method() === 'POST' ? true : view('pages.payments_redirect', ['marking' => $marking, 'transaction' => $transaction, 'status' => $status]);
|
||||
$marking = $transaction->owner()->first()->owner()->first();
|
||||
|
||||
return $request->method() === 'POST' ? true : view('pages.payments_redirect', ['marking' => $marking->reference, 'transaction' => $transaction, 'status' => $status]);
|
||||
}
|
||||
}
|
||||
+1
-18
@@ -14,8 +14,6 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Documents\Services\FetchesDocument;
|
||||
|
||||
use App\Classes\Modules\Documents\Services\ApprovesDocument;
|
||||
use App\Classes\Modules\Notifications\DataTransferObjects\NotificationObject;
|
||||
Use App\Classes\Modules\Notifications\Processors\CreateNotificationProcessor;
|
||||
|
||||
use App\Models\Document;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@@ -52,9 +50,6 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
/** @var UpdatesOrdersStatus */
|
||||
private $updatesOrdersStatus;
|
||||
|
||||
/** @var CreateNotificationProcessor */
|
||||
private $createNotificationProcessor;
|
||||
|
||||
/**
|
||||
* ApproveIdentificationDocumentLogic constructor.
|
||||
* @param CanApproveDocument $canApproveDocument
|
||||
@@ -63,9 +58,8 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
* @param FetchesDocument $fetchesDocument
|
||||
* @param UpdatesCompanyStatus $updatesCompanyStatus
|
||||
* @param UpdatesOrdersStatus $updatesOrdersStatus
|
||||
* @param CreateNotificationProcessor $createNotificationProcessor
|
||||
*/
|
||||
public function __construct(CanApproveDocument $canApproveDocument, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument, UpdatesCompanyStatus $updatesCompanyStatus, UpdatesOrdersStatus $updatesOrdersStatus, CreateNotificationProcessor $createNotificationProcessor)
|
||||
public function __construct(CanApproveDocument $canApproveDocument, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument, UpdatesCompanyStatus $updatesCompanyStatus, UpdatesOrdersStatus $updatesOrdersStatus)
|
||||
{
|
||||
$this->canApproveDocument = $canApproveDocument;
|
||||
$this->approvesDocument = $approvesDocument;
|
||||
@@ -73,7 +67,6 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
$this->fetchesDocument = $fetchesDocument;
|
||||
$this->updatesCompanyStatus = $updatesCompanyStatus;
|
||||
$this->updatesOrdersStatus = $updatesOrdersStatus;
|
||||
$this->createNotificationProcessor = $createNotificationProcessor;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,16 +90,6 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
|
||||
$this->updatesCompanyStatus->execute($document->owner, $status === 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
|
||||
|
||||
$object = new NotificationObject(
|
||||
'ID Verification ' . ( $status === 'approve' ? 'Approved' : 'Rejected' ),
|
||||
( $status === 'approve' ? 'Dear user, congratulations that your ' : 'Dear user, we are sorry to inform you that your ' ) . ( $document->type === 'IDENTITY_CARD' ? 'IC' : 'SSM' ) . ( $status === 'approve' ? ' has been approved. Start your first order now!' : ' has been rejected due to ' . ( $request->input('rejectRemark') ?? '' ) . ', please resubmit it for further action.' ),
|
||||
$document->owner,
|
||||
$document->owner->companyModules()->first()->employees()->first(),
|
||||
$document,
|
||||
);
|
||||
|
||||
$this->createNotificationProcessor->execute($object);
|
||||
|
||||
if($status === 'approve'){
|
||||
$orders = $this->updatesOrdersStatus->execute($document->owner, ApprovalStatus::APPROVED);
|
||||
}
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Notifications\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Notifications\Services\ListsNotification;
|
||||
use App\Http\Resources\NotificationResource;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListNotificationsLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Retrieve Notifications',
|
||||
'message' => 'You have successfully retrieved a list of Notifications'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var ListsNotification */
|
||||
private $listsNotification;
|
||||
|
||||
/**
|
||||
* ListNotificationsLogic constructor.
|
||||
* @param ListsNotification $listsNotification
|
||||
*/
|
||||
public function __construct(
|
||||
ListsNotification $listsNotification
|
||||
)
|
||||
{
|
||||
$this->listsNotification = $listsNotification;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @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
|
||||
{
|
||||
|
||||
$filters = [
|
||||
// 'target_id'=>auth()->user()->id,
|
||||
// 'per_page'=>$request->route('per_page')
|
||||
];
|
||||
|
||||
$notifications = $this->listsNotification->execute($filters);
|
||||
|
||||
return $this->collectionResponse(NotificationResource::collection($notifications));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Notifications\Services;
|
||||
|
||||
|
||||
use App\Classes\General\Eloquent\AbstractListRecord;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use App\Models\Notification;
|
||||
|
||||
class ListsNotification extends AbstractListRecord
|
||||
{
|
||||
|
||||
/** @var Bank */
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* ListsBank constructor.
|
||||
* @param Notification $repository
|
||||
*/
|
||||
public function __construct(Notification $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Builder
|
||||
*/
|
||||
function getRepository(): Builder
|
||||
{
|
||||
return $this->repository->newQuery();
|
||||
}
|
||||
}
|
||||
+2
-6
@@ -158,13 +158,9 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
}
|
||||
|
||||
foreach($containerDetail->Rows as $packingList){
|
||||
$marking = explode('/', explode('CIEF/', $packingList[13])[1]);
|
||||
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $packingList[13]));
|
||||
|
||||
if(!array_key_exists(1, $marking)){
|
||||
continue;
|
||||
}
|
||||
|
||||
$orderNumber = $marking[1];
|
||||
$orderNumber = $marking[array_key_last($marking)];
|
||||
|
||||
if(!$packingList[22]){
|
||||
continue;
|
||||
|
||||
+29
-7
@@ -181,16 +181,38 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
$eta = Carbon::parse($tracking[2]);
|
||||
}
|
||||
|
||||
if (strpos($trackingRow->tracking, '预计船时间为') !== false) {
|
||||
$tracking = explode('预计船时间为', $trackingRow->tracking);
|
||||
$delayDate = Carbon::parse(explode('日', $tracking[1])[0]);
|
||||
$rescheduleETD = strpos($trackingRow->remark, '开') || strpos($trackingRow->remark, '到港');
|
||||
$rescheduleETA = strpos($trackingRow->remark, '到港');
|
||||
if (($rescheduleETD !== false || $rescheduleETA !== false) && strpos($trackingRow->tracking, '货物装柜完成。') === false) {
|
||||
preg_match_all('/([0-9]+.{3})/', $trackingRow->remark, $matches);
|
||||
$dates = collect();
|
||||
|
||||
foreach($matches[0] as $date){
|
||||
try {
|
||||
$dates->push(Carbon::parse(str_replace('.', '/', $date).Carbon::now()->format('Y')));
|
||||
} catch (\Exception $exception) {
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$rescheduleDate = $dates->sortDesc()->first();
|
||||
if(!$delayDate || $rescheduleDate > $delayDate){
|
||||
/** @var Carbon $delayDate */
|
||||
$delayDate = $rescheduleDate;
|
||||
|
||||
if($rescheduleETA === false && $delayDate) {
|
||||
$delayDate = $delayDate->addDays('5');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (strpos($trackingRow->tracking, '预计开船为') !== false) {
|
||||
$tracking = explode('预计开船为', $trackingRow->tracking);
|
||||
$delayDate = Carbon::parse(explode('日', $tracking[1])[0]);
|
||||
if ($trackingRow->tracking === '已开船') {
|
||||
$delayDate = Carbon::parse($trackingRow->trackingtime)->addDays('5');
|
||||
}
|
||||
|
||||
|
||||
if ($trackingRow->tracking === '货物已进目的港仓库') {
|
||||
$unstuffingDate = Carbon::parse($trackingRow->trackingtime);
|
||||
}
|
||||
@@ -344,7 +366,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
|
||||
$transport = $container->transports()->first();
|
||||
|
||||
if(!$transport->schedules()->where('eta', '=', $delayDate)->first()) {
|
||||
if(!$transport->schedules()->whereDate('eta', '>=', $delayDate)->first()) {
|
||||
$etd = $transport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()->etd;
|
||||
$transport->schedules()->update(['status' => ApprovalStatus::EXPIRED]);
|
||||
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $delayDate, ApprovalStatus::APPROVED));
|
||||
|
||||
+2
-8
@@ -134,19 +134,13 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
|
||||
|
||||
foreach ($response->Rows as $parcel){
|
||||
|
||||
$marking = explode('/', explode('CIEF/', $parcel[5])[1]);
|
||||
|
||||
if(!array_key_exists(1, $marking)){
|
||||
continue;
|
||||
}
|
||||
|
||||
$orderNumber = $marking[1];
|
||||
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $parcel[5]));
|
||||
$orderNumber = $marking[array_key_last($marking)];
|
||||
|
||||
if(!$parcel[9]){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
|
||||
} catch (ResourceNotFoundException $exception) {
|
||||
|
||||
@@ -76,7 +76,7 @@ class UpdateConstantLogic extends AbstractControllerLogic
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
|
||||
$object = new ConstantObject($request->input('name'), $request->input('reference'), $request->input('detail'));
|
||||
$object = new ConstantObject($request->input('reference'), $request->input('value'));
|
||||
|
||||
$segment = $this->fetchesSegment->execute(['id' => $request->route('id')]);
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Segments\ControllersLogic;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
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\AddItemToConstantValueArray;
|
||||
use App\Classes\Modules\Segments\Services\RemoveItemFromConstantValueArray;
|
||||
|
||||
class UpdateConstantPostcodeLogic 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 AddItemToConstantValueArray */
|
||||
private $addItemToConstantValueArray;
|
||||
|
||||
/** @var RemoveItemFromConstantValueArray */
|
||||
private $removeItemFromConstantValueArray;
|
||||
|
||||
|
||||
/**
|
||||
* UpdateConstantLogic constructor.
|
||||
* @param CanUpdateConstant $canUpdateConstant
|
||||
* @param UpdatesConstant $updatesConstant
|
||||
* @param FetchesSegment $fetchesSegment
|
||||
* @param FetchesConstant $fetchesConstant
|
||||
* @param AddItemToConstantValueArray $addItemToConstantValueArray
|
||||
* @param RemoveItemFromConstantValueArray $removeItemFromConstantValueArray
|
||||
*/
|
||||
public function __construct(CanUpdateConstant $canUpdateConstant, UpdatesConstant $updatesConstant, FetchesSegment $fetchesSegment, FetchesConstant $fetchesConstant,AddItemToConstantValueArray $addItemToConstantValueArray, RemoveItemFromConstantValueArray $removeItemFromConstantValueArray)
|
||||
{
|
||||
$this->canUpdateConstant = $canUpdateConstant;
|
||||
$this->updatesConstant = $updatesConstant;
|
||||
$this->fetchesSegment = $fetchesSegment;
|
||||
$this->fetchesConstant = $fetchesConstant;
|
||||
$this->addItemToConstantValueArray = $addItemToConstantValueArray;
|
||||
$this->removeItemFromConstantValueArray = $removeItemFromConstantValueArray;
|
||||
}
|
||||
/**
|
||||
* @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' => $request->input('reference')]);
|
||||
|
||||
$object = new ConstantObject($constant->reference, $this->addItemToConstantValueArray->execute($constant->value, $request->input('postcode')));
|
||||
$this->canUpdateConstant->passes($object);
|
||||
|
||||
$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),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,34 +7,22 @@ use App\Classes\General\Interfaces\DataTransferObject;
|
||||
class ConstantObject implements DataTransferObject
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
private $name;
|
||||
|
||||
/** @var string */
|
||||
private $reference;
|
||||
|
||||
/** @var array */
|
||||
private $detail;
|
||||
private $value;
|
||||
|
||||
/**
|
||||
* ConstantObject constructor.
|
||||
* @param string $name
|
||||
* @param string $reference
|
||||
* @param array $detail
|
||||
* @param array $value
|
||||
*/
|
||||
public function __construct(string $name, string $reference, array $detail)
|
||||
public function __construct(string $reference, array $value)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->reference = $reference;
|
||||
$this->detail = $detail;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,9 +36,9 @@ class ConstantObject implements DataTransferObject
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getDetail(): array
|
||||
public function getValue(): array
|
||||
{
|
||||
return $this->detail;
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Segments\Services;
|
||||
|
||||
class AddItemToConstantValueArray
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param $item
|
||||
* @return array
|
||||
*/
|
||||
public function execute($array, $item): array {
|
||||
$array[] = $item;
|
||||
sort($array);
|
||||
return $array;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,11 +27,11 @@ class ConvertsConstantDetailsToResource
|
||||
|
||||
public function execute(SegmentConstant $constant){
|
||||
|
||||
if($constant->reference === SegmentConstants::SUPPLIER_CURRENCIES) {
|
||||
return property_exists($constant->detail, 'id') ? new CurrencyResource($this->fetchesCurrency->execute(['id' => $constant->detail->id])) : '';
|
||||
}
|
||||
// if($constant->reference === SegmentConstants::SUPPLIER_CURRENCIES) {
|
||||
// return property_exists($constant->detail, 'id') ? new CurrencyResource($this->fetchesCurrency->execute(['id' => $constant->detail->id])) : '';
|
||||
// }
|
||||
|
||||
return $constant->detail;
|
||||
return $constant->value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,8 @@ class CreatesConstant extends AbstractUpdateRelationshipRecord
|
||||
public function execute(Segment $segment, ConstantObject $object)
|
||||
{
|
||||
$model = new SegmentConstant();
|
||||
$model->name = $object->getName();
|
||||
$model->reference = $object->getReference();
|
||||
$model->detail = json_encode($object->getDetail());
|
||||
$model->value = json_encode($object->getValue());
|
||||
|
||||
return $this->handler($segment->constants(), $model);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Segments\Services;
|
||||
|
||||
class RemoveItemFromConstantValueArray
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param $item
|
||||
* @return array
|
||||
*/
|
||||
public function execute($array, $item): array {
|
||||
foreach($array as $key => $value){
|
||||
if($array[$key] == $item){
|
||||
unset($array[$key]);
|
||||
}
|
||||
}
|
||||
return array_values($array);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,9 +17,8 @@ class UpdatesConstant extends AbstractUpdateRecord
|
||||
*/
|
||||
public function execute(SegmentConstant $model, ConstantObject $object)
|
||||
{
|
||||
$model->name = $object->getName();
|
||||
$model->reference = $object->getReference();
|
||||
$model->detail = json_encode($object->getDetail());
|
||||
$model->value = json_encode($object->getValue());
|
||||
|
||||
return $this->handler($model);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,9 +15,8 @@ class ConstantValidation extends AbstractValidation
|
||||
protected function data($object): array {
|
||||
|
||||
$data = [
|
||||
'name' => $object->getName(),
|
||||
'reference' => $object->getReference(),
|
||||
'detail' => $object->getDetail()
|
||||
'value' => $object->getValue()
|
||||
];
|
||||
|
||||
return $data;
|
||||
@@ -28,9 +27,8 @@ class ConstantValidation extends AbstractValidation
|
||||
*/
|
||||
protected function rules(): array {
|
||||
return [
|
||||
'name' => 'required',
|
||||
'reference' => 'required',
|
||||
'detail' => 'required'
|
||||
'value' => 'required'
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
+30
-9
@@ -20,7 +20,11 @@ use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\PackageType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionDetailType;
|
||||
|
||||
use App\Models\Document;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@@ -86,7 +90,11 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
{
|
||||
$packing_list = $this->fetchesPackingList->execute(['id' => $request->input('packing_list_id')]);
|
||||
|
||||
$cbm = $packing_list->packages->sum(function($package) {
|
||||
$cbm = $packing_list->packages->where('type', '!=', PackageType::OVER_WEIGHT)->sum(function($package) {
|
||||
return ($package->width / 100) * ($package->height / 100) *($package->length / 100) * ($package->quantity);
|
||||
});
|
||||
|
||||
$over_weight_cbm = $packing_list->packages->where('type', PackageType::OVER_WEIGHT)->sum(function($package) {
|
||||
return ($package->width / 100) * ($package->height / 100) *($package->length / 100) * ($package->quantity);
|
||||
});
|
||||
|
||||
@@ -143,7 +151,7 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
}
|
||||
|
||||
$price_cbm = $base_price + $warehouse_rate + $state_rate;
|
||||
$total_cbm = $price_cbm * $cbm;
|
||||
$total_cbm = $price_cbm * ($cbm + $over_weight_cbm);
|
||||
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('SHIP-');
|
||||
|
||||
@@ -165,16 +173,28 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
ApprovalStatus::PENDING_SUBMISSION
|
||||
);
|
||||
|
||||
/** @var Transaction $invoice_transaction */
|
||||
$invoice_transaction = $this->createsTransaction->execute($packing_list, $object);
|
||||
|
||||
$object_detail = new TransactionDetailObject(
|
||||
$invoice_transaction->bill_no,
|
||||
$invoice_transaction->bill_no,
|
||||
1,
|
||||
$invoice_transaction->amount,
|
||||
$invoice_transaction->amount
|
||||
'SHIPPING_FEE',
|
||||
TransactionDetailType::SHIPPING_FEE,
|
||||
$cbm,
|
||||
$price_cbm
|
||||
);
|
||||
$transaction_detail = $this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
|
||||
|
||||
$this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
|
||||
|
||||
if ($over_weight_cbm > 0) {
|
||||
$object_detail = new TransactionDetailObject(
|
||||
'OVER_WEIGHT_CHARGES',
|
||||
TransactionDetailType::OVER_WEIGHT_CHARGES,
|
||||
$over_weight_cbm,
|
||||
$price_cbm
|
||||
);
|
||||
|
||||
$this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
|
||||
}
|
||||
|
||||
$transaction_invoice_pdf = LaravelMpdf::loadView('pages.pdfs.shipping_invoice', ['invoice_transaction' => $invoice_transaction]);
|
||||
|
||||
@@ -185,11 +205,12 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
ApprovalStatus::COMPLETED,
|
||||
'shipping_invoice'
|
||||
);
|
||||
|
||||
/** @var Document $document */
|
||||
$document = $this->createsDocument->execute($invoice_transaction, $document_object);
|
||||
|
||||
$this->createsFile->execute($document, $document_object);
|
||||
|
||||
// dd('yess');
|
||||
return $this->response([]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class TransactionDetailObject implements DataTransferObject
|
||||
/** @var string|null */
|
||||
private $name;
|
||||
|
||||
/** @var int|null */
|
||||
/** @var float|null */
|
||||
private $quantity;
|
||||
|
||||
/** @var float|null */
|
||||
@@ -22,10 +22,10 @@ class TransactionDetailObject implements DataTransferObject
|
||||
* TransactionDetailObject constructor.
|
||||
* @param string $reference
|
||||
* @param string $name
|
||||
* @param int $quantity
|
||||
* @param float $quantity
|
||||
* @param float $price
|
||||
*/
|
||||
public function __construct(?string $reference, ?string $name , ?int $quantity, ?float $price)
|
||||
public function __construct(?string $reference, ?string $name , ?float $quantity, ?float $price)
|
||||
{
|
||||
$this->reference = $reference;
|
||||
$this->name = $name;
|
||||
@@ -50,9 +50,9 @@ class TransactionDetailObject implements DataTransferObject
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return float
|
||||
*/
|
||||
public function getQuantity(): ?int
|
||||
public function getQuantity(): ?float
|
||||
{
|
||||
return $this->quantity;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\ValueObjects\Constants;
|
||||
|
||||
final class TransactionDetailType {
|
||||
|
||||
public const SHIPPING_FEE = 'Shipping Fee';
|
||||
|
||||
public const OVER_WEIGHT_CHARGES = 'Over weight charges';
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Notifications;
|
||||
|
||||
use App\Classes\Modules\Notifications\ControllersLogic\ListNotificationsLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListNotificationsController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ListNotificationsLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function list(Request $request, ListNotificationsLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ class DownloadOrderQrPdfController
|
||||
$warehousePrefix = '';
|
||||
$deliveryPrefix = '';
|
||||
$customerMarking = '';
|
||||
$remark = $warehouse->remarks()->first()->content;
|
||||
$remark = $warehouse->remarks()->first();
|
||||
|
||||
if($warehouse->reference === WarehouseReferences::VT_GUANG_ZHOU || $warehouse->reference === WarehouseReferences::VT_YIWU) {
|
||||
$customerMarking = $order->companyModule->connections()->first()->invitee_reference.'/';
|
||||
@@ -44,11 +44,11 @@ class DownloadOrderQrPdfController
|
||||
if($warehouse->reference === WarehouseReferences::YD_GUANG_ZHOU){
|
||||
$warehousePrefix = 'YD/';
|
||||
|
||||
if(strtolower($deliveryAddress->state->name) === 'sabah' || strtolower($deliveryAddress->state->name) === 'labuan') {
|
||||
if(strtolower($deliveryAddress->state->name) === 'sabah' || strtolower($deliveryAddress->state->name) === 'labuan' || in_array(strtolower($deliveryAddress->district->name), ['limbang', 'lawas'])) {
|
||||
$warehousePrefix = 'KK/';
|
||||
}
|
||||
|
||||
if(strtolower($deliveryAddress->state->name) === 'sarawak') {
|
||||
if(strtolower($deliveryAddress->state->name) === 'sarawak' && !in_array(strtolower($deliveryAddress->district->name), ['limbang', 'lawas'])) {
|
||||
$warehousePrefix = 'KU/';
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ class DownloadOrderQrPdfController
|
||||
'delivery_address' => $deliveryAddress,
|
||||
'warehouse_address' => $warehouseAddress,
|
||||
'warehouse_contacts' => $warehouseContacts,
|
||||
'remark' => $remark
|
||||
'remark' => $remark ? $remark->content : ''
|
||||
];
|
||||
|
||||
$pdf = LaravelMpdf::loadView('pdfs.qr', $data, [], [
|
||||
|
||||
@@ -200,4 +200,62 @@ class MonthlyReportController
|
||||
})->sum('quantity'),
|
||||
]]))->handler();
|
||||
}
|
||||
|
||||
public function customerActivityReport(Request $request): JsonResponse {
|
||||
|
||||
$active_start = $request->input('active_start');
|
||||
$active_end = $request->input('active_end');
|
||||
$inactive_start = $request->input('inactive_start');
|
||||
$inactive_end = $request->input('inactive_end');
|
||||
$minCbm = $request->input('cbm');
|
||||
$minOrders = $request->input('minOrders');
|
||||
|
||||
$activeCompanies = CompanyModule::where('type', \App\Classes\ValueObjects\Constants\BusinessType::IMPORTER)->whereHas('orderPackingLists', function($query) use($inactive_start, $inactive_end) {
|
||||
return $query->where('packing_lists.type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('transports', function ($query) use ($inactive_start, $inactive_end) {
|
||||
return $query->where('drop_date', '>=', \Carbon\Carbon::parse($inactive_start))->where('drop_date', '<=', \Carbon\Carbon::parse($inactive_end)->addDay());
|
||||
});
|
||||
})->pluck('id');
|
||||
|
||||
$companies = CompanyModule::where('type', \App\Classes\ValueObjects\Constants\BusinessType::IMPORTER)->whereHas('orderPackingLists', function($query) use($active_start, $active_end) {
|
||||
return $query->where('packing_lists.type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('transports', function ($query) use ($active_start, $active_end) {
|
||||
return $query->whereDate('drop_date', '>=', \Carbon\Carbon::parse($active_start))->whereDate('drop_date', '<=', \Carbon\Carbon::parse($active_end)->addDay());
|
||||
});
|
||||
})->whereNotIn('id', $activeCompanies)->get();
|
||||
|
||||
$customerActivityData = [];
|
||||
$counter = 1;
|
||||
|
||||
foreach ($companies as $key => $company){
|
||||
$connection = $company->inviters()->withPivot('invitee_reference')->first();
|
||||
$marking = $connection ? $connection->pivot->invitee_reference:'';
|
||||
$packingList = $company->orderPackingLists()->where('packing_lists.type', \App\Classes\ValueObjects\Constants\PackingListType::SHIPPING_PACKING_LIST)->get();
|
||||
$totalCbm = $packingList->flatMap(function ($packingList) {
|
||||
return $packingList->packages;
|
||||
})->sum(function($package){
|
||||
return (( (float) $package->width / 100) * ( (float) $package->length / 100) * ( (float) $package->height / 100)) * $package->quantity;
|
||||
});
|
||||
|
||||
if ($minCbm != 'null' && $totalCbm < $minCbm) { continue; }
|
||||
|
||||
if ($minOrders != 'null' && $packingList->count() < $minOrders) { continue; }
|
||||
|
||||
array_push($customerActivityData, array(
|
||||
'key' => $counter,
|
||||
'marking' => $marking,
|
||||
'packingListCount'=> $packingList->count(),
|
||||
'totalCbm'=> $totalCbm,
|
||||
));
|
||||
$counter ++;
|
||||
}
|
||||
|
||||
return (new ApiResponseObject('fetch service report Successful',
|
||||
'',
|
||||
HttpStatus::OK_WITH_MESSAGE, ['data' => [
|
||||
'active_start' => Carbon::parse($active_start)->format('d/m/Y'),
|
||||
'active_end' => Carbon::parse($active_end)->format('d/m/Y'),
|
||||
'inactive_start' => Carbon::parse($inactive_start)->format('d/m/Y'),
|
||||
'inactive_end' => Carbon::parse($inactive_end)->format('d/m/Y'),
|
||||
'customerActivityData' => $customerActivityData,
|
||||
]]))->handler();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Segments;
|
||||
|
||||
use App\Classes\Modules\Segments\ControllersLogic\UpdateConstantPostcodeLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdateConstantPostcodeController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param UpdateConstantPostcodeLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function update(Request $request, UpdateConstantPostcodeLogic $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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,9 +19,8 @@ class ConstantResource extends JsonResource
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'reference' => $this->reference,
|
||||
'detail' => (App()->make(ConvertsConstantDetailsToResource::class))->execute($this->resource)
|
||||
'value' => (App()->make(ConvertsConstantDetailsToResource::class))->execute($this->resource)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\BusinessType;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
|
||||
class NotificationResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'title' => $this->title,
|
||||
'description' => $this->description,
|
||||
'long_ago' => $this->created_at->diffForHumans(),
|
||||
'created_at' => $this->created_at->format('d-m-Y')
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
use Tymon\JWTAuth\Contracts\JWTSubject;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
@@ -24,8 +25,9 @@ class User extends AbstractModel implements
|
||||
AuthorizableContract,
|
||||
CanResetPasswordContract
|
||||
{
|
||||
use HasRoles, Notifiable, Authenticatable, Authorizable, CanResetPassword, MustVerifyEmail;
|
||||
use HasRoles, Notifiable, Authenticatable, Authorizable, CanResetPassword, MustVerifyEmail, SoftDeletes;
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
/**
|
||||
* Get the identifier that will be stored in the subject claim of the JWT.
|
||||
|
||||
@@ -18,7 +18,7 @@ class CreateTransactionDetailsTable extends Migration
|
||||
$table->foreignId('transaction_id')->unsigned();
|
||||
$table->string('reference');
|
||||
$table->string('name');
|
||||
$table->integer('quantity')->default(0);
|
||||
$table->decimal('quantity', 25, 5)->default(0.00);
|
||||
$table->decimal('price', 25, 5)->default(0.00);
|
||||
$table->decimal('amount', 25, 5)->default(0.00);
|
||||
$table->softDeletes();
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddDeletedAtToUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
@@ -317,12 +317,6 @@ hr{
|
||||
background-color: $color-primary-lighter !important;
|
||||
}
|
||||
|
||||
.bg-primary-lighter-hover {
|
||||
&:hover {
|
||||
background-color: $color-primary-lighter !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Complete
|
||||
------------------------------------
|
||||
*/
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -6,7 +6,7 @@
|
||||
<error-message-component class="m-b-20" :error="error"></error-message-component>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row" v-show="step === 1">
|
||||
<div class="row hide" v-show="step === 1">
|
||||
<div class="col">
|
||||
<div class="row m-b-15">
|
||||
<div class="col">
|
||||
@@ -180,13 +180,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-show="step === 2">
|
||||
<div class="row" v-show="step === 1">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="bold fs-11 all-caps muted">Personal Information</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-15">
|
||||
<div class="col p-r-5">
|
||||
<validation-wrapper-component :validator="$v.parameters.name">
|
||||
@@ -202,18 +197,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-15">
|
||||
<div class="col p-r-5">
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.parameters.email">
|
||||
<label>Email</label>
|
||||
<input class="form-control" v-model="parameters.email">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-4 p-l-5">
|
||||
<validation-wrapper-component :validator="$v.parameters.wechat_id">
|
||||
<label>WeChat ID</label>
|
||||
<input class="form-control" v-model="parameters.wechat_id">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m-b-15">
|
||||
@@ -230,9 +219,10 @@
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn btn-sm p-t-10 p-b-10 btn-default bg-master-lighter b-rad-none" @click="changeStep('back')">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<p class="text-info pointer m-b-0">Sign in instead</p>
|
||||
<button type="button" class="hide btn btn-sm p-t-10 p-b-10 btn-default bg-master-lighter b-rad-none" @click="changeStep('back')">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto p-r-10">
|
||||
<i class="fa fa-angle-left fs-16" style="margin-top: 1px;"></i>
|
||||
@@ -241,8 +231,8 @@
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<button type="button" class="btn btn-sm btn-block p-t-10 p-b-10 p-r-35 p-l-35 btn-primary b-rad-none p-r-30" @click="submitForm"><i class="fa fa-check fs-18 m-r-10"></i>Complete Registration</button>
|
||||
<div class="col-3">
|
||||
<button type="button" class="btn btn-sm btn-block p-t-10 p-b-10 p-r-35 p-l-35 btn-primary b-rad-none p-r-30" @click="submitForm">Sign Up</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+22
-1
@@ -137,7 +137,28 @@
|
||||
</button>
|
||||
</div>
|
||||
<modal-component small type="rejectDocument">
|
||||
<reject-identification-verification-form-component :section="section" :data="item"></reject-identification-verification-form-component>
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<h5 class="all-caps">Reject Document</h5>
|
||||
<div class="fs-11">Are you sure you want to reject this customer's identification?</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-r-5">
|
||||
<div data-dismiss="modal" class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div data-dismiss="modal" class="btn btn-sm btn-danger btn-block b-rad-none" @click="approveDocument('reject')">Reject</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</modal-component>
|
||||
<div class="col no-padding ml-auto">
|
||||
<button class="btn btn-md btn-block btn-success b-rad-none p-t-10 p-b-10 requestModal" data-type="approveDocument">
|
||||
|
||||
-82
@@ -1,82 +0,0 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-auto text-center">
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="all-caps">Reject Document</h5>
|
||||
<div class="fs-11">Are you sure you want to reject this customer's identification?</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-left margin-auto m-t-10 m-b-10">
|
||||
<div class="col">
|
||||
<span class="text-danger fs-9">{{ error }}</span>
|
||||
<div class="fs-11">Reason: </div>
|
||||
<div class="row">
|
||||
<div class="col fs-11">
|
||||
<div class="b-a padding-5 w-100 m-b-5 pointer b-grey muted" :class="{'b-primary': parameters.rejectRemark === rejectRemarkItem, 'text-primary': parameters.rejectRemark === rejectRemarkItem}" v-for="rejectRemarkItem in rejectRemarkArray" @click="chooseRejectRemark(rejectRemarkItem)">{{ rejectRemarkItem }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-r-5">
|
||||
<div data-dismiss="modal" class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div class="btn btn-sm btn-danger btn-block b-rad-none" @click="approveDocument('reject')">Reject</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
import modalFormHandler from '../../../general/mixins/modalFormHandler';
|
||||
import { required } from "vuelidate/lib/validators";
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
parameters: {
|
||||
rejectRemark: null,
|
||||
},
|
||||
rejectRemarkArray: null,
|
||||
documentType: this.data.document_type === 'IDENTITY_CARD' ? 'IC' : 'SSM',
|
||||
error: null,
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
parameters: {
|
||||
rejectRemark: { required },
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.rejectRemarkArray = [
|
||||
this.documentType + ' not clear',
|
||||
this.documentType + ' name different with registration name',
|
||||
'Wrong Document uploaded',
|
||||
'Non-Malaysian ' + this.documentType + ' Uploaded',
|
||||
this.documentType + ' not Genuine'
|
||||
];
|
||||
},
|
||||
methods: {
|
||||
approveDocument(status){
|
||||
this.parameters.rejectRemark === null ? this.error = 'Please choose a remark.' : null;
|
||||
this.isLoading = true;
|
||||
this.submit(this.route('api.company.identification.approval', this.item.owner.id, this.item.id, status), 'put', 'identificationVerificationSection', true, true);
|
||||
},
|
||||
chooseRejectRemark(remark) {
|
||||
this.parameters.rejectRemark = remark;
|
||||
}
|
||||
},
|
||||
mixins: [componentHandler, modalFormHandler]
|
||||
|
||||
}
|
||||
</script>
|
||||
+2
@@ -11,6 +11,7 @@
|
||||
<on-boarding-section-component v-if="!company.last_order"></on-boarding-section-component>
|
||||
<div class="row" v-if="company.last_order">
|
||||
<div class="col">
|
||||
<!-- new swction -->
|
||||
<div class="row tabsContainer">
|
||||
<div class="col no-padding">
|
||||
<div class="row m-l-0 m-r-0">
|
||||
@@ -126,6 +127,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end new swction -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+3
-3
@@ -8,8 +8,8 @@
|
||||
</div>
|
||||
<div class="row" v-show="!$store.getters.isShowing('createOrderForm')">
|
||||
<div class="col">
|
||||
<on-boarding-section-component v-if="!company.last_order"></on-boarding-section-component>
|
||||
<div class="row" v-if="company.last_order">
|
||||
<on-boarding-section-component v-if="company.last_order && company.status === 0"></on-boarding-section-component>
|
||||
<div class="row" v-if="company.last_order && company.status !== 0">
|
||||
<div class="col">
|
||||
<div class="row m-b-30 relative">
|
||||
<div class="col">
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<order-form-component v-show="$store.getters.isShowing('createOrderForm')" :company="company" :section="section"></order-form-component>
|
||||
<order-form-component v-show="$store.getters.isShowing('createOrderForm') || (!company.last_order && company.status === 0)" :company="company" :section="section"></order-form-component>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row m-b-20">
|
||||
<div class="row m-b-20 hide">
|
||||
<div class="col">
|
||||
<div class="row m-b-50 text-center" v-if="!$store.getters.isAdmin">
|
||||
<div class="col">
|
||||
@@ -97,6 +97,109 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center justify-content-center m-b-30">
|
||||
<div class="col-10 bg-master-lightest padding-25">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-12 col-lg-3">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-10">
|
||||
<a :href="route('order.qr.download', 3362)" target="_blank">
|
||||
<div class="peelable-corner overflow-hidden relative">
|
||||
<img :src="'https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl={id:3362}'" class="w-100">
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h4 class="text-success bold">Hooray! You have successfully created your first order.</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-20">
|
||||
<div class="col-auto">
|
||||
<h3 class="no-margin"><b>Order No.</b> 636295692</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center justify-content-center m-b-50">
|
||||
<div class="col-10">
|
||||
<div class="row">
|
||||
<div class="col p-t-10 p-b-25 p-l-25 p-r-25 bg-master-lightest b-r b-grey">
|
||||
<div class="row m-b-15">
|
||||
<div class="col text-center">
|
||||
<img src="/images/qr-box.svg" width="150" height="150">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col">
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<div class="bold all-caps fs-10"><i class="fa fa-circle text-primary m-r-10"></i>Step 1</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="no-margin">Send the QR Code label to your supplier to attach to your parcel</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-t-10 p-b-25 p-l-25 p-r-25 bg-master-lightest b-r b-grey">
|
||||
<div class="row m-b-15">
|
||||
<div class="col text-center">
|
||||
<img src="/images/package.svg" width="120" height="150">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col">
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<div class="bold all-caps fs-10"><i class="fa fa-circle text-primary m-r-10"></i>Step 2</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="no-margin">We receive your packages at our warehouse, and arrange for shipping.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-t-10 p-b-25 p-l-25 p-r-25 bg-master-lightest">
|
||||
<div class="row m-b-15">
|
||||
<div class="col">
|
||||
<img src="/images/package_hands.svg" width="160" height="150">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col">
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<div class="bold all-caps fs-10"><i class="fa fa-circle text-primary m-r-10"></i>Step 3</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="no-margin">Track your parcel to your doorsteps at your selected delivery address.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center justify-content-center">
|
||||
<div class="col-10">
|
||||
<complete-registration-form-component></complete-registration-form-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -35,7 +35,7 @@
|
||||
<div v-if="!item.order" class="text-danger">Unclaimed</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row hide" v-if="false">
|
||||
<div class="col">
|
||||
<div v-if="!item.shippng_transaction">
|
||||
<div class="btn btn-xs btn-primary pointer" @click="generateInvoice()">Generate Invoice</div>
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="btn-group">
|
||||
<i class="fa fa-bell fs-18 m-t-5 muted pointer" :class="{'text-primary' : isClicked}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" @click="openNotification()"></i>
|
||||
<div class="b-rad-md dropdown-menu dropdown-menu-right p-l-15 p-b-15 p-r-15 p-t-0" style="width: 100vw; height: 100vh; background: transparent !important;" @click="openNotification()">
|
||||
<div class="row shadow" style="width: 320px; position: absolute; top: 50px; right: 50px; background: white!important;">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="bg-master-lighter col p-l-10 p-l-10 p-t-10 bg-white text-center">
|
||||
<p>Notification Center</p>
|
||||
</div>
|
||||
</div>
|
||||
<loading-component style="height: 200px; top: 0;" key="1" color="primary" v-show="isLoading"></loading-component>
|
||||
<div class="row" :class="{'h-100' : notificationsLength >= 5}" v-show="!isLoading" style="max-height: 400px; ">
|
||||
<div class="col page-container overflow-hidden">
|
||||
<div class="row b-b b-grey bg-primary-lighter-hover pointer w-100 m-l-0 m-r-0" v-for="(notification, index) in notifications">
|
||||
<div class="col-auto justify-content-center align-items-center d-flex hide">
|
||||
<div>
|
||||
<i class="fa fa-check-circle fs-20 p-l-5 text-success"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col padding-10 p-l-15 p-r-15">
|
||||
<p class="bold m-b-5 lh-16">{{ notification.title }}</p>
|
||||
<p class="fs-9 m-b-0 lh-10">{{ notification.description }}</p>
|
||||
<p class="fs-9 m-b-0 m-t-10 lh-10">{{ notification.long_ago }}</p>
|
||||
</div>
|
||||
<div class="col-auto justify-content-center align-items-center d-none" :class="{'d-flex' : index === 0}">
|
||||
<div>
|
||||
<i class="fa fa-circle fs-10 text-primary"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-center m-t-50 m-b-50" v-if="notificationsLength === 0" v-show="!isLoading">
|
||||
<div class="col">
|
||||
<div class="row align-items-center justify-content-center hint-text">
|
||||
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
|
||||
</div>
|
||||
<div class="row text-center">
|
||||
<div class="col">
|
||||
<div class="row m-t-20">
|
||||
<div class="col">
|
||||
<p class="all-caps no-margin fs-11" style="letter-spacing: 2px;">Nothing To Show Here</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-5 align-items-center justify-content-center hide">
|
||||
<div class="col">
|
||||
<small class="fs-9 muted all-caps font-lato" style="letter-spacing: 2px">There is no results found.</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row b-t muted">
|
||||
<div class="col p-l-10 p-l-10 p-t-10 m-b-10 bg-white text-center">
|
||||
<a href="#">View All Notifications</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
isLoading: true,
|
||||
error: '',
|
||||
notifications: null,
|
||||
isClicked: false,
|
||||
notificationsLength: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openNotification(){
|
||||
this.isClicked === false ? this.fetchNotification() : '';
|
||||
this.isClicked = !this.isClicked;
|
||||
},
|
||||
fetchNotification(){
|
||||
this.isLoading = true;
|
||||
this.submit(route('notifications.list'), 'get', this.section, false, false)
|
||||
},
|
||||
successHandler(response){
|
||||
this.isLoading = false;
|
||||
this.notifications = response.payload.data;
|
||||
this.notificationsLength = response.payload.data.length;
|
||||
},
|
||||
},
|
||||
mixins: [ModalFormHandler]
|
||||
}
|
||||
</script>
|
||||
+16
-10
@@ -7,22 +7,28 @@
|
||||
</div>
|
||||
</div>
|
||||
<error-message-component class="m-b-20" :error="error"></error-message-component>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.receive_date">
|
||||
<div class="row m-b-25">
|
||||
<div class="col p-r-5">
|
||||
<validation-wrapper-component :validator="$v.parameters.receive_date">
|
||||
<label class="text-primary">Receive Date</label>
|
||||
<date-picker-component :parameters="parameters" :value="'receive_date'"></date-picker-component>
|
||||
<date-picker-component v-model="parameters.receive_date"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.tracking">
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<validation-wrapper-component :validator="$v.parameters.tracking">
|
||||
<label class="text-primary">Tracking</label>
|
||||
<input type="text" class="form-control fs-12" v-model.trim="parameters.tracking">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<package-form-component :section="section" :packages="parameters.packages"></package-form-component>
|
||||
<div class="row m-t-15 align-items-center justify-content-center">
|
||||
<div class="col">
|
||||
<div class="btn btn-block btn-lg btn-primary b-rad-none no-border" @click="submitForm">Submit</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-15 align-items-center justify-content-center" v-if="parameters.packages.length > 0">
|
||||
<div class="col">
|
||||
<div class="btn btn-block btn-lg btn-primary b-rad-none no-border" @click="submitForm">Submit</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -133,9 +133,15 @@
|
||||
</div>
|
||||
</div>
|
||||
<loading-component class="m-l-0" style="height: 50px; top: 0;" color="info"></loading-component>
|
||||
<div class="row">
|
||||
<div class="row" v-if="!company.last_order">
|
||||
<div class="col">
|
||||
<h4 class="text-info">We are generating the <b>QR code</b> that you need to <b>send to your supplier</b> to print to <b>stick to your packages</b>, this QR code is required for us to identify your packages when they arrives at our warehouse!</h4>
|
||||
<h4 class="text-info">We are generating your first <b>QR code</b></h4>
|
||||
<p>Please wait...</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="company.last_order">
|
||||
<div class="col">
|
||||
<h4 class="text-info">We are generating the <b>QR code</b> for you to <b>send to your supplier</b> to print and <b>stick to your packages</b>, this QR code is required for us to identify your packages when they arrives at our warehouse!</h4>
|
||||
<p>Please wait...</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -176,7 +182,7 @@
|
||||
methods:{
|
||||
createOrder(){
|
||||
this.step++;
|
||||
this.submit((this.route('api.order.create')), 'post', 'orderListSection', true, false)
|
||||
this.submit((this.route('api.order.create')), 'post', 'orderListSection', false, false)
|
||||
},
|
||||
cancelOrder(){
|
||||
this.parameters.warehouse_id = '';
|
||||
@@ -184,13 +190,18 @@
|
||||
this.$store.dispatch('toggleSection', {name: this.section, status: false})
|
||||
},
|
||||
successHandler(response){
|
||||
let vm = this;
|
||||
if(!this.company.last_order) {
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(function(){
|
||||
window.location.href = this.route('order.show', response.payload.data.reference)
|
||||
}, 5000);
|
||||
|
||||
},
|
||||
errorHandler(response){
|
||||
alert(response.message)
|
||||
this.error = response.message;
|
||||
this.step--;
|
||||
}
|
||||
|
||||
@@ -1,121 +1,101 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row no-margin">
|
||||
<div class="col p-t-25 p-t-25">
|
||||
<div class="row">
|
||||
<div class="col p-b-10 b-b b-grey">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto p-r-0" style="min-width: 40px;">
|
||||
<div class="font-heading all-caps fs-10"></div>
|
||||
</div>
|
||||
<div class="col p-r-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Type</div>
|
||||
</div>
|
||||
<div class="col-4 p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Description</div>
|
||||
</div>
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Width</div>
|
||||
</div>
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Height</div>
|
||||
</div>
|
||||
<div class="col-1 text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Length</div>
|
||||
</div>
|
||||
<div class="col-1 text-right p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Weight</div>
|
||||
</div>
|
||||
<div class="col-1 text-right p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Quantity</div>
|
||||
</div>
|
||||
<div class="col-1 text-right p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Reference</div>
|
||||
</div>
|
||||
<div class="col-auto text-center">
|
||||
<button class="btn btn-xs btn-outline-success b-rad-none invisible"><i class="fa fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<div class="row" v-if="!submitted">
|
||||
<div class="col p-b-5 p-t-5 b-b b-grey">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto p-r-0" style="min-width: 40px;">
|
||||
<div class="font-heading all-caps fs-10"></div>
|
||||
</div>
|
||||
<div class="col p-b-10 p-t-10 b-b b-grey">
|
||||
<div class="row align-items-center m-b-15">
|
||||
<div class="col p-r-5">
|
||||
<select-component :options="[{'id': 0, 'text': 'Carton'}, {'id': 1, 'text': 'Pallet'}]" v-model="product.type"></select-component>
|
||||
<validation-wrapper-component :validator="$v.product.description">
|
||||
<label class="text-primary">Description</label>
|
||||
<input type="text" class="form-control fs-12" v-model="product.description">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-4 p-r-5 p-l-5">
|
||||
<textarea class="form-control fs-10 b-rad-none" placeholder="Description" rows="1" @keyup="onlyEnglish($event)" v-model="product.description"></textarea>
|
||||
<div class="col p-l-5">
|
||||
<validation-wrapper-component :validator="$v.product.quantity">
|
||||
<label class="text-primary">Quantity</label>
|
||||
<input type="text" class="form-control fs-12" v-model="product.quantity">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<input type="text" class="form-control fs-10 b-rad-none text-center" placeholder="Width" v-model.lazy="product.width"/>
|
||||
</div>
|
||||
<div class="row m-b-15">
|
||||
<div class="col p-r-5">
|
||||
<validation-wrapper-component :validator="$v.product.width">
|
||||
<label class="text-primary">Width</label>
|
||||
<input type="text" class="form-control fs-12" v-model="product.width">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<input type="text" class="form-control fs-10 b-rad-none text-center" placeholder="Height" v-model.lazy="product.height"/>
|
||||
<div class="col p-r-5 p-l-5">
|
||||
<validation-wrapper-component :validator="$v.product.height">
|
||||
<label class="text-primary">Height</label>
|
||||
<input type="text" class="form-control fs-12" v-model="product.height">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<input type="text" class="form-control fs-10 b-rad-none text-center" placeholder="Length" v-model.lazy="product.length"/>
|
||||
<div class="col p-l-5">
|
||||
<validation-wrapper-component :validator="$v.product.length">
|
||||
<label class="text-primary">Length</label>
|
||||
<input type="text" class="form-control fs-12" v-model="product.length">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<input type="text" class="form-control fs-10 b-rad-none text-center" placeholder="Weight" v-model.lazy="product.weight"/>
|
||||
</div>
|
||||
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<input type="text" class="form-control fs-10 b-rad-none text-center" placeholder="Quantity" v-model.lazy="product.quantity"/>
|
||||
</div>
|
||||
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<input type="text" class="form-control fs-10 b-rad-none text-center" placeholder="Reference" v-model.lazy="product.reference"/>
|
||||
</div>
|
||||
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-xs btn-outline-success b-rad-none" @click="addPackage()"><i class="fa fa-check"></i></button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button class="btn btn-success btn-block b-rad-none" @click="addPackage()">Add Package</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-for="(item, index) in packages">
|
||||
<div class="col p-b-10 p-t-10 b-b b-grey">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto p-r-0" style="min-width: 40px;">
|
||||
<div class="font-heading all-caps fs-10">{{index + 1}}</div>
|
||||
</div>
|
||||
<div class="col p-r-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.type}}</div>
|
||||
</div>
|
||||
<div class="col-4 p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.description}}</div>
|
||||
</div>
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.width}}</div>
|
||||
</div>
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.height}}</div>
|
||||
</div>
|
||||
<div class="col-1 text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.length}}</div>
|
||||
</div>
|
||||
<div class="col-1 text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.weight}}</div>
|
||||
</div>
|
||||
<div class="col-1 text-right p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.quantity}}</div>
|
||||
</div>
|
||||
<div class="col-1 text-right p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.reference}}</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-xs btn-outline-danger b-rad-none" v-if="!submitted" @click="removePackage(index)"><i class="fa fa-times"></i></button>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row align-items-center m-b-15">
|
||||
<div class="col-auto">
|
||||
<div @click="removePackage(index)" class="pointer">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
width="25" height="25"
|
||||
viewBox="0 0 172 172"
|
||||
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="#e74c3c"><path d="M18.87987,153.12013c2.23887,2.23819 5.86807,2.23819 8.10693,0l59.0132,-59.0132l59.0132,59.0132c2.24964,2.17277 5.82555,2.1417 8.03709,-0.06984c2.21154,-2.21154 2.24261,-5.78745 0.06984,-8.03709l-59.0132,-59.0132l59.0132,-59.0132c1.49042,-1.43949 2.08815,-3.57117 1.56346,-5.57571c-0.52469,-2.00454 -2.09015,-3.57 -4.09469,-4.09469c-2.00454,-0.52469 -4.13622,0.07305 -5.57571,1.56346l-59.0132,59.0132l-59.0132,-59.0132c-2.24964,-2.17277 -5.82555,-2.1417 -8.03709,0.06984c-2.21154,2.21154 -2.24261,5.78745 -0.06984,8.03709l59.0132,59.0132l-59.0132,59.0132c-2.23819,2.23887 -2.23819,5.86807 0,8.10693z"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<p class="m-b-0 small muted">Description</p>
|
||||
<p class="m-b-0 bold">{{item.description}}</p>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<p class="m-b-0 small muted">Quantity</p>
|
||||
<p class="m-b-0 bold">{{item.quantity}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto">
|
||||
<p class="m-b-0 small muted">Width</p>
|
||||
<p class="m-b-0 bold">{{item.width}}</p>
|
||||
</div>
|
||||
<div class="col-auto text-center">
|
||||
<p class="m-b-0 small muted">Height</p>
|
||||
<p class="m-b-0 bold">{{item.height}}</p>
|
||||
</div>
|
||||
<div class="col-auto text-center">
|
||||
<p class="m-b-0 small muted">Length</p>
|
||||
<p class="m-b-0 bold">{{item.length}}</p>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<p class="m-b-0 small muted">Total CBM</p>
|
||||
<p class="m-b-0 bold text-success">{{(Math.round((((item.width / 100) * (item.height / 100) * (item.length / 100) * item.quantity)) * 1000) / 1000).toFixed(3)}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -129,6 +109,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { required, numeric } from "vuelidate/lib/validators";
|
||||
import formHandler from '../../../general/mixins/formHandler';
|
||||
export default {
|
||||
props: {
|
||||
@@ -141,7 +122,7 @@
|
||||
return {
|
||||
submitted: false,
|
||||
product: {
|
||||
type: '',
|
||||
type: 0,
|
||||
description: '',
|
||||
width: 0,
|
||||
height: 0,
|
||||
@@ -152,15 +133,40 @@
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onlyEnglish(event){
|
||||
let value = event.target.value,
|
||||
regex = /^[^~`!@#$%^&*()_+=[\]\{}|;':",.\/<>?a-zA-Z0-9-]+$/;
|
||||
event.preventDefault();
|
||||
if(regex.test(value)){
|
||||
this.product.description = value.replace(regex, '');
|
||||
validations: {
|
||||
product: {
|
||||
type: {
|
||||
required
|
||||
},
|
||||
description: {
|
||||
required
|
||||
},
|
||||
width: {
|
||||
required,
|
||||
numeric
|
||||
},
|
||||
height: {
|
||||
required,
|
||||
numeric
|
||||
},
|
||||
length: {
|
||||
required,
|
||||
numeric
|
||||
},
|
||||
weight: {
|
||||
required,
|
||||
numeric
|
||||
},
|
||||
quantity: {
|
||||
required,
|
||||
numeric
|
||||
},
|
||||
reference: {
|
||||
required
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addPackage(){
|
||||
this.packages.push({
|
||||
type: this.product.type,
|
||||
@@ -173,17 +179,19 @@
|
||||
reference: this.product.reference,
|
||||
});
|
||||
|
||||
this.product = {
|
||||
type: '',
|
||||
description: '',
|
||||
width: 0,
|
||||
height: 0,
|
||||
length: 0,
|
||||
weight: 0,
|
||||
quantity: 1,
|
||||
reference: 0,
|
||||
};
|
||||
|
||||
this.resetProduct();
|
||||
},
|
||||
resetProduct(){
|
||||
this.product = {
|
||||
type: '',
|
||||
description: '',
|
||||
width: 0,
|
||||
height: 0,
|
||||
length: 0,
|
||||
weight: 0,
|
||||
quantity: 1,
|
||||
reference: 0,
|
||||
};
|
||||
},
|
||||
removePackage(index){
|
||||
this.packages.splice(index, 1);
|
||||
|
||||
@@ -273,9 +273,11 @@
|
||||
viewBox="0 0 172 172"
|
||||
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 class="col-auto" v-if="false">
|
||||
<div data-type="createWarehousePackageList" class="btn btn-sm btn-block bg-white text-info b-rad-sm pointer requestModal">Add</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="stick-up" type="createWarehousePackageList" size="large">
|
||||
</div>
|
||||
<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" >
|
||||
<create-warehouse-package-list-form-component :id="order.id" :section="section"></create-warehouse-package-list-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row m-l-0 m-r-0 bg-master-light padding-10" @keyup.enter="submitSearch()">
|
||||
<div class="col-12 col-md mb-2 mb-md-0">
|
||||
<div class="row">
|
||||
<div class="col p-r-0 h-100">
|
||||
<validation-wrapper-component :validator="$v.numOrders">
|
||||
<label class="all-caps">Number Of Orders</label>
|
||||
<input class="form-control" v-model.lazy="numOrders">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col p-l-0 h-100">
|
||||
<validation-wrapper-component :validator="$v.cbm">
|
||||
<label class="all-caps">CBM</label>
|
||||
<input class="form-control" v-model.lazy="cbm">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md mb-2 mb-md-0">
|
||||
<div class="row">
|
||||
<div class="col p-r-0 h-100">
|
||||
<validation-wrapper-component :validator="$v.activeDateFrom">
|
||||
<label class="all-caps">Active Date From</label>
|
||||
<date-picker-component v-model.lazy="activeDateFrom"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col p-l-0 h-100">
|
||||
<validation-wrapper-component :validator="$v.activeDateTo">
|
||||
<label class="all-caps">Active Date To</label>
|
||||
<date-picker-component v-model.lazy="activeDateTo"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md mb-2 mb-md-0">
|
||||
<div class="row">
|
||||
<div class="col p-r-0 h-100">
|
||||
<validation-wrapper-component :validator="$v.inactiveDateFrom">
|
||||
<label class="all-caps">Inactive Date From</label>
|
||||
<date-picker-component v-model.lazy="inactiveDateFrom"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col p-l-0 h-100">
|
||||
<validation-wrapper-component :validator="$v.inactiveDateTo">
|
||||
<label class="all-caps">Inactive Date To</label>
|
||||
<date-picker-component v-model.lazy="inactiveDateTo"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto mb-2 mb-md-0">
|
||||
<div class="row h-100">
|
||||
<div class="col p-r-0 h-100">
|
||||
<div class="btn btn-primary b-rad-none w-100 h-100 d-flex justify-content-center align-items-center p-l-30 p-r-30" @click="submitSearch()">
|
||||
Search
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-l-0 h-100">
|
||||
<div class="btn btn-secondary b-rad-none w-100 h-100 d-flex justify-content-center align-items-center p-l-30 p-r-30" @click="resetSearch()">
|
||||
Reset
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<loading-component style="height: 100%; top: 0;" key="1" color="success" v-show="isLoading"></loading-component>
|
||||
<div class="row" v-show="!isLoading" v-if="activityData">
|
||||
<div class="col">
|
||||
<h4>List of customers active between <span style="color: green; font-weight: bold">{{ activityData.active_start }} - {{ activityData.active_end }}</span> & inactive between <span style="color: red; font-weight: bold">{{ activityData.active_start }} - {{ activityData.active_end }}</span></h4>
|
||||
<table>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>marking</th>
|
||||
<th>Number of Orders</th>
|
||||
<th>CBM</th>
|
||||
</tr>
|
||||
<tr v-for="item in activityData.customerActivityData" >
|
||||
<td>{{item.key}}</td>
|
||||
<td><a :href="route('customer.profile', item.marking)" target="_blank">{{ item.marking }}</a></td>
|
||||
<td>{{ item.packingListCount }}</td>
|
||||
<td>{{ item.totalCbm }} </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import componentHandler from "../../../general/mixins/componentHandler";
|
||||
import { required } from "vuelidate/lib/validators";
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
section: 'customerActivityReportSection',
|
||||
isLoading: false,
|
||||
cbm: null,
|
||||
numOrders: null,
|
||||
activeDateFrom: '',
|
||||
activeDateTo: '',
|
||||
inactiveDateFrom: '',
|
||||
inactiveDateTo: '',
|
||||
activityData: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitSearch(){
|
||||
this.$store.dispatch('toggleSection', {name: this.section, status: true});
|
||||
this.submit(route('api.report.customerActivity') + '?active_start=' + this.activeDateFrom + '&active_end=' + this.activeDateTo + '&inactive_start=' + this.inactiveDateFrom + '&inactive_end=' + this.inactiveDateTo + '&cbm=' + this.cbm + '&minOrders=' + this.numOrders, 'get', this.section, false, false);
|
||||
this.isLoading = true;
|
||||
},
|
||||
resetSearch() {
|
||||
this.$store.dispatch('toggleSection', {name: this.section, status: false});
|
||||
this.cbm = null;
|
||||
this.numOrders = null;
|
||||
this.activeDateFrom = '';
|
||||
this.activeDateTo = '';
|
||||
this.inactiveDateFrom = '';
|
||||
this.inactiveDateTo = '';
|
||||
this.activityData = null;
|
||||
},
|
||||
successHandler(response){
|
||||
this.activityData = response.payload.data;
|
||||
this.isLoading = false;
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
cbm: { },
|
||||
numOrders: { },
|
||||
activeDateFrom: { required },
|
||||
activeDateTo: { required },
|
||||
inactiveDateFrom: { required },
|
||||
inactiveDateTo: { required }
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
};
|
||||
</script>
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps">{{data.name}}</div>
|
||||
<div class="font-heading all-caps">{{data.reference}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ export default {
|
||||
(this.$store.getters.isAuthenticated && !this.isProtectedRoute()&& this.isWithTokenRoute()) ? window.location.href = this.route('dashboard') : '';
|
||||
},
|
||||
isProtectedRoute(){
|
||||
const unprotectedRoutes = [this.route('login'), this.route('account.email.verification'), this.route('company.claim')];
|
||||
const unprotectedRoutes = [this.route('login'), this.route('account.email.verification'), this.route('company.claim'), this.route('signup')];
|
||||
if(window.location.href.indexOf(this.route('company.claim')) === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
@extends('layouts.base')
|
||||
@section('content')
|
||||
<div class="fluid-container h-100">
|
||||
<div class="row h-100">
|
||||
<div class="col-5 d-none d-lg-inline h-100 padding-50 bg-info" >
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row m-b-50">
|
||||
<div class="col-5 col-md-3">
|
||||
<img class="w-100" src="{{asset('images/cief-logo-white.png')}}" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<h3 class="text-white ">Spend less time managing your logistics and more time optimizing your operations.</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<h4 class="text-white ">You know how to run your operations, let us help you streamline your logistic supply chain management.</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ">
|
||||
<div class="col">
|
||||
<h4 class="text-white">Sign-up today and get access to:</h4>
|
||||
<h5 class="text-white m-l-20"><i class="fa fa-circle-o m-r-10"></i>An intuitive and easy to use order process</h5>
|
||||
<h5 class="text-white m-l-20"><i class="fa fa-circle-o m-r-10"></i>Service customization to keep you in control</h5>
|
||||
<h5 class="text-white m-l-20"><i class="fa fa-circle-o m-r-10"></i>Follow-up action to keep you on track</h5>
|
||||
<h5 class="text-white m-l-20"><i class="fa fa-circle-o m-r-10"></i>Personalized customer support</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col bg-white no-padding h-100">
|
||||
<div class="row h-100 align-items-center justify-content-center">
|
||||
<div class="col h-100">
|
||||
<div class="page-container">
|
||||
<div class="page-content-wrapper p-t-50 p-b-50 h-100">
|
||||
<div class="row no-margin align-items-center justify-content-center h-100">
|
||||
<div class="col">
|
||||
<div class="content p-t-0 overflow-hidden">
|
||||
<div class="row h-100 no-margin align-items-center justify-content-center">
|
||||
<div class="col col-md-10">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<loading-component style="height: 350px;" key="1" color="primary" v-show="$store.getters.isLoading('loginSection')"></loading-component>
|
||||
<div class="row justify-content-center" v-show="!$store.getters.isLoading('loginSection')">
|
||||
<div class="col">
|
||||
<registration-form-component section="loginSection"></registration-form-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -2,37 +2,42 @@
|
||||
@section('inner_content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<customer-report-section-component></customer-report-section-component>
|
||||
<div class="row d-none" :class="[{'d-flex': $store.getters.isAdmin}]" v-if="$store.getters.isAdmin">
|
||||
<div class="col-6">
|
||||
<div class="row p-b-5 b-b b-grey m-b-10 m-l-0 m-r-0">
|
||||
<div class="col no-padding">
|
||||
<h6>Customers List</h6>
|
||||
<customer-activity-report-section-component></customer-activity-report-section-component>
|
||||
<div class="row" v-show="!$store.getters.isShowing('customerActivityReportSection')">
|
||||
<div class="col">
|
||||
<customer-report-section-component></customer-report-section-component>
|
||||
<div class="row d-none" :class="[{'d-flex': $store.getters.isAdmin}]" v-if="$store.getters.isAdmin">
|
||||
<div class="col-6">
|
||||
<div class="row p-b-5 b-b b-grey m-b-10 m-l-0 m-r-0">
|
||||
<div class="col no-padding">
|
||||
<h6>Customers List</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-l-0 m-r-0">
|
||||
<div class="col">
|
||||
<list-component key="2" section="customerListSection" :endpoint="route('api.company.list')" :options="{'has_business_module_type': 1}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<company-component :data="data"></company-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-l-0 m-r-0">
|
||||
<div class="col">
|
||||
<list-component key="2" section="customerListSection" :endpoint="route('api.company.list')" :options="{'has_business_module_type': 1}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<company-component :data="data"></company-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="row p-b-5 b-b b-grey m-b-10 m-l-0 m-r-0">
|
||||
<div class="col no-padding">
|
||||
<h6>Customers Without Confirmed Orders</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-l-0 m-r-0">
|
||||
<div class="col">
|
||||
<list-component key="2" section="customerWithoutConfirmedOrdersListSection" :endpoint="route('api.company.list')" :options="{'has_business_module_type': 1, 'created_after': '18-09-2021','without_confirmed_orders': true}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<company-component :data="data"></company-component>
|
||||
</template>
|
||||
</list-component>
|
||||
<div class="col-6">
|
||||
<div class="row p-b-5 b-b b-grey m-b-10 m-l-0 m-r-0">
|
||||
<div class="col no-padding">
|
||||
<h6>Customers Without Confirmed Orders</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-l-0 m-r-0">
|
||||
<div class="col">
|
||||
<list-component key="2" section="customerWithoutConfirmedOrdersListSection" :endpoint="route('api.company.list')" :options="{'has_business_module_type': 1, 'created_after': '18-09-2021','without_confirmed_orders': true}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<company-component :data="data"></company-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<div class="col">Delivery Date</div>
|
||||
<div class="col text-right">Action</div>
|
||||
</div>
|
||||
<list-component section="activeContainerListSection" :endpoint="route('api.packing_list.list')" :options="{type: 2, 'packing_list_delivery_status': 1, 'per_page': 30}">
|
||||
<list-component section="activeContainerListSection" :endpoint="route('api.packing_list.list')" :options="{packing_list_type: 2, 'packing_list_delivery_status': 1, with_arrival_date: true ,'per_page': 30, order_by: {column: 'arrival_date', DESC: true}}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
|
||||
</template>
|
||||
@@ -103,7 +103,7 @@
|
||||
<div class="col">status</div>
|
||||
<div class="col">Delivery Date</div>
|
||||
</div>
|
||||
<list-component section="arrivedContainerListSection" :endpoint="route('api.packing_list.list')" :options="{type: 2, 'packing_list_delivery_status': 2,'per_page': 30}">
|
||||
<list-component section="arrivedContainerListSection" :endpoint="route('api.packing_list.list')" :options="{packing_list_type: 2, 'packing_list_delivery_status': 2, with_arrival_date: true ,'per_page': 30, order_by: {column: 'arrival_date', DESC: true}}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
|
||||
</template>
|
||||
@@ -121,7 +121,7 @@
|
||||
<div class="col">status</div>
|
||||
<div class="col">Delivery Date</div>
|
||||
</div>
|
||||
<list-component section="completeContainerListSection" :endpoint="route('api.packing_list.list')" :options="{type: 2, 'packing_list_delivery_status': 3, 'per_page': 30}">
|
||||
<list-component section="completeContainerListSection" :endpoint="route('api.packing_list.list')" :options="{packing_list_type: 2, 'packing_list_delivery_status': 3, with_arrival_date: true ,'per_page': 30, order_by: {column: 'arrival_date', DESC: true}}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
|
||||
</template>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -7,12 +7,14 @@
|
||||
<h6>Arrived Parcel</h6>
|
||||
</div>
|
||||
</div>
|
||||
<list-component section="warehouseListSection" :endpoint="route('api.packing_list.list')" :options="{packing_list_type: 1, packing_list_status: 2, per_page: 5, order_by: {column: 'arrival_date', DESC: true}, with_arrival_date: true}">
|
||||
<list-component section="warehouseListSection" :endpoint="route('api.packing_list.list')" :options="{packing_list_type: 1, packing_list_status: 2, per_page: 20, order_by: {column: 'arrival_date', DESC: true}, with_arrival_date: true}" >
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<parcel-component v-for="packages in data.packages" :data="packages" :key="packages.id"></parcel-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row p-b-5 b-b b-grey m-b-10 m-l-0 m-r-0">
|
||||
<div class="col no-padding">
|
||||
@@ -29,7 +31,7 @@
|
||||
<div class="col">Delivery Date</div>
|
||||
<div class="col"></div>
|
||||
</div>
|
||||
<list-component section="onHoldParcel" :endpoint="route('api.packing_list.list')" :options="{status_in: [5, 0], per_page: 5}">
|
||||
<list-component section="onHoldParcel" :endpoint="route('api.packing_list.list')" :options="{status_in: [5], packing_list_type: 2, per_page: 20}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
|
||||
</template>
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<notification-section-component section="section"></notification-section-component>
|
||||
</div>
|
||||
<div class="col-auto p-r-20 d-md-none">
|
||||
<div class="row d-md-none">
|
||||
<div class="col padding-15 pointer" @click="$store.dispatch('toggleSection', {name: 'sideMenu', status: true})">
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -40,7 +40,7 @@
|
||||
<p style="font-size: 30px; margin-bottom: 0 !important; margin-top: 10px !important;">仓库地址:</p>
|
||||
<p style="margin-top: 5px !important; margin-bottom: 5px !important; word-wrap: break-word; font-size: 30px;">{{$warehouse_address->state->name.' '.$warehouse_address->district->name.' '.$warehouse_address->street_one.' '.$warehouse_address->street_two.' 邮编:'.$warehouse_address->postcode}}</p>
|
||||
<p style="margin-top: 5px !important; margin-bottom: 0px !important; font-size: 30px;">联系:@foreach($warehouse_contacts as $contact){{ $loop->first ? '' : ' / ' }}{{ $contact->phone.' '.$contact->reference }}@endforeach</p>
|
||||
<p style="margin-top: 5px !important; margin-bottom: 0px !important; font-size: 30px;">{{$remark}}</p>
|
||||
<p style="margin-top: 5px !important; margin-bottom: 0px !important; font-size: 30px;">{!! $remark !!}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
Vendored
+13
@@ -6,6 +6,19 @@
|
||||
'routes' => collect(\Route::getRoutes())->mapWithKeys(function ($route) { return [$route->getName() => $route->uri()]; })
|
||||
]) !!};
|
||||
</script>
|
||||
@if(!App::environment('production'))
|
||||
<script type="text/javascript">
|
||||
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
|
||||
(function(){
|
||||
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
|
||||
s1.async=true;
|
||||
s1.src='https://embed.tawk.to/623d8cdd2abe5b455fc195aa/1fv06sgtf';
|
||||
s1.charset='UTF-8';
|
||||
s1.setAttribute('crossorigin','*');
|
||||
s0.parentNode.insertBefore(s1,s0);
|
||||
})();
|
||||
</script>
|
||||
@endif
|
||||
<script src="{{ asset('js/vendor.js') }}" type="text/javascript"></script>
|
||||
<script src="{{mix('vue/app.js')}}"></script>
|
||||
<script src="{{ asset('js/site.js') }}" type="text/javascript"></script>
|
||||
|
||||
@@ -10,4 +10,6 @@ Route::group(['prefix' => 'report', 'as' => 'report.', 'namespace' => 'Reports']
|
||||
Route::get('/profit/{model}/{value}/{from?}/{to?}', 'MonthlyReportController@profitModelReport')->name('profit');
|
||||
|
||||
Route::get('/service', 'MonthlyReportController@serviceReport')->name('service');
|
||||
|
||||
Route::get('/customers/active', 'MonthlyReportController@customerActivityReport')->name('customerActivity');
|
||||
});
|
||||
|
||||
@@ -13,5 +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');
|
||||
});
|
||||
});
|
||||
+72
-6
@@ -31,6 +31,10 @@ Route::get('', function () {
|
||||
return view('pages.accounts.login');
|
||||
})->name('login');
|
||||
|
||||
Route::get('/signup', function () {
|
||||
return view('pages.accounts.signup');
|
||||
})->name('signup');
|
||||
|
||||
Route::group(['prefix' => 'swagger'], function () {
|
||||
Route::get('/', function () {
|
||||
return view('swagger.index');
|
||||
@@ -125,7 +129,7 @@ Route::get('/orders/refresh', function(){
|
||||
|
||||
Route::get('/containers/refresh', function(){
|
||||
|
||||
(App()->make(\App\Classes\Modules\PackingLists\Processors\FetchPackingListFromVTPortalProcessor::class))->execute();
|
||||
(App()->make(\App\Classes\Modules\PackingLists\Processors\FetchWarehouseReceiveListFromVTPortalProcessor::class))->execute();
|
||||
// FetchLoadedContainersFromVTPortalJob::dispatch();
|
||||
// FetchContainersStatusUpdateFromVTPortalJob::dispatch();
|
||||
|
||||
@@ -239,6 +243,54 @@ Route::get('/settings', function () {
|
||||
return view('pages.settings');
|
||||
})->name('settings');
|
||||
|
||||
Route::get('/customer/summary/monthly', function () {
|
||||
// $containers = Container::whereMonth('loading_date', 1)->where('owner_id', 3)->get();
|
||||
$containers = Container::whereIn('reference', ['SM21-166', 'SM21-168', 'SM21-170', 'SM21-171', 'SM21-172', 'SM21-173', 'EPS-3833'])->get();
|
||||
foreach ($containers as $container){
|
||||
$packingLists = $container->packingLists()->get()->filter(function ($packingList) {
|
||||
return $packingList->owner->company_module_id === 248;
|
||||
});
|
||||
|
||||
if (!count($packingLists)) continue;
|
||||
|
||||
echo '<table>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Full Marking</th>
|
||||
<th>Container</th>
|
||||
<th>Description</th>
|
||||
<th>Ctns</th>
|
||||
<th>L (cm)</th>
|
||||
<th>H (cm)</th>
|
||||
<th>W (cm)</th>
|
||||
<th>CBM</th>
|
||||
</tr>';
|
||||
foreach ($packingLists as $packingList){
|
||||
if($packingList->packingLists->first()){
|
||||
$packingList = $packingList->packingLists->first();
|
||||
}
|
||||
$packages = $packingList->packages;
|
||||
foreach ($packages as $package){
|
||||
echo '<tr>
|
||||
<td>-</td>
|
||||
<td>MS/CIEF/769SMC/'.$packingList->owner->reference.'</td>
|
||||
<td>'.$container->reference.'</td>
|
||||
<td>'.$package->description.'</td>
|
||||
<td>'.$package->quantity.'</td>
|
||||
<td>'.$package->length.'</td>
|
||||
<td>'.$package->height.'</td>
|
||||
<td>'.$package->width.'</td>
|
||||
<td>'.((($package->length / 100) * ($package->height / 100) * ($package->width / 100)) * $package->quantity).'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
echo '</table>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Route::get('/customers/active/{active_start}/{active_end}/{inactive_start?}/{inactive_end?}/{with_cbm?}', function ($active_start, $active_end, $inactive_start=null, $inactive_end=null, $with_cbm = false) {
|
||||
$activeCompanies = CompanyModule::where('type', \App\Classes\ValueObjects\Constants\BusinessType::IMPORTER)->whereHas('orderPackingLists', function($query) use($inactive_start, $inactive_end) {
|
||||
return $query->where('packing_lists.type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('transports', function ($query) use ($inactive_start, $inactive_end) {
|
||||
@@ -253,10 +305,18 @@ Route::get('/customers/active/{active_start}/{active_end}/{inactive_start?}/{ina
|
||||
})->whereNotIn('id', $activeCompanies)->get();
|
||||
|
||||
echo '<h4>List of customers active between <span style="color: green; font-weight: bold">'.\Carbon\Carbon::parse($active_start)->format('d/m/Y'). ' - '.\Carbon\Carbon::parse($active_end)->format('d/m/Y').'</span> & inactive between <span style="color: red; font-weight: bold">'.\Carbon\Carbon::parse($inactive_start)->format('d/m/Y'). ' - '.\Carbon\Carbon::parse($inactive_end)->format('d/m/Y').'</span></h4>';
|
||||
echo '<table>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>marking</th>
|
||||
<th>Number of Orders</th>
|
||||
<th>CBM</th>
|
||||
</tr>';
|
||||
foreach ($companies as $key => $company){
|
||||
$connection = $company->inviters()->withPivot('invitee_reference')->first();
|
||||
$marking = $connection ? $connection->pivot->invitee_reference:'';
|
||||
|
||||
$packingList = collect();
|
||||
$totalCbm = 0;
|
||||
if($with_cbm){
|
||||
$packingList = $company->orderPackingLists()->where('packing_lists.type', \App\Classes\ValueObjects\Constants\PackingListType::SHIPPING_PACKING_LIST)->get();
|
||||
$totalCbm = $packingList->flatMap(function ($packingList) {
|
||||
@@ -266,13 +326,19 @@ Route::get('/customers/active/{active_start}/{active_end}/{inactive_start?}/{ina
|
||||
});
|
||||
}
|
||||
|
||||
$totalCbm = ($with_cbm ? '['. $packingList->count().'] ('. $totalCbm .')' : '');
|
||||
|
||||
echo $key + 1 .'. <a href="'.\route('customer.profile', $marking).'" target="_blank">'.$marking.'</a> '.$totalCbm.'<br><br>';
|
||||
echo '<tr>
|
||||
<td>'.$key.'</td>
|
||||
<td><a href="'.route('customer.profile', $marking).'" target="_blank">'.$marking.'</a></td>
|
||||
<td>'. $packingList->count() .'</td>
|
||||
<td>'. $totalCbm .'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '</table>';
|
||||
|
||||
});
|
||||
|
||||
Route::get('/online_payment/redirect', 'Billplz\CallbackBillplzController@callback')->name('online_payment.redirect');
|
||||
|
||||
Route::get('/notifications/list', 'Notifications\ListNotificationsController@list')->name('notifications.list');
|
||||
Route::get('/order/{id}', function ($id) {
|
||||
return view('pages.orders.profile', ['id' => $id]);
|
||||
})->name('order.details');
|
||||
Reference in New Issue
Block a user