mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 20:44:19 +00:00
Compare commits
259 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| db6412c5c0 | |||
| e77e82bac2 | |||
| 1b230dbce0 | |||
| 4329f77e95 | |||
| 2f999d7e3c | |||
| 302aa521ed | |||
| 50ca61c587 | |||
| a6cbec3523 | |||
| ee2208c992 | |||
| b73ef5a386 | |||
| cecc0a1b1b | |||
| b92a6fe710 | |||
| 24bd8be09d | |||
| d8801408ae | |||
| 274b64de7e | |||
| 06da9bb435 | |||
| a276bc9582 | |||
| 72f555d7d2 | |||
| 9db80220b8 | |||
| 55882aaacb | |||
| ca669f6f0a | |||
| ec70a390d0 | |||
| 987418d51a | |||
| 6b641d44f2 | |||
| b57dbe77be | |||
| b9ddd42f82 | |||
| 039a048150 | |||
| f727389add | |||
| 2bb6816794 | |||
| 0616ee0bac | |||
| c038324339 | |||
| ac839c5835 | |||
| d4b85f2952 | |||
| 2be24c4dac | |||
| 6caa68cfa4 | |||
| 582534849a | |||
| b4f816b90d | |||
| 0c939dca6f | |||
| f5b2664f5f | |||
| 9613ed32c1 | |||
| 202456289b | |||
| c59bbd6677 | |||
| ebfa25933d | |||
| 3dedb75239 | |||
| 9152bae815 | |||
| a88512e973 | |||
| 2f59295f67 | |||
| bdb81daf1a | |||
| 42935d025d | |||
| 92b463b78e | |||
| f62fc48636 | |||
| a71ca9dd29 | |||
| 651dea8f3a | |||
| 79ada10312 | |||
| 66ef0c08f5 | |||
| fafc716109 | |||
| d93d51ff09 | |||
| b260d30e42 | |||
| af2d3adbcd | |||
| 846f617e00 | |||
| daa8618616 | |||
| 22aaccbe21 | |||
| 1be99a0730 | |||
| ac461a48b7 | |||
| 1619bc212f | |||
| c487b31673 | |||
| 0775c2687f | |||
| 7767b4f177 | |||
| ee7acbc683 | |||
| b3b048ef2b | |||
| 12e2ce4de1 | |||
| d90347d2ee | |||
| ad39cdd124 | |||
| e0f0e0e59e | |||
| e497eec331 | |||
| 1429f97bca | |||
| 952333e5cb | |||
| e4af160ad2 | |||
| 16031665a9 | |||
| 39e1c09f05 | |||
| 0d4db39013 | |||
| 1e634ddc44 | |||
| 06015cea72 | |||
| 3ccf7a088a | |||
| 258b8085ee | |||
| 76c05b7c77 | |||
| 6ebe22b798 | |||
| 17042b4312 | |||
| f935cc10a6 | |||
| 415b5d7697 | |||
| 591575081a | |||
| 96fcfb241a | |||
| 5b9a286467 | |||
| 5ed84c1ee9 | |||
| 40fec78213 | |||
| b4dcc0f049 | |||
| 6873ddb7cf | |||
| 84e45f9824 | |||
| 8079584f04 | |||
| 866dda9d98 | |||
| 8715997f88 | |||
| 822c9c467f | |||
| 59d2b5c50a | |||
| 6676951dee | |||
| 1ac7657870 | |||
| 761dedf427 | |||
| 0c2c64c637 | |||
| 10b699990f | |||
| 606325706e | |||
| 742d26bdd3 | |||
| 308a1bcdc0 | |||
| f0f70e421e | |||
| 3dff650b04 | |||
| 5a55b4ccf2 | |||
| 303b1abff1 | |||
| 69a2743056 | |||
| cf49a661e1 | |||
| 4bcb67e972 | |||
| e8564ee3b5 | |||
| 23e5e1e268 | |||
| cce1979388 | |||
| f39f9ee2a7 | |||
| c1cf22544f | |||
| 321002ed04 | |||
| de237a4110 | |||
| ee408da523 | |||
| de797d65ee | |||
| 9831ff29af | |||
| 0102dabdba | |||
| 86913ad80b | |||
| fad2685534 | |||
| 589422a9a8 | |||
| e2b96d7281 | |||
| df14f196b9 | |||
| 7698c35b85 | |||
| 88c0b4303e | |||
| c4eec73803 | |||
| 6932b3291c | |||
| cbaf05389e | |||
| 00f4f141c4 | |||
| 7771b903ae | |||
| 6de35b13f1 | |||
| 46da64fc47 | |||
| 0821db2899 | |||
| 74005ba312 | |||
| 7935be2912 | |||
| 8e0d23a208 | |||
| 2a077edcde | |||
| 142904b0af | |||
| 97fe1d9192 | |||
| 27940854e2 | |||
| d4c35a5286 | |||
| 35dec3042b | |||
| 918db70429 | |||
| 1796ddefbf | |||
| e1ee96f77c | |||
| 31e28c3dfa | |||
| faf4d35340 | |||
| 4fef6f8e6f | |||
| 5d504b5111 | |||
| 3854884370 | |||
| fe70c4b111 | |||
| dad2f95eaa | |||
| 764e709135 | |||
| 9b35f8c374 | |||
| 2e03ce370d | |||
| d972e98732 | |||
| 9041d9623b | |||
| f4a96fec78 | |||
| c299c60d38 | |||
| 96eeb5a63e | |||
| fc6c365792 | |||
| 6094adadec | |||
| 78ce2084b9 | |||
| 4fb284c85c | |||
| 9e060bccd3 | |||
| 3100d42bd7 | |||
| 0640e0de9b | |||
| aa1d1dccc5 | |||
| e369bc7f9e | |||
| 6713542dc9 | |||
| f73094ca06 | |||
| 453683ca76 | |||
| caef08aa98 | |||
| 2c2e4eece8 | |||
| a30421a3e9 | |||
| 056342308e | |||
| f7ca8558f5 | |||
| 92255056cc | |||
| 5e1626e6a4 | |||
| c533c0c4a6 | |||
| e8eb02430b | |||
| f17bfea250 | |||
| 24ceb3cb39 | |||
| b6086554e2 | |||
| fee73f7708 | |||
| cd7ee3afb3 | |||
| 3329028860 | |||
| 6507b84e55 | |||
| eab465e837 | |||
| 1cc0303539 | |||
| 305ae6c217 | |||
| bcd926b4c9 | |||
| cd84348542 | |||
| 8e0efdf6e7 | |||
| 37cdbbb2c4 | |||
| 8ca1cc1625 | |||
| b67b676704 | |||
| 2f98dc976a | |||
| 2421dd0988 | |||
| 20237d69fb | |||
| 03851deeea | |||
| 22f1548eac | |||
| 4e4475ad12 | |||
| a287a1193a | |||
| a80b3013c3 | |||
| 4224c3e436 | |||
| 77c2ede28e | |||
| 8418268731 | |||
| 5fdc6d5719 | |||
| 08517e8ee7 | |||
| ddbecaae6f | |||
| 8795f1c203 | |||
| 762e9b8dca | |||
| d8c9c77d8d | |||
| f21708ff57 | |||
| ac4fcb05e9 | |||
| b3a296f2eb | |||
| 5a723c5fd1 | |||
| 6e9a27024b | |||
| e0018de70d | |||
| f5a0e9cd07 | |||
| 908c547ddc | |||
| cdda3ff5e1 | |||
| 27bacd412a | |||
| 424ac600c3 | |||
| 715635954a | |||
| a5a450a7d4 | |||
| 2919544769 | |||
| e3284fdf98 | |||
| 114a083627 | |||
| 32a509d090 | |||
| bd2b7b236b | |||
| 6a08d88031 | |||
| ef95893c3b | |||
| 5043b32191 | |||
| 7169ba423c | |||
| f8e7573cfd | |||
| 5aa93b30c7 | |||
| 8c35601ccd | |||
| 0ec9226226 | |||
| 3286939ccc | |||
| 3a2146146c | |||
| e2e8f69f90 | |||
| e5c28faba7 | |||
| 4b81666cf2 | |||
| 4a2fb8e9e4 | |||
| ea772c3916 | |||
| f8d65d05da |
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class DoesNotHaveTransactionType implements Filter
|
||||
{
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereDoesntHave('transactions', function (Builder $query) use($value) {
|
||||
$query->where('type', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class HasInvoiceStatusIn implements Filter
|
||||
{
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('transactions', function (Builder $query) use($value) {
|
||||
$query->where('type', 1)->whereIn('status', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class HasTransactionType implements Filter
|
||||
{
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereHas('transactions', function (Builder $query) use($value) {
|
||||
$query->where('type', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class TargetId implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->where('target_type', User::class)->where('target_id', $value);
|
||||
}
|
||||
|
||||
}
|
||||
+18
-1
@@ -14,6 +14,8 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Documents\Services\FetchesDocument;
|
||||
|
||||
use App\Classes\Modules\Documents\Services\ApprovesDocument;
|
||||
use App\Classes\Modules\Notifications\DataTransferObjects\NotificationObject;
|
||||
Use App\Classes\Modules\Notifications\Processors\CreateNotificationProcessor;
|
||||
|
||||
use App\Models\Document;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@@ -50,6 +52,9 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
/** @var UpdatesOrdersStatus */
|
||||
private $updatesOrdersStatus;
|
||||
|
||||
/** @var CreateNotificationProcessor */
|
||||
private $createNotificationProcessor;
|
||||
|
||||
/**
|
||||
* ApproveIdentificationDocumentLogic constructor.
|
||||
* @param CanApproveDocument $canApproveDocument
|
||||
@@ -58,8 +63,9 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
* @param FetchesDocument $fetchesDocument
|
||||
* @param UpdatesCompanyStatus $updatesCompanyStatus
|
||||
* @param UpdatesOrdersStatus $updatesOrdersStatus
|
||||
* @param CreateNotificationProcessor $createNotificationProcessor
|
||||
*/
|
||||
public function __construct(CanApproveDocument $canApproveDocument, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument, UpdatesCompanyStatus $updatesCompanyStatus, UpdatesOrdersStatus $updatesOrdersStatus)
|
||||
public function __construct(CanApproveDocument $canApproveDocument, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument, UpdatesCompanyStatus $updatesCompanyStatus, UpdatesOrdersStatus $updatesOrdersStatus, CreateNotificationProcessor $createNotificationProcessor)
|
||||
{
|
||||
$this->canApproveDocument = $canApproveDocument;
|
||||
$this->approvesDocument = $approvesDocument;
|
||||
@@ -67,6 +73,7 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
$this->fetchesDocument = $fetchesDocument;
|
||||
$this->updatesCompanyStatus = $updatesCompanyStatus;
|
||||
$this->updatesOrdersStatus = $updatesOrdersStatus;
|
||||
$this->createNotificationProcessor = $createNotificationProcessor;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,6 +97,16 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
|
||||
|
||||
$this->updatesCompanyStatus->execute($document->owner, $status === 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
|
||||
|
||||
$object = new NotificationObject(
|
||||
'ID Verification ' . ( $status === 'approve' ? 'Approved' : 'Rejected' ),
|
||||
( $status === 'approve' ? 'Dear user, congratulations that your ' : 'Dear user, we are sorry to inform you that your ' ) . ( $document->type === 'IDENTITY_CARD' ? 'IC' : 'SSM' ) . ( $status === 'approve' ? ' has been approved. Start your first order now!' : ' has been rejected due to ' . ( $request->input('rejectRemark') ?? '' ) . ', please resubmit it for further action.' ),
|
||||
$document->owner,
|
||||
$document->owner->companyModules()->first()->employees()->first(),
|
||||
$document,
|
||||
);
|
||||
|
||||
$this->createNotificationProcessor->execute($object);
|
||||
|
||||
if($status === 'approve'){
|
||||
$orders = $this->updatesOrdersStatus->execute($document->owner, ApprovalStatus::APPROVED);
|
||||
}
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Models\Order;
|
||||
use App\Models\PackingList;
|
||||
use Carbon\Carbon;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
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;
|
||||
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
|
||||
use App\Classes\ValueObjects\Constants\RoleTypes;
|
||||
|
||||
class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize, FromCollection
|
||||
class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize, FromQuery
|
||||
{
|
||||
|
||||
use Exportable;
|
||||
@@ -36,31 +35,19 @@ class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping,
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection|mixed
|
||||
*/
|
||||
public function collection()
|
||||
public function query()
|
||||
{
|
||||
$returnArray = collect();
|
||||
|
||||
$packingLists = PackingList::where('type', '=', 1)->where('status', '=', 2)->get();
|
||||
$exceptionUsers = in_array(Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]);
|
||||
|
||||
foreach($packingLists as $packingList){
|
||||
$packages = !$packingList->packingLists()->exists() || $exceptionUsers ? $packingList->packages : $packingList->packingLists->first()->packages;
|
||||
foreach ($packages as $package) {
|
||||
$returnArray->push($package);
|
||||
}
|
||||
}
|
||||
|
||||
return $returnArray;
|
||||
return PackingList::where('type', '=', 1)->where('status', '=', 2)->where('owner_type', Order::class)->whereHas('transports', function($query){
|
||||
return $query->where('drop_date', '>=',Carbon::now()->subMonth());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ReturnArray $returnArray
|
||||
*
|
||||
* @param $packingList
|
||||
* @return array
|
||||
*/
|
||||
public function map($package): array
|
||||
public function map($packingList): array
|
||||
{
|
||||
$packingList = $package->packingList;
|
||||
$order = $packingList->owner;
|
||||
|
||||
$connection = $order->companyModule()->first()->inviters()->withPivot('invitee_reference')->first();
|
||||
@@ -68,7 +55,9 @@ class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping,
|
||||
|
||||
$warehouse = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee;
|
||||
|
||||
$cbm = (($package->width / 100) * ($package->height / 100) * ($package->length / 100)) * $package->quantity;
|
||||
$cbm = $packingList->packages->sum(function($package){
|
||||
return (($package->width / 100) * ($package->height / 100) * ($package->length / 100)) * $package->quantity;
|
||||
});
|
||||
|
||||
$arrival_date = $packingList->transports()->first()->drop_date->format('d-m-Y');
|
||||
|
||||
@@ -77,8 +66,8 @@ class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping,
|
||||
$marking,
|
||||
$warehouse->reference,
|
||||
$cbm,
|
||||
$package->description,
|
||||
$package->quantity,
|
||||
$packingList->packages->implode('description', ', '),
|
||||
$packingList->packages->sum('quantity'),
|
||||
$arrival_date,
|
||||
''
|
||||
];
|
||||
|
||||
@@ -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)
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Models\Order;
|
||||
use App\Models\PackingList;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
@@ -46,6 +47,7 @@ class ExportsOnHoldPackingList implements FromQuery, WithHeadings, WithHeadingRo
|
||||
$container = $packingList->containers()->first();
|
||||
$ContainerTransport = $container->transports()->first();
|
||||
$order = $packingList->owner;
|
||||
if(!$order instanceof Order)return [];
|
||||
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
|
||||
|
||||
return [
|
||||
|
||||
@@ -57,7 +57,8 @@ class ExportsPendingArrangementDeliveryList implements FromQuery, WithHeadings,
|
||||
$container = $packingList->containers()->first();
|
||||
$ContainerTransport = $container->transports()->first();
|
||||
$order = $packingList->owner;
|
||||
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
|
||||
$inviter = $order->companyModule ? $order->companyModule->inviters()->withPivot('invitee_reference')->first() : null;
|
||||
$marking = $inviter ? $inviter->pivot->invitee_reference : 'Unclaimed';
|
||||
$address = $order->addresses()->where('status', ApprovalStatus::APPROVED)->first();
|
||||
$contacts = $address->contacts->first() ? $address->contacts->first(): '';
|
||||
$originalPackingList = $packingList->owner instanceof PackingList ? $packingList->owner : $packingList;
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Notifications\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Notifications\Services\ListsNotification;
|
||||
use App\Http\Resources\NotificationResource;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListNotificationsLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Retrieve Notifications',
|
||||
'message' => 'You have successfully retrieved a list of Notifications'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var ListsNotification */
|
||||
private $listsNotification;
|
||||
|
||||
/**
|
||||
* ListNotificationsLogic constructor.
|
||||
* @param ListsNotification $listsNotification
|
||||
*/
|
||||
public function __construct(
|
||||
ListsNotification $listsNotification
|
||||
)
|
||||
{
|
||||
$this->listsNotification = $listsNotification;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
|
||||
$filters = [
|
||||
// 'target_id'=>auth()->user()->id,
|
||||
// 'per_page'=>$request->route('per_page')
|
||||
];
|
||||
|
||||
$notifications = $this->listsNotification->execute($filters);
|
||||
|
||||
return $this->collectionResponse(NotificationResource::collection($notifications));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Notifications\Services;
|
||||
|
||||
|
||||
use App\Classes\General\Eloquent\AbstractListRecord;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use App\Models\Notification;
|
||||
|
||||
class ListsNotification extends AbstractListRecord
|
||||
{
|
||||
|
||||
/** @var Bank */
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* ListsBank constructor.
|
||||
* @param Notification $repository
|
||||
*/
|
||||
public function __construct(Notification $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Builder
|
||||
*/
|
||||
function getRepository(): Builder
|
||||
{
|
||||
return $this->repository->newQuery();
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ class CreateOrderLogic extends AbstractControllerLogic
|
||||
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $request->input('warehouse_id')]);
|
||||
|
||||
if(!in_array($company->companyModules()->importers()->first()->id, WarehouseReferences::YD_EXEMPT_LIST)){
|
||||
$originWarehouse = $this->fetchesCompanyModule->execute(['reference' => $originWarehouse->reference === WarehouseReferences::VT_GUANG_ZHOU ? WarehouseReferences::YD_GUANG_ZHOU_2 : WarehouseReferences::YD_YIWU]);
|
||||
$originWarehouse = $this->fetchesCompanyModule->execute(['reference' => $originWarehouse->reference === WarehouseReferences::VT_GUANG_ZHOU ? WarehouseReferences::YD_GUANG_ZHOU : WarehouseReferences::YD_YIWU]);
|
||||
}
|
||||
|
||||
if($originWarehouse->reference === WarehouseReferences::YD_YIWU && in_array($address->state_id, [5, 13, 14])) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Classes\Modules\PackingLists\ControllersLogic;
|
||||
|
||||
use App\Classes\Exceptions\ResourceNotFoundException;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
|
||||
use App\Classes\Modules\Orders\Services\FetchesOrder;
|
||||
@@ -134,20 +135,25 @@ class AssignPackingListOrderLogic extends AbstractControllerLogic
|
||||
|
||||
$this->unityAssignContractEntity->execute($supervisorContractEntity->hash_id, $contractObligations);
|
||||
|
||||
$packing_list = $this->fetchesPackingList->execute([
|
||||
'reference' => $warehouse_packing_list->reference,
|
||||
'type' => PackingListType::SHIPPING_PACKING_LIST
|
||||
]);
|
||||
try {
|
||||
$packing_list = $this->fetchesPackingList->execute([
|
||||
'reference' => $warehouse_packing_list->reference,
|
||||
'type' => PackingListType::SHIPPING_PACKING_LIST
|
||||
]);
|
||||
|
||||
$warehouse_packing_list = $this->updatesPackingListOwner->execute($packing_list, $order);
|
||||
|
||||
$this->updatesPackingListContractReference->execute($packing_list, $contractReference);
|
||||
$warehouse_packing_list = $this->updatesPackingListOwner->execute($packing_list, $order);
|
||||
|
||||
$this->updatesPackingListContractReference->execute($packing_list, $contractReference);
|
||||
|
||||
foreach($contractObligations as $obligation) {
|
||||
$stepObject = new StepsObject($order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->id, $obligation->reference, $obligation->sequence, $obligation->hash_id);
|
||||
$this->createsStep->execute($packing_list, $stepObject);
|
||||
}
|
||||
} catch (ResourceNotFoundException $exception) {
|
||||
|
||||
foreach($contractObligations as $obligation) {
|
||||
$stepObject = new StepsObject($order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->id, $obligation->reference, $obligation->sequence, $obligation->hash_id);
|
||||
$this->createsStep->execute($packing_list, $stepObject);
|
||||
}
|
||||
|
||||
|
||||
return $this->resourceResponse(new PackingListResource($warehouse_packing_list));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\PackingLists\Services\DeletesPackingList;
|
||||
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
|
||||
use App\Classes\Modules\PackingLists\Standards\Rules\CanDeletePackingList;
|
||||
use App\Classes\ValueObjects\Constants\PackingListType;
|
||||
use ErrorException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -58,9 +59,11 @@ class DeletePackingListLogic extends AbstractControllerLogic
|
||||
|
||||
$this->canDeletePackingList->passes();
|
||||
|
||||
$query = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
|
||||
$warehouseList = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
|
||||
$packingList = $this->fetchesPackingList->execute(['reference' => $warehouseList->reference, 'type' => PackingListType::SHIPPING_PACKING_LIST]);
|
||||
|
||||
$this->deletesPackingList->execute($query);
|
||||
$this->deletesPackingList->execute($warehouseList);
|
||||
$this->deletesPackingList->execute($packingList);
|
||||
|
||||
return $this->response([]);
|
||||
|
||||
|
||||
@@ -56,28 +56,23 @@ class ReschedulePackingListLogic extends AbstractControllerLogic
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
try {
|
||||
$packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
|
||||
$packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
|
||||
|
||||
$transport = $packing_list->transports()->first();
|
||||
$transport = $packing_list->transports()->first();
|
||||
|
||||
$old_sechedule = $transport->schedules()->first();
|
||||
$old_sechedule = $transport->schedules()->first();
|
||||
|
||||
$this->updatesScheduleStatus->execute($old_sechedule, ApprovalStatus::REJECTED);
|
||||
$this->updatesScheduleStatus->execute($old_sechedule, ApprovalStatus::REJECTED);
|
||||
|
||||
$scheduleObject = new ScheduleObject(
|
||||
Carbon::parse($request->input('eta')),
|
||||
Carbon::parse($request->input('etd')),
|
||||
ApprovalStatus::APPROVED
|
||||
);
|
||||
$schedule = $this->createsSchedule->execute($transport, $scheduleObject);
|
||||
|
||||
return $this->resourceResponse(new PackingListResource($packing_list));
|
||||
|
||||
} catch (\Exception $exception){
|
||||
throw new ErrorException($exception->getMessage(), $exception->getCode());
|
||||
}
|
||||
$scheduleObject = new ScheduleObject(
|
||||
Carbon::parse($request->input('eta')),
|
||||
Carbon::parse($request->input('etd')),
|
||||
ApprovalStatus::APPROVED
|
||||
);
|
||||
|
||||
$schedule = $this->createsSchedule->execute($transport, $scheduleObject);
|
||||
|
||||
return $this->resourceResponse(new PackingListResource($packing_list));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -91,7 +91,6 @@ class FetchDeliveryListFromVTPortalProcessor
|
||||
$deliveryStep->update(['status' => ApprovalStatus::COMPLETED]);
|
||||
|
||||
} catch (GuzzleException $exception) {
|
||||
dd($exception);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
+128
-42
@@ -7,12 +7,15 @@ use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
|
||||
use App\Classes\Modules\Orders\Services\FetchesDataFromVTPortal;
|
||||
use App\Classes\Modules\Orders\Services\FetchesOrder;
|
||||
use App\Classes\Modules\PackingLists\DataTransferObjects\ContainerObject;
|
||||
use App\Classes\Modules\PackingLists\DataTransferObjects\PackageObject;
|
||||
use App\Classes\Modules\PackingLists\DataTransferObjects\PackingListObject;
|
||||
use App\Classes\Modules\PackingLists\Services\Containers\FetchesContainer;
|
||||
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
|
||||
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
|
||||
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
|
||||
use App\Classes\Modules\Steps\DataTransferObjects\StepsObject;
|
||||
use App\Classes\Modules\Steps\Services\CreatesStep;
|
||||
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
|
||||
use App\Classes\Modules\Transports\Services\CreatesTransport;
|
||||
use App\Classes\Modules\Unity\Processors\ActivateContractProcessor;
|
||||
use App\Classes\Modules\Unity\Processors\AssignContractEntityProcessor;
|
||||
@@ -21,10 +24,13 @@ use App\Classes\Modules\Unity\Services\CreatesContract;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\ContainerTypes;
|
||||
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
|
||||
use App\Classes\ValueObjects\Constants\PackageType;
|
||||
use App\Classes\ValueObjects\Constants\RoleTypes;
|
||||
use App\Classes\ValueObjects\Constants\PackingListType;
|
||||
use App\Classes\ValueObjects\Constants\TransportType;
|
||||
use App\Models\Order;
|
||||
use App\Models\PackingList;
|
||||
use App\Models\Transport;
|
||||
use Carbon\Carbon;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -124,9 +130,8 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
*/
|
||||
public function execute(?Carbon $start = null, ?Carbon $end = null){
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$start = $start ? $start : Carbon::now()->subDays(10);
|
||||
$start = $start ? $start : Carbon::today()->subDays(5);
|
||||
|
||||
$startLimit = Carbon::parse('11-08-2021');
|
||||
|
||||
@@ -134,7 +139,7 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
$start = $startLimit;
|
||||
}
|
||||
|
||||
$end = $end ? $end : Carbon::now();
|
||||
$end = $end ? $end : Carbon::today()->addDay();
|
||||
$filter = '["LoadedTime:$between$%js%\"'.$start->format('Y-m-d').'T00:00:00.000\"$and$%js%\"'.$end->format('Y-m-d').'T00:00:00.000\"\u0000"]';
|
||||
|
||||
$containersRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VCustomercontainer","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"LoadedTime asc","Filter":'.$filter.'}}'), '');
|
||||
@@ -142,72 +147,155 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
$containers = $this->fetchesDataFRomVTPortal->getResponseBody($containersRequest);
|
||||
|
||||
foreach ($containers->Rows as $container){
|
||||
$filter = '["ContainerID:=%js%'.$container[11].'"]';
|
||||
$containerDetailRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"CreatedOn asc","Filter":'.$filter.'}}'), '');
|
||||
$filter = '["ContainerID:=%js%'.$container[12].'"]';
|
||||
$containerDetailRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"ParcelInContainer","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":null,"Filter":'.$filter.'}}'), '');
|
||||
|
||||
$containerDetail = $this->fetchesDataFRomVTPortal->getResponseBody($containerDetailRequest);
|
||||
|
||||
$containerObject = new ContainerObject($container[0], str_replace(' ', '', $container[24]), str_replace(' ', '', $container[15]), ContainerTypes::FORTY_FEET_DRY_CONTAINER, Carbon::parse($container[5]), ApprovalStatus::PENDING_VERIFICATION);
|
||||
$containerObject = new ContainerObject($container[0], str_replace(' ', '', $container[24]), str_replace(' ', '', $container[16]), ContainerTypes::FORTY_FEET_DRY_CONTAINER, Carbon::parse($container[6]), ApprovalStatus::PENDING_VERIFICATION);
|
||||
$containerInfo = $container;
|
||||
|
||||
|
||||
try {
|
||||
$container = $this->fetchesContainer->execute(['reference' => $containerObject->getReference()]);
|
||||
} catch (ResourceNotFoundException $exception){
|
||||
$warehouseId = $container[12];
|
||||
$warehouseId = $container[13];
|
||||
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $warehouseId === 11 ? 3 : 4]);
|
||||
$container = $this->createContainerProcessor->execute($containerObject, $originWarehouse);
|
||||
}
|
||||
$eta = Carbon::parse($containerInfo[4]);
|
||||
|
||||
$etd = Carbon::parse($eta)->subDays(5);
|
||||
|
||||
$delayDate = $containerInfo[7];
|
||||
|
||||
$containerStatus = $containerInfo[10];
|
||||
|
||||
$unstuffingDate = $containerInfo[8];
|
||||
|
||||
$transport = $container->transports()->first();
|
||||
|
||||
if(!$transport){
|
||||
$transportObject = new TransportObject(TransportType::SEA, null, null, $etd, null, ApprovalStatus::APPROVED);
|
||||
/** @var Transport $transport */
|
||||
$transport = $this->createsTransport->execute($transportObject, $container);
|
||||
$this->createsSchedule->execute($transport, new ScheduleObject($etd, $eta, ApprovalStatus::APPROVED));
|
||||
}
|
||||
|
||||
if($delayDate){
|
||||
|
||||
$delayDate = Carbon::parse($delayDate);
|
||||
$transport = $container->transports()->first();
|
||||
|
||||
if(!$transport->schedules()->where('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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($containerStatus === 'Unstuffing'){
|
||||
$container->update(['status' => ApprovalStatus::COMPLETED]);
|
||||
$container->transports()->first()->update(['drop_date' => Carbon::parse($unstuffingDate)->subDay(), 'status' => ApprovalStatus::COMPLETED]);
|
||||
|
||||
/** @var PackingList $packingList */
|
||||
foreach($container->packingLists as $packingList){
|
||||
|
||||
if($packingList->status === ApprovalStatus::PENDING_VERIFICATION){
|
||||
$packingList->status = ApprovalStatus::APPROVED;
|
||||
$packingList->save();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
foreach($containerDetail->Rows as $packingList){
|
||||
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $packingList[13]));
|
||||
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $packingList[39]));
|
||||
|
||||
$orderNumber = $marking[array_key_last($marking)];
|
||||
|
||||
if(!$packingList[22]){
|
||||
if(!$packingList[11]){
|
||||
continue;
|
||||
}
|
||||
|
||||
$allow_contract = true;
|
||||
|
||||
try {
|
||||
/** @var Order $order */
|
||||
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
|
||||
} catch (ResourceNotFoundException $exception){
|
||||
continue;
|
||||
$warehousePackingList = $this->fetchesPackingList->execute(['reference' => $packingList[3]]);
|
||||
if(!$warehousePackingList->owner instanceof Order) throw new ResourceNotFoundException;
|
||||
$order = $warehousePackingList->owner;
|
||||
} catch (ResourceNotFoundException $exception) {
|
||||
try {
|
||||
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
|
||||
} catch (ResourceNotFoundException $exception) {
|
||||
try {
|
||||
$order = $this->fetchesOrder->execute(['reference' => substr($orderNumber, -9)]);
|
||||
} catch (ResourceNotFoundException $exception) {
|
||||
$order = $this->fetchesCompanyModule->execute(['id' => 1]);
|
||||
$allow_contract = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$packingListReference = $packingList[16];
|
||||
|
||||
try{
|
||||
$this->fetchesPackingList->execute(['reference' => $packingListReference]);
|
||||
$packingListReference = $packingList[3];
|
||||
$package = $packingList;
|
||||
$deliveryDate = $package[1] ? Carbon::parse($package[1]) : null;
|
||||
|
||||
try {
|
||||
$packingList = $this->fetchesPackingList->execute(['reference' => $packingListReference, 'type' => PackingListType::SHIPPING_PACKING_LIST]);
|
||||
} catch (ResourceNotFoundException $exception){
|
||||
$contract = $this->unityCreateContract->execute();
|
||||
$contractReference = $contract->hash_id;
|
||||
$contractObligations = $contract->contract_obligation_list;
|
||||
if ($allow_contract) {
|
||||
$appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
|
||||
// $contract = $this->unityCreateContract->execute();
|
||||
// $contractReference = $contract->hash_id;
|
||||
// $contractObligations = $contract->contract_obligation_list;
|
||||
//
|
||||
// $this->unityActivateContract->execute($contractReference);
|
||||
//
|
||||
// $supervisorHashId = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->unity_hash_id;
|
||||
//
|
||||
// $supervisorContractEntity = $this->unityCreateContractEntity->execute($contractReference, $supervisorHashId);
|
||||
// $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->update(['entity_hash_id' => $supervisorContractEntity->hash_id, 'entity_signature' => $supervisorContractEntity->entity_signature_hash_id]);
|
||||
//
|
||||
// $importerContractEntity = $this->unityCreateContractEntity->execute($contractReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->appointee->unity_hash_id);
|
||||
// $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->update(['entity_hash_id' => $importerContractEntity->hash_id, 'entity_signature' => $importerContractEntity->entity_signature_hash_id]);
|
||||
//
|
||||
// $this->unityAssignContractEntity->execute($supervisorContractEntity->hash_id, $contractObligations);
|
||||
} else {
|
||||
$appointee_id = 2037;
|
||||
}
|
||||
|
||||
$this->unityActivateContract->execute($contractReference);
|
||||
|
||||
$supervisorHashId = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->unity_hash_id;
|
||||
|
||||
$supervisorContractEntity = $this->unityCreateContractEntity->execute($contractReference, $supervisorHashId);
|
||||
$order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->update(['entity_hash_id' => $supervisorContractEntity->hash_id, 'entity_signature' => $supervisorContractEntity->entity_signature_hash_id]);
|
||||
|
||||
$importerContractEntity = $this->unityCreateContractEntity->execute($contractReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->appointee->unity_hash_id);
|
||||
$order->orderRoles()->where('role_id', '=', OrderRoleTypes::IMPORTER)->first()->update(['entity_hash_id' => $importerContractEntity->hash_id, 'entity_signature' => $importerContractEntity->entity_signature_hash_id]);
|
||||
|
||||
$this->unityAssignContractEntity->execute($supervisorContractEntity->hash_id, $contractObligations);
|
||||
|
||||
$connection = $order->companyModule->connections()->first();
|
||||
$marking = $connection->invitee_reference;
|
||||
|
||||
$packingListObject = new PackingListObject($packingListReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id, PackingListType::SHIPPING_PACKING_LIST, ApprovalStatus::SUSPENDED, $contractReference);
|
||||
$packingListObject = new PackingListObject($packingListReference, $appointee_id, PackingListType::SHIPPING_PACKING_LIST, ApprovalStatus::SUSPENDED, null);
|
||||
|
||||
/** @var PackingList $packingList */
|
||||
$packingList = $this->createPackingListProcessor->execute($packingListObject, $order);
|
||||
$container->packingLists()->attach($packingList);
|
||||
}
|
||||
|
||||
foreach($contractObligations as $obligation) {
|
||||
$stepObject = new StepsObject($order->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->id, $obligation->reference, $obligation->sequence, $obligation->hash_id);
|
||||
$this->createsStep->execute($packingList, $stepObject);
|
||||
$container->packingLists()->detach($packingList);
|
||||
$container->packingLists()->attach($packingList);
|
||||
$packingList->packages()->delete();
|
||||
|
||||
$replica = $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
|
||||
if($replica) $replica->packages()->delete();
|
||||
|
||||
$packageObject = new PackageObject(PackageType::CARTON, $package[8], $package[21], $package[22], $package[20], 0, $package[11], ApprovalStatus::APPROVED);
|
||||
$this->createPackageProcessor->execute($packageObject, $packingList);
|
||||
if($containerStatus === 'Unstuffing'){
|
||||
$packingList->transports()->delete();
|
||||
|
||||
if($deliveryDate) {
|
||||
// && !$packingList->transports()->exists()
|
||||
$packingList->status = ApprovalStatus::COMPLETED;
|
||||
$packingList->save();
|
||||
|
||||
$transportObject = new TransportObject(TransportType::LAND, null, null, $deliveryDate, $deliveryDate, ApprovalStatus::APPROVED);
|
||||
/** @var Transport $transport */
|
||||
$transport = $this->createsTransport->execute($transportObject, $packingList);
|
||||
$this->createsSchedule->execute($transport, new ScheduleObject($deliveryDate, $deliveryDate, ApprovalStatus::APPROVED));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -217,8 +305,6 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
Log::error($exception);
|
||||
}
|
||||
|
||||
|
||||
DB::commit();
|
||||
return [];
|
||||
|
||||
}
|
||||
|
||||
+20
-14
@@ -136,7 +136,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
public function execute(?Carbon $start = null, ?Carbon $end = null)
|
||||
{
|
||||
try {
|
||||
$start = $start ? $start : Carbon::now()->subMonths(2);
|
||||
$start = $start ? $start : Carbon::today()->subMonths(1);
|
||||
|
||||
$startLimit = Carbon::parse('01-12-2021');
|
||||
|
||||
@@ -144,7 +144,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
$start = $startLimit;
|
||||
}
|
||||
|
||||
$end = $end ? $end : Carbon::now();
|
||||
$end = $end ? $end : Carbon::today()->addDay();
|
||||
|
||||
$orderRequest = $this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/GetOrderList.ashx', 'GET', [
|
||||
'begintime' => $start->timestamp,
|
||||
@@ -154,6 +154,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($orderRequest);
|
||||
|
||||
foreach($rows->data as $row){
|
||||
|
||||
$containerReference = null;
|
||||
$loadingDate = null;
|
||||
$unstuffingDate = null;
|
||||
@@ -222,7 +223,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
$unstuffingDate = Carbon::parse($trackingRow->trackingtime);
|
||||
}
|
||||
|
||||
if (Str::contains($trackingRow->tracking, ['派送中'])) {
|
||||
if (Str::contains($trackingRow->tracking, ['派送中', '签收完成', ' 第三方提货', '货物已派送完成'])) {
|
||||
$deliveryDate = Carbon::parse($trackingRow->trackingtime);
|
||||
}
|
||||
}
|
||||
@@ -244,8 +245,6 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
$packingListReference = $row->expressno;
|
||||
|
||||
try{
|
||||
@@ -398,11 +397,14 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
$packingList->save();
|
||||
}
|
||||
|
||||
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
|
||||
foreach($packingList->steps()->where('reference', '!=', 'DELIVERY')->get() as $step){
|
||||
$this->updatesContractObligations->execute($signature, $step->obligation_hash_id);
|
||||
$step->update(['status' => ApprovalStatus::COMPLETED]);
|
||||
if ($allow_contract) {
|
||||
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
|
||||
foreach($packingList->steps()->where('reference', '!=', 'DELIVERY')->get() as $step){
|
||||
$this->updatesContractObligations->execute($signature, $step->obligation_hash_id);
|
||||
$step->update(['status' => ApprovalStatus::COMPLETED]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,17 +419,21 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
$transport = $this->createsTransport->execute($transportObject, $packingList);
|
||||
$this->createsSchedule->execute($transport, new ScheduleObject($deliveryDate, $deliveryDate, ApprovalStatus::APPROVED));
|
||||
|
||||
$deliveryStep = $packingList->steps()->where('reference', '=', 'LAST_MILE_DELIVERY')->first();
|
||||
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
|
||||
$this->updatesContractObligations->execute($signature, $deliveryStep->obligation_hash_id);
|
||||
$deliveryStep->update(['status' => ApprovalStatus::COMPLETED]);
|
||||
|
||||
if ($allow_contract) {
|
||||
$deliveryStep = $packingList->steps()->where('reference', '=', 'LAST_MILE_DELIVERY')->first();
|
||||
$signature = $packingList->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::SUPERVISOR)->first()->appointee->entity_sigiture;
|
||||
$this->updatesContractObligations->execute($signature, $deliveryStep->obligation_hash_id);
|
||||
$deliveryStep->update(['status' => ApprovalStatus::COMPLETED]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
echo 'successful';
|
||||
|
||||
}
|
||||
} catch (\Exception $exception) {
|
||||
dump($exception);
|
||||
Log::debug($exception);
|
||||
}
|
||||
|
||||
|
||||
+9
-19
@@ -46,42 +46,32 @@ class FetchPackingListFromVTPortalProcessor
|
||||
*/
|
||||
public function execute(){
|
||||
|
||||
$packingLists = PackingList::where('type', '=', PackingListType::SHIPPING_PACKING_LIST)->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::SUSPENDED])->whereDoesntHave('containers', function($query){
|
||||
$packingLists = PackingList::where('type', '=', PackingListType::SHIPPING_PACKING_LIST)->where('reference', 'not like', '%PO%')->whereIn('claimant_id', [2])->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::SUSPENDED])->whereDoesntHave('containers', function($query){
|
||||
$query->where('status', '=', ApprovalStatus::COMPLETED);
|
||||
})->get();
|
||||
})->limit(10)->get();
|
||||
|
||||
DB::beginTransaction();
|
||||
foreach($packingLists as $packingList){
|
||||
try {
|
||||
|
||||
$filter = '["PoID:=%js%'.$packingList->reference.'"]';
|
||||
|
||||
$filter = '["PoNumber:=%js%\"'.$packingList->reference.'\"\u0000"]';
|
||||
|
||||
$shippingPackingListsRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VPodetailparcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"CreatedOn asc","Filter":'.$filter.'}}'), '');
|
||||
$shippingPackingListsRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"Po","view":"grid1","request":{"PageIndex":-1,"PageSize":1000,"Filter":'.$filter.'}}'), '');
|
||||
|
||||
$shippingPackingLists = $this->fetchesDataFRomVTPortal->getResponseBody($shippingPackingListsRequest);
|
||||
|
||||
if(count($shippingPackingLists->Rows)) {
|
||||
$packingList->packages()->delete();
|
||||
|
||||
$replica = $packingList->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST_REPLICA)->first();
|
||||
if($replica) $replica->packages()->delete();
|
||||
|
||||
foreach($shippingPackingLists->Rows as $shippingPackingList){
|
||||
if(!$shippingPackingList[22]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$packageObject = new PackageObject(PackageType::CARTON, $shippingPackingList[19], $shippingPackingList[31], $shippingPackingList[30], $shippingPackingList[29], 0, $shippingPackingList[22], ApprovalStatus::APPROVED);
|
||||
$this->createPackageProcessor->execute($packageObject, $packingList);
|
||||
}
|
||||
} else {
|
||||
dump($packingList->reference);
|
||||
}
|
||||
|
||||
} catch (GuzzleException $exception) {
|
||||
dd($exception);
|
||||
Log::error($exception);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
DB::commit();
|
||||
|
||||
return [];
|
||||
|
||||
|
||||
+17
-53
@@ -116,7 +116,7 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
|
||||
|
||||
try {
|
||||
|
||||
$start = $start ? $start : Carbon::now()->subMonth();
|
||||
$start = $start ? $start : Carbon::today()->subDays(5);
|
||||
|
||||
$startLimit = Carbon::parse('11-08-2021');
|
||||
|
||||
@@ -124,76 +124,40 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
|
||||
$start = $startLimit;
|
||||
}
|
||||
|
||||
$end = $end ? $end : Carbon::now();
|
||||
$end = $end ? $end : Carbon::today()->addDay();
|
||||
|
||||
$filter = '["ParcelDate:$between$%js%\"'.$start->format('Y-m-d').'T00:00:00.000\"$and$%js%\"'.$end->format('Y-m-d').'T00:00:00.000\"\u0000"]';
|
||||
|
||||
$warehouseListRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"WarehouseList","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ParcelDate asc","Filter":'.$filter.'}}'), '');
|
||||
$warehouseListRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"Parcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ParcelDate asc","Filter":'.$filter.'}}'), '');
|
||||
|
||||
$response = $this->fetchesDataFRomVTPortal->getResponseBody($warehouseListRequest);
|
||||
|
||||
foreach ($response->Rows as $parcel){
|
||||
|
||||
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $parcel[5]));
|
||||
$allow_contract = true;
|
||||
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $parcel[11]));
|
||||
$orderNumber = $marking[array_key_last($marking)];
|
||||
|
||||
if(!$parcel[9]){
|
||||
$quantity = $parcel[16];
|
||||
if(!$quantity){
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
|
||||
$appointee_id = $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
|
||||
} catch (ResourceNotFoundException $exception) {
|
||||
|
||||
$oldOrder = OldOrders::where('marking', '=', $orderNumber)->first();
|
||||
|
||||
if(!$oldOrder){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$customerMarking = str_replace('/', '', str_replace(' ', '', explode('CIEF/', $oldOrder->company->marking)[1]));
|
||||
|
||||
$companyModule = CompanyModule::whereHas('inviters', function($query) use ($customerMarking) {
|
||||
return $query->where('invitee_reference', '=', $customerMarking);
|
||||
})->first();
|
||||
|
||||
|
||||
if(!$companyModule){
|
||||
log::error('unknown customer: '.$customerMarking);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!$oldOrder->address) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/** @var Address $address */
|
||||
$address = $this->createAddressFromOldAddressProcessor->execute($oldOrder->address, $companyModule);
|
||||
|
||||
if(!$address){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$warehouseId = $parcel[0];
|
||||
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $warehouseId === 11 ? 3 : 4]);
|
||||
|
||||
$order = $this->createOrderProcessor->execute($companyModule->company, $originWarehouse, $address, $orderNumber);
|
||||
|
||||
$order->created_at = Carbon::parse($parcel[1]);
|
||||
$order->save();
|
||||
|
||||
$allow_contract = false;
|
||||
$order = $this->fetchesCompanyModule->execute(['id' => 1]);
|
||||
$appointee_id = 2037;
|
||||
}
|
||||
|
||||
$packingListReference = $parcel[17];
|
||||
$quantity = $parcel[9];
|
||||
$measurement = round(($parcel[10]/$quantity) ** (1/3) * 100, 2);
|
||||
$description = $parcel[7];
|
||||
$tracking = $parcel[6];
|
||||
$packingListReference = $parcel[0];
|
||||
// $measurement = round(($parcel[10]/$quantity) ** (1/3) * 100, 2);
|
||||
$description = $parcel[13];
|
||||
$tracking = $parcel[37];
|
||||
$receiveDate = $parcel[1];
|
||||
|
||||
$packingListObject = new PackingListObject($packingListReference, $order->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->id, PackingListType::WAREHOUSE_RECEIVE_LIST, ApprovalStatus::APPROVED);
|
||||
$packingListObject = new PackingListObject($packingListReference, $appointee_id, PackingListType::WAREHOUSE_RECEIVE_LIST, $allow_contract ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
|
||||
|
||||
/** @var PackingList $packingList */
|
||||
$packingList = $order->packingLists()->where('reference', '=', $packingListReference)->first();
|
||||
@@ -216,7 +180,7 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
|
||||
$packingList->packages()->delete();
|
||||
if($replica) $replica->packages()->delete();
|
||||
|
||||
$packageObject = new PackageObject(PackageType::CARTON, $description, $measurement, $measurement, $measurement, 0, $quantity, ApprovalStatus::APPROVED);
|
||||
$packageObject = new PackageObject(PackageType::CARTON, $description, $parcel[23], $parcel[22], $parcel[21], 0, $quantity, ApprovalStatus::APPROVED);
|
||||
$this->createPackageProcessor->execute($packageObject, $packingList);
|
||||
}
|
||||
} catch (\Exception $exception){
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Segments\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Segments\Services\ListsSegments;
|
||||
use App\Http\Resources\AirShipmentItemPriceResource;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListAirShipmentPriceLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Retrieved Air Shipment Price List',
|
||||
'message' => 'You have successfully retrieved a list of Air Shipment Price'
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/** @var ListsSegments */
|
||||
private $listsSegments;
|
||||
|
||||
/**
|
||||
* ListSegmentLogic constructor.
|
||||
* @param ListsSegments $listsSegments
|
||||
*/
|
||||
public function __construct(ListsSegments $listsSegments)
|
||||
{
|
||||
$this->listsSegments = $listsSegments;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
|
||||
// $query = $this->listsSegments->execute($this->listsSegments->deserializeFilters($request->input('filters')));
|
||||
|
||||
// category - Dimension / perKg
|
||||
$price = array(
|
||||
|
||||
[
|
||||
'details' => json_encode([
|
||||
'name' => 'Sound system speakers - MINI',
|
||||
'pricePerKg' => '',
|
||||
'pricePerPcs' => '',
|
||||
'isProhibited' => '',
|
||||
'hasGram' => '',
|
||||
'hasDimensionCharges' => '',
|
||||
'tax' => '50',
|
||||
])
|
||||
],
|
||||
[
|
||||
'details' => json_encode([
|
||||
'name' => 'Sound system speakers - SMALL',
|
||||
'pricePerKg' => '',
|
||||
'pricePerPcs' => '',
|
||||
'isProhibited' => '',
|
||||
'hasGram' => '',
|
||||
'hasDimensionCharges' => '',
|
||||
'tax' => '200',
|
||||
])
|
||||
],
|
||||
[
|
||||
'details' => json_encode([
|
||||
'name' => 'Sound system speakers - LARGE',
|
||||
'pricePerKg' => '',
|
||||
'pricePerPcs' => '',
|
||||
'isProhibited' => '',
|
||||
'hasGram' => '',
|
||||
'hasDimensionCharges' => '',
|
||||
'tax' => '400',
|
||||
])
|
||||
],
|
||||
[
|
||||
'details' => json_encode([
|
||||
'name' => 'Washing Machine - Dimension',
|
||||
'pricePerKg' => '',
|
||||
'pricePerPcs' => '',
|
||||
'isProhibited' => '',
|
||||
'hasGram' => '',
|
||||
'hasDimensionCharges' => 'true',
|
||||
'tax' => '',
|
||||
])
|
||||
],
|
||||
[
|
||||
'details' => json_encode([
|
||||
'name' => 'Oven, Balnder - perPcs',
|
||||
'pricePerKg' => '',
|
||||
'pricePerPcs' => '20',
|
||||
'isProhibited' => '',
|
||||
'hasGram' => '',
|
||||
'hasDimensionCharges' => '',
|
||||
'tax' => '',
|
||||
])
|
||||
],
|
||||
[
|
||||
'details' => json_encode([
|
||||
'name' => 'Perfume - perKg',
|
||||
'pricePerKg' => '33',
|
||||
'pricePerPcs' => '',
|
||||
'isProhibited' => '',
|
||||
'hasGram' => '',
|
||||
'hasDimensionCharges' => '',
|
||||
'tax' => '',
|
||||
])
|
||||
],
|
||||
[
|
||||
'details' => json_encode([
|
||||
'name' => 'Gold - Prohibited',
|
||||
'pricePerKg' => '',
|
||||
'pricePerPcs' => '',
|
||||
'isProhibited' => 'true',
|
||||
'hasGram' => '',
|
||||
'hasDimensionCharges' => '',
|
||||
'tax' => '',
|
||||
])
|
||||
],
|
||||
[
|
||||
'details' => json_encode([
|
||||
'name' => 'Food - hasGram',
|
||||
'pricePerKg' => '',
|
||||
'pricePerPcs' => '',
|
||||
'isProhibited' => '',
|
||||
'hasGram' => 'true',
|
||||
'hasDimensionCharges' => '',
|
||||
'tax' => '',
|
||||
])
|
||||
],
|
||||
[
|
||||
'details' => json_encode([
|
||||
'name' => 'TV 30" - 36"',
|
||||
'pricePerKg' => 28,
|
||||
'pricePerPcs' => '',
|
||||
'isProhibited' => '',
|
||||
'hasGram' => 'true',
|
||||
'hasDimensionCharges' => "true",
|
||||
'tax' => 500,
|
||||
])
|
||||
],
|
||||
[
|
||||
'details' => json_encode([
|
||||
'name' => 'TV 37" - 42"',
|
||||
'pricePerKg' => 28,
|
||||
'pricePerPcs' => '',
|
||||
'isProhibited' => '',
|
||||
'hasGram' => 'true',
|
||||
'hasDimensionCharges' => "true",
|
||||
'tax' => 1000,
|
||||
])
|
||||
],
|
||||
[
|
||||
'details' => json_encode([
|
||||
'name' => 'TV 43"+"',
|
||||
'pricePerKg' => 28,
|
||||
'pricePerPcs' => '',
|
||||
'isProhibited' => '',
|
||||
'hasGram' => 'true',
|
||||
'hasDimensionCharges' => "true",
|
||||
'tax' => 1500,
|
||||
])
|
||||
]
|
||||
);
|
||||
|
||||
return $this->collectionResponse(AirShipmentItemPriceResource::collection($price));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Transactions\ControllersLogic;
|
||||
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\Modules\Documents\Services\CreatesFiles;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Documents\Services\CreatesDocument;
|
||||
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
||||
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
||||
use App\Classes\Modules\Transactions\ControllersLogic\Document;
|
||||
|
||||
class ApproveShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Shipping Invoice Status',
|
||||
'message' => 'You have successfully updated the shipping invoice status'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var FetchesPackingList */
|
||||
private $fetchesPackingList;
|
||||
|
||||
/** @var UpdatesTransactionStatus */
|
||||
private $updatesTransactionStatus;
|
||||
|
||||
/** @var CreatesDocument */
|
||||
private $createsDocument;
|
||||
|
||||
/** @var CreatesFiles */
|
||||
private $createsFiles;
|
||||
|
||||
/**
|
||||
* ApprovePaymentVerificationLogic constructor.
|
||||
* @param FetchesPackingList $fetchesPackingList
|
||||
* @param UpdatesTransactionStatus $updatesTransactionStatus
|
||||
* @param CreatesDocument $createsDocument
|
||||
* @param CreatesFiles $createsFiles
|
||||
* @param CreateInvoiceTransactionProcessor $createInvoiceTransactionProcessor
|
||||
*/
|
||||
public function __construct(FetchesPackingList $fetchesPackingList, UpdatesTransactionStatus $updatesTransactionStatus, CreatesDocument $createsDocument, CreatesFiles $createsFiles)
|
||||
{
|
||||
$this->fetchesPackingList = $fetchesPackingList;
|
||||
$this->updatesTransactionStatus = $updatesTransactionStatus;
|
||||
$this->createsDocument = $createsDocument;
|
||||
$this->createsFiles = $createsFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
|
||||
|
||||
$invoice_transaction = $packing_list->transactions->where('type', TransactionType::SHIPPING_INVOICE)->first();
|
||||
|
||||
$this->updatesTransactionStatus->execute($invoice_transaction, ApprovalStatus::APPROVED);
|
||||
|
||||
$transaction_invoice_pdf = LaravelMpdf::loadView('pages.pdfs.shipping_invoice', ['invoice_transaction' => $invoice_transaction]);
|
||||
|
||||
$document_object = new DocumentObject(
|
||||
DocumentType::SHIPPING_INVOICE,
|
||||
[chunk_split('data:application/pdf;base64,'.base64_encode($transaction_invoice_pdf->output()))],
|
||||
'',
|
||||
ApprovalStatus::COMPLETED,
|
||||
'shipping_invoice'
|
||||
);
|
||||
|
||||
/** @var Document $document */
|
||||
$document = $this->createsDocument->execute($invoice_transaction, $document_object);
|
||||
|
||||
$this->createsFiles->execute($document, $document_object);
|
||||
|
||||
return $this->response([]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -83,9 +83,12 @@ class CreatePaymentTransactionLogic extends AbstractControllerLogic
|
||||
$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
|
||||
$company_module->employees()->first()->email ?? '',
|
||||
'This payment is for the invoice number . ' . $invoice_transaction->bill_no,
|
||||
$amount,
|
||||
$billNumber,
|
||||
$request->input('bank_code'),
|
||||
true
|
||||
);
|
||||
|
||||
$payment_reference = $billPlzBill->id;
|
||||
|
||||
+39
-56
@@ -21,10 +21,12 @@ 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\SegmentConstants;
|
||||
use App\Classes\ValueObjects\Constants\TransactionDetailType;
|
||||
|
||||
use App\Models\Document;
|
||||
use App\Models\Transaction;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@@ -98,57 +100,35 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
return ($package->width / 100) * ($package->height / 100) *($package->length / 100) * ($package->quantity);
|
||||
});
|
||||
|
||||
$order = $packing_list->owner()->first();
|
||||
$order = $packing_list->owner;
|
||||
$address = $order->addresses()->first();
|
||||
|
||||
$base_price_constant = $this->fetchesSegmentConstant->execute(['id' => 1]);
|
||||
$warehouse_rate_constant = $this->fetchesSegmentConstant->execute(['id' => 2]);
|
||||
$state_rate_constant = $this->fetchesSegmentConstant->execute(['id' => 3]);
|
||||
$center_postcode_constant = $this->fetchesSegmentConstant->execute(['id' => 4]);
|
||||
$outstation_postcode_constant = $this->fetchesSegmentConstant->execute(['id' => 5]);
|
||||
$base_price_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::BASE_PRICE]);
|
||||
$warehouse_rate_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::WAREHOUSE_RATE]);
|
||||
$state_rate_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::STATE_RATE]);
|
||||
$center_postcode_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::CENTER_POSTCODE]);
|
||||
$outstation_postcode_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::OUTSTATION_POSTCODE]);
|
||||
|
||||
$base_price = 0;
|
||||
$warehouse_rate = 0;
|
||||
$state_rate = 0;
|
||||
$state_select = [];
|
||||
$with_out = false;
|
||||
$state_select = '';
|
||||
|
||||
if ($base_price_constant) {
|
||||
$base_price = $base_price_constant->value->price;
|
||||
}
|
||||
$base_price = $this->getConstantByKey($base_price_constant, date('Y-m-d'));
|
||||
|
||||
if ($warehouse_rate_constant) {
|
||||
$package_warehouse = $order->OrderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee->reference;
|
||||
foreach ($warehouse_rate_constant->value->config as $key_warehouse => $row_warehouse) {
|
||||
if ($row_warehouse->warehouse_name == $package_warehouse) {
|
||||
$warehouse_rate = $row_warehouse->rate;
|
||||
}
|
||||
}
|
||||
}
|
||||
$warehouseId = $order->orderRoles()->where('role_id', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->company_module_id;
|
||||
$selected_warehouse_rate = $this->getConstantByKey($warehouse_rate_constant, $warehouseId);
|
||||
$warehouse_rate = is_object($selected_warehouse_rate) ? $selected_warehouse_rate->amount : 0;
|
||||
|
||||
if ($state_rate_constant) {
|
||||
foreach ($state_rate_constant->value->config as $key_state => $row_state) {
|
||||
if ($row_state->status_id == $address->state_id) {
|
||||
$state_select = $row_state;
|
||||
}
|
||||
}
|
||||
}
|
||||
$stateId = $address->state_id;
|
||||
$state_rate_constant = $this->getConstantByKey($state_rate_constant, $stateId);
|
||||
|
||||
if ($outstation_postcode_constant) {
|
||||
foreach ($outstation_postcode_constant->value as $key_out => $row_out) {
|
||||
|
||||
if($row_out == $address->postcode) {
|
||||
$with_out = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($state_select)) {
|
||||
$state_rate = $state_select->rate;
|
||||
if ($with_out) {
|
||||
$state_rate = $state_select->rate + $state_select->outstation_rate;
|
||||
}
|
||||
}
|
||||
// get $state_rate
|
||||
$postcode = $address->postcode;
|
||||
$this->checkPostcodeExistInConstant($center_postcode_constant, $postcode) === true ? $state_select = 'center' : '' ;
|
||||
$this->checkPostcodeExistInConstant($outstation_postcode_constant, $postcode) === true ? $state_select = 'outstation' : '' ;
|
||||
$state_rate_constant = (array)$state_rate_constant;
|
||||
$state_rate = $state_select == '' ? 0 : $state_rate_constant[$state_select];
|
||||
|
||||
$price_cbm = $base_price + $warehouse_rate + $state_rate;
|
||||
$total_cbm = $price_cbm * ($cbm + $over_weight_cbm);
|
||||
@@ -196,21 +176,24 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
$this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
|
||||
}
|
||||
|
||||
$transaction_invoice_pdf = LaravelMpdf::loadView('pages.pdfs.shipping_invoice', ['invoice_transaction' => $invoice_transaction]);
|
||||
|
||||
$document_object = new DocumentObject(
|
||||
DocumentType::SHIPPING_INVOICE,
|
||||
[chunk_split('data:application/pdf;base64,'.base64_encode($transaction_invoice_pdf->output()))],
|
||||
'',
|
||||
ApprovalStatus::COMPLETED,
|
||||
'shipping_invoice'
|
||||
);
|
||||
|
||||
/** @var Document $document */
|
||||
$document = $this->createsDocument->execute($invoice_transaction, $document_object);
|
||||
|
||||
$this->createsFile->execute($document, $document_object);
|
||||
|
||||
return $this->response([]);
|
||||
}
|
||||
|
||||
function getConstantByKey($segmentConstantObject, $key) {
|
||||
if ($segmentConstantObject) {
|
||||
$base_rate = (array) $segmentConstantObject->value;
|
||||
$base_rate = array_key_exists($key, $base_rate) === true ? $base_rate[$key] : 0;
|
||||
return $base_rate;
|
||||
}
|
||||
}
|
||||
|
||||
function checkPostcodeExistInConstant($segmentConstantObject, $postcode) {
|
||||
$segmentConstantObject = $segmentConstantObject->value;
|
||||
if (!empty($segmentConstantObject)) {
|
||||
return in_array($postcode, $segmentConstantObject);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Transactions\ControllersLogic;
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\SegmentConstants\Services\FetchesSegmentConstant;
|
||||
use App\Classes\ValueObjects\Constants\SegmentConstants;
|
||||
|
||||
use App\Models\District;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Classes\General\Helper;
|
||||
|
||||
class ShippingEstimationCalculatorLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/** @var FetchesSegmentConstant */
|
||||
private $fetchesSegmentConstant;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Shipping estimation',
|
||||
'message' => 'You have successfully calculate the Shipping Estimation'
|
||||
];
|
||||
}
|
||||
|
||||
public function __construct(
|
||||
FetchesSegmentConstant $fetchesSegmentConstant
|
||||
){
|
||||
$this->fetchesSegmentConstant = $fetchesSegmentConstant;
|
||||
}
|
||||
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$base_price = $warehouse_rate = $state_rate = 0;
|
||||
|
||||
$width = $request->input('width') / 100; // metre
|
||||
$length = $request->input('length') / 100; // metre
|
||||
$height = $request->input('height') / 100; // metre
|
||||
|
||||
$cbm = (float) ($width * $length * $height);
|
||||
|
||||
// calculate base price
|
||||
$base_prices = $this->getSegmentConstantData(SegmentConstants::BASE_PRICE);
|
||||
$base_price = $this->getConstantDataUsingKey($base_prices, date('Y-m-d'));
|
||||
|
||||
// calculate warehouse rate
|
||||
$warehouse_prices = $this->getSegmentConstantData(SegmentConstants::WAREHOUSE_RATE);
|
||||
$warehouse_rate = $this->getConstantDataUsingKey($warehouse_prices, $request->input('warehouse_id'), 'amount');
|
||||
|
||||
// calculate applied state rate
|
||||
$state_prices = $this->getSegmentConstantData(SegmentConstants::STATE_RATE);
|
||||
$outstation_postcodes = $this->getSegmentConstantData(SegmentConstants::OUTSTATION_POSTCODE);
|
||||
|
||||
$district = District::where('postcode','LIKE','%'.$request->input('postcode').'%')->first();
|
||||
if(array_search($request->input('postcode'), $outstation_postcodes)!==false){
|
||||
$state_rate = $this->getConstantDataUsingKey($state_prices, $district->state_id, 'outstation');
|
||||
}
|
||||
|
||||
$price_cbm = $base_price + $warehouse_rate + $state_rate;
|
||||
$total_price_cbm = $price_cbm * $cbm;
|
||||
|
||||
return $this->response([
|
||||
'cbm' => $cbm, 'base_price' => $base_price, 'warehouse_rate' => $warehouse_rate,
|
||||
'state_rate' => $state_rate, 'total_price_cbm' => $total_price_cbm
|
||||
]);
|
||||
}
|
||||
|
||||
private function getConstantDataUsingKey($data, $search_key, $field='')
|
||||
{
|
||||
if(array_key_exists($search_key, $data) !== true) {
|
||||
return 0;
|
||||
} else {
|
||||
if($field!=''){
|
||||
return $data[$search_key]->$field;
|
||||
} else {
|
||||
return $data[$search_key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function getSegmentConstantData($reference)
|
||||
{
|
||||
$data = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => $reference]);
|
||||
return (array) $data->value;
|
||||
}
|
||||
|
||||
}
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Classes\Modules\Transactions\ControllersLogic;
|
||||
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\ValueObjects\Constants\TransactionDetailType;
|
||||
use App\Classes\Modules\Documents\DataTransferObjects\FileObject;
|
||||
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransaction;
|
||||
|
||||
use App\Classes\Modules\Transactions\Services\CreatesTransactionDetail;
|
||||
use App\Classes\Modules\Transactions\Services\FetchesTransactionDetail;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionDetail;
|
||||
use App\Classes\Modules\Transactions\Services\DeletesTransactionDetails;
|
||||
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
|
||||
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionDetailObject;
|
||||
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
|
||||
|
||||
class UpdateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Update Shipping Invoice Transaction',
|
||||
'message' => 'You have successfully update shipping invoice transaction'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var FetchesPackingList */
|
||||
private $fetchesPackingList;
|
||||
|
||||
/** @var FetchesTransaction */
|
||||
private $fetchesTransaction;
|
||||
|
||||
/** @var UpdatesTransaction */
|
||||
private $updatesTransaction;
|
||||
|
||||
/** @var FetchesTransactionDetail */
|
||||
private $fetchesTransactionDetail;
|
||||
|
||||
/** @var CreatesTransactionDetail */
|
||||
private $createsTransactionDetail;
|
||||
|
||||
/** @var UpdatesTransactionDetail */
|
||||
private $updatesTransactionDetail;
|
||||
|
||||
/** @var DeletesTransactionDetails */
|
||||
private $deletesTransactionDetails;
|
||||
|
||||
public function __construct(
|
||||
FetchesPackingList $fetchesPackingList,
|
||||
FetchesTransaction $fetchesTransaction,
|
||||
UpdatesTransaction $updatesTransaction,
|
||||
FetchesTransactionDetail $fetchesTransactionDetail,
|
||||
CreatesTransactionDetail $createsTransactionDetail,
|
||||
UpdatesTransactionDetail $updatesTransactionDetail,
|
||||
DeletesTransactionDetails $deletesTransactionDetails
|
||||
)
|
||||
{
|
||||
|
||||
$this->fetchesPackingList = $fetchesPackingList;
|
||||
$this->fetchesTransaction = $fetchesTransaction;
|
||||
$this->updatesTransaction = $updatesTransaction;
|
||||
$this->fetchesTransactionDetail = $fetchesTransactionDetail;
|
||||
$this->createsTransactionDetail = $createsTransactionDetail;
|
||||
$this->updatesTransactionDetail = $updatesTransactionDetail;
|
||||
$this->deletesTransactionDetails = $deletesTransactionDetails;
|
||||
}
|
||||
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$invoice_transaction = $this->fetchesTransaction->execute(['id' => $request->route('id')]);
|
||||
|
||||
$old_transaction_details = $invoice_transaction->transactionDetails->whereNotIn('reference', ['SHIPPING_FEE', 'OVER_WEIGHT_CHARGES'])->pluck('id')->toArray();
|
||||
|
||||
$new_transaction_details = collect($request->input('transaction_details'));
|
||||
|
||||
$total_cbm = $invoice_transaction->amount;
|
||||
|
||||
foreach($old_transaction_details as $old_transaction_detail_id){
|
||||
$old_transaction_detail = $this->fetchesTransactionDetail->execute(['id' => $old_transaction_detail_id]);
|
||||
|
||||
$total_cbm -= $old_transaction_detail->price;
|
||||
|
||||
if(!$new_transaction_details->contains('id', $old_transaction_detail_id)){
|
||||
$this->deletesTransactionDetails->execute($old_transaction_detail);
|
||||
}
|
||||
}
|
||||
|
||||
foreach($new_transaction_details as $transaction_detail){
|
||||
$transaction_detail = (object) $transaction_detail;
|
||||
|
||||
if(!in_array($transaction_detail->reference, ['SHIPPING_FEE', 'OVER_WHEIGHT_CHARGES'])){
|
||||
$object_detail = new TransactionDetailObject(
|
||||
'CUSTOM_CHARGES',
|
||||
isset($transaction_detail->name) ? $transaction_detail->name : TransactionDetailType::CUSTOM_CHARGES,
|
||||
$transaction_detail->quantity,
|
||||
$transaction_detail->price
|
||||
);
|
||||
|
||||
if(isset($transaction_detail->id)){
|
||||
$new_transaction_detail = $this->updatesTransactionDetail->execute($this->fetchesTransactionDetail->execute(['id' => $transaction_detail->id]), $object_detail);
|
||||
}else{
|
||||
$new_transaction_detail = $this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
|
||||
}
|
||||
|
||||
$total_cbm += $new_transaction_detail->amount;
|
||||
}
|
||||
}
|
||||
|
||||
$object = new TransactionObject(
|
||||
$invoice_transaction->bill_no,
|
||||
TransactionType::SHIPPING_INVOICE,
|
||||
1,
|
||||
$invoice_transaction->issuer,
|
||||
1,
|
||||
PaymentMethodType::CASH,
|
||||
$total_cbm,
|
||||
$total_cbm,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
ApprovalStatus::PENDING_VERIFICATION
|
||||
);
|
||||
|
||||
/** @var Transaction $invoice_transaction */
|
||||
$invoice_transaction = $this->updatesTransaction->execute($invoice_transaction, $object);
|
||||
|
||||
return $this->response([]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,17 +3,17 @@
|
||||
namespace App\Classes\Modules\Transactions\Services;
|
||||
|
||||
use App\Classes\General\Eloquent\AbstractDeleteRecord;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\TransactionDetail;
|
||||
|
||||
class DeletesTransactionDetails extends AbstractDeleteRecord
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Transaction $model
|
||||
* @param TransactionDetail $model
|
||||
* @return mixed
|
||||
*/
|
||||
public function execute(Transaction $model) {
|
||||
return $model->transactionDetails()->delete();
|
||||
public function execute(TransactionDetail $model) {
|
||||
return $model->delete();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Transactions\Services;
|
||||
|
||||
use App\Classes\General\Eloquent\AbstractUpdateRecord;
|
||||
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionDetailObject;
|
||||
use App\Models\TransactionDetail;
|
||||
|
||||
class UpdatesTransactionDetail extends AbstractUpdateRecord
|
||||
{
|
||||
/**
|
||||
* @param TransactionDetail $transactionDetail
|
||||
* @param TransactionDetailObject $object
|
||||
* @return \Illuminate\Database\Eloquent\Model
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function execute(TransactionDetail $transactionDetail, TransactionDetailObject $object) {
|
||||
$transactionDetail->reference = $object->getReference();
|
||||
$transactionDetail->name = $object->getName();
|
||||
$transactionDetail->quantity = $object->getQuantity();
|
||||
$transactionDetail->price = $object->getPrice();
|
||||
$transactionDetail->amount = $object->getAmount();
|
||||
|
||||
return $this->handler($transactionDetail);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,4 +7,6 @@ final class TransactionDetailType {
|
||||
public const SHIPPING_FEE = 'Shipping Fee';
|
||||
|
||||
public const OVER_WEIGHT_CHARGES = 'Over weight charges';
|
||||
|
||||
public const CUSTOM_CHARGES = 'Custom charges';
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ final class WarehouseReferences {
|
||||
|
||||
public const YD_DESTINATION_WAREHOUSE = self::YD_KLANG;
|
||||
|
||||
public const YD_EXEMPT_LIST = [230, 294, 320, 652, 1248, 1726];
|
||||
public const YD_EXEMPT_LIST = [230, 294, 320, 652, 1248, 1726, 2349, 2574];
|
||||
|
||||
public const REPLICA_WHITE_LIST = [502];
|
||||
|
||||
|
||||
@@ -49,9 +49,6 @@ class CurlVTCommand extends Command
|
||||
{
|
||||
return FetchWarehouseReceiveListFromVTPortalJob::withChain([
|
||||
new FetchLoadedContainersFromVTPortalJob,
|
||||
new FetchPackingListFromVTPortalJob,
|
||||
new FetchContainersStatusUpdateFromVTPortalJob,
|
||||
new FetchDeliveryListFromVTPortalJob
|
||||
])->dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class Kernel extends ConsoleKernel
|
||||
{
|
||||
|
||||
$schedule->command('command:curlVTCommand')
|
||||
->cron('0 9-18/3 * * *')
|
||||
->cron('0 8 * * *')
|
||||
->withoutOverlapping()
|
||||
->appendOutputTo (storage_path().'/logs/curlvt.log');
|
||||
|
||||
|
||||
@@ -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,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Notifications;
|
||||
|
||||
use App\Classes\Modules\Notifications\ControllersLogic\ListNotificationsLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListNotificationsController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ListNotificationsLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function list(Request $request, ListNotificationsLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Segments;
|
||||
|
||||
use App\Classes\Modules\Segments\ControllersLogic\ListAirShipmentPriceLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListAirShipmentPriceController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ListSegmentLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function list(Request $request, ListAirShipmentPriceLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Transactions;
|
||||
|
||||
use App\Classes\Modules\Transactions\ControllersLogic\ApproveShippingInvoiceTransactionLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ApproveShippingInvoiceTransactionController
|
||||
{
|
||||
|
||||
public function approve(Request $request, ApproveShippingInvoiceTransactionLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Transactions;
|
||||
|
||||
use App\Classes\Modules\Transactions\ControllersLogic\ShippingEstimationCalculatorLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ShippingEstimationCalculatorController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ShippingEstimationCalculatorLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function calculate(Request $request, ShippingEstimationCalculatorLogic $logic): JsonResponse
|
||||
{
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Http\Controllers\Transactions;
|
||||
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Classes\Modules\Transactions\ControllersLogic\UpdateShippingInvoiceTransactionLogic;
|
||||
|
||||
|
||||
class UpdateShippingInvoiceTransactionController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param UpdateShippingInvoiceTransactionLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function update(Request $request, UpdateShippingInvoiceTransactionLogic $logic) : JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class AirShipmentItemPriceResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$object = $this->resource;
|
||||
$detailsArray = (array)json_decode($object['details']);
|
||||
|
||||
return [
|
||||
'name' => $detailsArray['name'],
|
||||
'details' => $object['details'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class ContainerResource extends JsonResource
|
||||
'remarks' => RemarkResource::collection($this->remarks),
|
||||
'status' => $this->status,
|
||||
'packing_lists' => $this->whenLoaded('packingLists', PackingListResource::collection($this->whenLoaded('packingLists', function(){
|
||||
return $this->packingLists()->whereHas('packages')->get()->sortBy(function ($packingList) {
|
||||
return $this->packingLists()->get()->sortBy(function ($packingList) {
|
||||
return $packingList->owner->company_module_id;
|
||||
});
|
||||
})))
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\BusinessType;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
|
||||
class NotificationResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'title' => $this->title,
|
||||
'description' => $this->description,
|
||||
'long_ago' => $this->created_at->diffForHumans(),
|
||||
'created_at' => $this->created_at->format('d-m-Y')
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,11 +16,11 @@ class TransactionDetailResource extends JsonResource
|
||||
{
|
||||
|
||||
return [
|
||||
'stockCode' => $this->product_code,
|
||||
'description' => $this->product_name,
|
||||
'reference' => $this->reference,
|
||||
'quantity' => $this->quantity,
|
||||
'unit_price' => (double) $this->price,
|
||||
'total' => (double) $this->amount
|
||||
'price' => (double) $this->price,
|
||||
'name' => $this->name,
|
||||
'amount' => (double) $this->amount
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
@@ -19,18 +22,33 @@ class TransactionResource extends JsonResource
|
||||
return [
|
||||
'id' => $this->id,
|
||||
// 'booking' => new BookingResource($this->booking),
|
||||
'documents' => DocumentResource::collection($this->documents),
|
||||
'type' => (int) $this->type,
|
||||
'bill_no' => $this->bill_no,
|
||||
'amount' => (double) $this->amount,
|
||||
'outstanding' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount')),
|
||||
'service_charge' => (double) $this->service_charge,
|
||||
'tax' => (double) $this->tax,
|
||||
'original_amount' => (double) $this->original_amount,
|
||||
'currency' => new CurrencyResource($this->currency),
|
||||
'original_currency' => new CurrencyResource($this->original_currency),
|
||||
'currency_rate' => (double) $this->currency_rate,
|
||||
'status' => (int) $this->status,
|
||||
'details' => TransactionDetailResource::collection($this->transactionDetails),
|
||||
'documents' => new DocumentResource($this->documents()->first()),
|
||||
'transactions' => TransactionResource::collection($this->transactions),
|
||||
'payment_attempts' => TransactionResource::collection(
|
||||
$this->transactions()
|
||||
->payments()->where('status', ApprovalStatus::PENDING_SUBMISSION)
|
||||
->get()
|
||||
),
|
||||
'payment_history' => TransactionResource::collection(
|
||||
$this->transactions()
|
||||
->payments()
|
||||
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::COMPLETED, ApprovalStatus::REJECTED])
|
||||
->get()
|
||||
),
|
||||
'expires_on' => Carbon::parse($this->expires_on)->format('d-m-Y h:s:i'),
|
||||
'updated_at' => Carbon::parse($this->update_at)->format('d-m-Y h:s:i')
|
||||
'updated_at' => Carbon::parse($this->update_at)->format('d-m-Y')
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class SegmentCompany extends AbstractModel
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'segment_companies';
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
*/
|
||||
class SegmentConstant extends AbstractModel
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'segment_constants';
|
||||
|
||||
public function getDetailAttribute($value)
|
||||
|
||||
@@ -16,6 +16,7 @@ class CreateSegmentCompaniesTable extends Migration
|
||||
Schema::create('segment_companies', function (Blueprint $table) {
|
||||
$table->foreignId('segment_id');
|
||||
$table->foreignId('company_id');
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
$table->primary(['segment_id', 'company_id']);
|
||||
});
|
||||
|
||||
+1
-1
@@ -32,6 +32,6 @@ class CreateAddonsTables extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('order_addons');
|
||||
Schema::dropIfExists('addons');
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,11 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(CurrenciesTableSeeder::class);
|
||||
|
||||
$this->call(CompaniesTableSeeder::class);
|
||||
|
||||
$this->call(SegmentsTableSeeder::class);
|
||||
|
||||
$this->call(SegmentConstantsTableSeeder::class);
|
||||
|
||||
// $this->call(OrdersTableSeeder::class);
|
||||
}
|
||||
}
|
||||
@@ -9,154 +9,128 @@ use Illuminate\Support\Facades\DB;
|
||||
|
||||
class SegmentConstantsTableSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
|
||||
private function insertData($segment_id=1, $reference, $array_data)
|
||||
{
|
||||
DB::beginTransaction();
|
||||
|
||||
DB::table('segment_constants')->insert([
|
||||
[
|
||||
'id' => 1,
|
||||
'segment_id' => 1,
|
||||
'reference' => SegmentConstants::BASE_PRICE,
|
||||
'value' => json_encode([
|
||||
'id'=> 1,
|
||||
'price' => 500,
|
||||
]),
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'segment_id' => 1,
|
||||
'reference' => SegmentConstants::WAREHOUSE_RATE,
|
||||
'value' => json_encode([
|
||||
'id'=> 1,
|
||||
'config' => [
|
||||
[
|
||||
'warehouse_name' => WarehouseReferences::VT_GUANG_ZHOU,
|
||||
'rate' => 10
|
||||
],
|
||||
[
|
||||
'warehouse_name' => WarehouseReferences::YD_GUANG_ZHOU,
|
||||
'rate' => 10
|
||||
],
|
||||
[
|
||||
'warehouse_name' => WarehouseReferences::VT_YIWU,
|
||||
'rate' => 10
|
||||
],
|
||||
]
|
||||
]),
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'segment_id' => 1,
|
||||
'reference' => SegmentConstants::STATE_RATE,
|
||||
'value' => json_encode([
|
||||
'id'=> 1,
|
||||
'config' => [
|
||||
[
|
||||
'status_id' => 1,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 2,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 3,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 4,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 5,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 6,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 7,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 8,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 9,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 10,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 11,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 12,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 13,
|
||||
'rate' => 20,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 14,
|
||||
'rate' => 20,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 15,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
],
|
||||
[
|
||||
'status_id' => 16,
|
||||
'rate' => 10,
|
||||
'outstation_rate' => 2
|
||||
]
|
||||
]
|
||||
]),
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'segment_id' => 1,
|
||||
'reference' => SegmentConstants::CENTER_POSTCODE,
|
||||
'value' => json_encode(['80050','80100','80150','80200','80250','80300','80350','80400','80500','80506','80508','80516','80519','80534','80536','80542','80546','80558','80560','80564','80568','80578','80584','80586','80590','80592','80594','80596','80600','80604','80608','80620','80622','80628','80644','80648','80662','80664','80668','80670','80672','80673','80676','80700','80710','80720','80730','80900','80902','80904','80906','80908','80988','80990','81000','81100','81200','81300','81310']),
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'segment_id' => 1,
|
||||
'reference' => SegmentConstants::OUTSTATION_POSTCODE,
|
||||
'value' => json_encode(['80000']),
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'segment_id' => 2,
|
||||
'reference' => SegmentConstants::CUSTOMER_RATE,
|
||||
'value' => json_encode([
|
||||
'id'=> 1,
|
||||
'price' => 15,
|
||||
]),
|
||||
],
|
||||
'segment_id' => $segment_id,
|
||||
'reference' => $reference,
|
||||
'value' => json_encode($array_data)
|
||||
]);
|
||||
DB::commit();
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
// insert base prices
|
||||
$n_days = 10; // for the 10 days ahead
|
||||
$today = date("Y-m-d");
|
||||
$prices = [];
|
||||
for($ii=0; $ii<$n_days;$ii++){
|
||||
$prices[] = [
|
||||
"date" => date('Y-m-d', strtotime($today. ' + '.$ii.' days')),
|
||||
"price" => rand(10, 30) / 10
|
||||
];
|
||||
}
|
||||
$this->insertData(1, SegmentConstants::BASE_PRICE, $prices);
|
||||
|
||||
// insert state prices
|
||||
$prices = [];
|
||||
for($ii=1; $ii<=16;$ii++){
|
||||
$prices[] = [
|
||||
'state_id' => $ii,
|
||||
'center' => '10.00',
|
||||
'outstation'=> '2.00'
|
||||
];
|
||||
}
|
||||
$this->insertData(1, SegmentConstants::STATE_RATE, $prices);
|
||||
|
||||
// insert warehouse prices
|
||||
$prices = [];
|
||||
for($ii=1; $ii<=7;$ii++){
|
||||
$prices[] = [
|
||||
'warehouse_id' => $ii,
|
||||
'amount' => '1.'.$ii
|
||||
];
|
||||
}
|
||||
$this->insertData(1, SegmentConstants::WAREHOUSE_RATE, $prices);
|
||||
|
||||
// insert center postcodes
|
||||
$prices = [
|
||||
[ 'post_code' => '80050' ],
|
||||
[ 'post_code' => '80100' ],
|
||||
[ 'post_code' => '80150' ],
|
||||
[ 'post_code' => '80200' ],
|
||||
[ 'post_code' => '80250' ],
|
||||
[ 'post_code' => '80300' ],
|
||||
[ 'post_code' => '80350' ],
|
||||
[ 'post_code' => '80400' ],
|
||||
[ 'post_code' => '80500' ],
|
||||
[ 'post_code' => '80506' ],
|
||||
[ 'post_code' => '80508' ],
|
||||
[ 'post_code' => '80516' ],
|
||||
[ 'post_code' => '80519' ],
|
||||
[ 'post_code' => '80534' ],
|
||||
[ 'post_code' => '80536' ],
|
||||
[ 'post_code' => '80542' ],
|
||||
[ 'post_code' => '80546' ],
|
||||
[ 'post_code' => '80558' ],
|
||||
[ 'post_code' => '80560' ],
|
||||
[ 'post_code' => '80564' ],
|
||||
[ 'post_code' => '80568' ],
|
||||
[ 'post_code' => '80578' ],
|
||||
[ 'post_code' => '80584' ],
|
||||
[ 'post_code' => '80586' ],
|
||||
[ 'post_code' => '80590' ],
|
||||
[ 'post_code' => '80592' ],
|
||||
[ 'post_code' => '80594' ],
|
||||
[ 'post_code' => '80596' ],
|
||||
[ 'post_code' => '80600' ],
|
||||
[ 'post_code' => '80604' ],
|
||||
[ 'post_code' => '80608' ],
|
||||
[ 'post_code' => '80620' ],
|
||||
[ 'post_code' => '80622' ],
|
||||
[ 'post_code' => '80628' ],
|
||||
[ 'post_code' => '80644' ],
|
||||
[ 'post_code' => '80648' ],
|
||||
[ 'post_code' => '80662' ],
|
||||
[ 'post_code' => '80664' ],
|
||||
[ 'post_code' => '80668' ],
|
||||
[ 'post_code' => '80670' ],
|
||||
[ 'post_code' => '80672' ],
|
||||
[ 'post_code' => '80673' ],
|
||||
[ 'post_code' => '80676' ],
|
||||
[ 'post_code' => '80700' ],
|
||||
[ 'post_code' => '80710' ],
|
||||
[ 'post_code' => '80720' ],
|
||||
[ 'post_code' => '80730' ],
|
||||
[ 'post_code' => '80900' ],
|
||||
[ 'post_code' => '80902' ],
|
||||
[ 'post_code' => '80904' ],
|
||||
[ 'post_code' => '80906' ],
|
||||
[ 'post_code' => '80908' ],
|
||||
[ 'post_code' => '80988' ],
|
||||
[ 'post_code' => '80990' ],
|
||||
[ 'post_code' => '81000' ],
|
||||
[ 'post_code' => '81100' ],
|
||||
[ 'post_code' => '81200' ],
|
||||
[ 'post_code' => '81300' ],
|
||||
[ 'post_code' => '81310' ]
|
||||
];
|
||||
$this->insertData(1, SegmentConstants::CENTER_POSTCODE, $prices);
|
||||
|
||||
// insert outstation prices
|
||||
$prices = [
|
||||
['post_code' => '80000' ]
|
||||
];
|
||||
$this->insertData(1, SegmentConstants::OUTSTATION_POSTCODE, $prices);
|
||||
|
||||
// insert customer prices
|
||||
$prices = [
|
||||
['id'=> 1, 'price' => 15 ]
|
||||
];
|
||||
$this->insertData(2, SegmentConstants::CUSTOMER_RATE, $prices);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 959 KiB |
@@ -317,6 +317,12 @@ hr{
|
||||
background-color: $color-primary-lighter !important;
|
||||
}
|
||||
|
||||
.bg-primary-lighter-hover {
|
||||
&:hover {
|
||||
background-color: $color-primary-lighter !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Complete
|
||||
------------------------------------
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="row" @keyup.enter="submitForm">
|
||||
<div class="col">
|
||||
<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.email">
|
||||
<label class="text-primary">Email Address</label>
|
||||
<input type="text" class="form-control fs-12" v-model.trim="parameters.email">
|
||||
</validation-wrapper-component>
|
||||
<validation-wrapper-component :validator="$v.parameters.password">
|
||||
<label class="text-primary">Password</label>
|
||||
<input type="password" class="form-control fs-12" v-model="parameters.password">
|
||||
</validation-wrapper-component>
|
||||
<div class="row m-t-15 align-items-center justify-content-center">
|
||||
<div class="col-auto">
|
||||
<div class="checkbox check-complete no-margin">
|
||||
<input type="checkbox" checked="checked" value="1" id="checkbox2">
|
||||
<label for="checkbox2 bold no-margin">Remember Me</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<p class="muted fs-11 font-arial m-b-0 pointer bold" @click="$store.dispatch('toggleSection', {name: 'forgetPassword', status: true})">Forgot password?</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-15 align-items-center justify-content-center">
|
||||
<div class="col">
|
||||
<div class="btn btn-block btn-lg b-rad-none no-border" :class="[{'btn-primary': currentUrl.indexOf('last_mile_delivery') === -1 }, {'btn-info': currentUrl.indexOf('last_mile_delivery') > -1 }]" @click="submitForm">Sign In</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-15">
|
||||
<div class="col text-center">
|
||||
<div class="col">
|
||||
<p>New Customer? <strong class=" m-b-0 pointer" @click="$store.dispatch('toggleSection', {name: 'registrationForm', status: true})">Create Account</strong></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import loginFormValidation from '../../../general/mixins/accounts/validation/loginFormValidation'
|
||||
export default {
|
||||
props: {
|
||||
section:{
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
error: '',
|
||||
parameters: {
|
||||
email: this.email,
|
||||
password: ''
|
||||
},
|
||||
currentUrl: window.location.href,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
submitForm(){
|
||||
this.submit(this.route('api.account.authentication.authenticate.attempt'), 'post', this.section, false, false)
|
||||
}
|
||||
},
|
||||
mixins: [loginFormValidation]
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="row m-t-15">
|
||||
<div class="col text-center">
|
||||
<div class="col">
|
||||
<p>New Customer? <strong class=" m-b-0 pointer" @click="$store.dispatch('toggleSection', {name: 'registrationForm', status: true})">Create Account</strong></p>
|
||||
<p>New Customer? <strong class=" m-b-0 pointer"><a class="text-master" :href="route('signup')">Create Account</a></strong></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -156,14 +156,14 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn btn-sm p-t-10 p-b-10 btn-default bg-master-lighter b-rad-none" @click="$store.dispatch('toggleSection', {name: 'registrationForm', status: false})">
|
||||
<a :href="route('login')" class="btn btn-sm p-t-10 p-b-10 btn-default bg-master-lighter b-rad-none">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto p-r-10">
|
||||
<i class="fa fa-angle-left fs-16" style="margin-top: 1px;"></i>
|
||||
</div>
|
||||
<div class="col p-l-5">I already have an account</div>
|
||||
</div>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<button type="button" class="btn btn-sm btn-block p-t-10 p-b-10 p-r-35 p-l-35 btn-primary b-rad-none p-r-30" @click="changeStep('next')">
|
||||
|
||||
@@ -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>
|
||||
|
||||
+1
-22
@@ -137,28 +137,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<modal-component small type="rejectDocument">
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<h5 class="all-caps">Reject Document</h5>
|
||||
<div class="fs-11">Are you sure you want to reject this customer's identification?</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-r-5">
|
||||
<div data-dismiss="modal" class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div data-dismiss="modal" class="btn btn-sm btn-danger btn-block b-rad-none" @click="approveDocument('reject')">Reject</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<reject-identification-verification-form-component :section="section" :data="item"></reject-identification-verification-form-component>
|
||||
</modal-component>
|
||||
<div class="col no-padding ml-auto">
|
||||
<button class="btn btn-md btn-block btn-success b-rad-none p-t-10 p-b-10 requestModal" data-type="approveDocument">
|
||||
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-auto text-center">
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="all-caps">Reject Document</h5>
|
||||
<div class="fs-11">Are you sure you want to reject this customer's identification?</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-left margin-auto m-t-10 m-b-10">
|
||||
<div class="col">
|
||||
<span class="text-danger fs-9">{{ error }}</span>
|
||||
<div class="fs-11">Reason: </div>
|
||||
<div class="row">
|
||||
<div class="col fs-11">
|
||||
<div class="b-a padding-5 w-100 m-b-5 pointer b-grey muted" :class="{'b-primary': parameters.rejectRemark === rejectRemarkItem, 'text-primary': parameters.rejectRemark === rejectRemarkItem}" v-for="rejectRemarkItem in rejectRemarkArray" @click="chooseRejectRemark(rejectRemarkItem)">{{ rejectRemarkItem }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-r-5">
|
||||
<div data-dismiss="modal" class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div class="btn btn-sm btn-danger btn-block b-rad-none" @click="approveDocument('reject')">Reject</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
import modalFormHandler from '../../../general/mixins/modalFormHandler';
|
||||
import { required } from "vuelidate/lib/validators";
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
parameters: {
|
||||
rejectRemark: null,
|
||||
},
|
||||
rejectRemarkArray: null,
|
||||
documentType: this.data.document_type === 'IDENTITY_CARD' ? 'IC' : 'SSM',
|
||||
error: null,
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
parameters: {
|
||||
rejectRemark: { required },
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.rejectRemarkArray = [
|
||||
this.documentType + ' not clear',
|
||||
this.documentType + ' name different with registration name',
|
||||
'Wrong Document uploaded',
|
||||
'Non-Malaysian ' + this.documentType + ' Uploaded',
|
||||
this.documentType + ' not Genuine'
|
||||
];
|
||||
},
|
||||
methods: {
|
||||
approveDocument(status){
|
||||
this.parameters.rejectRemark === null ? this.error = 'Please choose a remark.' : null;
|
||||
this.isLoading = true;
|
||||
this.submit(this.route('api.company.identification.approval', this.item.owner.id, this.item.id, status), 'put', 'identificationVerificationSection', true, true);
|
||||
},
|
||||
chooseRejectRemark(remark) {
|
||||
this.parameters.rejectRemark = remark;
|
||||
}
|
||||
},
|
||||
mixins: [componentHandler, modalFormHandler]
|
||||
|
||||
}
|
||||
</script>
|
||||
-2
@@ -11,7 +11,6 @@
|
||||
<on-boarding-section-component v-if="!company.last_order"></on-boarding-section-component>
|
||||
<div class="row" v-if="company.last_order">
|
||||
<div class="col">
|
||||
<!-- new swction -->
|
||||
<div class="row tabsContainer">
|
||||
<div class="col no-padding">
|
||||
<div class="row m-l-0 m-r-0">
|
||||
@@ -127,7 +126,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end new swction -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
<div class="btn btn-default no-border" @click="expanded = !expanded">
|
||||
<i class="fa" :class="{'fa-angle-down': !expanded, 'fa-angle-up': expanded}" ></i>
|
||||
</div>
|
||||
<a class="btn btn-default no-border" :href="route('container.show', item.container_reference)">
|
||||
<i class="fa fa-angle-right fa-fw"></i>
|
||||
<a class="btn btn-default no-border" :href="route('container.refresh', item.container_reference)" target="_blank">
|
||||
<i class="fa fa-refresh fa-fw"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,18 +13,22 @@
|
||||
<div class="col-1">{{ (parseFloat(cbm) + parseFloat(overweight)).toFixed(3)}}</div>
|
||||
<div class="col-1 bold text-center" :class="{'text-danger': item.status === 5, 'text-success': item.status !== 5}">{{item.transport ? 'Delivery' : item.status === 5 ? 'On Hold' : 'Release'}}</div>
|
||||
<div class="col-3">
|
||||
<div v-if="item.order">
|
||||
<div v-if="item.order" style="word-break: break-word;">
|
||||
{{item.order.address.contact ? item.order.address.contact.reference+' '+item.order.address.contact.phone : ''}}<br>
|
||||
{{item.order.address.street_one+' '+(item.order.address.street_two ? item.order.address.street_two : '')+', '+ item.order.address.district.name+', '+item.order.address.post_code+' '+item.order.address.state.name+', '+item.order.address.country.name}}<br>{{item.order.address.remark ? item.order.address.remark.content: ''}}
|
||||
<div class="btn btn-xs btn-primary pointer m-t-10 requestModal" data-type="defineLocation">Define Location</div>
|
||||
<div class="btn btn-xs btn-primary pointer m-t-10 requestModal hide" data-type="defineLocation">Define Location</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="defineLocation">
|
||||
<declare-postcode-area-form-component :section="section" :data="{postcode: item.order.address.post_code, postcodeArea: item.order.address.post_code_area}"></declare-postcode-area-form-component>
|
||||
<declare-postcode-area-form-component :data="item.order.address.post_code"></declare-postcode-area-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="no-margin" v-if="item.transport">{{ item.transport.current_schedule.eta }}</p>
|
||||
<p class="no-margin text-danger" v-if="!item.transport">{{ item.packages[0].container.transport ? item.packages[0].container.transport.dropped_days+' Days': 'n/a'}}</p>
|
||||
<p class="no-margin text-danger" v-if="!item.transport">{{ item.packages.length ? item.packages[0].container.transport ? item.packages[0].container.transport.dropped_days+' Days': 'n/a' : 'n/a'}}</p>
|
||||
<div class="btn btn-xs btn-primary pointer m-t-10 requestModal" data-type="rescheduleTransport">Reschedule Transport</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="rescheduleTransport">
|
||||
<reschedule-transport-date-form-component :data="item"></reschedule-transport-date-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
<div class="col-auto text-right" v-if="!item.transport">
|
||||
<div class="row m-b-5">
|
||||
@@ -36,23 +40,6 @@
|
||||
<div v-if="!item.order" class="text-danger">Unclaimed</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<div v-if="item.shippng_transaction">
|
||||
<div v-for="files in item.shippng_transaction.documents.files" v-bind:key="files.id" class="col-auto no-padding">
|
||||
<document-file-viewer-component :file="files">
|
||||
<template slot="button">
|
||||
<div class="btn btn-xs btn-primary pointer d-block m-b-5">View Invoice</div>
|
||||
</template>
|
||||
</document-file-viewer-component>
|
||||
</div>
|
||||
<!-- <div class="btn btn-xs btn-primary pointer d-block">Pay Invoice</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -84,9 +71,6 @@
|
||||
this.parameters.packing_list_id = this.data.id;
|
||||
},
|
||||
methods: {
|
||||
generateInvoice() {
|
||||
this.submit(this.route('api.transaction.supplier.create'), 'post', '', true, true);
|
||||
},
|
||||
updateStatus(status){
|
||||
this.submit(this.route('api.packing_list.status.update', this.item.id, status), 'put', '', true, true)
|
||||
},
|
||||
|
||||
@@ -28,10 +28,11 @@
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
selected: false,
|
||||
}
|
||||
props: {
|
||||
selectedPackageList: {
|
||||
type: Array,
|
||||
required: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
activate(){
|
||||
@@ -45,6 +46,15 @@
|
||||
},
|
||||
noPackage() {
|
||||
return ( this.item.packages.reduce((total, obj) => 1 + total, 0));
|
||||
},
|
||||
selected() {
|
||||
var response = false;
|
||||
this.selectedPackageList.forEach((value, index) => {
|
||||
if (value.id == this.item.id) {
|
||||
response = true;
|
||||
}
|
||||
});
|
||||
return response;
|
||||
}
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<div class="row" style="width: 450px; margin: auto;" @keyup.enter="submitForm">
|
||||
<div class="col bg-white padding-40 b-rad-lg">
|
||||
<div class="row m-b-10">
|
||||
<div class="col text-center">
|
||||
<p>Plese set the approximate dates of below.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row m-auto mt-10 mb-10">
|
||||
<div class="col p-l-0 p-r-10">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.etd">
|
||||
<label class="text-primary">Etd</label>
|
||||
<date-picker-component v-model="parameters.etd"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col p-r-0 p-l-10">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.eta">
|
||||
<label class="text-primary">Eta</label>
|
||||
<date-picker-component v-model="parameters.eta"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-15">
|
||||
<div class="col-auto p-r-5">
|
||||
<div class="btn btn-lg btn-default b-rad-none" data-dismiss="modal">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div class="btn btn-primary w-100 btn-lg" @click="submit(route('api.packing_list.reschedule', data.id), 'put', section, true, true)">Confirm</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import modalFormHandler from '../../../general/mixins/modalFormHandler';
|
||||
import { required } from "vuelidate/lib/validators";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
section:{
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
parameters: {
|
||||
etd: this.etd,
|
||||
eta: this.eta,
|
||||
}
|
||||
};
|
||||
},
|
||||
validations: {
|
||||
parameters: {
|
||||
etd: { required },
|
||||
eta: { required },
|
||||
}
|
||||
},
|
||||
mixins: [modalFormHandler]
|
||||
}
|
||||
|
||||
</script>
|
||||
+1
-1
@@ -455,7 +455,7 @@
|
||||
</div>
|
||||
<div class="row" v-for="packingList in container.packing_lists">
|
||||
<div class="col">
|
||||
<list-packagelist-form-component :data="packingList" v-on:input="updateList($event)"></list-packagelist-form-component>
|
||||
<list-packagelist-form-component :data="packingList" :selectedPackageList="selectedPackageList" v-on:input="updateList($event)"></list-packagelist-form-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="btn-group">
|
||||
<i class="fa fa-bell fs-18 m-t-5 muted pointer" :class="{'text-primary' : isClicked}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" @click="openNotification()"></i>
|
||||
<div class="b-rad-md dropdown-menu dropdown-menu-right p-l-15 p-b-15 p-r-15 p-t-0" style="width: 100vw; height: 100vh; background: transparent !important;" @click="openNotification()">
|
||||
<div class="row shadow" style="width: 320px; position: absolute; top: 50px; right: 50px; background: white!important;">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="bg-master-lighter col p-l-10 p-l-10 p-t-10 bg-white text-center">
|
||||
<p>Notification Center</p>
|
||||
</div>
|
||||
</div>
|
||||
<loading-component style="height: 200px; top: 0;" key="1" color="primary" v-show="isLoading"></loading-component>
|
||||
<div class="row" :class="{'h-100' : notificationsLength >= 5}" v-show="!isLoading" style="max-height: 400px; ">
|
||||
<div class="col page-container overflow-hidden">
|
||||
<div class="row b-b b-grey bg-primary-lighter-hover pointer w-100 m-l-0 m-r-0" v-for="(notification, index) in notifications">
|
||||
<div class="col-auto justify-content-center align-items-center d-flex hide">
|
||||
<div>
|
||||
<i class="fa fa-check-circle fs-20 p-l-5 text-success"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col padding-10 p-l-15 p-r-15">
|
||||
<p class="bold m-b-5 lh-16">{{ notification.title }}</p>
|
||||
<p class="fs-9 m-b-0 lh-10">{{ notification.description }}</p>
|
||||
<p class="fs-9 m-b-0 m-t-10 lh-10">{{ notification.long_ago }}</p>
|
||||
</div>
|
||||
<div class="col-auto justify-content-center align-items-center d-none" :class="{'d-flex' : index === 0}">
|
||||
<div>
|
||||
<i class="fa fa-circle fs-10 text-primary"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-center m-t-50 m-b-50" v-if="notificationsLength === 0" v-show="!isLoading">
|
||||
<div class="col">
|
||||
<div class="row align-items-center justify-content-center hint-text">
|
||||
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
|
||||
</div>
|
||||
<div class="row text-center">
|
||||
<div class="col">
|
||||
<div class="row m-t-20">
|
||||
<div class="col">
|
||||
<p class="all-caps no-margin fs-11" style="letter-spacing: 2px;">Nothing To Show Here</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-5 align-items-center justify-content-center hide">
|
||||
<div class="col">
|
||||
<small class="fs-9 muted all-caps font-lato" style="letter-spacing: 2px">There is no results found.</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row b-t muted">
|
||||
<div class="col p-l-10 p-l-10 p-t-10 m-b-10 bg-white text-center">
|
||||
<a href="#">View All Notifications</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
isLoading: true,
|
||||
error: '',
|
||||
notifications: null,
|
||||
isClicked: false,
|
||||
notificationsLength: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openNotification(){
|
||||
this.isClicked === false ? this.fetchNotification() : '';
|
||||
this.isClicked = !this.isClicked;
|
||||
},
|
||||
fetchNotification(){
|
||||
this.isLoading = true;
|
||||
this.submit(route('notifications.list'), 'get', this.section, false, false)
|
||||
},
|
||||
successHandler(response){
|
||||
this.isLoading = false;
|
||||
this.notifications = response.payload.data;
|
||||
this.notificationsLength = response.payload.data.length;
|
||||
},
|
||||
},
|
||||
mixins: [ModalFormHandler]
|
||||
}
|
||||
</script>
|
||||
@@ -32,7 +32,8 @@
|
||||
</div>
|
||||
<div class="col" v-if="$store.getters.isAdmin">
|
||||
<p class="no-margin all-caps fs-10 light">Warehouse</p>
|
||||
<p class="no-margin">{{item.order.warehouse.reference}}</p>
|
||||
<p class="no-margin" v-if="item.order">{{item.order.warehouse.reference}}</p>
|
||||
<span class='text-danger' v-if="!item.order">Unclaimed</span>
|
||||
</div>
|
||||
<div class="col-auto text-right">
|
||||
<div class="btn btn-xs btn-default" @click="expanded = !expanded"><i class="fa" :class="{'fa-angle-up': expanded, 'fa-angle-down': !expanded}"></i></div>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<div class="row" style="width: 450px; margin: auto;" @keyup.enter="submitForm">
|
||||
<div class="col bg-white padding-40 b-rad-lg">
|
||||
<div class="row m-b-10">
|
||||
<div class="col text-center">
|
||||
<h3 class="all-caps">Are you sure?</h3>
|
||||
<div class="fs-11">Are you sure you want to delete this Packing List?</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-15">
|
||||
<div class="col-auto p-r-5">
|
||||
<div class="btn btn-lg btn-default b-rad-none" data-dismiss="modal">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div class="btn btn-danger w-100 btn-lg" @click="submit(route('api.packing_list.delete', data.id), 'delete', section, true, true)">Confirm</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import modalFormHandler from '../../../general/mixins/modalFormHandler';
|
||||
|
||||
export default {
|
||||
mixins: [modalFormHandler]
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -52,6 +52,7 @@
|
||||
</div>
|
||||
<div class="row text-center justify-content-center">
|
||||
<div class="col-8">
|
||||
<p class="m-b-0 text-danger m-t-15" v-if="parameters.warehouse_id === 3">近期由于船期的安排和马来西亚海关的运作等一些不可控因数,导致船期延迟,请大家提前做好采购安排。若有不便之处,敬请谅解。 <br>Due to inevitable circumstances, shipping arrangements and Malaysia custom clearance may have delays. Kindly plan your purchases in advance, thank you for your cooperation.</p>
|
||||
<p class="m-b-0 text-danger m-t-15" v-if="parameters.warehouse_id === 4">由于义乌船期不稳定,建议发广州仓库。<br>Due to unexpected shipping delays for Yiwu warehouse, you may select an alternative warehouse.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,458 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col no-margin">
|
||||
<loading-component style="height: 200px; top: 0;" key="1" color="success" v-show="$store.getters.isLoading(section)"></loading-component>
|
||||
<div class="row align-content-center h-100" v-if="step === 1">
|
||||
<div class="col-8">
|
||||
<div class="row m-b-20">
|
||||
<div class="col-12 col-md-7">
|
||||
<div class="row m-b-10 text-info">
|
||||
<div class="col">
|
||||
<h5 class="m-b-0 m-t-0 bold">Service Type</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-center justify-content-center">
|
||||
<div class="col p-l-5">
|
||||
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" :class="{ 'b-info': parameters.type === 1, 'b-grey': parameters.type !== 1 }" @click="parameters.type = 1">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABmJLR0QA/wD/AP+gvaeTAAAEJklEQVR4nO3aS6hVVRzH8c8tsUKvjWoQBGGPSZFGg0ot8+YgMBoKEQhBBBFNokFkUhOzGjSoUVnUMIugUQ8pe4gVRhFISpMI7UpGpuiN3vc0WOt0ttt93nufvW93fWFxNov9/6///p211l7rvzaJRCKRSCQSiUQikUgkEolEIpFIJBY5S/E0jqJVUZnDAWzHpZN5rMnxlOqEKyqncM9EnmxCzAoPdtOQdm1BBmEZbsbr0WYe9w7ZXmMZRogy7O4XBPwT60awbxyTFpAw57bwIy4Z0UdjqEPAc/FetP9UeJEtWOoQEC7Gkejj2TH81E5dAsIN+D362Tymr9qoU0B4IPo5jatL8Ddx6hYQXom+vsWFJfmcGE0Q8AJ8Gf29hamS/E6EJggIl+F49PlwiX4rpykCwp3CIvsvzJTpeEr5wS4EvsP7sbwrvGhGYjEK+Kuwh27zG/ZidywHhnVYxZAhBPXJBO0GZSk2YIfwgvnHmVmdo3gVdwuL8r5UJeBC4SLcJSx52hmkdpnHV0JqbgbnFTlY7ALmuQYP4R1huGcF/QlbsSRrUJScPIzbxwxknzAcx7XbWxDfKH5H4XxsxDP4OtP+m0LigoLgsiKOQ1lzYJGAVc6RvVgrpMpa2NKuLBrCaVh3Z7OgzWftiiRgbzZhP/5w9hkMqhvCZc2BdbJJ74Ms53QxPIL7xmx83mi9eFS7Kngi/j4iLGGmFCQk0nDtzilBm+W5+r49MBHYH38f1ON8paoe+H+YA2fwtxHmwG5sxE4hwzuHk8Lm+0XhLDY7PzRxDszHPxevd+K2gvv34A58IZw3FzJID7xc8YI2X3YLCcymMWj8H2PlAP7O0KyfgOuEntYSVuGPYpWQElqG1cL+sL1CP4HrB32yCTBs/Cexpo/PgQW8ShCkhdec/TbKMo1d8d6f8bn658BR4/8FV3SJZ5+OZqvoLuCU0KXbjQ9yIDOl86FPC28PYJOnrHzguPHv6RJPdir4nu4C3qrT7Xv9c3mmcSzarh/CrmzKiP+WHve10Or1Fm5nG54T3lZtsh9OzgqZ3ewa6TSez/mog4nF387C5ifOg7H+2lx90YeTT+buWR3rDw4SQI6y5sAy4v+mh///Ru6OAofZku/+WcHXxuvZ3D3TfXxOslQZ/+EleDwabTHcN3XZSbmqhW+VjBt/34RLtyFQ1GO35+4ZZAhUTe3xvxydbM3VL41BzOKH2Hh+o70t2r40TgBjUnv863WWAdND2K0QTq9awgfgddGI+D+KjnYZfCH6RrT5YNzGS6D2+K8UtjUtYYXe659ckWn8uLCBr5tGxL9GZz95DI/hOmF5sDxeb9Pp9idwY1mNl0Aj4l+pMxx6lQ81M53VmPhn8AIO6SQkD8W6DVU2XBILPf5EIpFIJBKJRCKRSCQSiUQiUSP/AlkkSdKJddQ3AAAAAElFTkSuQmCC" class="w-100">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="no-margin" :class="{ 'text-info': parameters.type === 1, 'semi-bold': parameters.type === 1}">Pick Up</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-r-5">
|
||||
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" :class="{ 'b-info': parameters.type === 2, 'b-grey': parameters.type !== 2 }" @click="parameters.type = 2">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABmJLR0QA/wD/AP+gvaeTAAAG00lEQVR4nO2caYwURRSAv4VhOWRBZEEFQgAFFVFARcEjyEpQMCggCoZA/IEHcoioARUNlxKjiTEeqIhRJFFBEQHxwPgDMYCcaqIEMSDBoKKcyyEsO/54r1O9Pd09Bz073UN/yaSnql7XvC6qq1699xaIiYmJiYmJiYmJiSlKWgIzgc1AJXAY2ATMAFoUUK9IMBQ4BCQ9PgeBwQXTLuQMBaqRgVoM9AbO0s+NwKfadop4EFNoiZl5j/nITVGZA0B5LegVGWYiA/NJBrJLVXZ6XjWKGFuQQemdgWwfld2UV40ixmFkUBpnIFumsofyqpEHdQrxoxmQzEK2JId7AiOsA/ibXq/KQNaS2Z4nXXwJ6wAu0+vDGchOctwTg5wwDiKv5RQfuSdVZj/QvBb0ihRDECM5iZgqfZBNpQyoAJZjDOnbC6Rj6BmMGMleR7n9xIOXlnLEcbARMW8OARuAacSvbUxQVABzga2Iy8rtdT0AfAX0K5COoaQDsArvNc7r80QhlA0b/TAbxF/AVKAr4q5yozkycFWIm6uiFnQMLfcAJ5DBWwQ0zeLeSXrfijzoFQmexjhKZ2POsplSrvf+G7BeoScBzEMevgp4IMd+mmkfJ4AmwagWDeYjD14JDHRp7wQsAK5P089NmM3kpSAVDDMjMSeHHi7tfYF9KvNymr6ewgxgFXBlcGqGF8tUGenS9iBwEjMo96bpa4XK/ajX9UDdwDQNIQ2RmXJSv1skgFeQQajGbCyX+/RVBzNTLwJ26vfxgWsdInogD/mTra4e8KXWHwMm6vfD+M+mzir3u5YHYuLDrQLVOkNqw6HaTa9bbHW3IIb034ibyvImb0DcU15cq9c1el2GRO6aAKsR/2Cb01c5c2pjALvq9QdbnTWo84G1wDVaXpemr14uchOAbUB7YBbyWn8O3AnUz03lcLEaec362uoWa90ILa/U8qA0fW1VuY1Aqa2+jvY/HzhCTX/hG0R4py7BuObtiUDbta4L8vD7tey3jp2D2WiSwDM+cuOROLHdAbEJ8XJHigsQ5f+w1ZUhA3Ec2UwuUZldafq6FbOBVOn3j4ABeG883RBj+x/Mbn9HDs9RMIYgin9mq7sO8xqCOBYsp4IfszDn59HI7m3Nrj3AC8BlHvfWR7zaSWpuZqFnOqL0s7a6sVo3T8tztPxomr6+UbnbtNwKidj9TOqrOhFJULLTFHOUjAxLEKWH2ere1LoJWv5eyzf49JNAHrwa96TKqxGj3HpVLWfDUuSVLUN8iUnS7/ShYgei9MW2unXUTBzaQ+om4+QKldmW5vdKkUjeEoy/0f6pBvpn9QQF5iiiuOVlTiBmRjVwNmIAW7HfRj79jFOZd7L47RbILF+PrJdridjggZltjyNrkLWQW8e6fpjZ0dmnnwUqMyZvmoaUAdS03ZyZBNNs9X4pHK+pzEqy92BHngHITKxEdkj7acM6gSSRc3Ezjz7Kgb0qNypvmkaMupg86M2ktwVHqcxe4j9vAKA7MiC/IicWK8Q51kO+BDNj36sNBcOOc2cdquXjiNniRjtM5sIZn6HwPqku/Fe1bjveseLJKrMD7yD8GcEuUs2X+sgZOQks9LgvgfG0PJdPBcNMG2QA9pHq1LXiJH52Xw9MnKV7nnQMNcNI9dKA7Mx/YgbQbz18kTMkKuekHsaBMNnRVoE5886xfXfLQGiMicplkoxeNFh/xrWLVMPZ8tTMoOZ6+KFHX/21/QgSEyl6eiHrVhWp7qtGmNOG5RjtiDG27/fo8wPcl4OiowwTC5nt0m5tHhsc9cMx8eOuzpuAczHB9uFBKRtG3sZ4jEsdbTdj4iRug/Q65tTith6OxhzzivLPXgdhZlEXR1s5xqn6iMf9DTC2n9t6WAJ8re1vBaBvqGiFcbW7nXMXadsq/M2RCzEhUrcEpI7IP1A1kgJXFJQgi3sSyYVx+vLuwwTA22bQ312YmexmQE/FmD4NclM5XDyEWZvOd7R1wOywd2fRp2XquNmHCcwfa8/MQd+88h3wbRblTkhMZA+pKRsJJEEoibjrs+m/IZJnY7/XTi/ENfYfcOlp6J8R2SQXWa75TMtjkId9HomS2ZkK9ESM6XFZ9n8MeZUrkdya0Y6+1yBZrKXUPKFkq3/BsXZWZ75LT8SYPoX89yW5MkL7P0pqRkJbbdt9Gv0XHGvHtOfrNUZsuaBcUXMxOTL1bPWtMXGWyPIx8hDLkUFsB3yBiYE4jelcaIjJlV4GnIecTKyd3+sMHQk6UTPVwvrsRGy2oGgP/OLyO/uQnT7StEZmwUHE1nsXmSVB0xyJHe9GTKaFFMHgxcTExMTExMTExBQt/wPtRjB5yTmw/QAAAABJRU5ErkJggg==" class="w-100">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="no-margin"></h5>
|
||||
<h5 class="no-margin" :class="{ 'text-info': parameters.type === 2, 'semi-bold': parameters.type === 2}">Drop Off</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-20" v-if="parameters.type !== ''">
|
||||
<div class="col bg-master-lightest p-t-15">
|
||||
<div class="row m-b-20 text-info">
|
||||
<div class="col">
|
||||
<h5 class="m-b-0 m-t-0 bold">Packing list</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<validation-wrapper-component selectable class="m-b-15" :validator="$v.productType">
|
||||
<label>Product Type</label>
|
||||
<selectable-component :endpoint="route('api.segment.air_shipment.price.list')" :section="section" valueColumn="details" :labelColumn="['name']" v-model="productType"></selectable-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.productDesc">
|
||||
<label>Product Description</label>
|
||||
<input class="form-control" v-model="parameters.product.productDesc">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.quantity">
|
||||
<label>Quantity</label>
|
||||
<input class="form-control" type="number" v-model="parameters.product.quantity">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.totalWeight">
|
||||
<label>Total Weight (KG)</label>
|
||||
<input type="text" class="form-control fs-12" v-model.trim="parameters.product.totalWeight" v-money="weight">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col" v-if="productTypeArray['hasGram'] === 'true'">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.gram">
|
||||
<label>Gram</label>
|
||||
<input class="form-control" v-model="parameters.product.gram">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="productTypeArray['hasDimensionCharges'] === 'true'">
|
||||
<div class="col-4">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.width">
|
||||
<label>Width</label>
|
||||
<input class="form-control" v-model="parameters.product.width">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.length">
|
||||
<label>Length</label>
|
||||
<input class="form-control" v-model="parameters.product.length">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.product.height">
|
||||
<label>Height</label>
|
||||
<input class="form-control" v-model="parameters.product.height">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="productTypeArray['isProhibited'] === 'true'" class="text-danger text-center">This item is blacklisted to ship to bangladish. <span class="text-underline text-complete">Black listed items list</span></p>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="btn btn-complete w-100 m-b-15 padding-10" :class="{'disabled': productTypeArray['isProhibited'] === 'true', 'not-allowed': productTypeArray['isProhibited'] === 'true'}" @click="addProduct()">Add Product</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="margin-15 padding-15 bg-master-lightest">
|
||||
<p class="m-b-15 bold fs-18">Order Summary</p>
|
||||
<p class="m-b-15 bold fs-15">Products</p>
|
||||
<div class="row" v-if="productList.length != 0">
|
||||
<div class="col">
|
||||
<div class="row m-l-0 m-r-0 m-b-10" v-for="(cartItem, index) in productList">
|
||||
<div class="col p-t-10 p-b-10 bg-white">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="bold no-margin">{{cartItem.productDesc}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="muted no-margin">{{ cartItem.quantity }} X {{ cartItem.productType }} - {{ cartItem.totalWeight }}KG</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto bg-white pointer" @click="removeElement(index)">
|
||||
<div class="row h-100 align-content-center justify-content-center">
|
||||
<div class="col">
|
||||
<i class="fa fa-times fs-12"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-l-0 m-r-0 m-b-10 b-a rounded b-primary-light" v-if="parameters.product.productDesc != '' || productType != ''">
|
||||
<div class="col p-t-10 p-b-10 bg-white">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="bold no-margin">{{parameters.product.productDesc}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="muted no-margin">{{parameters.product.quantity}} X {{ productTypeArray['name'] }} - {{ parameters.product.totalWeight }}KG</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="parameters.product.productDesc == '' && productType == '' && productList.length == 0">
|
||||
<div class="col">
|
||||
<p class="muted">There are no items added yet!</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="bold fs-15">Quotation</p>
|
||||
<div class="row justify-content-between m-b-5">
|
||||
<div class="col">Total Weight</div>
|
||||
<div class="col">{{ parameters.totalWeight }} kg</div>
|
||||
</div>
|
||||
<div class="row justify-content-between m-b-5">
|
||||
<div class="col">Service Type</div>
|
||||
<div class="col">{{ parameters.type === 1 ? 'Pick Up' : parameters.type === 2 ? 'Drop Off' : '' }}</div>
|
||||
</div>
|
||||
<div class="row justify-content-between m-b-5">
|
||||
<div class="col">Price Per kg</div>
|
||||
<div class="col">{{ parameters.pricePerKg }} RM</div>
|
||||
</div>
|
||||
<div class="row justify-content-between m-b-5">
|
||||
<div class="col">Shipping Fee</div>
|
||||
<div class="col">{{ parameters.totalShipping }} RM</div>
|
||||
</div>
|
||||
<div class="row justify-content-between">
|
||||
<div class="col">Special Product Tax</div>
|
||||
<div class="col">{{ parameters.totalTax }} RM</div>
|
||||
</div>
|
||||
<p class="text-complete text-underline pointer">What is this cost?</p>
|
||||
<div class="row m-t-15 justify-content-between">
|
||||
<div class="col fs-20 bold">Total</div>
|
||||
<div class="col fs-20 bold">{{ parameters.totalCombine }} RM</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-15">
|
||||
<div class="col">
|
||||
<div class="btn btn-success w-100 m-b-15 padding-10" @click="step++">Procced Next</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="step === 2">
|
||||
<div class="col">
|
||||
<new-registration-form-component section="loginSection"></new-registration-form-component>
|
||||
<div class="row m-t-15">
|
||||
<div class="col-auto">
|
||||
<div class="btn btn-default w-100 m-b-15 padding-10" @click="step--">back</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn btn-success w-100 m-b-15 padding-10" @click="step++">Procced Next</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="step === 3">
|
||||
<div class="col-8">
|
||||
<div class="row m-t-20">
|
||||
<div class="col bg-master-lightest p-t-15">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.pickUpAddress">
|
||||
<label>Pick up address</label>
|
||||
<input class="form-control" v-model="parameters.pickUpAddress">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.pickUpDate">
|
||||
<label>Pick up date</label>
|
||||
<date-picker-component v-model.lazy="parameters.pickUpDate"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.deliveryAddress">
|
||||
<label>Delivery address</label>
|
||||
<input class="form-control" v-model="parameters.deliveryAddress">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-20">
|
||||
<div class="col">
|
||||
<p>Addon Wrapping service</p>
|
||||
<div class="row m-l-5">
|
||||
<div class="col-4 p-r-10 p-l-0">
|
||||
<div class="padding-20 bg-master-light text-center pointer" @click="parameters.wrappingService = 'Pick Up' " :class="{'bg-complete-light': parameters.wrappingService === 'Pick Up', 'text-white': parameters.wrappingService === 'Pick Up',}">
|
||||
Wrap my goods
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 p-l-10">
|
||||
<div class="padding-20 bg-master-light text-center pointer" @click="parameters.wrappingService = 'Drop Off'" :class="{'bg-complete-light': parameters.wrappingService === 'Drop Off', 'text-white': parameters.wrappingService === 'Drop Off',}">
|
||||
No Thanks
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="margin-15 padding-15 bg-master-lightest">
|
||||
<p class="m-b-15 bold fs-18">Order Summary</p>
|
||||
<div class="row m-b-15">
|
||||
<div class="col">
|
||||
<p class="bold fs-15">Products</p>
|
||||
<p>1x product1 </p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="bold fs-15">Quotation</p>
|
||||
<div class="row justify-content-between m-b-5">
|
||||
<div class="col">Total Weight</div>
|
||||
<div class="col">15 kg</div>
|
||||
</div>
|
||||
<div class="row justify-content-between m-b-5">
|
||||
<div class="col">Service Type</div>
|
||||
<div class="col">{{ parameters.servicetype }}</div>
|
||||
</div>
|
||||
<div class="row justify-content-between m-b-5">
|
||||
<div class="col">Price Per kg</div>
|
||||
<div class="col">26 RM</div>
|
||||
</div>
|
||||
<div class="row justify-content-between m-b-5">
|
||||
<div class="col">Shipping Fee</div>
|
||||
<div class="col">200 RM</div>
|
||||
</div>
|
||||
<div class="row justify-content-between">
|
||||
<div class="col">Special Product Tax</div>
|
||||
<div class="col">50 RM</div>
|
||||
</div>
|
||||
<p class="text-complete text-underline pointer">What is this cost?</p>
|
||||
<div class="row m-t-15 justify-content-between">
|
||||
<div class="col fs-20 bold">Total</div>
|
||||
<div class="col fs-20 bold">50 RM</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-15">
|
||||
<div class="col">
|
||||
<div class="btn btn-success w-100 m-b-15 padding-10" @click="step++">Procced Next</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
import { required } from "vuelidate/lib/validators";
|
||||
import { VMoney } from 'v-money'
|
||||
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
section: 'createDelvieryOrderSectionComponent',
|
||||
weight: {decimal: '.',thousands: ',', precision: 1},
|
||||
step: 1,
|
||||
productType: '',
|
||||
productList: [],
|
||||
parameters : {
|
||||
type: '',
|
||||
|
||||
product: {
|
||||
productType: '',
|
||||
productDesc: '',
|
||||
quantity: '1',
|
||||
totalWeight: 10,
|
||||
gram: '',
|
||||
width: '',
|
||||
length: '',
|
||||
height: '',
|
||||
},
|
||||
|
||||
pickUpAddress: '',
|
||||
pickUpDate: '',
|
||||
deliveryAddress: '',
|
||||
wrappingService: '',
|
||||
|
||||
tax: 0,
|
||||
totalWeight: 0,
|
||||
pricePerKg: 0,
|
||||
totalShipping: 0,
|
||||
totalTax: 0,
|
||||
totalCombine: 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
productType: { },
|
||||
parameters: {
|
||||
product: {
|
||||
productDesc: { },
|
||||
quantity: { },
|
||||
totalWeight: { },
|
||||
gram: { },
|
||||
width: { },
|
||||
length: { },
|
||||
height: { },
|
||||
},
|
||||
|
||||
pickUpAddress: { },
|
||||
pickUpDate: { },
|
||||
deliveryAddress: { },
|
||||
wrappingService: { },
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
productTypeArray() {
|
||||
return this.productType === '' ? '' : JSON.parse(this.productType);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
addProduct() {
|
||||
// todo: change this to vuelidate
|
||||
if (this.parameters.product.productDesc != '' && this.productType != '') {
|
||||
|
||||
// add weight
|
||||
this.parameters.totalWeight += parseInt(this.parameters.product.totalWeight);
|
||||
|
||||
// has tax
|
||||
if (this.productTypeArray['tax']) {
|
||||
this.parameters.totalTax += parseInt(this.productTypeArray['tax']);
|
||||
}
|
||||
|
||||
var itemShippingFee = 0;
|
||||
|
||||
// pricePerKg * kg
|
||||
if (this.productTypeArray['pricePerKg']) {
|
||||
|
||||
// add pricePerKg
|
||||
this.parameters.pricePerKg += parseInt(this.productTypeArray['pricePerKg']);
|
||||
|
||||
itemShippingFee += parseInt(this.productTypeArray['pricePerKg']) * parseInt(this.parameters.product.totalWeight);
|
||||
}
|
||||
|
||||
// pricePerPcs * quantity
|
||||
if (this.productTypeArray['pricePerPcs']) {
|
||||
itemShippingFee += parseInt(this.productTypeArray['pricePerPcs']) * this.parameters.product.quantity;
|
||||
}
|
||||
|
||||
this.productList.push(
|
||||
{
|
||||
productType: this.productTypeArray['name'],
|
||||
productDesc: this.parameters.product.productDesc,
|
||||
quantity: this.parameters.product.quantity,
|
||||
gram: '',
|
||||
width: '',
|
||||
length: '',
|
||||
height: '',
|
||||
|
||||
totalWeight: this.parameters.product.totalWeight,
|
||||
itemTax: this.productTypeArray['tax'],
|
||||
pricePerKg: this.productTypeArray['pricePerKg'],
|
||||
itemShippingFee: itemShippingFee,
|
||||
}
|
||||
);
|
||||
|
||||
this.parameters.totalShipping += itemShippingFee;
|
||||
this.parameters.totalCombine += ( itemShippingFee + parseInt(this.productTypeArray['tax'] == '' ? 0 : this.productTypeArray['tax']) );
|
||||
|
||||
this.parameters.product.productDesc = '' ;
|
||||
this.productType = '';
|
||||
}
|
||||
},
|
||||
removeElement(index) {
|
||||
var itemRemoved = this.productList.splice(index, 1)[0];
|
||||
|
||||
// remove weight
|
||||
this.parameters.totalWeight -= parseInt(itemRemoved['totalWeight']);
|
||||
|
||||
// has tax
|
||||
if (itemRemoved['itemTax']) {
|
||||
this.parameters.totalTax -= parseInt(itemRemoved['itemTax']);
|
||||
}
|
||||
|
||||
if (itemRemoved['itemShippingFee']) {
|
||||
this.parameters.totalShipping -= parseInt(itemRemoved['itemShippingFee']);
|
||||
}
|
||||
|
||||
// remove pricePerKg
|
||||
if (itemRemoved['pricePerKg']) {
|
||||
this.parameters.pricePerKg -= parseInt(itemRemoved['pricePerKg']);
|
||||
}
|
||||
|
||||
this.parameters.totalCombine -= ( parseInt(itemRemoved['itemShippingFee']) + parseInt(itemRemoved['itemTax'] == '' ? 0 : parseInt(itemRemoved['itemTax'])) );
|
||||
|
||||
}
|
||||
},
|
||||
mixins: [componentHandler],
|
||||
directives: {money: VMoney}
|
||||
}
|
||||
</script>
|
||||
+256
@@ -0,0 +1,256 @@
|
||||
<template>
|
||||
<div class="row m-b-15 m-l-5 m-r-10 parentContainer">
|
||||
<div class="col bg-white rounded">
|
||||
<div class="row">
|
||||
<div class="col padding-20">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Marking</p>
|
||||
<div class="no-margin">
|
||||
<div v-if="item.order">
|
||||
<a :href="route('customer.profile', item.order.company_module.marking)">{{item.order.company_module.marking}}</a>/<a :href="route('order.show', item.order.reference)">{{item.order.reference}}</a>
|
||||
<p v-if="item.receive_packing_list">{{item.receive_packing_list.transport.drop_date}}</p>
|
||||
</div>
|
||||
<div v-if="!item.order" class="text-danger">Unclaimed Packing List</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Invoice Date</p>
|
||||
<div v-if="!item.shippng_transaction">n/a</div>
|
||||
<div v-if="item.shippng_transaction"> {{ item.shippng_transaction.updated_at }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Status</p>
|
||||
<div class="all-caps">{{ invoice_status }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Amount</p>
|
||||
<div v-if="!item.shippng_transaction">n/a</div>
|
||||
<div v-if="item.shippng_transaction">MYR {{ item.shippng_transaction.amount.toFixed(2) }}</div>
|
||||
</div>
|
||||
<div class="col-auto p-l-0 p-r-0" v-if="['Pending Payment', 'Paid Invoice'].includes(invoice_status)">
|
||||
<div v-if="item.shippng_transaction">
|
||||
<div v-if="item.shippng_transaction.documents.length">
|
||||
<div v-for="file in item.shippng_transaction.documents[0].files" v-bind:key="file.id" class="col-auto no-padding">
|
||||
<document-file-viewer-component :file="file">
|
||||
<template slot="button">
|
||||
<div class="btn bg-grey no-border muted">
|
||||
<i class="fa fa-file-pdf-o"></i>
|
||||
</div>
|
||||
</template>
|
||||
</document-file-viewer-component>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="btn bg-grey no-border muted invisible">
|
||||
<i class="fa fa-file-pdf-o"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn bg-grey no-border" @click="expanded = !expanded" v-if="['Pending Approval', 'Pending Payment'].includes(invoice_status)">
|
||||
<i class="fa" :class="{'fa-angle-down': !expanded, 'fa-angle-up': expanded}" ></i>
|
||||
</div>
|
||||
<div v-if="!item.shippng_transaction">
|
||||
<div class="btn btn-outline-primary btn-lg pointer" @click="generateInvoice()">Generate Invoice</div>
|
||||
</div>
|
||||
<div class="btn bg-grey no-border muted requestModal" v-if="item.shippng_transaction && invoice_status == 'Pending Approval'" data-type="confirmInvoice">
|
||||
<i class="fa fa-check fs-12"></i>
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="confirmInvoice">
|
||||
<approve-shipping-invoice-form-component :section="section" :data="data"></approve-shipping-invoice-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded" v-if="item.shippng_transaction && invoice_status == 'Pending Approval'">
|
||||
<div class="col p-b-10">
|
||||
<div class="row">
|
||||
<div class="col p-l-20 p-r-20 p-t-10 p-b-10">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Container Reference</p>
|
||||
<div>{{ item.packages.length ? item.packages[0].container.container_reference : 'n/a' }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Due Date</p>
|
||||
<div v-if="item.packages.length">
|
||||
<div v-if="item.packages[0].container.transport">{{ item.packages[0].container.transport.drop_date == null ? item.packages[0].container.transport.current_schedule.etd : item.packages[0].container.transport.drop_date }}</div>
|
||||
<div v-else>n/a</div>
|
||||
</div>
|
||||
<div v-else>n/a</div>
|
||||
</div>
|
||||
<!-- <div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Paid Date</p>
|
||||
<div>n/a</div>
|
||||
</div> -->
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Total CBM</p>
|
||||
<div>{{ (parseFloat(cbm) + parseFloat(overweight)).toFixed(3) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5 class="text-underline text-center">Invoice Details</h5>
|
||||
<invoice-items-form-component :data="item.shippng_transaction" :section="section"></invoice-items-form-component>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Subtotal</p>
|
||||
<div>{{ item.shippng_transaction.amount - item.shippng_transaction.service_charge - item.shippng_transaction.tax }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Service Charges</p>
|
||||
<div>{{ item.shippng_transaction.service_charge }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Tax</p>
|
||||
<div>{{ item.shippng_transaction.tax }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Total</p>
|
||||
<div>{{ item.shippng_transaction.amount }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded" v-if="item.shippng_transaction && invoice_status == 'Pending Payment'">
|
||||
<div class="col-12 col-md-7 padding-20">
|
||||
<div class="row bg-master-lightest h-100">
|
||||
<div class="col">
|
||||
<div class="row bg-master-lightest" v-if="item.shippng_transaction.payment_attempts.length">
|
||||
<div class="col">
|
||||
<div class="row m-t-10 m-b-10">
|
||||
<div class="col">
|
||||
<div class="font-head fs-10 all-caps">Payment Attempt</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<shipping-transaction-component v-for="item in item.shippng_transaction.payment_attempts" v-bind:key="item.id" :data="item" ></shipping-transaction-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row bg-master-lightest" v-if="item.shippng_transaction.payment_history.length">
|
||||
<div class="col">
|
||||
<div class="row m-t-10 m-b-10">
|
||||
<div class="col">
|
||||
<div class="font-head fs-10 all-caps">Payment History</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<payment-history-component v-for="item in item.shippng_transaction.payment_history" v-bind:key="item.id" :data="item" ></payment-history-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-5 padding-20 parentContainer">
|
||||
<div class="row bg-master-lightest h-100">
|
||||
<div class="col">
|
||||
<div class="row padding-10">
|
||||
<div class="col">
|
||||
<div class="row align-items-end m-b-10 text-complete">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-12">Total Amount:</div>
|
||||
</div>
|
||||
<div class="col-auto text-right">
|
||||
<div class="font-heading fs-12">MYR {{(Math.round((item.shippng_transaction.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-end m-b-10 text-success">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-12">Paid Total:</div>
|
||||
</div>
|
||||
<div class="col-auto text-right">
|
||||
<!-- <div class="font-heading fs-12">MYR {{(Math.round((item.shippng_transaction.paid_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div> -->
|
||||
<div class="font-heading fs-12">Paid Total</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-end m-b-10 ">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-12">Floating Amount:</div>
|
||||
</div>
|
||||
<div class="col-auto text-right">
|
||||
<!-- <div class="font-heading fs-12">MYR {{(Math.round((item.shippng_transaction.floating_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div> -->
|
||||
<div class="font-heading fs-12">Floating Amount</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-end bold text-danger">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-12">OutStanding Total:</div>
|
||||
</div>
|
||||
<div class="col-auto text-right">
|
||||
<div class="font-heading fs-12">MYR {{(Math.round((item.shippng_transaction.outstanding + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="row m-t-20" v-if="item.shippng_transaction.outstanding > 0"> -->
|
||||
<div class="row m-t-20">
|
||||
<div class="col">
|
||||
<div class="btn btn-sm all-caps b-rad-none btn-success btn-block requestModal" data-type="makePayment">Make Payment</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="makePayment">
|
||||
<payment-form-component :data="item.shippng_transaction" :section="section"></payment-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
props: {
|
||||
invoice_status: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
section:{
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
parameters: {
|
||||
packing_list_id: null,
|
||||
transaction_details: [],
|
||||
},
|
||||
expanded: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
cbm () {
|
||||
return (Math.ceil((this.item.packages.reduce((total, obj) => (obj.type === 2 ? 0 : obj.cbm) + total, 0)) * 1000) / 1000).toFixed(3)
|
||||
},
|
||||
overweight(){
|
||||
return (Math.ceil((this.item.packages.reduce((total, obj) => (obj.type === 2 ? obj.cbm : 0) + total, 0)) * 1000) / 1000).toFixed(3)
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.parameters.packing_list_id = this.data.id;
|
||||
},
|
||||
methods: {
|
||||
generateInvoice() {
|
||||
this.submit(this.route('api.transaction.invoice.create'), 'post', this.section, true, true);
|
||||
},
|
||||
successHandler(response){
|
||||
this.item = response.payload.data;
|
||||
// this.$forceUpdate();
|
||||
}
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<div class="row m-l-0 m-b-10 m-r-0 parentContainer" :class="[{'b-a': item.status === 4}, {'b-danger': item.status === 4}, {'b-a': item.status === 5}, {'b-danger': item.status === 5}]" >
|
||||
<div class="col">
|
||||
<div class="row" v-if="!item.transaction_bill">
|
||||
<div class="col">
|
||||
<div class="row bg-white ">
|
||||
<div class="col p-t-10 p-b-10 p-r-0 pointer" @click="clickExpand()" :class="[{'bg-master-lighter': item.status === 1 && item.type !== 6}, {'bg-white': item.status !== 1 && item.status !== 4}, {'bg-warning-lighter': item.type === 6}]">
|
||||
<div class="row m-b-5">
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-8 muted all-caps">Status</div>
|
||||
<div class="font-heading fs-10 bold" :class="[{'text-danger': item.status === 1 || item.status === 4}, {'text-success': item.status !== 1 && item.status !== 4}]">
|
||||
{{ item.status === 1 ? 'Pending Verification' : item.status === ( 4 || 5) ? 'Rejected' : 'Processing Payment'}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto p-l-0">
|
||||
<div class="font-heading fs-8 muted all-caps">Payment Amount</div>
|
||||
<div class="font-heading fs-10 bold">
|
||||
{{item.currency.short_code}} {{(Math.round((item.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading fs-8 all-caps" :class="[{'text-danger': item.status === 4}, {'text-primary': item.status !== 4}]">{{ item.status === 2 ? 'Received' : item.status === 4 ? 'Rejected' : 'Submitted'}} On: {{item.updated_at}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto" v-if="item.status !== 3" :class="[{'bg-master-light': item.status === 1 && item.type !== 6}, {'bg-master-lighter': item.status === 2}, {'bg-warning-light': item.type === 6}]">
|
||||
<div class="row align-items-center h-100" v-if="item.status !== 1 || item.payment_method !== 5">
|
||||
<div class="col">
|
||||
<i class="fa" :class="[{'fa-cloud-download': item.status === 1 || item.status === 2}, {'fa-ban': item.status === 4}, {'muted': item.status === 1 || item.status === 2}, {'text-danger': item.status === 4}]"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center h-100" v-if="item.payment_method === 5 && item.status === 1">
|
||||
<div class="col">
|
||||
<a :href="route('billplz.bill', item.payment_reference)"><i class="fa fa-repeat text-success"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row b-t b-grey" v-if="expandPaymentDetails">
|
||||
<div class="col bg-white padding-15">
|
||||
<!-- <div class="row align-items-end m-b-10 text-success bold">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-10">Recipient Gets</div>
|
||||
</div>
|
||||
<div class="col-auto text-right">
|
||||
<div class="font-heading fs-10">{{item.original_currency.short_code}} {{(item.original_amount).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-end bold m-b-10 text-primary">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-10">Rate</div>
|
||||
</div>
|
||||
<div class="col-auto text-right">
|
||||
<div class="font-heading fs-10 ">{{(Math.round((item.currency_rate + Number.EPSILON) * 100000) / 100000).toFixed(5) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-end m-b-10 hint-text">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-10">Transfer Charges</div>
|
||||
</div>
|
||||
<div class="col-auto text-right">
|
||||
<div class="font-heading fs-10">MYR {{(Math.round((item.service_charge + Number.EPSILON) * 100) / 100).toFixed(2)}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-end m-b-5 hint-text">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-10">Tax</div>
|
||||
</div>
|
||||
<div class="col-auto text-right">
|
||||
<div class="font-heading fs-10">MYR {{(Math.round((item.tax + Number.EPSILON) * 100) / 100).toFixed(2)}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-end m-b-10 bold text-success">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-10">Your Payment</div>
|
||||
</div>
|
||||
<div class="col-auto text-right">
|
||||
<div class="font-heading fs-12">MYR {{(Math.round((item.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-10 m-b-5">Your Payment Proof</div>
|
||||
<div class="row no-margin" v-if="item.payment_method !== 5">
|
||||
<div v-if="item.documents.length">
|
||||
<div v-for="file in item.documents[0].files" v-bind:key="file.id" class="col-auto no-padding m-r-5">
|
||||
<document-file-viewer-component :file="file">
|
||||
<template slot="button">
|
||||
<div class="icon-thumbnail fs-11 text-white icon-25 bg-primary btn-rounded float-left m-r-5">
|
||||
<i class="fa fa-file-image-o fs-10"></i>
|
||||
</div>
|
||||
</template>
|
||||
</document-file-viewer-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row no-margin" v-if="item.payment_method === 5 && (item.status === 2 || item.status === 3)">
|
||||
<a :href="route('billplz.bill', item.payment_reference)" target="_blank">
|
||||
<div class="icon-thumbnail fs-11 text-white icon-25 bg-primary btn-rounded float-left m-r-5">
|
||||
<i class="fa fa-file-image-o fs-10"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
expandPaymentDetails: false,
|
||||
amount: (Math.round(1000 * 100) / 100).toFixed(2),
|
||||
parameters: {
|
||||
amount: (Math.round(1000 * 100) / 100).toFixed(2),
|
||||
bank_id: 1
|
||||
},
|
||||
section: 'bookingDetailSection',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickExpand(){
|
||||
this.expandPaymentDetails = !this.expandPaymentDetails;
|
||||
},
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
</script>
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<div class="row m-b-10 parentContainer">
|
||||
<div class="col">
|
||||
<loading-component style="height: 200px; top: 0;" key="1" color="success" v-show="isLoading"></loading-component>
|
||||
<div class="row p-b-5 b-b b-grey" v-show="!isLoading">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row m-b-10">
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-10 muted all-caps">Date</div>
|
||||
<div class="font-heading fs-10">
|
||||
{{ item.updated_at }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-auto">
|
||||
<div class="font-heading fs-10 muted all-caps">Order No</div>
|
||||
<div class="font-heading fs-10">
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <div class="col-auto">
|
||||
<div class="font-heading fs-10 muted all-caps">Marking</div>
|
||||
<div class="font-heading fs-10">
|
||||
<a :href="route('customer.profile', item.booking.company.reference)">{{item.booking.company.reference}}</a>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col text-right">
|
||||
<div class="font-heading fs-10 muted all-caps">Amount</div>
|
||||
<div class="font-heading fs-14 text-success bold">
|
||||
{{(Math.round((item.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<div class="font-heading fs-10 muted all-caps">Payment Proof</div>
|
||||
<div class="row no-margin" v-if="item.payment_method !==5 && item.payment_method !==4">
|
||||
<div v-for="file in item.documents[0].files" v-bind:key="file.id" class="col-auto no-padding">
|
||||
<document-file-viewer-component :file="file">
|
||||
<template slot="button">
|
||||
<div class="icon-thumbnail fs-11 text-white icon-25 bg-primary btn-rounded float-left m-r-5">
|
||||
<i class="fa fa-file-image-o fs-10"></i>
|
||||
</div>
|
||||
</template>
|
||||
</document-file-viewer-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row no-margin" v-if="item.payment_method ===5">
|
||||
<div class="col no-padding">
|
||||
<a :href="route('billplz.bill', item.payment_reference)" target="_blank">
|
||||
<div class="icon-thumbnail fs-11 text-white icon-25 bg-complete btn-rounded float-left m-r-5">
|
||||
Bz
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row no-margin" v-if="item.payment_method ===4">
|
||||
<div class="col no-padding">
|
||||
<div class="font-heading fs-10">{{item.payment_reference}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-auto">
|
||||
<div class="font-heading fs-10 muted all-caps">Service</div>
|
||||
<div class="font-heading fs-10">
|
||||
{{item.booking.service.name}}
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <div class="col">
|
||||
<div class="font-heading fs-10 muted all-caps">Booking</div>
|
||||
<div class="font-heading fs-10">
|
||||
{{item.original_currency.short_code}} {{(Math.round((item.original_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-auto">
|
||||
<div class="row">
|
||||
<div v-if="!no_action" class="col-6 col-md-auto text-right">
|
||||
<button class="btn btn-xs btn-outline-danger b-rad-none m-r-5 requestModal" data-type="rejectPayment">
|
||||
<i class="fa fa-times fa-fw"></i>
|
||||
</button>
|
||||
<button class="btn btn-xs btn-success b-rad-none requestModal" data-type="approvePayment">
|
||||
<i class="fa fa-check fa-fw"></i>
|
||||
</button>
|
||||
<modal-component small type="rejectPayment">
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<h5 class="all-caps">Reject Document</h5>
|
||||
<div class="fs-11">Are you sure you want to reject this payment?</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-r-5">
|
||||
<div data-dismiss="modal" class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div data-dismiss="modal" class="btn btn-sm btn-danger btn-block b-rad-none" @click="approvePayment('reject')">Reject</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</modal-component>
|
||||
<modal-component small type="approvePayment">
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<h5 class="all-caps">Approve Payment</h5>
|
||||
<div class="fs-11">Are you sure you want to approve this payment?</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-r-5">
|
||||
<div data-dismiss="modal" class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div data-dismiss="modal" class="btn btn-sm btn-success btn-block b-rad-none" @click="approvePayment('approve')">Approve</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
import staticFormHandler from '../../../general/mixins/staticFormHandler'
|
||||
export default {
|
||||
props: {
|
||||
no_action: Boolean
|
||||
},
|
||||
methods: {
|
||||
approvePayment(status){
|
||||
this.isLoading = true;
|
||||
this.submit(this.route('api.transaction.payment.approval', this.item.id, status), 'put', 'identificationVerificationSection', true, true);
|
||||
},
|
||||
},
|
||||
mixins: [componentHandler, staticFormHandler]
|
||||
}
|
||||
</script>
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="row m-l-0 m-b-10 m-r-0 parentContainer">
|
||||
<div class="col-auto bg-master-lighter requestModal pointer" data-type="deleteAttempt">
|
||||
<div class="row align-items-center h-100">
|
||||
<div class="col">
|
||||
<i class="fa fa-times muted"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col bg-white p-t-10 p-b-10 p-r-0">
|
||||
<div class="row m-b-5">
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-8 muted all-caps">Payment Amount</div>
|
||||
<div class="font-heading fs-10 bold">
|
||||
MYR {{(Math.round((item.original_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto p-l-5 p-r-5 bg-success pointer" v-if="item.payment_method === 5">
|
||||
<a :href="route('billplz.bill', item.payment_reference)">
|
||||
<div class="row align-items-center h-100">
|
||||
<div class="col">
|
||||
<i class="fa fa-repeat fs-20 text-white p-l-10 p-r-10"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-auto p-l-5 p-r-5 bg-success requestModal pointer" v-if="item.payment_method !== 5" data-type="paymentProofModal">
|
||||
<div @click="selectedID(item.id)" class="row align-items-center h-100">
|
||||
<div class="col">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="30" height="30" viewBox="0 0 172 172" style=" fill:#000000;"><defs><linearGradient x1="86" y1="70.76994" x2="86" y2="116.46013" gradientUnits="userSpaceOnUse" id="color-1_52139_gr1"><stop offset="0" stop-color="#ffffff"></stop><stop offset="1" stop-color="#ffffff"></stop></linearGradient><linearGradient x1="61.8125" y1="34.48869" x2="61.8125" y2="144.97181" gradientUnits="userSpaceOnUse" id="color-2_52139_gr2"><stop offset="0" stop-color="#ffffff"></stop><stop offset="1" stop-color="#ffffff"></stop></linearGradient><linearGradient x1="130.34375" y1="34.48869" x2="130.34375" y2="144.97181" gradientUnits="userSpaceOnUse" id="color-3_52139_gr3"><stop offset="0" stop-color="#ffffff"></stop><stop offset="1" stop-color="#ffffff"></stop></linearGradient><linearGradient x1="86" y1="32.25" x2="86" y2="148.71013" gradientUnits="userSpaceOnUse" id="color-4_52139_gr4"><stop offset="0" stop-color="#ffffff"></stop><stop offset="1" stop-color="#ffffff"></stop></linearGradient></defs><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><path d="M102.45825,99.43213h-5.70825c-1.4835,0 -2.6875,1.16637 -2.6875,2.65256v8.10013c0,1.48081 -1.19862,2.68481 -2.67944,2.68481h-10.76612c-1.48081,0 -2.67944,-1.204 -2.67944,-2.68481v-8.10013c0,-1.48619 -1.204,-2.65256 -2.6875,-2.65256h-5.70825c-1.93769,0 -3.04225,-2.39188 -1.88125,-4.05275l14.577,-20.855c1.8275,-2.61494 5.69481,-2.61763 7.52231,-0.00538l14.577,20.86306c1.16369,1.66088 0.05644,4.05006 -1.87856,4.05006z" fill="url(#color-1_52139_gr1)"></path><path d="M51.0625,67.1875h5.375c0,-8.0625 7.23206,-16.12231 16.125,-16.12231v-5.375c-11.85456,0 -21.5,10.74731 -21.5,21.49731z" fill="url(#color-2_52139_gr2)"></path><path d="M139.75,80.625c0,-10.75 -8.44144,-18.80981 -18.8125,-18.80981v5.375c7.40944,0 13.4375,5.37231 13.4375,13.43481z" fill="url(#color-3_52139_gr3)"></path><path d="M148.09738,92.27263c1.59369,-3.68188 2.40263,-7.59219 2.40263,-11.64494c0,-16.29969 -13.26281,-29.5625 -29.5625,-29.5625c-6.5145,0 -12.68769,2.08819 -17.78588,5.96088c-4.30269,-13.03438 -16.52006,-22.08587 -30.58912,-22.08587c-17.78319,0 -32.25,14.46681 -32.25,32.25c0,4.14681 0.16662,8.05981 1.42437,10.74731h-1.42437c-13.33806,0 -24.1875,10.84944 -24.1875,24.1875c0,11.56431 8.16194,21.24737 19.0275,23.62044c1.02394,6.39894 6.53869,11.31706 13.2225,11.31706h56.4375h16.125h5.375c6.54944,0 12.00238,-4.71388 13.18488,-10.92469c9.2235,-1.20131 16.37762,-9.08913 16.37762,-18.63513c0,-6.09256 -2.924,-11.72019 -7.77762,-15.23006zM126.3125,131.6875h-5.375h-16.125h-56.4375c-3.49912,0 -6.45538,-2.6875 -7.568,-5.375h93.0735c-1.11263,2.6875 -4.06888,5.375 -7.568,5.375zM137.0625,120.9375h-96.75c-10.37106,0 -18.8125,-8.44144 -18.8125,-18.8125c0,-10.37106 8.44144,-18.8125 18.8125,-18.8125h9.51375l-1.68506,-3.78131c-2.23063,-5.01488 -2.45369,-7.48737 -2.45369,-12.341c0,-14.81888 12.05613,-26.875 26.875,-26.875c13.01825,0 24.13106,9.29875 26.42619,22.11275l0.92719,5.17075l3.64962,-3.77325c4.60638,-4.76225 10.77687,-7.38525 17.372,-7.38525c13.33806,0 24.1875,10.84944 24.1875,24.1875c0,3.6765 -0.81431,7.21056 -2.37575,10.41944l-1.763,3.32713l2.37037,1.26044c4.40481,2.34081 7.14338,6.88806 7.14338,11.868c0,7.40944 -6.02806,13.43481 -13.4375,13.43481z" fill="url(#color-4_52139_gr4)"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="deleteAttempt">
|
||||
<delete-payment-attempt-form-component :data="item" :section="section" class="text-center"></delete-payment-attempt-form-component>
|
||||
</modal-component>
|
||||
<modal-component type="paymentProofModal">
|
||||
<payment-verification-form-component v-if="selected_id == item.id" :section="section" :data="item"></payment-verification-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
expandPaymentDetails: false,
|
||||
amount: (Math.round(1000 * 100) / 100).toFixed(2),
|
||||
selected_id: '',
|
||||
parameters: {
|
||||
amount: (Math.round(1000 * 100) / 100).toFixed(2),
|
||||
bank_id: 1
|
||||
},
|
||||
section: 'bookingDetailSection',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickExpand(){
|
||||
this.expandPaymentDetails = !this.expandPaymentDetails;
|
||||
},
|
||||
selectedID(id){
|
||||
this.selected_id = id;
|
||||
}
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
</script>
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<div class="row" @keyup.enter="submitForm">
|
||||
<div class="col bg-white padding-40 b-rad-lg">
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<h5 class="all-caps">Approve Invoice</h5>
|
||||
<div class="fs-11">Are you sure you want to approve this invoice?</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-r-5">
|
||||
<div data-dismiss="modal" class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div class="btn btn-success w-100 btn-sm" @click="submit(route('api.transaction.invoice.approve', data.id), 'put', section, true, true)">Confirm</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import modalFormHandler from '../../../general/mixins/modalFormHandler';
|
||||
export default {
|
||||
mixins: [modalFormHandler]
|
||||
}
|
||||
|
||||
</script>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<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">Are you Sure?</h3>
|
||||
<div class="fs-11">Are you sure you want to delete payment booking? you will not be able to recover your booking after confirming your action.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-r-5">
|
||||
<div class="btn btn-sm btn-success btn-block b-rad-none" data-dismiss="modal">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div class="btn btn-sm btn-danger btn-block b-rad-none" @click="submit(route('api.transaction.suspend', item.id), 'delete', section, true, true)">Delete</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
|
||||
export default {
|
||||
mixins: [componentHandler, ModalFormHandler]
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<div class="row bg-white b-a b-grey rounded padding-10" v-if="!isEdit">
|
||||
<div class="col">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto"><div class="icon-thumbnail icon-35 mr-0 bg-master-lightest light">{{index + 1}}</div></div>
|
||||
<div class="col">
|
||||
<p class="m-b-0 small muted">Name</p>
|
||||
<p class="m-b-0 bold">{{product.name}}</p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="m-b-0 small muted">Unit Price</p>
|
||||
<p class="m-b-0 bold">{{product.price}}</p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="m-b-0 small muted">Quantity</p>
|
||||
<p class="m-b-0 bold">{{product.quantity}}</p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="m-b-0 small muted">Total</p>
|
||||
<p class="m-b-0 bold text-success">{{currency}} {{(Math.round((productTotal + Number.EPSILON) * 100) / 100).toFixed(2)}}</p>
|
||||
</div>
|
||||
<div class="col-auto" :class="{ 'invisible': ['SHIPPING_FEE', 'OVER_WEIGHT_CHARGES'].includes(product.reference) }">
|
||||
<div @click="isEdit = !isEdit" class="pointer">
|
||||
<i class="fa fa-pencil" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto" :class="{ 'invisible': ['SHIPPING_FEE', 'OVER_WEIGHT_CHARGES'].includes(product.reference) }">
|
||||
<div @click="$emit('remove')" class="pointer">
|
||||
<i class="fa fa-close" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="isEdit">
|
||||
<div class="col padding-25 bg-master-lightest">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.product.name">
|
||||
<label>Name</label>
|
||||
<input class="form-control" v-model="product.name">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.product.price">
|
||||
<label>Unit Price</label>
|
||||
<input class="form-control" v-model="product.price">
|
||||
<!-- <input class="form-control" v-model="product.price" v-money="{decimal: '.',thousands: '', precision: 2}"> -->
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.product.quantity">
|
||||
<label>Quantity</label>
|
||||
<!-- <input class="form-control" v-model="product.quantity" v-money="{decimal: '.',thousands: '', precision: 2}"> -->
|
||||
<input class="form-control" v-model="product.quantity" >
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>{{ data }}</p>
|
||||
|
||||
<div class="row m-t-15">
|
||||
<div class="col">
|
||||
<p class="m-b-0 small">Total</p>
|
||||
<h6 class="no-margin bold text-complete">{{currency}} {{productTotal.toFixed(3)}}</h6>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<button class="btn btn-lg btn-secondary b-rad-none" @click="cancelUpdate()">Cancel</button>
|
||||
<button class="btn btn-lg btn-outline-success b-rad-none" @click="updateProduct()">Save Changes</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import formHandler from '../../../general/mixins/formHandler';
|
||||
import { required } from "vuelidate/lib/validators";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
editable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
currency:{
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
index:{
|
||||
type: Number,
|
||||
// required: true
|
||||
default: 0
|
||||
},
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
isEdit: false,
|
||||
product: {
|
||||
name: '',
|
||||
quantity: 0,
|
||||
price: 0,
|
||||
amount: 0,
|
||||
},
|
||||
products: []
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
product: {
|
||||
name: { required },
|
||||
quantity: { required },
|
||||
price: { required },
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.data) {
|
||||
this.product = this.data;
|
||||
} else {
|
||||
this.isEdit = true;
|
||||
}
|
||||
this.product.amount = (Math.round((this.product.amount+ Number.EPSILON) * 1000) / 1000).toFixed(3);
|
||||
},
|
||||
computed: {
|
||||
productTotal(){
|
||||
return this.product.quantity * parseFloat((this.product.price).toString().replace(',', ''));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
clearInterval(){
|
||||
clearInterval(this.interval);
|
||||
this.interval = false;
|
||||
},
|
||||
updateProduct(){
|
||||
if (!this.data) {
|
||||
this.$emit('add', {
|
||||
name: this.product.name,
|
||||
quantity: this.product.quantity,
|
||||
reference: 'CUSTOM_CHARGES',
|
||||
price: parseFloat((this.product.price).toString().replace(',', '')),
|
||||
amount: this.productTotal
|
||||
});
|
||||
|
||||
} else {
|
||||
this.isEdit = !this.isEdit;
|
||||
|
||||
console.log(this.data.reference);
|
||||
|
||||
this.$emit('change', {
|
||||
name: this.product.name,
|
||||
quantity: this.product.quantity,
|
||||
reference: this.data.reference,
|
||||
price: parseFloat((this.product.price).toString().replace(',', '')),
|
||||
amount: this.productTotal
|
||||
}, this.index);
|
||||
}
|
||||
},
|
||||
cancelUpdate() {
|
||||
if (!this.data) {
|
||||
this.$emit('change', 'cancelAddProduct', true);
|
||||
} else {
|
||||
this.isEdit = !this.isEdit;
|
||||
this.product = this.data;
|
||||
}
|
||||
}
|
||||
},
|
||||
mixins: [formHandler]
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row no-margin">
|
||||
<div class="col p-b-15 p-l-0 p-r-0">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row" v-for="(detail, index) in details">
|
||||
<div class="col p-b-10 p-t-10 " :class="[{'b-grey' : index !== Object.keys(details).length - 1}, {'b-b' : index !== Object.keys(details).length - 1}]">
|
||||
<invoice-item-form-component :data="detail" :index="index" currency="MYR" :editable="!submitted" :section="section" @change="updateProduct($event, index)" v-on:remove="removeProduct(index)"></invoice-item-form-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" v-if="addCharges">
|
||||
<div class="col">
|
||||
<invoice-item-form-component currency="MYR" :editable="!submitted" :section="section" @change="addCharges = !addCharges" @add="addProduct($event)" v-on:remove="removeProduct(index)"></invoice-item-form-component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row d-flex justify-content-center allign-items-between align-items-center m-b-15">
|
||||
<div class="col-auto">
|
||||
<div class="btn btn-outline-primary btn-md" @click="addCharges = !addCharges">{{ addCharges? 'Cancel' : 'Add Charges' }}</div>
|
||||
<div class="btn btn-outline-primary btn-md" @click="submitForm()">Save Change</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import formHandler from '../../../general/mixins/formHandler';
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
interval:false,
|
||||
addCharges:false,
|
||||
canSubmitChanges:false,
|
||||
submitted: false,
|
||||
details: this.data.details,
|
||||
canSaveChange: false,
|
||||
parameters: {
|
||||
transaction_details: []
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateProduct(product, index) {
|
||||
this.details[index] = {
|
||||
name: product.name,
|
||||
quantity: product.quantity,
|
||||
reference: product.reference,
|
||||
price: parseFloat((product.price).toString().replace(',', '')),
|
||||
amount: parseFloat((product.amount).toString().replace(',', '')),
|
||||
};
|
||||
},
|
||||
removeProduct(index) {
|
||||
this.canSubmitChanges = !this.canSubmitChanges;
|
||||
this.data.details.splice(index, 1);
|
||||
},
|
||||
addProduct(newProduct) {
|
||||
this.canSubmitChanges = !this.canSubmitChanges;
|
||||
this.addCharges = !this.addCharges;
|
||||
this.details.push(newProduct);
|
||||
},
|
||||
submitForm() {
|
||||
this.canSubmitChanges = !this.canSubmitChanges;
|
||||
this.parameters.transaction_details = this.details;
|
||||
|
||||
console.log(this.parameters.transaction_details);
|
||||
|
||||
this.submit(this.route('api.transaction.invoice.update', this.data.id), 'put', this.section, true, true);
|
||||
}
|
||||
},
|
||||
mixins: [formHandler]
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<div class="row" @keyup.enter="submitForm">
|
||||
<div class="col">
|
||||
<div class="row bg-white padding-40 b-rad-lg">
|
||||
<div class="col">
|
||||
<h3 class="text-center m-b-15">Make Payment</h3>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<div class="row m-b-5 animate__animated animate__fadeInUpBig animate__fast" v-if="error">
|
||||
<div class="col">
|
||||
<small class="bold fs-10 text-danger">{{error}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-r-0 m-b-15">
|
||||
<div class="col p-r-0">
|
||||
<validation-wrapper-component :validator="$v.parameters.amount">
|
||||
<label>Amount</label>
|
||||
<input class="form-control text-black" style="cursor: not-allowed;" disabled v-model="parameters.amount" v-money="{decimal: '.',thousands: '', precision: 2}">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-auto b-r b-t b-b b-grey">
|
||||
<div class="row h-100 align-items-center">
|
||||
<div class="col">
|
||||
<div class="font-heading fs-10 muted">MYR</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row p-l-15 p-r-15">
|
||||
<div class="col m-r-5 text-center bg-white">
|
||||
<div class="row h-100">
|
||||
<div class="col b-a padding-10 pointer" :class="{ 'b-primary': paymentMethod.name === 'Online Transfer', 'text-primary': paymentMethod.name === 'Online Transfer', 'b-grey': paymentMethod.name !== 'Online Transfer' }" @click="updatePaymentType({name: 'Online Transfer', id: 'payment_gateway'})">
|
||||
<div class="m-b-15 m-t-10 text-center">
|
||||
<img src="/images/fpx-logo-vector-01.png" alt="logo" height="25">
|
||||
</div>
|
||||
<p id="online-banking" class="no-margin bold all-caps">Online Banking</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col m-l-5 text-center bg-white">
|
||||
<div class="row h-100">
|
||||
<div class="col b-a padding-10 pointer" :class="{ 'b-primary': paymentMethod.name === 'Cash Deposit', 'text-primary': paymentMethod.name === 'Cash Deposit', 'b-grey': paymentMethod.name !== 'Cash Deposit' }" @click="updatePaymentType({name: 'Cash Deposit', id: 'cash'})">
|
||||
<div class="m-b-5 text-center">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="35" height="35" viewBox="0 0 172 172" style=" fill:#000000;"><defs><linearGradient x1="86" y1="15.45313" x2="86" y2="157.24562" gradientUnits="userSpaceOnUse" id="color-1_46094_gr1"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="86" y1="62.14844" x2="86" y2="87.68238" gradientUnits="userSpaceOnUse" id="color-2_46094_gr2"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient></defs><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><path d="M142.4375,26.875h-18.8125v-5.375c0,-2.96431 -2.41069,-5.375 -5.375,-5.375h-64.5c-2.96431,0 -5.375,2.41069 -5.375,5.375v5.375h-18.8125c-4.44513,0 -8.0625,3.61737 -8.0625,8.0625v86c0,4.44512 3.61737,8.0625 8.0625,8.0625h40.3125v10.75h-10.75c-4.44512,0 -8.0625,3.61738 -8.0625,8.0625v2.6875h-10.75v5.375h10.75h69.875h10.75v-5.375h-10.75v-2.6875c0,-4.44512 -3.61738,-8.0625 -8.0625,-8.0625h-10.75v-10.75h40.3125c4.44512,0 8.0625,-3.61738 8.0625,-8.0625v-86c0,-4.44513 -3.61737,-8.0625 -8.0625,-8.0625zM123.625,96.75v-53.75h10.75v64.5h-96.75v-64.5h10.75v53.75zM107.5,91.375h-43v-48.64644c5.25675,-1.06962 9.40894,-5.22181 10.47856,-10.47856h22.04019c1.06963,5.25675 5.22181,9.40894 10.47856,10.47856v48.64644zM53.75,21.5h64.5v69.875h-5.375v-53.75h-2.6875c-4.44512,0 -8.0625,-3.61738 -8.0625,-8.0625v-2.6875h-32.25v2.6875c0,4.44512 -3.61737,8.0625 -8.0625,8.0625h-2.6875v53.75h-5.375zM112.875,145.125c1.4835,0 2.6875,1.204 2.6875,2.6875v2.6875h-59.125v-2.6875c0,-1.4835 1.204,-2.6875 2.6875,-2.6875h10.75h32.25zM96.75,139.75h-21.5v-10.75h21.5zM145.125,120.9375c0,1.4835 -1.204,2.6875 -2.6875,2.6875h-40.3125h-32.25h-40.3125c-1.4835,0 -2.6875,-1.204 -2.6875,-2.6875v-86c0,-1.4835 1.204,-2.6875 2.6875,-2.6875h18.8125v5.375h-10.75c-2.96431,0 -5.375,2.41069 -5.375,5.375v64.5c0,2.96431 2.41069,5.375 5.375,5.375h96.75c2.96431,0 5.375,-2.41069 5.375,-5.375v-64.5c0,-2.96431 -2.41069,-5.375 -5.375,-5.375h-10.75v-5.375h18.8125c1.4835,0 2.6875,1.204 2.6875,2.6875z" fill="url(#color-1_46094_gr1)"></path><path d="M86,64.5c-5.93706,0 -10.75,4.81294 -10.75,10.75c0,5.93706 4.81294,10.75 10.75,10.75c5.93706,0 10.75,-4.81294 10.75,-10.75c0,-5.93706 -4.81294,-10.75 -10.75,-10.75z" fill="url(#color-2_46094_gr2)"></path></g></g></svg>
|
||||
</div>
|
||||
<p id="manual-transfer" class="no-margin bold">Manual Transfer</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4 p-r-0">
|
||||
<div class="btn btn-sm all-caps b-rad-none btn-default bg-master-lighter btn-block" @click="expandPayment = false" data-dismiss="modal">Cancel</div>
|
||||
</div>
|
||||
<div class="col-8 p-l-0">
|
||||
<div class="btn btn-sm all-caps b-rad-none btn-default bg-success btn-block text-white" @click="submitForm()" :class="[{'hide': paymentMethod.name === ''}]" data-dismiss="modal">Cancel</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import formHandler from '../../../general/mixins/formHandler';
|
||||
import { required } from "vuelidate/lib/validators";
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
parameters : {
|
||||
amount: this.data.outstanding.toFixed(2),
|
||||
transaction_id: this.data.id,
|
||||
payment_method: '',
|
||||
},
|
||||
paymentMethod: {
|
||||
name: '',
|
||||
id: '',
|
||||
status: false
|
||||
},
|
||||
error: '',
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
parameters : {
|
||||
amount: { required },
|
||||
},
|
||||
},
|
||||
methods:{
|
||||
submitForm(){
|
||||
this.parameters.payment_method = this.paymentMethod.id === 'payment_gateway' ? 5 : '';
|
||||
this.submit(this.route('api.transaction.payment.create'), 'post', this.section, true, true);
|
||||
},
|
||||
updatePaymentType(payment){
|
||||
this.paymentMethod = {
|
||||
name: payment.name,
|
||||
id: payment.id,
|
||||
status: false,
|
||||
}
|
||||
this.error = '';
|
||||
},
|
||||
},
|
||||
mixins: [formHandler]
|
||||
}
|
||||
|
||||
</script>
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<div class="row" @keyup.enter="submitForm">
|
||||
<div class="col">
|
||||
<loading-component style="height: 200px; top: 0;" key="1" color="success" v-show="$store.getters.isLoading(section)"></loading-component>
|
||||
<div class="row" v-show="!$store.getters.isLoading(section)">
|
||||
<div class="col">
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<div class="font-heading fs-16 all-caps bold m-b-15">Payment Verification</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<div class="row align-items-top">
|
||||
<div class="col">
|
||||
<div class="font-heading fs-10 muted all-caps">You are Paying</div>
|
||||
<div class="font-heading fs-16 bold text-success">
|
||||
{{data.currency.short_code}} {{(Math.round((data.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<error-message-component class="m-b-20" :error="error"></error-message-component>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<file-input-component :validator="$v.files" v-model="files">
|
||||
<template slot="label">
|
||||
<div class="font-heading fs-11 text-primary all-caps">Payment Proof</div>
|
||||
</template>
|
||||
</file-input-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-20">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn btn-sm bg-master-lighter p-t-10 p-b-10 p-r-35 p-l-35 btn-default b-rad-none" data-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<button type="button" class="btn btn-sm p-t-10 p-b-10 p-r-35 p-l-35 btn-success b-rad-none" @click="submitForm">Save and continue</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ModalFromHandler from '../../../general/mixins/modalFormHandler'
|
||||
import { required } from "vuelidate/lib/validators";
|
||||
export default {
|
||||
// props: {
|
||||
// id: {
|
||||
// required: true,
|
||||
// type: Number
|
||||
// }
|
||||
// },
|
||||
data(){
|
||||
return {
|
||||
files: [],
|
||||
parameters: {}
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
files: {
|
||||
required
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitForm(){
|
||||
this.parameters = {
|
||||
files: this.files
|
||||
};
|
||||
this.submit(this.route('api.transaction.payment.verification.create', this.data.id), 'post', this.section, true, true)
|
||||
}
|
||||
},
|
||||
mixins: [ModalFromHandler]
|
||||
|
||||
}
|
||||
</script>
|
||||
+149
File diff suppressed because one or more lines are too long
+63
@@ -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>
|
||||
+1
-1
@@ -5,7 +5,7 @@ export default {
|
||||
(this.$store.getters.isAuthenticated && !this.isProtectedRoute()&& this.isWithTokenRoute()) ? window.location.href = [7, 8].includes(this.$store.getters.getCompanyModuleType) ? this.route('last_mile_delivery.dashboard') : this.route('dashboard') : '';
|
||||
},
|
||||
isProtectedRoute(){
|
||||
const unprotectedRoutes = [this.route('login'), this.route('account.email.verification'), this.route('company.claim'), this.route('last_mile_delivery.login')];
|
||||
const unprotectedRoutes = [this.route('login'), this.route('signup'), this.route('account.email.verification'), this.route('company.claim'), this.route('last_mile_delivery.login')];
|
||||
if(window.location.href.indexOf(this.route('company.claim')) === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+2
-1
@@ -29,7 +29,8 @@ export default {
|
||||
$crisp.push(["set", "user:nickname", getters.getDecodedAccessToken.user.company_marking]);
|
||||
$crisp.push(["set", "session:data", [
|
||||
[
|
||||
["company name", getters.getDecodedAccessToken.user.company_name],
|
||||
["izyim-marking", getters.getDecodedAccessToken.user.company_marking],
|
||||
["company-name", getters.getDecodedAccessToken.user.company_name]
|
||||
]
|
||||
]]);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{{-- seperate signup page form login page for marketing crm --}}
|
||||
@extends('layouts.base_login')
|
||||
|
||||
@section('inner_content')
|
||||
<div class="row h-100 no-margin align-items-center justify-content-center">
|
||||
<div class="col col-md-10">
|
||||
<div class="row m-b-50">
|
||||
<div class="col-8 col-md-6">
|
||||
<img class="w-100" src="{{asset('images/cief-izyim-logo.png')}}" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<loading-component style="height: 350px;" key="1" color="primary" v-show="$store.getters.isLoading('loginSection')"></loading-component>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col">
|
||||
<registration-form-component section="loginSection"></registration-form-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -59,7 +59,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<login-form-component section="loginSection"></login-form-component>
|
||||
<delivery-login-form-component section="loginSection"></delivery-login-form-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
@extends('layouts.base_portal')
|
||||
@section('inner_content')
|
||||
<delivery-orders-section-component></delivery-orders-section-component>
|
||||
@endsection
|
||||
File diff suppressed because one or more lines are too long
@@ -10,6 +10,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<notification-section-component section="section"></notification-section-component>
|
||||
</div>
|
||||
<div class="col-auto p-r-20 d-md-none">
|
||||
<div class="row d-md-none">
|
||||
<div class="col padding-15 pointer" @click="$store.dispatch('toggleSection', {name: 'sideMenu', status: true})">
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -9,6 +9,8 @@ Route::group(['prefix' => 'segment', 'as' => 'segment.', 'namespace' => 'Segment
|
||||
Route::put('/update/{id}', 'UpdateSegmentController@update')->name('update');
|
||||
Route::get('/list', 'ListSegmentsController@list')->name('list');
|
||||
|
||||
Route::get('/air-shipment/item-price/list', 'ListAirShipmentPriceController@list')->name('air_shipment.price.list');
|
||||
|
||||
Route::group(['prefix' => '{id}/constant', 'as' => 'constant.'], function () {
|
||||
Route::put('/service/update', 'UpdateCustomServiceConstantController@update')->name('service.update');
|
||||
Route::put('/update', 'UpdateConstantController@update')->name('update');
|
||||
|
||||
+13
-6
@@ -5,14 +5,21 @@ use Illuminate\Support\Facades\Route;
|
||||
Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' => 'transaction.'], function () {
|
||||
|
||||
Route::get('/list', 'ListTransactionsController@list')->name('list');
|
||||
// Route::delete('/suspend/{id}', 'SuspendTransactionController@suspend')->name('suspend');
|
||||
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::group(['prefix' => 'payment', 'as' => 'payment.'], function () {
|
||||
Route::post('/create', 'CreatePaymentTransactionController@create')->name('create');
|
||||
Route::post('/upload-verification-document/{transaction_id}', 'UploadPaymentVerificationDocumentController@upload')->name('verification.create');
|
||||
Route::put('/approve/{transaction_id}/{status}', 'ApprovePaymentTransactionController@approve')->where('status', 'approve|reject')->name('approval');
|
||||
});
|
||||
|
||||
Route::group(['prefix' => 'invoice', 'as' => 'invoice.'], function () {
|
||||
route::post('/shipping-invoice/create', 'CreateShippingInvoiceTransactionController@create')->name('create');
|
||||
route::put('/shipping-invoice/{id}/update', 'UpdateShippingInvoiceTransactionController@update')->name('update');
|
||||
route::put('/shipping-invoice/{id}/approve', 'ApproveShippingInvoiceTransactionController@approve')->name('approve');
|
||||
});
|
||||
|
||||
|
||||
route::post('/shipping-invoice/create', 'CreateShippingInvoiceTransactionController@create')->name('supplier.create');
|
||||
route::post('/shipping-invoice/calculator', 'ShippingEstimationCalculatorController@calculate')->name('shipping.estimation.calculator');
|
||||
|
||||
// Route::group(['prefix' => '{id}/payment', 'as' => 'payment.'], function () {
|
||||
// Route::post('quotation', 'FetchBookingPaymentQuotationController@fetch')->name('quotation');
|
||||
|
||||
+65
-14
@@ -7,6 +7,7 @@ use App\Classes\Jobs\FetchOrdersFromYDPortalJob;
|
||||
use App\Classes\Jobs\FetchPackingListFromVTPortalJob;
|
||||
use App\Classes\Jobs\FetchWarehouseReceiveListFromVTPortalJob;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchOrderListsFromYdPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchPackingListFromVTPortalProcessor;
|
||||
use App\Models\CompanyConnection;
|
||||
use App\Models\CompanyModule;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
@@ -55,10 +56,25 @@ Route::group(['prefix'=> '/last_mile_delivery', 'as' => 'last_mile_delivery.'],
|
||||
|
||||
});
|
||||
|
||||
Route::group(['prefix'=> '/air_shipment', 'as' => 'air_shipment.'], function () {
|
||||
// Route::get('/', function () {
|
||||
// return view('pages.accounts.signup');
|
||||
// })->name('login');
|
||||
|
||||
Route::get('/quotation', function () {
|
||||
return view('pages.airShipment.quotation');
|
||||
})->name('quotation');
|
||||
});
|
||||
|
||||
Route::get('', function () {
|
||||
return view('pages.accounts.login');
|
||||
})->name('login');
|
||||
|
||||
Route::get('/signup', function () {
|
||||
return view('pages.accounts.sign_up');
|
||||
})->name('signup');
|
||||
|
||||
|
||||
Route::group(['prefix' => 'swagger'], function () {
|
||||
Route::get('/', function () {
|
||||
return view('swagger.index');
|
||||
@@ -137,13 +153,14 @@ Route::get('/customer/{marking}/details', function ($marking) {
|
||||
return view('pages.customers.profile_details', ['id' => $id]);
|
||||
})->name('customer.profile.details');
|
||||
|
||||
Route::get('/orders/refresh', function(){
|
||||
|
||||
Route::get('/orders/refresh', function(\Illuminate\Http\Request $request){
|
||||
$packingLists = \App\Models\PackingList::where('type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->has('containers')->get();
|
||||
dd($packingLists);
|
||||
$packingLists->each(function (\App\Models\PackingList $packingList) {
|
||||
$packingList->containers()->detach();
|
||||
});
|
||||
FetchWarehouseReceiveListFromVTPortalJob::withChain([
|
||||
new FetchLoadedContainersFromVTPortalJob,
|
||||
new FetchPackingListFromVTPortalJob,
|
||||
new FetchContainersStatusUpdateFromVTPortalJob,
|
||||
new FetchDeliveryListFromVTPortalJob,
|
||||
new FetchOrdersFromYDPortalJob
|
||||
])->dispatch();
|
||||
|
||||
@@ -153,7 +170,7 @@ Route::get('/orders/refresh', function(){
|
||||
|
||||
Route::get('/containers/refresh', function(){
|
||||
|
||||
(App()->make(\App\Classes\Modules\PackingLists\Processors\FetchWarehouseReceiveListFromVTPortalProcessor::class))->execute();
|
||||
dd((App()->make(\App\Classes\Modules\PackingLists\Processors\FetchLoadedContainersFromVTPortalProcessor::class))->execute());
|
||||
// FetchLoadedContainersFromVTPortalJob::dispatch();
|
||||
// FetchContainersStatusUpdateFromVTPortalJob::dispatch();
|
||||
|
||||
@@ -228,9 +245,37 @@ Route::get('/debug', function (){
|
||||
dd($issues);
|
||||
});
|
||||
|
||||
Route::get('/yd', function (){
|
||||
(App()->make(FetchOrderListsFromYdPortalProcessor::class))->execute();
|
||||
});
|
||||
Route::get('/yd', function (\Illuminate\Http\Request $request){
|
||||
$start = $request->input('start_date') ? \Carbon\Carbon::parse($request->input('start_date')): null;
|
||||
$end = $request->input('end_date') ? \Carbon\Carbon::parse($request->input('end_date')): null;
|
||||
(App()->make(FetchOrderListsFromYdPortalProcessor::class))->execute($start, $end);
|
||||
(App()->make(FetchPackingListFromVTPortalProcessor::class))->execute();
|
||||
})->name('yd.refresh');
|
||||
|
||||
Route::get('/container/{reference}/refresh/', function (string $reference){
|
||||
$container = Container::where('reference', $reference)->first();
|
||||
$supplier = in_array($container->owner_id, [3, 4]) ? 'VT' : 'YD';
|
||||
|
||||
if($supplier === 'VT'){
|
||||
$startDate = $container->loading_date->subDays(3);
|
||||
$endDate = $container->loading_date->addDay();
|
||||
(App()->make(\App\Classes\Modules\PackingLists\Processors\FetchLoadedContainersFromVTPortalProcessor::class))->execute($startDate, $endDate);
|
||||
}
|
||||
|
||||
if($supplier === 'YD'){
|
||||
$arrivalDates = \App\Models\PackingList::whereIn('reference', $container->packingLists->pluck('reference'))->where('type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->get()->map(function($packingList){
|
||||
return $packingList->transports()->first()->drop_date;
|
||||
})->sortBy(function($date){
|
||||
return $date;
|
||||
});
|
||||
|
||||
$startDate = $arrivalDates->first()->subDay()->format('d-m-Y');
|
||||
$endDate = $arrivalDates->last()->addDay()->format('d-m-Y');
|
||||
|
||||
return redirect(route('yd.refresh').'?start_date='.$startDate.'&end_date='.$endDate);
|
||||
}
|
||||
|
||||
})->name('container.refresh');
|
||||
|
||||
Route::get('/min_cbm', function (){
|
||||
$companies = CompanyModule::where('type', \App\Classes\ValueObjects\Constants\BusinessType::IMPORTER)->whereHas('orders', function ($query){
|
||||
@@ -270,9 +315,10 @@ 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();
|
||||
$containers = Container::whereMonth('loading_date', '>=', ((float)\Carbon\Carbon::now()->format('m') - 2))->whereYear('loading_date', (float)\Carbon\Carbon::now()->format('Y'))->get();
|
||||
foreach ($containers as $container){
|
||||
$packingLists = $container->packingLists()->get()->filter(function ($packingList) {
|
||||
return $packingList->owner->company_module_id === 248;
|
||||
@@ -280,7 +326,7 @@ Route::get('/customer/summary/monthly', function () {
|
||||
|
||||
if (!count($packingLists)) continue;
|
||||
|
||||
echo '<table>
|
||||
echo '<table style="width: 100%; text-align: center;">
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Full Marking</th>
|
||||
@@ -299,7 +345,7 @@ Route::get('/customer/summary/monthly', function () {
|
||||
$packages = $packingList->packages;
|
||||
foreach ($packages as $package){
|
||||
echo '<tr>
|
||||
<td>-</td>
|
||||
<td>'.$container->loading_date->format('d-m-Y').'</td>
|
||||
<td>MS/CIEF/769SMC/'.$packingList->owner->reference.'</td>
|
||||
<td>'.$container->reference.'</td>
|
||||
<td>'.$package->description.'</td>
|
||||
@@ -368,4 +414,9 @@ Route::get('/online_payment/redirect', 'Billplz\CallbackBillplzController@callba
|
||||
|
||||
Route::get('/order/{id}', function ($id) {
|
||||
return view('pages.orders.profile', ['id' => $id]);
|
||||
})->name('order.details');
|
||||
})->name('order.details');
|
||||
|
||||
Route::get('/payment-and-billing', function () {
|
||||
return view('pages.paymentAndBilling');
|
||||
})->name('admin.payment-and-billing');
|
||||
Route::get('/notifications/list', 'Notifications\ListNotificationsController@list')->name('notifications.list');
|
||||
|
||||
Reference in New Issue
Block a user