Compare commits

...

94 Commits

Author SHA1 Message Date
omair saleh 0e7469f1cd new registration ui flow 2022-03-29 23:15:42 +08:00
omair saleh 32476afdd4 fix vt warehouse list 2022-03-27 12:56:31 +08:00
omair saleh 8b6db1fb68 temp test vt warehouse list 2022-03-27 12:55:06 +08:00
omair saleh 43f3fbff07 temp test vt warehouse list 2022-03-27 12:54:06 +08:00
omair saleh caf8624d4c temp test vt warehouse list 2022-03-27 12:51:43 +08:00
omair saleh eb417cf389 temp test vt warehouse list 2022-03-27 12:50:23 +08:00
omair saleh 276a87ff0d temp test vt warehouse list 2022-03-27 12:49:08 +08:00
omair saleh 6d2f179025 Merge branch 'development' into 'master'
Development

See merge request CIEFWorldwideSdnBhd/shipping-portal!116
2022-03-27 03:54:48 +00:00
omair saleh 8609c926f9 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2022-03-27 11:53:18 +08:00
omair saleh 368a055bb4 add chat box to development 2022-03-27 11:50:27 +08:00
omair saleh d617001412 fix vt YW orders 2022-03-27 11:49:32 +08:00
omair saleh c932cb00cc add chat widget 2022-03-25 17:36:27 +08:00
omair saleh 1be62a5f77 fix vt order number to filter yw 2022-03-25 16:54:10 +08:00
omair saleh 445bcb3864 small clean up 2022-03-24 13:33:04 +08:00
omair saleh d489775924 small clean up 2022-03-24 13:32:34 +08:00
omair saleh fff428882d small clean up 2022-03-24 13:31:37 +08:00
omair saleh 42205ddbc3 small clean up 2022-03-24 13:29:59 +08:00
omair saleh 722e502b3b tidy up invoices details descriptions 2022-03-24 13:26:55 +08:00
omair saleh 4f93569b4c Merge branch 'development' into 'master'
Development

See merge request CIEFWorldwideSdnBhd/shipping-portal!115
2022-03-24 05:22:35 +00:00
omair saleh e1abebc66c Merge branch 'transaction-invoice' into 'development'
transaction detail over weight

