Compare commits

...

183 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
glovetleong 9a1562386f billpliz callback 2022-03-16 23:01:38 +08:00
omair saleh 22700893a2 fix qr remark 2022-03-16 10:03:47 +08:00
omair saleh 550c9480a4 fix qr remark 2022-03-16 10:02:17 +08:00
omair saleh 48bab9998c fix qr remark 2022-03-16 09:47:26 +08:00
omair saleh 3ff81d4f00 fix qr remark 2022-03-16 09:46:23 +08:00
omair saleh cc7edfc784 sort deliveries by date 2022-03-16 01:24:37 +08:00
omair saleh 72448d656c sort deliveries by date 2022-03-16 01:20:13 +08:00
omair saleh c941f679b6 sort deliveries by date 2022-03-16 01:19:31 +08:00
omair saleh 78f6c70cad sort deliveries by date 2022-03-16 01:18:53 +08:00
omair saleh 1575d62e0f sort deliveries by date 2022-03-16 01:17:21 +08:00
omair saleh 43f4bc533a sort deliveries by date 2022-03-16 01:16:13 +08:00
omair saleh 9ae36dc400 sort deliveries by date 2022-03-16 01:14:27 +08:00
omair saleh 02c55d97b7 sort deliveries by date 2022-03-16 01:00:27 +08:00
omair saleh baeaa0f31a sort deliveries by date 2022-03-16 00:58:16 +08:00
omair saleh dadc786f1f Merge branch 'development' into 'master'
Development

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

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

See merge request CIEFWorldwideSdnBhd/shipping-portal!110
2022-03-14 05:45:21 +00:00
glovetleong 7ec109eb3e soft delete user 2022-03-14 13:42:48 +08:00
omair saleh 7151616b04 Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development 2022-03-14 13:19:04 +08:00
omair saleh f2007b25e4 fix delivery list filter 2022-03-14 11:32:22 +08:00
omair saleh 6389fc6600 fix delivery list filter 2022-03-14 11:24:33 +08:00
omair saleh eb6b2943af fix delivery list filter 2022-03-14 11:21:20 +08:00
omair saleh 5fb7ddb0ec fix delivery list filter 2022-03-14 11:20:16 +08:00
omair saleh 91feb5b8fa fix delivery list filter 2022-03-14 11:19:45 +08:00
omair saleh 9c98693071 Merge remote-tracking branch 'origin/development' into development 2022-03-14 11:14:29 +08:00
omair saleh 56fb250e6f fix delivery list filter 2022-03-14 11:14:14 +08:00
Leong Chee Siong eabfeb6724 Merge branch 'transaction-invoice' into 'development'
payment transaction

