Compare commits

..

170 Commits

Author SHA1 Message Date
edmondlang 715635954a update file name 2022-04-07 12:30:39 +08:00
edmondlang 2919544769 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into export-customer-order-list 2022-04-07 11:37:10 +08:00
edmondlang e3284fdf98 export customer order list 2022-04-07 11:36:03 +08:00
omair saleh bed78c053a remove memo 2022-04-07 10:59:50 +08:00
omair saleh 5b370a299c update pending delivery report excel 2022-04-06 16:01:31 +08:00
omair saleh e57dc231e6 update pending delivery report excel 2022-04-06 16:01:03 +08:00
omair saleh 5727801918 update pending delivery report excel 2022-04-06 15:59:28 +08:00
omair saleh bf325ff028 update pending delivery report excel 2022-04-06 15:55:31 +08:00
omair saleh 229e757663 Merge branch 'export-delivery-list' into 'master'
Export delivery list

See merge request CIEFWorldwideSdnBhd/shipping-portal!117
2022-04-06 07:32:01 +00:00
edmondlang 10d62dd8d1 update export delivery list - include state and postcode 2022-04-06 13:53:43 +08:00
edmondlang 0fa0d8daab Shipping portal - export function for Delivery list (only 'Pending Arrangement' tab) 2022-04-06 13:30:16 +08:00
omair saleh 68d961a681 custom clearance status 2022-04-05 11:38:21 +08:00
omair saleh 2c29e5939e custom clearance status 2022-04-05 11:25:56 +08:00
omair saleh 6910dce35f custom clearance status 2022-04-05 11:23:39 +08:00
omair saleh a19db06b6b custom clearance status 2022-04-05 11:20:45 +08:00
omair saleh b764ee0769 update packing list monthly summary containers 2022-04-01 17:02:36 +08:00
omair saleh ab1d92af86 fix yd missing packages from order 2022-04-01 14:58:27 +08:00
omair saleh 2ff9a38114 fix yd missing packages from order 2022-04-01 14:57:41 +08:00
omair saleh 0abdbd525e fix yd missing packages from order 2022-04-01 14:56:46 +08:00
omair saleh f44aace3c5 fix yd missing packages from order 2022-04-01 14:56:05 +08:00
omair saleh 0af84a9b7d fix yd missing packages from order 2022-04-01 14:54:09 +08:00
omair saleh 1aff95b41c fix yd missing packages from order 2022-04-01 14:51:57 +08:00
omair saleh 745f476f89 fix yd missing packages from order 2022-04-01 14:41:24 +08:00
omair saleh e1d751b859 fix yd missing packages from order 2022-04-01 11:21:44 +08:00
omair saleh 6077b1fbbb fix yd missing packages from order 2022-04-01 10:56:56 +08:00
omair saleh 5fe8a7a59e fix order address update to vt 2022-03-31 21:15:19 +08:00
omair saleh 8b38bcac8a fix order address update to vt 2022-03-31 21:10:23 +08:00
omair saleh 5561442932 fix order address update to vt 2022-03-31 21:09:01 +08:00
omair saleh f33efd373c fix order address update to vt 2022-03-31 21:05:44 +08:00
omair saleh 53c325b36d fetch only 2 months orders from yd 2022-03-31 20:47:14 +08:00
omair saleh cd141bf988 fix yd older than 2 months orders 2022-03-31 20:30:49 +08:00
omair saleh 908f3fc11b fix yd older than 2 months orders 2022-03-31 20:29:49 +08:00
omair saleh 8e9f12b17e fix yd older than 2 months orders 2022-03-31 20:29:14 +08:00
omair saleh 782bcc69f1 fix yd older than 2 months orders 2022-03-31 20:28:41 +08:00
omair saleh 144464621e fix yd older than 2 months orders 2022-03-31 20:28:07 +08:00
omair saleh b290f95426 fix yd older than 2 months orders 2022-03-31 20:27:31 +08:00
omair saleh b7e6269aa9 fix yd older than 2 months orders 2022-03-31 20:25:14 +08:00
omair saleh 7180f802b3 fix yd older than 2 months orders 2022-03-31 20:20:19 +08:00
omair saleh 7159c1c11d fix yd older than 2 months orders 2022-03-31 20:17:55 +08:00
omair saleh cce0cae57c fix yd older than 2 months orders 2022-03-31 20:17:03 +08:00
omair saleh bebce6fbaa fix yd older than 2 months orders 2022-03-31 19:50:55 +08:00
omair saleh 531ab699ba show delivery delay days 2022-03-31 19:45:06 +08:00
omair saleh 9f9c17977d show delivery delay days 2022-03-31 19:44:11 +08:00
omair saleh 24f5de8c2c fix missing yd delivery 2022-03-31 14:41:10 +08:00
omair saleh 3b8079785a fix missing yd delivery 2022-03-31 14:19:47 +08:00
omair saleh 627fb3aa96 fix missing yd delivery 2022-03-31 14:18:34 +08:00
omair saleh 2b4d3f1992 fix missing yd delivery 2022-03-31 14:16:40 +08:00
omair saleh 65daceb59c fix missing yd delivery 2022-03-31 14:13:26 +08:00
omair saleh d7457e7174 fix missing yd delivery 2022-03-31 14:10:24 +08:00
omair saleh 9753eb3a18 fix packages is missing in yd api 2022-03-31 13:56:47 +08:00
omair saleh e7df49a0d1 fix packages is missing in yd api 2022-03-31 13:54:48 +08:00
omair saleh cd4e7aab10 fix packages is missing in yd api 2022-03-31 13:52:36 +08:00
omair saleh 29350dbb86 fix packages is missing in yd api 2022-03-31 13:52:16 +08:00
omair saleh 7338ebc78a fix packages is missing in yd api 2022-03-31 13:49:47 +08:00
omair saleh 4eded7a742 update holiday announcement 2022-03-31 09:31:09 +08:00
omair saleh dc562f6554 update holiday announcement 2022-03-31 09:29:31 +08:00
omair saleh 2d965009ec move unclaimed packing lists to dashboard 2022-03-30 11:31:40 +08:00
omair saleh 7d84ddee95 fix do update bug 2022-03-30 00:25:18 +08:00
omair saleh 92b31a9342 fix do update bug 2022-03-30 00:22:05 +08:00
omair saleh 012dbfde09 fix do update bug 2022-03-30 00:21:14 +08:00
omair saleh 0b651953ea fix do update bug 2022-03-30 00:20:24 +08:00
omair saleh b34f50ae9d fix do update bug 2022-03-30 00:20:11 +08:00
omair saleh 8f0d1e6fdf fix do update bug 2022-03-30 00:19:22 +08:00
omair saleh e8990d96f7 debug do update 2022-03-30 00:06:22 +08:00
omair saleh 69ee0eea2c debug do update 2022-03-30 00:05:45 +08:00
omair saleh adcdf5909e debug do update 2022-03-29 23:57:16 +08:00
omair saleh b9523fb567 debug do update 2022-03-29 23:56:31 +08:00
omair saleh 79678d7b93 debug do update 2022-03-29 23:56:01 +08:00
omair saleh 2bdfd2772a debug do update 2022-03-29 23:54:14 +08:00
omair saleh 55513f5175 debug do update 2022-03-29 23:44:22 +08:00
omair saleh 709534ce04 debug do update 2022-03-29 23:43:29 +08:00
omair saleh 74d85eee60 debug do update 2022-03-29 23:42:32 +08:00
omair saleh 63badc08f0 debug do update 2022-03-29 23:41:34 +08:00
omair saleh 73010ed32b debug do update 2022-03-29 23:40:20 +08:00
omair saleh 7a2a90545b debug do update 2022-03-29 23:40:05 +08:00
omair saleh c0ee3a8e57 debug do update 2022-03-29 23:39:28 +08:00
omair saleh 0c7e4d5785 debug do update 2022-03-29 23:38:33 +08:00
omair saleh c3cd8ae3a0 debug do update 2022-03-29 23:35:27 +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
70 changed files with 1501 additions and 766 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);
}
}
@@ -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]);
}
}
@@ -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);
}
@@ -0,0 +1,91 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Models\Container;
use App\Models\Package;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Carbon\Carbon;
class ExportsCompanyModuleSummary implements FromCollection, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
{
use Exportable;
protected $companyModuleId, $containerIds;
public function headings(): array
{
return [
'Date',
'Full Marking',
'Container',
'Description',
'Ctns',
'L (cm)',
'H (cm)',
'W (cm)',
'CBM'
];
}
public function setParameters($companyModuleId, $containerIds)
{
$this->companyModuleId = $companyModuleId;
$this->containerIds = $containerIds;
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function collection()
{
$packagesArray = collect();
$containers = Container::whereIn('reference', explode(',', $this->containerIds))->get();
foreach ($containers as $container){
$company_module_id = $this->companyModuleId;
$packingLists = $container->packingLists()->get()->filter(function ($packingList) use ($company_module_id) {
return $packingList->owner->company_module_id == $company_module_id;
});
foreach ($packingLists as $packingList){
if($packingList->packingLists->first()){
$packingList = $packingList->packingLists->first();
}
$packages = $packingList->packages;
foreach ($packages as $package){
$packagesArray->push($package);
}
}
}
return $packagesArray;
}
/**
* @param Package $package
*
* @return array
*/
public function map($package): array
{
$connection = $package->packingList->owner->companyModule->inviters()->withPivot('invitee_reference')->first();
$marking = $connection ? $connection->pivot->invitee_reference:'';
return [
Carbon::parse($package->created_at)->format('d-m-Y'),
$marking,
$package->packingList->containers()->first()->reference,
$package->description,
$package->quantity,
$package->length,
$package->height,
$package->width,
((($package->length / 100) * ($package->height / 100) * ($package->width / 100)) * $package->quantity)
];
}
}
@@ -0,0 +1,81 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\PackingList;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Carbon\Carbon;
class ExportsPendingArrangementDeliveryList implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
{
use Exportable;
public function headings(): array
{
return [
'Container Ref.',
'ETA',
'Unstuffing',
'Marking',
'Order Number',
'Delay Days',
'Quantity',
'State',
'Postcode',
'Address',
'PIC',
'Phone',
'Remark'
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function query()
{
return PackingList::where('type', '=', 2)->whereHas('containers', function ($query){
$query->where('containers.status', ApprovalStatus::COMPLETED);
})->whereDoesntHave('transports');
}
/**
* @param PackingList $packingList
*
* @return array
*/
public function map($packingList): array
{
$container = $packingList->containers()->first();
$ContainerTransport = $container->transports()->first();
$order = $packingList->owner;
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
$address = $order->addresses()->where('status', ApprovalStatus::APPROVED)->first();
$contacts = $address->contacts->first() ? $address->contacts->first(): '';
$originalPackingList = $packingList->owner instanceof PackingList ? $packingList->owner : $packingList;
$transport = $originalPackingList->containers()->first()->transports()->first();
return [
$container->reference,
$ContainerTransport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()->eta,
$ContainerTransport->drop_date,
$marking,
$order->reference,
$transport ? Carbon::now()->diffInDays($transport->drop_date, false) . ' Days' : '',
$packingList->packages()->sum('quantity'),
$address->state->name,
$address->postcode,
$address->street_one.', '.$address->street_two.' '.$address->district->name.' '.$address->postcode.' '.$address->state->name.' '.$address->country->name,
$address->remarks->first() ? $address->remarks->first()->content: '',
$contacts ? $contacts ->reference : '',
$contacts ? $contacts ->phone : '',
];
}
}
@@ -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();
}
}
@@ -7,6 +7,7 @@ use App\Classes\Modules\Orders\Standards\Rules\CanApproveChangeOrderAddress;
use App\Classes\Modules\Orders\Services\UpdatesOrdersAddress;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackingListType;
use Illuminate\Http\Request;
class ApproveChangeOrderAddressProcessor
@@ -65,7 +66,11 @@ class ApproveChangeOrderAddressProcessor
$address->owner->addresses()->update(['status' => ApprovalStatus::EXPIRED]);
$appointee = $address->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
$appointee === 2 ? $this->updateDoFromVTPortalProcessor->execute($address) : $this->updateDoFromYDPortalProcessor->execute($address);
if($appointee === 2) {
foreach($address->owner->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST) as $packingList){
$this->updateDoFromVTPortalProcessor->execute($packingList);
}
}
}
@@ -6,23 +6,9 @@ use App\Classes\Exceptions\InternalServerErrorException;
use App\Classes\Modules\Orders\Services\FetchesDataFromVTPortal;
use App\Classes\Modules\Addresses\Services\FetchesAddress;
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
use App\Classes\Modules\Transports\Services\CreatesTransport;
use App\Classes\Modules\Unity\Services\UpdatesContractObligation;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Classes\ValueObjects\Constants\TransportType;
use App\Models\PackingList;
use App\Models\Transport;
use Carbon\Carbon;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\Log;
use Illuminate\Http\Request;
class UpdateDoFromVTPortalProcessor
{
/** @var FetchesDataFromVTPortal */
@@ -43,19 +29,20 @@ class UpdateDoFromVTPortalProcessor
}
/**
* @param $address
* @param PackingList $packing_list
* @return array
* @throws GuzzleException
* @throws InternalServerErrorException
*/
public function execute($address) {
public function execute(PackingList $packing_list) {
if(!app()->environment(['production'])){
return [];
}
try {
$order = $address->owner()->orderBy('id', 'desc')->first();
$packing_list = $order->packingLists()->orderBy('id', 'desc')->first();
$address= $packing_list->owner->addresses()->where('status', ApprovalStatus::APPROVED)->first();
$order = $packing_list->owner;
if ($packing_list) {
$contact = $address->contacts()->first();
@@ -67,7 +54,7 @@ class UpdateDoFromVTPortalProcessor
$status = 'On Hold';
if (in_array($packing_list->status, [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])) {
if (in_array($packing_list->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])) {
$status = 'Release';
}
@@ -77,6 +64,7 @@ class UpdateDoFromVTPortalProcessor
if ($vt_do) {
foreach ($vt_do->Rows as $key => $row) {
if($row[4] !== $packing_list->containers()->first()->reference) continue;
$vt_do_update = $this->fetchesDataFRomVTPortal->clientRequest(
'http://portal.vtnation.com.my/Services/DataControllerService.asmx/Execute',
'POST',
@@ -141,7 +129,7 @@ class UpdateDoFromVTPortalProcessor
}
} catch (\Exception $exception){
return [];
throw new InternalServerErrorException('failed to approve address due to an error related to VT portal: '.$exception->getMessage());
}
}
@@ -8,6 +8,7 @@ use App\Classes\Modules\Addresses\Services\FetchesAddress;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Models\PackingList;
use Illuminate\Support\Facades\Log;
class UpdateDoFromYDPortalProcessor
@@ -30,36 +31,34 @@ class UpdateDoFromYDPortalProcessor
}
/**
* @param $address
* @param PackingList $packingList
* @return void
* @throws InternalServerErrorException
*/
public function execute($address) {
public function execute(PackingList $packingList) {
if(!app()->environment(['production'])){
return;
}
try {
$order = $address->owner()->orderBy('id', 'desc')->first();
$packing_lists = $order->packingLists()
->where('type', PackingListType::SHIPPING_PACKING_LIST)
->where('status', '!=', ApprovalStatus::SUSPENDED)
->orderBy('id', 'desc')->get();
$address = $packingList->owner->addresses()->where('status', ApprovalStatus::APPROVED)->first();
if (!in_array($packingList->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])) {
return;
}
foreach ($packing_lists as $key => $row) {
if ($row->status === ApprovalStatus::SUSPENDED) {
continue;
}
$contact = $address->contacts()->first();
$remark = $address->remarks()->first();
$contact = $address->contacts()->first();
$remark = $address->remarks()->first();
$phone = $contact ? $contact->phone : null;
$reference = $contact ? $contact->reference : null;
$remark = $remark ? $remark->content : 'URGENT!!! PLEASE CALL BEFORE ONE DAY DELIVERY.';
$phone = $contact ? $contact->phone : null;
$reference = $contact ? $contact->reference : null;
$remark = $remark ? $remark->content : 'URGENT!!! PLEASE CALL BEFORE ONE DAY DELIVERY.';
$this->fetchesDataFRomYDPortal->clientRequest(
'http://www.yd-wl.com/api/UpdateOrderAddress.ashx',
'POST',
$this->fetchesDataFRomYDPortal->clientRequest(
'http://www.yd-wl.com/api/UpdateOrderAddress.ashx',
'POST',
[
'expressno' => $row->reference,
'expressno' => $packingList->reference,
'customers_name' => $reference,
'cellphone' => $phone,
'postcode' => $address->postcode,
@@ -68,8 +67,6 @@ class UpdateDoFromYDPortalProcessor
]);
}
} catch (\Exception $exception){
throw new InternalServerErrorException('failed to approve address due to an error related to YD portal');
}
@@ -14,6 +14,7 @@ use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Http\Resources\PackingListResource;
use App\Models\PackingList;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -70,16 +71,16 @@ class UpdatePackingListStatusLogic extends AbstractControllerLogic
{
$packingList = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$packing_list = $this->updatesPackingListStatus->execute($packingList, $request->route('status'));
$address = $packing_list->owner()->first()->addresses()->where('status', ApprovalStatus::APPROVED)->first();
/** @var PackingList $packingList */
$packingList = $this->updatesPackingListStatus->execute($packingList, $request->route('status'));
// $appointee = $address->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
$this->updateDoFromVTPortalProcessor->execute($address);
$this->updateDoFromYDPortalProcessor->execute($address);
$this->updateDoFromVTPortalProcessor->execute($packingList);
$this->updateDoFromYDPortalProcessor->execute($packingList);
return $this->resourceResponse(new PackingListResource($packing_list));
return $this->resourceResponse(new PackingListResource($packingList));
}
}
@@ -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;
@@ -36,6 +36,7 @@ use App\Models\Transport;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
class FetchOrderListsFromYdPortalProcessor
{
@@ -153,7 +154,6 @@ class FetchOrderListsFromYdPortalProcessor
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($orderRequest);
foreach($rows->data as $row){
$containerReference = null;
$loadingDate = null;
$unstuffingDate = null;
@@ -168,6 +168,11 @@ class FetchOrderListsFromYdPortalProcessor
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($trackingRequest);
if(!$rows){
Log::debug($row->expressno);
continue;
}
foreach (array_reverse($rows->data) as $trackingRow) {
if ($trackingRow->tracking === '货物已送达仓库准备入库中') {
$receiveDate = Carbon::parse($trackingRow->trackingtime);
@@ -181,21 +186,43 @@ 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);
}
if ($trackingRow->tracking === '货物已派送完成') {
if (Str::contains($trackingRow->tracking, ['派送中'])) {
$deliveryDate = Carbon::parse($trackingRow->trackingtime);
}
}
@@ -288,6 +315,13 @@ class FetchOrderListsFromYdPortalProcessor
$this->createPackageProcessor->execute($packageObject, $packingList);
}
if(!count($row->deliverysize)){
$measurement = round(((float) $row->volume / (float) $row->goodcount) ** (1/3) * 100, 2);
$packageObject = new PackageObject(PackageType::CARTON, $row->goodname, (float) $measurement, (float) $measurement, (float) $measurement, 0, (float) $row->goodcount, ApprovalStatus::APPROVED);
$this->createPackageProcessor->execute($packageObject, $warehouseReceiveList);
$this->createPackageProcessor->execute($packageObject, $packingList);
}
$weightCbm = (float) $row->weight / 500;
$overWeightCbm = $weightCbm - $packingList->packages()->sum(DB::raw('(width/100) * (height/100) * (length/100) * quantity'));
@@ -344,7 +378,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,7 +407,7 @@ class FetchOrderListsFromYdPortalProcessor
}
}
if($deliveryDate && !$packingList->transports){
if($deliveryDate && !$packingList->transports()->exists()){
$packingList->status = ApprovalStatus::COMPLETED;
$packingList->save();
@@ -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';
}
@@ -0,0 +1,30 @@
<?php
namespace App\Http\Controllers\Exports;
use App\Classes\Modules\Exports\Services\ExportsCompanyModuleSummary;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Maatwebsite\Excel\Excel;
class ExportCompanyModuleSummaryController
{
/**
* ExportCompanyModuleSummaryController constructor.
* @param Request $request
*/
public function __construct(Request $request)
{
$token = Auth::fromUser(User::find(1));
$request->headers->set('Authorization', 'Bearer '.$token);
}
public function export(Request $request) {
$exportsCompanyModuleSummary = new ExportsCompanyModuleSummary($request);
$exportsCompanyModuleSummary->setParameters($request->route('company_module_id'), $request->input('containerNumber'));
$response = $exportsCompanyModuleSummary->download('customerid-markingno.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
ob_end_clean();
return $response;
}
}
@@ -0,0 +1,29 @@
<?php
namespace App\Http\Controllers\Exports;
use App\Classes\Modules\Exports\Services\ExportsPendingArrangementDeliveryList;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Maatwebsite\Excel\Excel;
class ExportPendingArrangementPackingListController
{
/**
* ExportPendingArrangementPackingListController constructor.
* @param Request $request
*/
public function __construct(Request $request)
{
$token = Auth::fromUser(User::find(1));
$request->headers->set('Authorization', 'Bearer '.$token);
}
public function export(Request $request) {
$exportsPendingArrangementDeliveryList = new ExportsPendingArrangementDeliveryList($request);
$response = $exportsPendingArrangementDeliveryList->download('pending-arrangement-packing-list.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
ob_end_clean();
return $response;
}
}
@@ -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);
}
}
+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)
];
}
}
@@ -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')
];
}
}
+6 -2
View File
@@ -3,6 +3,7 @@
namespace App\Http\Resources;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Carbon\Carbon;
use Illuminate\Http\Resources\Json\JsonResource;
class TransportResource extends JsonResource
@@ -15,6 +16,7 @@ class TransportResource extends JsonResource
*/
public function toArray($request)
{
$currentSchedule = $this->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first();
return [
'id' => $this->id,
'type' => $this->type,
@@ -23,8 +25,10 @@ class TransportResource extends JsonResource
'dispatch_date' => $this->dispatch_date ? $this->dispatch_date->format('d-m-Y') : $this->dispatch_date,
'drop_date' => $this->drop_date ? $this->drop_date->format('d-m-Y') : $this->drop_date,
'status' => $this->status,
'current_schedule' => new ScheduleResource($this->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()),
'schedule_history' => ScheduleResource::collection($this->schedules()->where('status', '=', ApprovalStatus::EXPIRED)->get())
'current_schedule' => new ScheduleResource($currentSchedule),
'schedule_history' => ScheduleResource::collection($this->schedules()->where('status', '=', ApprovalStatus::EXPIRED)->get()),
'dropped_days' => Carbon::now()->diffInDays($this->drop_date, false),
'schedule_complete' => $currentSchedule ? $currentSchedule->eta <= Carbon::now() : false
];
}
}
+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.6 KiB