See merge request CIEFWorldwideSdnBhd/shipping-portal!114
2022-03-24 05:18:22 +00:00
omair saleh 2424882cfe Merge branch 'development' into 'transaction-invoice'
# Conflicts:
#   app/Classes/Modules/Transactions/ControllersLogic/CreateShippingInvoiceTransactionLogic.php
2022-03-24 05:18:17 +00:00
omair saleh 23f50faa84 release create warehouse arrival parcel module 2022-03-24 13:11:22 +08:00
edmondlang edc510681e Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2022-03-24 11:40:20 +08:00
omair saleh db03836ef5 add new way of detecting yd container rescheduling 2022-03-24 10:59:59 +08:00
edmondlang 3a5f404294 Tidy Up Export Customer activity details, add new filter - minOrders and minCbm 2022-03-23 00:53:16 +08:00
edmondlang 9b79f16faa Merge branch 'api-to-update-segment-constants' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2022-03-22 21:55:24 +08:00
edmondlang 4ff4418f7f Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2022-03-19 13:35:09 +08:00
glovetleong 19c8f1e658 transaction detail over weight 2022-03-18 20:46:40 +08:00
omair saleh e1c4d674b6 smc report for specific containers 2022-03-18 17:48:18 +08:00
omair saleh 3326de9c4f smc report for specific containers 2022-03-18 17:44:28 +08:00
omair saleh 54dd6d407d revert invoice changes 2022-03-18 16:18:44 +08:00
omair saleh 9ee81d9385 update rfm to table 2022-03-18 16:18:12 +08:00
omair saleh aa1ba03415 update rfm to table 2022-03-18 16:16:25 +08:00
omair saleh fb6b2173b5 update rfm to table 2022-03-18 16:14:42 +08:00
omair saleh f18e4a882f update container reschedule for yd 2022-03-17 17:47:34 +08:00
omair saleh 8edc91bb61 update container reschedule for yd 2022-03-17 17:46:24 +08:00
omair saleh 6122c288df update container reschedule for yd 2022-03-17 17:45:10 +08:00
omair saleh 9650877819 update container reschedule for yd 2022-03-17 17:43:03 +08:00
omair saleh c65d875a3d update container reschedule for yd 2022-03-17 17:41:39 +08:00
omair saleh c1bc610549 update container reschedule for yd 2022-03-17 17:41:06 +08:00
omair saleh 82d406abfc update container reschedule for yd 2022-03-17 17:39:47 +08:00
omair saleh 701610978d update container reschedule for yd 2022-03-17 17:37:07 +08:00
omair saleh f7e1665a02 update container reschedule for yd 2022-03-17 17:36:24 +08:00
omair saleh d389b87609 update container reschedule for yd 2022-03-17 17:34:51 +08:00
omair saleh 987fdcfba2 update container reschedule for yd 2022-03-17 17:33:23 +08:00
omair saleh 6214a2b723 update container reschedule for yd 2022-03-17 17:31:39 +08:00
omair saleh fe00b1fab7 update container reschedule for yd 2022-03-17 17:22:02 +08:00
omair saleh 41df3e6ae7 update container reschedule for yd 2022-03-17 17:18:47 +08:00
omair saleh cf7d9ccca5 update container reschedule for yd 2022-03-17 17:17:01 +08:00
omair saleh 384d234b50 update container reschedule for yd 2022-03-17 17:16:35 +08:00
omair saleh 3fbfa44a04 update container reschedule for yd 2022-03-17 17:14:02 +08:00
omair saleh cbc294054e update container reschedule for yd 2022-03-17 17:12:47 +08:00
omair saleh 324556985a update container reschedule for yd 2022-03-17 17:08:23 +08:00
omair saleh 1b8c6ca317 update container reschedule for yd 2022-03-17 17:08:12 +08:00
omair saleh bbd09d300c update container reschedule for yd 2022-03-17 17:07:33 +08:00
omair saleh 47c97d6151 update container reschedule for yd 2022-03-17 17:05:04 +08:00
omair saleh 435e3a8f7a update container reschedule for yd 2022-03-17 17:03:40 +08:00
omair saleh 151032bb66 update container reschedule for yd 2022-03-17 17:02:40 +08:00
omair saleh f32335d57b update container reschedule for yd 2022-03-17 16:58:52 +08:00
omair saleh 2deddc4e03 update container reschedule for yd 2022-03-17 16:57:49 +08:00
omair saleh 32e665e4f7 update container reschedule for yd 2022-03-17 16:57:03 +08:00
omair saleh a987419040 update container reschedule for yd 2022-03-17 16:36:50 +08:00
omair saleh b0a65f870c update container reschedule for yd 2022-03-17 16:33:00 +08:00
omair saleh 33a75eca7d smc monthly report 2022-03-17 13:53:50 +08:00
Leong Chee Siong deb68dc723 Merge branch 'transaction-invoice' into 'development'
billpliz callback