See merge request CIEFWorldwideSdnBhd/shipping-portal!109
2022-03-14 03:10:20 +00:00
omair saleh 8902a09337 fix delivery list filter 2022-03-14 10:59:44 +08:00
omair saleh 0a69faeb3b fix delivery list filter 2022-03-14 10:58:48 +08:00
omair saleh bea9507dae fix delivery list filter 2022-03-14 10:57:43 +08:00
glovetleong 5d9e621920 payment document approve 2022-03-12 20:06:10 +08:00
omair saleh 28088f7d9a fix mysql crash on supplier update api 2022-03-11 14:43:21 +08:00
glovetleong de56c21734 payment transaction 2022-03-08 16:55:31 +08:00
65 changed files with 1996 additions and 395 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);
}
}
@@ -16,13 +16,15 @@ class PackingListDeliveryStatus implements Filter
*/
public static function apply(Builder $builder, $value)
{
return $value == 1 ? $builder->whereDoesntHave('transports') : ($value == 2 ? $builder->whereHas('transports', function (Builder $query) use ($value) {
return $value == 1 ? $builder->whereHas('containers', function ($query){
$query->where('containers.status', ApprovalStatus::COMPLETED);
})->whereDoesntHave('transports') : ($value == 2 ? $builder->whereHas('transports', function (Builder $query) use ($value) {
$query->whereDoesntHave('schedules', function (Builder $query) use ($value) {
$query->where('status', '!=', ApprovalStatus::EXPIRED)->where('eta', '>', Carbon::now());
$query->where('status', '!=', ApprovalStatus::EXPIRED)->where('eta', '<=', Carbon::now());
});
}) : $builder->whereHas('transports', function (Builder $query) use ($value) {
$query->whereHas('schedules', function (Builder $query) use ($value) {
$query->where('status', '!=', ApprovalStatus::EXPIRED)->where('eta', '<', Carbon::now());
$query->where('status', '!=', ApprovalStatus::EXPIRED)->where('eta', '<=', Carbon::now());
});
}));
}
@@ -0,0 +1,91 @@
<?php
namespace App\Classes\Modules\Billplzs\ControllersLogic;
use App\Classes\Modules\Wallets\DataTransferObjects\WalletObject;
use App\Classes\Modules\Wallets\Services\UpdatesWallet;
use App\Classes\Exceptions\ResourceNotFoundException;
use App\Classes\Modules\Wallets\Services\UpdatesWalletBalance;
use App\Http\Resources\TransactionResource;
use App\Models\Booking;
use App\Models\User;
use App\Models\Wallet;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\Modules\Billplzs\Services\GetBillplzBill;
use App\Classes\Modules\Billplzs\DataTransferObjects\BillplzXSignatureObject;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
class CallbackBillplzLogic
{
/** @var GetBillplzBill */
private $getBillplzBill;
/** @var FetchesTransaction */
private $fetchesTransaction;
/** @var UpdatesTransactionStatus */
private $updatesTransactionStatus;
/** @var UpdatesWalletBalance */
private $updatesWalletBalance;
/**
* CallbackBillplzLogic constructor.
* @param GetBillplzBill $getBillplzBill
* @param FetchesTransaction $fetchesTransaction
* @param UpdatesTransactionStatus $updatesTransactionStatus
* @param UpdatesWalletBalance $updatesWalletBalance
*/
public function __construct(GetBillplzBill $getBillplzBill, FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus)
{
$this->getBillplzBill = $getBillplzBill;
$this->fetchesTransaction = $fetchesTransaction;
$this->updatesTransactionStatus = $updatesTransactionStatus;
}
/**
* @param Request $request
* @return bool|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @throws MalformedRequestException
* @throws ResourceNotFoundException
*/
public function execute(Request $request)
{
$billplzXSignatureObject = new BillplzXSignatureObject($request);
if(!$billplzXSignatureObject->isValidSignature()){
throw new MalformedRequestException('Billplz Payment validation failed.');
}
$billPlz = $this->getBillplzBill->execute($billplzXSignatureObject->getBillPlzId());
if(!$billPlz) throw new ResourceNotFoundException('Billplz bill not found.');
$transaction = $this->fetchesTransaction->execute(['payment_reference' => $billplzXSignatureObject->getBillPlzId()]);
if($billPlz->state === 'paid') {
$status = ApprovalStatus::APPROVED;
}
if($billPlz->state === 'due') {
$status = $billplzXSignatureObject->getStatus() === 'failed' ? ApprovalStatus::REJECTED : ApprovalStatus::PENDING_VERIFICATION;
}
$token = Auth::fromUser(User::find(1));
$request->headers->set('Authorization', 'Bearer '.$token);
$marking = $transaction->owner()->first()->owner()->first();
return $request->method() === 'POST' ? true : view('pages.payments_redirect', ['marking' => $marking->reference, 'transaction' => $transaction, 'status' => $status]);
}
}
@@ -0,0 +1,54 @@
<?php
namespace App\Classes\Modules\Billplzs\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Billplzs\Services\CreatesBillplzBill;
use ErrorException;
use App\Classes\Exceptions\MalformedRequestException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateBillplzBillLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Created Billplz Bill',
'message' => 'You have successfully created a new Bill'
];
}
/** @var CreatesBillplzBill */
private $createsBillplzBill;
/**
* CreateBookingLogic constructor.
* @param CreatesBillplzBill $createsBillplzBill
*/
public function __construct(CreatesBillplzBill $createsBillplzBill)
{
$this->createsBillplzBill = $createsBillplzBill;
}
/**
* @param Request $request
* @return JsonResponse
* @throws MalformedRequestException
*/
public function logic(Request $request) : JsonResponse
{
$billPlz = $this->createsBillplzBill->execute($request->user()->name, $request->user()->email, $request->input('description'), 200, $request->input('bankName'));
if(!$billPlz) throw new MalformedRequestException('Unable to get correct response from billplz server.');
return $this->response(['data' => $billPlz]);
}
}
@@ -0,0 +1,120 @@
<?php
namespace App\Classes\Modules\Billplzs\DataTransferObjects;
use Illuminate\Http\Request;
use App\Classes\General\Interfaces\DataTransferObject;
use function PHPSTORM_META\map;
class BillplzXSignatureObject implements DataTransferObject
{
/** @var string */
private $billPlzId;
/** @var string */
private $status;
/** @var array */
private $billPlzConstructArray;
/** @var string */
private $billPlzConstructString;
/** @var string */
private $billPlzComputedXSignature;
/** @var string */
private $type;
/** @var Request */
private $request;
/** @var string */
private $requestXSignature;
public function __construct(Request $request)
{
$this->type = $request->exists('billplz') ? 'redirect' : 'callback';
$this->request = $this->type === 'redirect' ? $request->input('billplz') : $request;
$this->billPlzId = $this->request['id'];
$this->status = $this->request['transaction_status'];
$this->requestXSignature = $this->request['x_signature'];
$this->_constructBillplzArray()->_natSortBillplzArray()->_constructBillplzString()->_computeBillplzXSignature();
}
private function _constructBillplzArray(){
$this->billPlzConstructArray = collect($this->request)->forget('x_signature')->map(function($item, $key){
return $this->type === 'redirect' ? 'billplz'.$key.$item : $key.$item;
})->toArray();
return $this;
}
private function _natCaseSortBillplzArray(){
natcasesort($this->billPlzConstructArray);
return $this;
}
private function _natSortBillplzArray(){
natsort($this->billPlzConstructArray);
return $this;
}
private function _constructBillplzString(){
$this->billPlzConstructString = implode('|', $this->billPlzConstructArray);
return $this;
}
private function _computeBillplzXSignature(){
$this->billPlzComputedXSignature = hash_hmac('sha256', $this->billPlzConstructString, config('billplz.x_signature_key'));
return $this;
}
public function getBillPlzId(): string
{
return $this->billPlzId;
}
public function getStatus(): string
{
return $this->status;
}
/**
* @return array
*/
public function getBillPlzConstructArray(): array
{
return $this->billPlzConstructArray;
}
/**
* @return string
*/
public function getBillPlzConstructString(): string
{
return $this->billPlzConstructString;
}
/**
* @return string
*/
public function getBillPlzComputedXSignature(): string
{
return $this->billPlzComputedXSignature;
}
public function isValidSignature(): bool
{
return $this->billPlzComputedXSignature === $this->requestXSignature ? true : false;
}
}
@@ -0,0 +1,57 @@
<?php
namespace App\Classes\Modules\Billplzs\Services;
use Illuminate\Support\Facades\Http;
use App\Classes\Exceptions\MalformedRequestException;
class CreatesBillplzBill
{
/**
* @param string $name
* @param string $email
* @param string $description
* @param float $amount
* @param string $billNumber
* @param null|string $bankCode
* @param null|Boolean $wallet
* @return null|object
* @throws MalformedRequestException
*/
public function execute(string $name, string $email, string $description, float $amount, string $billNumber, ?string $bankCode = null, ?bool $wallet = null) {
try{
// config('billplz.maybank')
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->post(config('billplz.base_url').'/api/v3/bills', [
'collection_id' => $wallet ? config('billplz.wallet_collection_id') : config('billplz.collection_id'),
'name' => $name,
'email' => $email,
'description' => $description,
'amount' => $this->finalizeAmount($amount),
'redirect_url' => route('online_payment.redirect'),
'callback_url' => route('api.online_payment.callback'),
'reference_1_label' => 'Bank Code',
'reference_1' => $bankCode ? $bankCode : '',
'reference_2_label' => 'Bill Number',
'reference_2' => $billNumber
]);
if($response->successful()){
$data = $response->json();
$data['url'] = $data['url'].'?auto_submit=true';
return (object) $data;
}else{
return null;
}
}catch(\Exception $exception){
throw new MalformedRequestException('Unable to get correct response from billplz server' . $exception->getMessage());
}
}
protected function finalizeAmount($amount){
$number = round($amount, 2) * 100;
return (string) $number;
}
}
@@ -0,0 +1,31 @@
<?php
namespace App\Classes\Modules\Billplzs\Services;
use App\Classes\Exceptions\MalformedRequestException;
use Illuminate\Support\Facades\Http;
class GetBillplzBill
{
/**
* @param string $billPlzId
* @return null|object
* @throws MalformedRequestException
*/
public function execute(string $billPlzId) {
try{
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$billPlzId);
if($response->successful()){
$data = $response->json();
return (object) $data;
}else{
return null;
}
}catch(\Exception $exception){
throw new MalformedRequestException('Unable to get correct response from billplz server');
}
}
}
@@ -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 : '',
];
}
}
@@ -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,12 +407,7 @@ class FetchOrderListsFromYdPortalProcessor
}
}
if($deliveryDate){
if($packingList->transports){
continue;
}
if($deliveryDate && !$packingList->transports()->exists()){
$packingList->status = ApprovalStatus::COMPLETED;
$packingList->save();
@@ -50,9 +50,10 @@ class FetchPackingListFromVTPortalProcessor
$query->where('status', '=', ApprovalStatus::COMPLETED);
})->get();
DB::beginTransaction();
foreach($packingLists as $packingList){
try {
DB::beginTransaction();
$filter = '["PoNumber:=%js%\"'.$packingList->reference.'\"\u0000"]';
@@ -75,14 +76,12 @@ class FetchPackingListFromVTPortalProcessor
}
}
DB::commit();
} catch (GuzzleException $exception) {
continue;
}
}
DB::commit();
return [];
@@ -134,19 +134,13 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
foreach ($response->Rows as $parcel){
$marking = explode('/', explode('CIEF/', $parcel[5])[1]);
if(!array_key_exists(1, $marking)){
continue;
}
$orderNumber = $marking[1];
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $parcel[5]));
$orderNumber = $marking[array_key_last($marking)];
if(!$parcel[9]){
continue;
}
try {
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
} catch (ResourceNotFoundException $exception) {
@@ -0,0 +1,81 @@
<?php
namespace App\Classes\Modules\Transactions\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Documents\Services\ApprovesDocument;
use App\Classes\Modules\Documents\Services\FetchesDocument;
use App\Classes\Modules\Documents\Services\RejectsDocument;
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ApprovePaymentTransactionLogic extends AbstractControllerLogic
{
/**
* ApprovePaymentVerificationLogic constructor.
* @param FetchesTransaction $fetchesTransaction
* @param UpdatesTransactionStatus $updatesTransactionStatus
* @param ApprovesDocument $approvesDocument
* @param RejectsDocument $rejectsDocument
* @param FetchesDocument $fetchesDocument
* @param CreateInvoiceTransactionProcessor $createInvoiceTransactionProcessor
*/
public function __construct(FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument)
{
$this->fetchesTransaction = $fetchesTransaction;
$this->updatesTransactionStatus = $updatesTransactionStatus;
$this->approvesDocument = $approvesDocument;
$this->rejectsDocument = $rejectsDocument;
}
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Payment Status',
'message' => 'You have successfully updated the payment status'
];
}
/** @var FetchesTransaction */
private $fetchesTransaction;
/** @var UpdatesTransactionStatus */
private $updatesTransactionStatus;
/** @var ApprovesDocument */
private $approvesDocument;
/** @var RejectsDocument */
private $rejectsDocument;
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function logic(Request $request) : JsonResponse
{
$status = $request->route('status');
$transaction = $this->fetchesTransaction->execute(['id' => $request->route('transaction_id')]);
$status === 'approve' ? $this->approvesDocument->execute($transaction->documents()->first()) : $this->rejectsDocument->execute($transaction->documents()->first());
$this->updatesTransactionStatus->execute($transaction, $status === 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
// $this->createInvoiceTransactionProcessor->execute($transaction->booking);
return $this->response([]);
}
}
@@ -0,0 +1,121 @@
<?php
namespace App\Classes\Modules\Transactions\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
use App\Classes\Modules\Transactions\Services\CreatesPaymentTransaction;
use App\Classes\Modules\Transactions\Services\CreatesTransactionDetail;
use App\Classes\Modules\Billplzs\Services\CreatesBillplzBill;
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionDetailObject;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
class CreatePaymentTransactionLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Create Payment Transactions',
'message' => 'You have successfully created currency supplier transactions'
];
}
/** @var FetchesTransaction */
private $fetchesTransaction;
/** @var FetchesSegmentConstant */
private $fetchesSegmentConstant;
/** @var GeneratesTransactionBillNumber */
private $generatesTransactionBillNumber;
/** @var CreatesPaymentTransaction */
private $createsPaymentTransaction;
/** @var CreatesBillplzBill */
private $createsBillplzBill;
/** @var CreatesTransactionDetail */
private $createsTransactionDetail;
public function __construct(
FetchesTransaction $fetchesTransaction,
GeneratesTransactionBillNumber $generatesTransactionBillNumber,
CreatesPaymentTransaction $createsPaymentTransaction,
CreatesTransactionDetail $createsTransactionDetail,
CreatesBillplzBill $createsBillplzBill
)
{
$this->fetchesTransaction = $fetchesTransaction;
$this->generatesTransactionBillNumber = $generatesTransactionBillNumber;
$this->createsPaymentTransaction = $createsPaymentTransaction;
$this->createsTransactionDetail = $createsTransactionDetail;
$this->createsBillplzBill = $createsBillplzBill;
}
public function logic(Request $request) : JsonResponse
{
$invoice_transaction = $this->fetchesTransaction->execute(['id' => $request->input('transaction_id')]);
$amount = $request->input('amount');
$company_module = $invoice_transaction->owner()->first()->owner()->first()->companyModule()->first();
$billNumber = $this->generatesTransactionBillNumber->execute('PYMT-');
$payment_reference = null;
if ($request->input('payment_method') == 5) {
$payment_method = PaymentMethodType::PAYMENT_GATEWAY;
$billPlzBill = $this->createsBillplzBill->execute(
$company_module->name,
$company_module->employees()->first()->email,
'This payment is credit topup for company ref. ' . $company_module->reference, $amount, $billNumber,
$request->input('bank_code'), true
);
$payment_reference = $billPlzBill->id;
}
else {
$payment_method = PaymentMethodType::CASH;
}
$object = new TransactionObject(
$billNumber,
TransactionType::PAYMENT,
$company_module->id,
1,
1,
$payment_method,
$request->input('amount'),
$request->input('amount'),
1,
1,
0,
0,
0,
null,
ApprovalStatus::PENDING_SUBMISSION,
null,
$payment_reference
);
$payment_transaction = $this->createsPaymentTransaction->execute($invoice_transaction, $object);
return $this->response([]);
}
}
@@ -20,24 +20,15 @@ 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\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
// use App\Classes\Modules\Transactions\Services\FetchesTransaction;
// use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
// use App\Models\Document;
// use App\Models\Transaction;
// use Barryvdh\DomPDF\PDF;
// use Carbon\Carbon;
use App\Models\Document;
use App\Models\Transaction;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
// use Meneses\LaravelLaravelMpdf\Facades\LaravelLaravelMpdf;
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
@@ -74,16 +65,6 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
/** @var CreatesFiles */
private $createsFile;
// /** @var FetchesTransaction */
// /** @var UpdatesTransactionStatus */
// private $updatesTransactionStatus;
// /** @var CreatesDocument */
// private $createsDocument;
// /** @var CreatesFiles */
// private $createsFile;
// /** @var PDF */
// private $pdf;
public function __construct(
FetchesPackingList $fetchesPackingList,
@@ -93,10 +74,6 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
CreatesTransactionDetail $createsTransactionDetail,
CreatesDocument $createsDocument,
CreatesFiles $createsFile
// CreatesDocument $createsDocument,
// CreatesFiles $createsFile,
// PDF $pdf
)
{
@@ -107,18 +84,17 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
$this->createsTransactionDetail = $createsTransactionDetail;
$this->createsDocument = $createsDocument;
$this->createsFile = $createsFile;
// $this->updatesTransactionStatus = $updatesTransactionStatus;
// $this->createsDocument = $createsDocument;
// $this->createsFile = $createsFile;
// $this->pdf = $pdf;
}
public function logic(Request $request) : JsonResponse
{
$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);
});
@@ -175,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-');
@@ -197,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]);
@@ -217,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([]);
}
}
@@ -0,0 +1,87 @@
<?php
namespace App\Classes\Modules\Transactions\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Classes\Modules\Companies\Services\UpdatesCompanyStatus;
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
use App\Classes\Modules\Documents\Services\CreatesDocument;
use App\Classes\Modules\Documents\Services\CreatesFiles;
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\CompanyType;
use App\Classes\ValueObjects\Constants\DocumentType;
use App\Models\Company;
use App\Models\Document;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UploadPaymentVerificationDocumentLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Payment Verify Document',
'message' => 'You have successfully submitted your payment verify document'
];
}
/** @var FetchesTransaction */
private $fetchesTransaction;
/** @var CreatesDocument */
private $createsDocument;
/** @var CreatesFiles */
private $createsFile;
/** @var UpdatesTransactionStatus */
private $updatesTransactionStatus;
/**
* CreatePaymentVerificationDocumentLogic constructor.
* @param FetchesTransaction $fetchesTransaction
* @param CreatesDocument $createsDocument
* @param CreatesFiles $createsFile
* @param UpdatesTransactionStatus $updatesTransactionStatus
*/
public function __construct(FetchesTransaction $fetchesTransaction, CreatesDocument $createsDocument, CreatesFiles $createsFile, UpdatesTransactionStatus $updatesTransactionStatus)
{
$this->fetchesTransaction = $fetchesTransaction;
$this->createsDocument = $createsDocument;
$this->createsFile = $createsFile;
$this->updatesTransactionStatus = $updatesTransactionStatus;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function logic(Request $request) : JsonResponse
{
$transaction = $this->fetchesTransaction->execute(['id' => $request->route('transaction_id')]);
$object = new DocumentObject(
DocumentType::CUSTOMER_PAYMENT_PROOF,
$request->input('files'),
'',
ApprovalStatus::PENDING_VERIFICATION,
'payments'
);
/** @var Document $document */
$document = $this->createsDocument->execute($transaction, $object);
$this->createsFile->execute($document, $object);
$this->updatesTransactionStatus->execute($transaction, ApprovalStatus::PENDING_VERIFICATION);
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;
}
@@ -57,6 +57,9 @@ class TransactionObject implements DataTransferObject
/** @var array|null */
private $details;
/** @var string */
private $paymentReference;
/**
* TransactionObject constructor.
* @param string $billNo
@@ -92,7 +95,8 @@ class TransactionObject implements DataTransferObject
float $serviceCharge,
?Carbon $expiresOn,
?int $status = ApprovalStatus::PENDING_SUBMISSION,
?array $details = []
?array $details = [],
?string $paymentReference = null
)
{
$this->billNo = $billNo;
@@ -111,6 +115,7 @@ class TransactionObject implements DataTransferObject
$this->expiresOn = $expiresOn;
$this->status = $status;
$this->details = $details;
$this->paymentReference = $paymentReference;
}
/**
@@ -243,7 +248,11 @@ class TransactionObject implements DataTransferObject
}, $this->details);
}
/**
* @return string|null
*/
public function getPaymentReference(): ?string
{
return $this->paymentReference;
}
}
@@ -0,0 +1,37 @@
<?php
namespace App\Classes\Modules\Transactions\Services;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\General\Eloquent\AbstractUpdateRelationshipRecord;
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
use App\Models\Transaction;
class CreatesPaymentTransaction extends AbstractUpdateRelationshipRecord
{
/**
* @param TransactionObject $object
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(Transaction $transaction, TransactionObject $object) {
$model = new Transaction();
$model->bill_no = $object->getBillNo();
$model->type = $object->getTransactionType();
$model->issuer = $object->getIssuer();
$model->receiver = $object->getReceiver();
$model->recipient_bank_account_id = $object->getRecipientBankAccountId();
$model->payment_method = $object->getPaymentMethod();
$model->amount = $object->getAmount();
$model->original_amount = $object->getOriginalAmount();
$model->currency_id = $object->getCurrencyId();
$model->original_currency_id = $object->getOriginalCurrencyId();
$model->currency_rate = $object->getCurrencyRate();
$model->tax = $object->getTax();
$model->service_charge = $object->getServiceCharge();
$model->expires_on = $object->getExpiresOn();
$model->status = $object->getStatus();
return $this->handler($transaction->transactions(), $model);
}
}
@@ -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';
}
@@ -6,9 +6,10 @@ final class TransactionType {
public const SHIPPING_INVOICE = 1;
public const PAYMENT = 2;
// public const PAYMENT_ATTEMPT = 0;
// public const PAYMENT = 1;
// public const INVOICE = 2;
@@ -0,0 +1,22 @@
<?php
namespace App\Http\Controllers\Billplz;
use App\Classes\Modules\Billplzs\ControllersLogic\CallbackBillplzLogic;
use Illuminate\Http\Request;
class CallbackBillplzController
{
/**
* @param Request $request
* @param CallbackBillplzLogic $logic
* @return bool|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\ResourceNotFoundException
*/
public function callback(Request $request, CallbackBillplzLogic $logic) {
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Billplz;
use App\Classes\Modules\Billplzs\ControllersLogic\CreateBillplzBillLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateBillplzBillController
{
/**
* @param Request $request
* @param CreateBillplzBillLogic $logic
* @return JsonResponse
*/
public function create(Request $request, CreateBillplzBillLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -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;
}
}
@@ -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,15 @@
<?php
namespace App\Http\Controllers\Transactions;
use App\Classes\Modules\Transactions\ControllersLogic\ApprovePaymentTransactionLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ApprovePaymentTransactionController
{
public function approve(Request $request, ApprovePaymentTransactionLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,19 @@
<?php
namespace App\Http\Controllers\Transactions;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Classes\Modules\Transactions\ControllersLogic\CreatePaymentTransactionLogic;
class CreatePaymentTransactionController
{
/**
* @param Request $request
* @param CreatePaymentTransactionLogic $logic
* @return JsonResponse
*/
public function create(Request $request, CreatePaymentTransactionLogic $logic) : JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Transactions;
use App\Classes\Modules\Transactions\ControllersLogic\UploadPaymentVerificationDocumentLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UploadPaymentVerificationDocumentController
{
/**
* @param Request $request
* @param UploadPaymentVerificationDocumentLogic $logic
* @return JsonResponse
*/
public function upload(Request $request, UploadPaymentVerificationDocumentLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
+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
];
}
}
+1 -1
View File
@@ -140,7 +140,7 @@ class CompanyModule extends AbstractModel implements Addressable, Documentable,
*/
public function banks(): HasMany
{
return $this->HasMany(Bank::class, 'company_id');
return $this->HasMany(BankAccount::class, 'company_id');
}
/**
+10 -1
View File
@@ -3,6 +3,7 @@
namespace App\Models;
use App\Classes\General\Interfaces\Documentable;
use App\Classes\General\Interfaces\Transactionable;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\TransactionType;
use Carbon\Carbon;
@@ -12,7 +13,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Eloquent\Relations\MorphTo;
class Transaction extends AbstractModel implements Documentable
class Transaction extends AbstractModel implements Documentable, Transactionable
{
protected $table = 'transactions';
@@ -29,6 +30,14 @@ class Transaction extends AbstractModel implements Documentable
return $this->morphMany(Order::class, 'owner');
}
/**
* @return MorphMany
*/
public function transactions(): MorphMany
{
return $this->MorphMany(Transaction::class, 'owner');
}
/**
* @return MorphMany
*/
+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.
+13
View File
@@ -0,0 +1,13 @@
<?php
return [
'base_url' => env('BILLPLZ_BASE_URL', 'https://www.billplz.com'),
'api_key' => env('BILLPLZ_API_KEY', '0fa4c710-761b-4a7a-a501-c2c2d02643d5'),
'x_signature_key' => env('BILLPLZ_X_SIGNATURE_KEY', 'S-pbNVthVRsvnPfZlgLwqqOg'),
'collection_id' => env('BILLPLZ_COLLECTION_ID', 'hev2wdjy'),
'wallet_collection_id' => env('BILLPLZ_WALLET_COLLECTION_ID', 'hev2wdjy'),
'redirect_url' => env('BILLPLZ_REDIRECT_URL', 'localhost'),
'callback_url' => env('BILLPLZ_CALLBACK_URL', 'localhost'),
'maybank' => 'MB2U0227',
'cimb' => 'BCBB0235'
];
@@ -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

@@ -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>
@@ -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>
@@ -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="{'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="{'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="{'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>
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
@@ -26,6 +26,8 @@ Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function
Route::get('/storage/{fileName}/fetch', 'Documents\RenderDocumentController@fileStorageServe')->where(['fileName' => '.*'])->name('storage.document.file');
Route::post('online_payment/callback', 'Billplz\CallbackBillplzController@callback')->name('online_payment.callback');
require __DIR__ . '/company.php';
require __DIR__ . '/document.php';
+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');
});
+12
View File
@@ -7,8 +7,20 @@ Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' =>
Route::get('/list', 'ListTransactionsController@list')->name('list');
// Route::delete('/suspend/{id}', 'SuspendTransactionController@suspend')->name('suspend');
Route::post('/payment/create', 'CreatePaymentTransactionController@create')->name('payment.create');
Route::post('/payment/upload-verification-document/{transaction_id}', 'UploadPaymentVerificationDocumentController@upload')->name('verification.create');
Route::put('/payment/approve/{transaction_id}/{status}', 'ApprovePaymentTransactionController@approve')->where('status', 'approve|reject')->name('approval');
route::post('/shipping-invoice/create', 'CreateShippingInvoiceTransactionController@create')->name('supplier.create');
// Route::group(['prefix' => '{id}/payment', 'as' => 'payment.'], function () {
// Route::post('quotation', 'FetchBookingPaymentQuotationController@fetch')->name('quotation');
// Route::post('create', 'CreateBookingPaymentController@create')->name('create');
// Route::post('{payment_id}/verification/create', 'CreatePaymentVerificationController@create')->name('verification.create');
// Route::put('/{payment_id}/approval/{status}', 'ApprovePaymentVerificationController@approve')->where('status', 'approve|reject')->name('approval');
// });
// route::post('{id}/bill/verification', 'CreatePaymentProofDocumentController@verify')->name('bill.verification');
+75 -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,9 +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('/order/{id}', function ($id) {
return view('pages.orders.profile', ['id' => $id]);
})->name('order.details');