-6
View File
@@ -317,12 +317,6 @@ hr{
background-color: $color-primary-lighter !important;
}
.bg-primary-lighter-hover {
&:hover {
background-color: $color-primary-lighter !important;
}
}
/* Complete
------------------------------------
*/
@@ -82,16 +82,35 @@
</div>
</div>
</div>
<div class="row parentContainer" v-if="!item.identification">
<div class="row">
<div class="col">
<div class="row">
<div class="col no-padding">
<button class="btn btn-sm btn-success btn-block b-rad-none requestModal" data-type="identificationVerificationModal">Upload Identification</button>
<div class="row parentContainer" v-if="!item.identification">
<div class="col">
<div class="row">
<div class="col no-padding">
<button class="btn btn-sm btn-success btn-block b-rad-none requestModal" data-type="identificationVerificationModal">Upload Identification</button>
</div>
</div>
<modal-component type="identificationVerificationModal">
<identification-verification-form-component section="orderListSection" :data="item"></identification-verification-form-component>
</modal-component>
</div>
</div>
<div class="row parentContainer">
<div class="col no-padding">
<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 requestModal" data-type="exportCompanyModuleSummary">
<div class="row align-items-center">
<div class="col-auto p-r-0 p-l-0">
<i class="fa fa-file-excel-o fs-16"></i>
</div>
<div class="col p-r-5">Export To Excel</div>
</div>
</button>
<modal-component type="exportCompanyModuleSummary">
<export-company-module-summary-form-component section="exportCompanyModuleSummarySection" :data="item.company_module" @exit="closeModal"></export-company-module-summary-form-component>
</modal-component>
</div>
</div>
<modal-component type="identificationVerificationModal">
<identification-verification-form-component section="orderListSection" :data="item"></identification-verification-form-component>
</modal-component>
</div>
</div>
</div>
@@ -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">
@@ -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>
@@ -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>
@@ -23,7 +23,8 @@
</div>
</div>
<div class="col">
<p class="no-margin">{{item.transport ? item.transport.current_schedule.eta : 'n/a'}}</p>
<p class="no-margin" v-if="item.transport">{{ item.transport.current_schedule.eta }}</p>
<p class="no-margin text-danger" v-if="!item.transport">{{ item.packages[0].container.transport ? item.packages[0].container.transport.dropped_days+' Days': 'n/a'}}</p>
</div>
<div class="col-auto text-right" v-if="!item.transport">
<div class="row m-b-5">
@@ -35,7 +36,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>
@@ -50,7 +50,7 @@
</div>
<div class="col-auto">
<small class="fs-10 all-caps muted">Status</small>
<p class="no-margin bold">{{status}}</p>
<p class="no-margin bold">{{item.container ? item.container.transport.schedule_complete && status === 'Shipping' ? 'Custom Clearance' : status : status}}</p>
</div>
<div class="col-auto" v-if="$store.getters.isAdmin">
<small class="fs-10 all-caps muted">Container</small>
@@ -22,17 +22,18 @@
<p class="no-margin all-caps fs-10 light">Arrival Date</p>
<p class="no-margin text-success bold">{{data.transport ? data.transport.drop_date : 'n/a'}}</p>
</div>
<div class="col text-right">
<div class="col text-right" v-if="$store.getters.isSuperAdmin">
<button type="button" class="btn b-rad-none btn-primary fs-11 requestModal" data-type="claimPackingList">Claim</button>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="claimPackingList">
<claim-packinglist-form-component :data="data.id"></claim-packinglist-form-component>
</modal-component>
</div>
</div>
</div>
</div>
</div>
</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="claimPackingList">
<claim-packinglist-form-component :data="data.id"></claim-packinglist-form-component>
</modal-component>
</div>
</div>
</template>
@@ -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>
@@ -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,63 @@
<template>
<div class="row">
<div class="col">
<loading-component style="height: 300px; top: 0;" key="1" color="success" v-show="isLoading" ></loading-component>
<div class="row justify-content-center" v-show="!isLoading">
<div class="col">
<div class="row m-b-20">
<div class="col">
<h3 class="all-caps text-center">Export Customer Summary</h3>
<div class="fs-11 text-center">Please key in the Container Number spereated by a comma.</div>
</div>
</div>
<div class="row m-b-15">
<div class="col">
<validation-wrapper-component :validator="$v.containerIds">
<label>Container Number</label>
<input class="form-control" v-model="containerIds">
</validation-wrapper-component>
</div>
</div>
<div class="row">
<div class="col p-r-5">
<div class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none" data-dismiss="modal">Cancel</div>
</div>
<div class="col p-l-5">
<div class="btn btn-sm btn-primary btn-block b-rad-none" @click="submitForm()">Confirm</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 {
containerIds: '',
}
},
validations: {
containerIds: {
required
},
},
methods: {
submitForm() {
this.validate();
if(this.validate()){
this.$v.$reset();
this.closeModal();
window.open(this.route('customer.summary.export', this.item.id)+'?containerNumber='+this.containerIds, '_blank');
}
return;
}
},
mixins: [componentHandler, ModalFormHandler]
}
</script>
@@ -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>
+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>
@@ -44,6 +44,20 @@
</div>
</div>
<div class="col">
<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">
<h6>Unclaimed Packing Lists</h6>
</div>
</div>
<list-component section="unclaimedPackingListSection" :endpoint="route('api.packing_list.list')" :options="{claimant_id: 2037, owner_id: 1, status: 4}">
<template slot="list" slot-scope="{data}">
<unclaimed-packinglist-component :data="data"></unclaimed-packinglist-component>
</template>
</list-component>
</div>
</div>
<profit-model-report-section-component></profit-model-report-section-component>
</div>
</div>
+55 -31
View File
@@ -75,55 +75,79 @@
<div class="col bg-master-lightest p-1 p-sm-4">
<div class="row tabsContainer tabContent" tab-name="pendingArrangement">
<div class="col">
<div class="row align-items-center m-b-5 p-b-10 b-b b-grey muted all-caps fs-10">
<div class="col-2">Marking</div>
<div class="col text-center">Quantity</div>
<div class="col">CBM</div>
<div class="col">Overweight CBM</div>
<div class="col">Total CBM</div>
<div class="col">status</div>
<div class="col">Delivery Date</div>
<div class="col text-right">Action</div>
<div class="row">
<div class="col">
<a href="{{route('packaging_list.pending_arrangement.export')}}" target="_blank">
<button type="button" class="btn btn-sm p-t-10 p-b-10 p-r-35 p-l-35 btn-primary b-rad-none">
<div class="row align-items-center">
<div class="col-auto p-r-0 p-l-0">
<i class="fa fa-file-excel-o fs-16"></i>
</div>
<div class="col p-r-5">Export To Excel</div>
</div>
</button>
</a>
<div class="row align-items-center m-t-10 p-t-10 p-b-10 b-t b-grey muted all-caps fs-10">
<div class="col-2">Marking</div>
<div class="col-1 text-center">Quantity</div>
<div class="col-1">CBM</div>
<div class="col-1">Overweight CBM</div>
<div class="col-1">Total CBM</div>
<div class="col-1 text-center">status</div>
<div class="col-3">Delivery Details</div>
<div class="col">Delivery Date</div>
</div>
</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': 10, order_by: {column: 'arrival_date', DESC: true}}">
<template slot="list" slot-scope="{data}">
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
<packing-list-component :data="data"></packing-list-component>
</template>
</list-component>
</div>
</div>
<div class="row tabsContainer tabContent hide" tab-name="pendingDelivery">
<div class="col">
<div class="row align-items-center m-b-5 p-b-10 b-b b-grey muted all-caps fs-10">
<div class="col-2">Marking</div>
<div class="col text-center">Quantity</div>
<div class="col">CBM</div>
<div class="col">Overweight CBM</div>
<div class="col">Total CBM</div>
<div class="col">status</div>
<div class="col">Delivery Date</div>
<div class="row">
<div class="col">
<div class="row align-items-center p-t-10 p-b-10 b-t b-grey muted all-caps fs-10">
<div class="col-2">Marking</div>
<div class="col-1 text-center">Quantity</div>
<div class="col-1">CBM</div>
<div class="col-1">Overweight CBM</div>
<div class="col-1">Total CBM</div>
<div class="col-1 text-center">status</div>
<div class="col-3">Delivery Details</div>
<div class="col">Delivery Date</div>
</div>
</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': 10, order_by: {column: 'arrival_date', DESC: true}}">
<template slot="list" slot-scope="{data}">
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
<packing-list-component :data="data"></packing-list-component>
</template>
</list-component>
</div>
</div>
<div class="row tabsContainer tabContent hide" tab-name="delivered">
<div class="col">
<div class="row align-items-center m-b-5 p-b-10 b-b b-grey muted all-caps fs-10">
<div class="col-2">Marking</div>
<div class="col text-center">Quantity</div>
<div class="col">CBM</div>
<div class="col">Overweight CBM</div>
<div class="col">Total CBM</div>
<div class="col">status</div>
<div class="col">Delivery Date</div>
<div class="row">
<div class="col">
<div class="row align-items-center p-t-10 p-b-10 b-t b-grey muted all-caps fs-10">
<div class="col-2">Marking</div>
<div class="col-1 text-center">Quantity</div>
<div class="col-1">CBM</div>
<div class="col-1">Overweight CBM</div>
<div class="col-1">Total CBM</div>
<div class="col-1 text-center">status</div>
<div class="col-3">Delivery Details</div>
<div class="col">Delivery Date</div>
</div>
</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': 10, order_by: {column: 'arrival_date', DESC: true}}">
<template slot="list" slot-scope="{data}">
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
<packing-list-component :data="data"></packing-list-component>
</template>
</list-component>
</div>
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
+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');
});
});
+71 -6
View File
@@ -125,7 +125,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();
@@ -231,6 +231,7 @@ Route::get('/warehouse/{id}/show', function ($id) {
})->name('warehouse.show');
Route::get('/export/customer-latest-order-date/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@export');
Route::get('/export/packing-list/{id}', 'Exports\ExportContainerPackingListController@export')->name('container.packaging_list.export');
Route::get('/export/pending-arrangement-delivery-list', 'Exports\ExportPendingArrangementPackingListController@export')->name('packaging_list.pending_arrangement.export');
Route::get('/settings', function () {
return view('pages.settings');
@@ -239,6 +240,56 @@ Route::get('/settings', function () {
return view('pages.settings');
})->name('settings');
Route::get('/customer/{company_module_id}/summary', 'Exports\ExportCompanyModuleSummaryController@export')->name('customer.summary.export');
Route::get('/customer/summary/monthly', function () {
// $containers = Container::whereMonth('loading_date', 1)->where('owner_id', 3)->get();
$containers = Container::whereIn('reference', ['EPS-3850', 'EPS-3863', 'WP-1331', 'EPS-3856'])->get();
foreach ($containers as $container){
$packingLists = $container->packingLists()->get()->filter(function ($packingList) {
return $packingList->owner->company_module_id === 248;
});
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 +304,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 +325,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');