See merge request CIEFWorldwideSdnBhd/shipping-portal!113
2022-03-17 02:13:19 +00:00
omair saleh 519408c2b5 lawas and Limbang show kk warehouse 2022-03-17 09:55:46 +08:00
omair saleh 53907e2463 lawas and Limbang show kk warehouse 2022-03-17 09:52:24 +08:00
omair saleh 10e6f6045e lawas and Limbang show kk warehouse 2022-03-17 09:51:36 +08:00
omair saleh c06cec5b41 lawas and Limbang show kk warehouse 2022-03-17 09:47:31 +08:00
omair saleh cfe611d05d lawas and Limbang show kk warehouse 2022-03-17 09:45:24 +08:00
ahmedsophyudden b9b79ca65a Shipping Portal - Api to update segment (general, state, postcode) 2022-03-17 01:01:01 +08:00
glovetleong 9a1562386f billpliz callback 2022-03-16 23:01:38 +08:00
omair saleh 22700893a2 fix qr remark 2022-03-16 10:03:47 +08:00
omair saleh 550c9480a4 fix qr remark 2022-03-16 10:02:17 +08:00
omair saleh 48bab9998c fix qr remark 2022-03-16 09:47:26 +08:00
omair saleh 3ff81d4f00 fix qr remark 2022-03-16 09:46:23 +08:00
omair saleh cc7edfc784 sort deliveries by date 2022-03-16 01:24:37 +08:00
omair saleh 72448d656c sort deliveries by date 2022-03-16 01:20:13 +08:00
omair saleh c941f679b6 sort deliveries by date 2022-03-16 01:19:31 +08:00
omair saleh 78f6c70cad sort deliveries by date 2022-03-16 01:18:53 +08:00
omair saleh 1575d62e0f sort deliveries by date 2022-03-16 01:17:21 +08:00
omair saleh 43f4bc533a sort deliveries by date 2022-03-16 01:16:13 +08:00
omair saleh 9ae36dc400 sort deliveries by date 2022-03-16 01:14:27 +08:00
omair saleh 02c55d97b7 sort deliveries by date 2022-03-16 01:00:27 +08:00
omair saleh baeaa0f31a sort deliveries by date 2022-03-16 00:58:16 +08:00
omair saleh dadc786f1f Merge branch 'development' into 'master'
Development

See merge request CIEFWorldwideSdnBhd/shipping-portal!112
2022-03-15 16:32:13 +00:00
omair saleh bd9dab0029 hide invoice button for production 2022-03-16 00:31:24 +08:00
omair saleh e2b795c872 Merge remote-tracking branch 'origin/development' into development 2022-03-16 00:30:55 +08:00
omair saleh 9a79c6dd1d Merge branch 'development' into 'master'
Warehouse Profile

See merge request CIEFWorldwideSdnBhd/shipping-portal!111
2022-03-15 16:28:58 +00:00
omair saleh d8e1c38429 hide invoice button for production 2022-03-16 00:24:18 +08:00
Leong Chee Siong aa28afb9f0 Merge branch 'transaction-invoice' into 'development'
soft delete user

See merge request CIEFWorldwideSdnBhd/shipping-portal!110
2022-03-14 05:45:21 +00:00
glovetleong 7ec109eb3e soft delete user 2022-03-14 13:42:48 +08:00
omair saleh 7151616b04 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2022-03-14 13:19:04 +08:00
omair saleh 28088f7d9a fix mysql crash on supplier update api 2022-03-11 14:43:21 +08:00
53 changed files with 1445 additions and 337 deletions
@@ -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);
}
}
@@ -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]);
}
}
@@ -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;
@@ -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));
@@ -373,12 +395,7 @@ class FetchOrderListsFromYdPortalProcessor
}
}
if($deliveryDate){
if($packingList->transports){
continue;
}
if($deliveryDate && !$packingList->transports){
$packingList->status = ApprovalStatus::COMPLETED;
$packingList->save();
@@ -50,9 +50,10 @@ class FetchPackingListFromVTPortalProcessor
$query->where('status', '=', ApprovalStatus::COMPLETED);
})->get();
DB::beginTransaction();
foreach($packingLists as $packingList){
try {
DB::beginTransaction();
$filter = '["PoNumber:=%js%\"'.$packingList->reference.'\"\u0000"]';
@@ -75,14 +76,12 @@ class FetchPackingListFromVTPortalProcessor
}
}
DB::commit();
} catch (GuzzleException $exception) {
continue;
}
}
DB::commit();
return [];
@@ -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'
];
}
@@ -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';
}
@@ -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);
}
}
+1 -2
View File
@@ -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)
];
}
}
+3 -1
View File
@@ -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

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>
@@ -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>
@@ -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>
@@ -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
View File
@@ -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
+35 -30
View File
@@ -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>
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -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>
+13
View File
@@ -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>
+2
View File
@@ -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');
});
+2
View File
@@ -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');
});
});
+74 -6
View File
@@ -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,11 +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('/online_payment/redirect', 'Billplz\CallbackBillplzController@callback')->name('online_payment.redirect');
Route::get('/order/{id}', function ($id) {
return view('pages.orders.profile', ['id' => $id]);
})->name('order.details');