mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b3a296f2eb | |||
| 5a723c5fd1 | |||
| 6e9a27024b | |||
| e2e8f69f90 | |||
| e5c28faba7 | |||
| 4b81666cf2 | |||
| 4a2fb8e9e4 | |||
| ea772c3916 | |||
| f8d65d05da |
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class OwnerId implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->where('owner_id', $value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,6 +26,8 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CallbackBillplzLogic
|
||||
{
|
||||
|
||||
|
||||
/** @var GetBillplzBill */
|
||||
private $getBillplzBill;
|
||||
|
||||
@@ -45,11 +47,12 @@ class CallbackBillplzLogic
|
||||
* @param UpdatesTransactionStatus $updatesTransactionStatus
|
||||
* @param UpdatesWalletBalance $updatesWalletBalance
|
||||
*/
|
||||
public function __construct(GetBillplzBill $getBillplzBill, FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus)
|
||||
public function __construct(GetBillplzBill $getBillplzBill, FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, UpdatesWalletBalance $updatesWalletBalance)
|
||||
{
|
||||
$this->getBillplzBill = $getBillplzBill;
|
||||
$this->fetchesTransaction = $fetchesTransaction;
|
||||
$this->updatesTransactionStatus = $updatesTransactionStatus;
|
||||
$this->updatesWalletBalance = $updatesWalletBalance;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,11 +84,22 @@ class CallbackBillplzLogic
|
||||
$status = $billplzXSignatureObject->getStatus() === 'failed' ? ApprovalStatus::REJECTED : ApprovalStatus::PENDING_VERIFICATION;
|
||||
}
|
||||
|
||||
if($transaction->status !== ApprovalStatus::COMPLETED){
|
||||
|
||||
if($transaction->owner instanceof Wallet && $transaction->status !== ApprovalStatus::APPROVED && $status === ApprovalStatus::APPROVED) {
|
||||
$this->updatesWalletBalance->execute($transaction->owner, $transaction->amount);
|
||||
}
|
||||
$this->updatesTransactionStatus->execute($transaction, $status);
|
||||
|
||||
}
|
||||
|
||||
|
||||
$token = Auth::fromUser(User::find(1));
|
||||
$request->headers->set('Authorization', 'Bearer '.$token);
|
||||
|
||||
$marking = $transaction->owner()->first()->owner()->first();
|
||||
$marking = $transaction->owner instanceof Booking ? $transaction->booking->marking : $transaction->owner->owner->bookings()->orderBy('id', 'DESC')->first()->marking;
|
||||
|
||||
return $request->method() === 'POST' ? true : view('pages.payments_redirect', ['marking' => $marking, 'transaction' => $transaction, 'status' => $status]);
|
||||
|
||||
return $request->method() === 'POST' ? true : view('pages.payments_redirect', ['marking' => $marking->reference, 'transaction' => $transaction, 'status' => $status]);
|
||||
}
|
||||
}
|
||||
+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);
|
||||
}
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
<?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)
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Models\PackingList;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class ExportsPendingArrangementDeliveryList implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
|
||||
{
|
||||
|
||||
use Exportable;
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Container Ref.',
|
||||
'ETA',
|
||||
'Unstuffing',
|
||||
'Marking',
|
||||
'Order Number',
|
||||
'Delay Days',
|
||||
'Quantity',
|
||||
'State',
|
||||
'Postcode',
|
||||
'Address',
|
||||
'PIC',
|
||||
'Phone',
|
||||
'Remark'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection|mixed
|
||||
*/
|
||||
public function query()
|
||||
{
|
||||
return PackingList::where('type', '=', 2)->whereHas('containers', function ($query){
|
||||
$query->where('containers.status', ApprovalStatus::COMPLETED);
|
||||
})->whereDoesntHave('transports');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PackingList $packingList
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function map($packingList): array
|
||||
{
|
||||
$container = $packingList->containers()->first();
|
||||
$ContainerTransport = $container->transports()->first();
|
||||
$order = $packingList->owner;
|
||||
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
|
||||
$address = $order->addresses()->where('status', ApprovalStatus::APPROVED)->first();
|
||||
$contacts = $address->contacts->first() ? $address->contacts->first(): '';
|
||||
$originalPackingList = $packingList->owner instanceof PackingList ? $packingList->owner : $packingList;
|
||||
$transport = $originalPackingList->containers()->first()->transports()->first();
|
||||
|
||||
return [
|
||||
$container->reference,
|
||||
$ContainerTransport->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()->eta,
|
||||
$ContainerTransport->drop_date,
|
||||
$marking,
|
||||
$order->reference,
|
||||
$transport ? Carbon::now()->diffInDays($transport->drop_date, false) . ' Days' : '',
|
||||
$packingList->packages()->sum('quantity'),
|
||||
$address->state->name,
|
||||
$address->postcode,
|
||||
$address->street_one.', '.$address->street_two.' '.$address->district->name.' '.$address->postcode.' '.$address->state->name.' '.$address->country->name,
|
||||
$address->remarks->first() ? $address->remarks->first()->content: '',
|
||||
$contacts ? $contacts ->reference : '',
|
||||
$contacts ? $contacts ->phone : '',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ use App\Classes\Modules\Orders\Standards\Rules\CanApproveChangeOrderAddress;
|
||||
use App\Classes\Modules\Orders\Services\UpdatesOrdersAddress;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
|
||||
use App\Classes\ValueObjects\Constants\PackingListType;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ApproveChangeOrderAddressProcessor
|
||||
@@ -66,11 +65,7 @@ class ApproveChangeOrderAddressProcessor
|
||||
$address->owner->addresses()->update(['status' => ApprovalStatus::EXPIRED]);
|
||||
|
||||
$appointee = $address->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
|
||||
if($appointee === 2) {
|
||||
foreach($address->owner->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST) as $packingList){
|
||||
$this->updateDoFromVTPortalProcessor->execute($packingList);
|
||||
}
|
||||
}
|
||||
$appointee === 2 ? $this->updateDoFromVTPortalProcessor->execute($address) : $this->updateDoFromYDPortalProcessor->execute($address);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,23 @@ use App\Classes\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\Orders\Services\FetchesDataFromVTPortal;
|
||||
use App\Classes\Modules\Addresses\Services\FetchesAddress;
|
||||
|
||||
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
|
||||
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
|
||||
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
|
||||
use App\Classes\Modules\Transports\Services\CreatesTransport;
|
||||
use App\Classes\Modules\Unity\Services\UpdatesContractObligation;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
|
||||
use App\Classes\ValueObjects\Constants\PackingListType;
|
||||
use App\Classes\ValueObjects\Constants\TransportType;
|
||||
use App\Models\PackingList;
|
||||
use App\Models\Transport;
|
||||
use Carbon\Carbon;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdateDoFromVTPortalProcessor
|
||||
{
|
||||
/** @var FetchesDataFromVTPortal */
|
||||
@@ -29,20 +43,19 @@ class UpdateDoFromVTPortalProcessor
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PackingList $packing_list
|
||||
* @param $address
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
public function execute(PackingList $packing_list) {
|
||||
public function execute($address) {
|
||||
|
||||
if(!app()->environment(['production'])){
|
||||
return [];
|
||||
}
|
||||
|
||||
try {
|
||||
$address= $packing_list->owner->addresses()->where('status', ApprovalStatus::APPROVED)->first();
|
||||
$order = $packing_list->owner;
|
||||
$order = $address->owner()->orderBy('id', 'desc')->first();
|
||||
$packing_list = $order->packingLists()->orderBy('id', 'desc')->first();
|
||||
|
||||
if ($packing_list) {
|
||||
$contact = $address->contacts()->first();
|
||||
@@ -54,7 +67,7 @@ class UpdateDoFromVTPortalProcessor
|
||||
|
||||
$status = 'On Hold';
|
||||
|
||||
if (in_array($packing_list->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])) {
|
||||
if (in_array($packing_list->status, [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])) {
|
||||
$status = 'Release';
|
||||
}
|
||||
|
||||
@@ -64,7 +77,6 @@ class UpdateDoFromVTPortalProcessor
|
||||
|
||||
if ($vt_do) {
|
||||
foreach ($vt_do->Rows as $key => $row) {
|
||||
if($row[4] !== $packing_list->containers()->first()->reference) continue;
|
||||
$vt_do_update = $this->fetchesDataFRomVTPortal->clientRequest(
|
||||
'http://portal.vtnation.com.my/Services/DataControllerService.asmx/Execute',
|
||||
'POST',
|
||||
@@ -129,7 +141,7 @@ class UpdateDoFromVTPortalProcessor
|
||||
}
|
||||
|
||||
} catch (\Exception $exception){
|
||||
throw new InternalServerErrorException('failed to approve address due to an error related to VT portal: '.$exception->getMessage());
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ use App\Classes\Modules\Addresses\Services\FetchesAddress;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PackingListType;
|
||||
use App\Models\PackingList;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UpdateDoFromYDPortalProcessor
|
||||
@@ -31,34 +30,36 @@ class UpdateDoFromYDPortalProcessor
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PackingList $packingList
|
||||
* @param $address
|
||||
* @return void
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
public function execute(PackingList $packingList) {
|
||||
if(!app()->environment(['production'])){
|
||||
return;
|
||||
}
|
||||
|
||||
public function execute($address) {
|
||||
try {
|
||||
$address = $packingList->owner->addresses()->where('status', ApprovalStatus::APPROVED)->first();
|
||||
$order = $address->owner()->orderBy('id', 'desc')->first();
|
||||
$packing_lists = $order->packingLists()
|
||||
->where('type', PackingListType::SHIPPING_PACKING_LIST)
|
||||
->where('status', '!=', ApprovalStatus::SUSPENDED)
|
||||
->orderBy('id', 'desc')->get();
|
||||
|
||||
if (!in_array($packingList->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$contact = $address->contacts()->first();
|
||||
$remark = $address->remarks()->first();
|
||||
foreach ($packing_lists as $key => $row) {
|
||||
if ($row->status === ApprovalStatus::SUSPENDED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$phone = $contact ? $contact->phone : null;
|
||||
$reference = $contact ? $contact->reference : null;
|
||||
$remark = $remark ? $remark->content : 'URGENT!!! PLEASE CALL BEFORE ONE DAY DELIVERY.';
|
||||
$contact = $address->contacts()->first();
|
||||
$remark = $address->remarks()->first();
|
||||
|
||||
$this->fetchesDataFRomYDPortal->clientRequest(
|
||||
'http://www.yd-wl.com/api/UpdateOrderAddress.ashx',
|
||||
'POST',
|
||||
$phone = $contact ? $contact->phone : null;
|
||||
$reference = $contact ? $contact->reference : null;
|
||||
$remark = $remark ? $remark->content : 'URGENT!!! PLEASE CALL BEFORE ONE DAY DELIVERY.';
|
||||
|
||||
$this->fetchesDataFRomYDPortal->clientRequest(
|
||||
'http://www.yd-wl.com/api/UpdateOrderAddress.ashx',
|
||||
'POST',
|
||||
[
|
||||
'expressno' => $packingList->reference,
|
||||
'expressno' => $row->reference,
|
||||
'customers_name' => $reference,
|
||||
'cellphone' => $phone,
|
||||
'postcode' => $address->postcode,
|
||||
@@ -67,6 +68,8 @@ class UpdateDoFromYDPortalProcessor
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
} catch (\Exception $exception){
|
||||
throw new InternalServerErrorException('failed to approve address due to an error related to YD portal');
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
|
||||
use App\Http\Resources\PackingListResource;
|
||||
use App\Models\PackingList;
|
||||
use ErrorException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -71,16 +70,16 @@ class UpdatePackingListStatusLogic extends AbstractControllerLogic
|
||||
{
|
||||
$packingList = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
|
||||
|
||||
/** @var PackingList $packingList */
|
||||
$packingList = $this->updatesPackingListStatus->execute($packingList, $request->route('status'));
|
||||
$packing_list = $this->updatesPackingListStatus->execute($packingList, $request->route('status'));
|
||||
$address = $packing_list->owner()->first()->addresses()->where('status', ApprovalStatus::APPROVED)->first();
|
||||
|
||||
|
||||
// $appointee = $address->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
|
||||
|
||||
$this->updateDoFromVTPortalProcessor->execute($packingList);
|
||||
$this->updateDoFromYDPortalProcessor->execute($packingList);
|
||||
$this->updateDoFromVTPortalProcessor->execute($address);
|
||||
$this->updateDoFromYDPortalProcessor->execute($address);
|
||||
|
||||
return $this->resourceResponse(new PackingListResource($packingList));
|
||||
return $this->resourceResponse(new PackingListResource($packing_list));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+6
-2
@@ -158,9 +158,13 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
}
|
||||
|
||||
foreach($containerDetail->Rows as $packingList){
|
||||
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $packingList[13]));
|
||||
$marking = explode('/', explode('CIEF/', $packingList[13])[1]);
|
||||
|
||||
$orderNumber = $marking[array_key_last($marking)];
|
||||
if(!array_key_exists(1, $marking)){
|
||||
continue;
|
||||
}
|
||||
|
||||
$orderNumber = $marking[1];
|
||||
|
||||
if(!$packingList[22]){
|
||||
continue;
|
||||
|
||||
+10
-44
@@ -36,7 +36,6 @@ use App\Models\Transport;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class FetchOrderListsFromYdPortalProcessor
|
||||
{
|
||||
@@ -154,6 +153,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($orderRequest);
|
||||
|
||||
foreach($rows->data as $row){
|
||||
|
||||
$containerReference = null;
|
||||
$loadingDate = null;
|
||||
$unstuffingDate = null;
|
||||
@@ -168,11 +168,6 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
|
||||
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($trackingRequest);
|
||||
|
||||
if(!$rows){
|
||||
Log::debug($row->expressno);
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (array_reverse($rows->data) as $trackingRow) {
|
||||
if ($trackingRow->tracking === '货物已送达仓库准备入库中') {
|
||||
$receiveDate = Carbon::parse($trackingRow->trackingtime);
|
||||
@@ -186,43 +181,21 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
$eta = Carbon::parse($tracking[2]);
|
||||
}
|
||||
|
||||
$rescheduleETD = strpos($trackingRow->remark, '开') || strpos($trackingRow->remark, '到港');
|
||||
$rescheduleETA = strpos($trackingRow->remark, '到港');
|
||||
if (($rescheduleETD !== false || $rescheduleETA !== false) && strpos($trackingRow->tracking, '货物装柜完成。') === false) {
|
||||
preg_match_all('/([0-9]+.{3})/', $trackingRow->remark, $matches);
|
||||
$dates = collect();
|
||||
|
||||
foreach($matches[0] as $date){
|
||||
try {
|
||||
$dates->push(Carbon::parse(str_replace('.', '/', $date).Carbon::now()->format('Y')));
|
||||
} catch (\Exception $exception) {
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$rescheduleDate = $dates->sortDesc()->first();
|
||||
if(!$delayDate || $rescheduleDate > $delayDate){
|
||||
/** @var Carbon $delayDate */
|
||||
$delayDate = $rescheduleDate;
|
||||
|
||||
if($rescheduleETA === false && $delayDate) {
|
||||
$delayDate = $delayDate->addDays('5');
|
||||
}
|
||||
}
|
||||
|
||||
if (strpos($trackingRow->tracking, '预计船时间为') !== false) {
|
||||
$tracking = explode('预计船时间为', $trackingRow->tracking);
|
||||
$delayDate = Carbon::parse(explode('日', $tracking[1])[0]);
|
||||
}
|
||||
|
||||
if ($trackingRow->tracking === '已开船') {
|
||||
$delayDate = Carbon::parse($trackingRow->trackingtime)->addDays('5');
|
||||
if (strpos($trackingRow->tracking, '预计开船为') !== false) {
|
||||
$tracking = explode('预计开船为', $trackingRow->tracking);
|
||||
$delayDate = Carbon::parse(explode('日', $tracking[1])[0]);
|
||||
}
|
||||
|
||||
|
||||
if ($trackingRow->tracking === '货物已进目的港仓库') {
|
||||
$unstuffingDate = Carbon::parse($trackingRow->trackingtime);
|
||||
}
|
||||
|
||||
if (Str::contains($trackingRow->tracking, ['派送中'])) {
|
||||
if ($trackingRow->tracking === '货物已派送完成') {
|
||||
$deliveryDate = Carbon::parse($trackingRow->trackingtime);
|
||||
}
|
||||
}
|
||||
@@ -315,13 +288,6 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
$this->createPackageProcessor->execute($packageObject, $packingList);
|
||||
}
|
||||
|
||||
if(!count($row->deliverysize)){
|
||||
$measurement = round(((float) $row->volume / (float) $row->goodcount) ** (1/3) * 100, 2);
|
||||
$packageObject = new PackageObject(PackageType::CARTON, $row->goodname, (float) $measurement, (float) $measurement, (float) $measurement, 0, (float) $row->goodcount, ApprovalStatus::APPROVED);
|
||||
$this->createPackageProcessor->execute($packageObject, $warehouseReceiveList);
|
||||
$this->createPackageProcessor->execute($packageObject, $packingList);
|
||||
}
|
||||
|
||||
$weightCbm = (float) $row->weight / 500;
|
||||
$overWeightCbm = $weightCbm - $packingList->packages()->sum(DB::raw('(width/100) * (height/100) * (length/100) * quantity'));
|
||||
|
||||
@@ -378,7 +344,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
|
||||
$transport = $container->transports()->first();
|
||||
|
||||
if(!$transport->schedules()->whereDate('eta', '>=', $delayDate)->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));
|
||||
@@ -407,7 +373,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
}
|
||||
}
|
||||
|
||||
if($deliveryDate && !$packingList->transports()->exists()){
|
||||
if($deliveryDate && !$packingList->transports){
|
||||
$packingList->status = ApprovalStatus::COMPLETED;
|
||||
$packingList->save();
|
||||
|
||||
|
||||
+8
-2
@@ -134,13 +134,19 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
|
||||
|
||||
foreach ($response->Rows as $parcel){
|
||||
|
||||
$marking = preg_split('(-|\(|\)|\/)', str_replace("/YW","", $parcel[5]));
|
||||
$orderNumber = $marking[array_key_last($marking)];
|
||||
$marking = explode('/', explode('CIEF/', $parcel[5])[1]);
|
||||
|
||||
if(!array_key_exists(1, $marking)){
|
||||
continue;
|
||||
}
|
||||
|
||||
$orderNumber = $marking[1];
|
||||
|
||||
if(!$parcel[9]){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
$order = $this->fetchesOrder->execute(['reference' => $orderNumber]);
|
||||
} catch (ResourceNotFoundException $exception) {
|
||||
|
||||
@@ -76,7 +76,7 @@ class UpdateConstantLogic extends AbstractControllerLogic
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
|
||||
$object = new ConstantObject($request->input('reference'), $request->input('value'));
|
||||
$object = new ConstantObject($request->input('name'), $request->input('reference'), $request->input('detail'));
|
||||
|
||||
$segment = $this->fetchesSegment->execute(['id' => $request->route('id')]);
|
||||
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Segments\ControllersLogic;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use App\Http\Resources\ConstantResource;
|
||||
use App\Classes\ValueObjects\Constants\SegmentConstants;
|
||||
use App\Classes\Modules\Segments\Services\FetchesSegment;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Segments\Services\FetchesConstant;
|
||||
use App\Classes\Modules\Segments\Services\UpdatesConstant;
|
||||
use App\Classes\Modules\Segments\Standards\Rules\CanUpdateConstant;
|
||||
use App\Classes\Modules\Segments\DataTransferObjects\ConstantObject;
|
||||
use App\Classes\Modules\Segments\Services\AddItemToConstantValueArray;
|
||||
use App\Classes\Modules\Segments\Services\RemoveItemFromConstantValueArray;
|
||||
|
||||
class UpdateConstantPostcodeLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Updated Segment Constant',
|
||||
'message' => 'You have successfully updated the Segment Constant'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var CanUpdateConstant */
|
||||
private $canUpdateConstant;
|
||||
|
||||
/** @var UpdatesConstant */
|
||||
private $updatesConstant;
|
||||
|
||||
/** @var FetchesSegment */
|
||||
private $fetchesSegment;
|
||||
|
||||
/** @var FetchesConstant */
|
||||
private $fetchesConstant;
|
||||
|
||||
/** @var AddItemToConstantValueArray */
|
||||
private $addItemToConstantValueArray;
|
||||
|
||||
/** @var RemoveItemFromConstantValueArray */
|
||||
private $removeItemFromConstantValueArray;
|
||||
|
||||
|
||||
/**
|
||||
* UpdateConstantLogic constructor.
|
||||
* @param CanUpdateConstant $canUpdateConstant
|
||||
* @param UpdatesConstant $updatesConstant
|
||||
* @param FetchesSegment $fetchesSegment
|
||||
* @param FetchesConstant $fetchesConstant
|
||||
* @param AddItemToConstantValueArray $addItemToConstantValueArray
|
||||
* @param RemoveItemFromConstantValueArray $removeItemFromConstantValueArray
|
||||
*/
|
||||
public function __construct(CanUpdateConstant $canUpdateConstant, UpdatesConstant $updatesConstant, FetchesSegment $fetchesSegment, FetchesConstant $fetchesConstant,AddItemToConstantValueArray $addItemToConstantValueArray, RemoveItemFromConstantValueArray $removeItemFromConstantValueArray)
|
||||
{
|
||||
$this->canUpdateConstant = $canUpdateConstant;
|
||||
$this->updatesConstant = $updatesConstant;
|
||||
$this->fetchesSegment = $fetchesSegment;
|
||||
$this->fetchesConstant = $fetchesConstant;
|
||||
$this->addItemToConstantValueArray = $addItemToConstantValueArray;
|
||||
$this->removeItemFromConstantValueArray = $removeItemFromConstantValueArray;
|
||||
}
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$segment = $this->fetchesSegment->execute(['id' => $request->route('id')]);
|
||||
|
||||
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $request->input('reference')]);
|
||||
|
||||
$object = new ConstantObject($constant->reference, $this->addItemToConstantValueArray->execute($constant->value, $request->input('postcode')));
|
||||
$this->canUpdateConstant->passes($object);
|
||||
|
||||
$constant = $this->updatesConstant->execute($constant, $object);
|
||||
|
||||
$oppositeConstant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $request->input('reference') == SegmentConstants::CENTER_POSTCODE ? SegmentConstants::OUTSTATION_POSTCODE : SegmentConstants::CENTER_POSTCODE]);
|
||||
|
||||
$oppositeObject = new ConstantObject($request->input('reference') == SegmentConstants::CENTER_POSTCODE ? SegmentConstants::OUTSTATION_POSTCODE : SegmentConstants::CENTER_POSTCODE, $this->removeItemFromConstantValueArray->execute($oppositeConstant->value, $request->input('postcode')));
|
||||
|
||||
$oppositeConstant = $this->updatesConstant->execute($oppositeConstant, $oppositeObject);
|
||||
|
||||
|
||||
return $this->response([
|
||||
'CENTER_POSTCODE' => $constant->reference == SegmentConstants::CENTER_POSTCODE ? new ConstantResource($constant) : New ConstantResource($oppositeConstant),
|
||||
'OUTSTATION_POSTCODE' => $constant->reference == SegmentConstants::OUTSTATION_POSTCODE ? new ConstantResource($constant) : New ConstantResource($oppositeConstant),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Segments\ControllersLogic;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\SegmentConstant;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use App\Http\Resources\ConstantResource;
|
||||
use App\Classes\ValueObjects\Constants\SegmentConstants;
|
||||
use App\Classes\Modules\Segments\Services\FetchesSegment;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Segments\Services\FetchesConstant;
|
||||
use App\Classes\Modules\Segments\Services\UpdatesConstant;
|
||||
use App\Classes\Modules\Segments\Standards\Rules\CanUpdateConstant;
|
||||
use App\Classes\Modules\Segments\DataTransferObjects\ConstantObject;
|
||||
use App\Classes\Modules\Segments\Services\UpdatesConstantValueByState;
|
||||
|
||||
class UpdateConstantStateLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Updated Segment Constant',
|
||||
'message' => 'You have successfully updated the Segment Constant'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var CanUpdateConstant */
|
||||
private $canUpdateConstant;
|
||||
|
||||
/** @var UpdatesConstant */
|
||||
private $updatesConstant;
|
||||
|
||||
/** @var FetchesSegment */
|
||||
private $fetchesSegment;
|
||||
|
||||
/** @var FetchesConstant */
|
||||
private $fetchesConstant;
|
||||
|
||||
/** @var UpdatesConstantValueByState */
|
||||
private $updatesConstantValueByState;
|
||||
|
||||
|
||||
/**
|
||||
* UpdateConstantLogic constructor.
|
||||
* @param CanUpdateConstant $canUpdateConstant
|
||||
* @param UpdatesConstant $updatesConstant
|
||||
* @param FetchesSegment $fetchesSegment
|
||||
* @param FetchesConstant $fetchesConstant
|
||||
* @param UpdatesConstantValueByState $updatesConstantValueByState
|
||||
*/
|
||||
public function __construct(CanUpdateConstant $canUpdateConstant, UpdatesConstant $updatesConstant, FetchesSegment $fetchesSegment, FetchesConstant $fetchesConstant,UpdatesConstantValueByState $updatesConstantValueByState)
|
||||
{
|
||||
$this->canUpdateConstant = $canUpdateConstant;
|
||||
$this->updatesConstant = $updatesConstant;
|
||||
$this->fetchesSegment = $fetchesSegment;
|
||||
$this->fetchesConstant = $fetchesConstant;
|
||||
$this->updatesConstantValueByState = $updatesConstantValueByState;
|
||||
}
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$segment = $this->fetchesSegment->execute(['id' => $request->route('id')]);
|
||||
|
||||
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => SegmentConstants::STATE_RATE]);
|
||||
|
||||
$constantValue = $this->updatesConstantValueByState->execute($constant->value, $request->input('status_id'), $request->input('rate'));
|
||||
|
||||
$object = new ConstantObject(SegmentConstants::STATE_RATE, (array) $constantValue);
|
||||
$this->canUpdateConstant->passes($object);
|
||||
|
||||
$constant = $this->updatesConstant->execute($constant, $object);
|
||||
|
||||
|
||||
return $this->resourceResponse(new ConstantResource($constant));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,22 +7,34 @@ use App\Classes\General\Interfaces\DataTransferObject;
|
||||
class ConstantObject implements DataTransferObject
|
||||
{
|
||||
|
||||
/** @var string */
|
||||
private $name;
|
||||
|
||||
/** @var string */
|
||||
private $reference;
|
||||
|
||||
/** @var array */
|
||||
private $value;
|
||||
private $detail;
|
||||
|
||||
/**
|
||||
* ConstantObject constructor.
|
||||
* @param string $name
|
||||
* @param string $reference
|
||||
* @param array $value
|
||||
* @param array $detail
|
||||
*/
|
||||
public function __construct(string $reference, array $value)
|
||||
public function __construct(string $name, string $reference, array $detail)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->reference = $reference;
|
||||
$this->value = $value;
|
||||
$this->detail = $detail;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,9 +48,9 @@ class ConstantObject implements DataTransferObject
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getValue(): array
|
||||
public function getDetail(): array
|
||||
{
|
||||
return $this->value;
|
||||
return $this->detail;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Segments\Services;
|
||||
|
||||
class AddItemToConstantValueArray
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param $item
|
||||
* @return array
|
||||
*/
|
||||
public function execute($array, $item): array {
|
||||
$array[] = $item;
|
||||
sort($array);
|
||||
return $array;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,11 +27,11 @@ class ConvertsConstantDetailsToResource
|
||||
|
||||
public function execute(SegmentConstant $constant){
|
||||
|
||||
// if($constant->reference === SegmentConstants::SUPPLIER_CURRENCIES) {
|
||||
// return property_exists($constant->detail, 'id') ? new CurrencyResource($this->fetchesCurrency->execute(['id' => $constant->detail->id])) : '';
|
||||
// }
|
||||
if($constant->reference === SegmentConstants::SUPPLIER_CURRENCIES) {
|
||||
return property_exists($constant->detail, 'id') ? new CurrencyResource($this->fetchesCurrency->execute(['id' => $constant->detail->id])) : '';
|
||||
}
|
||||
|
||||
return $constant->value;
|
||||
return $constant->detail;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,9 @@ class CreatesConstant extends AbstractUpdateRelationshipRecord
|
||||
public function execute(Segment $segment, ConstantObject $object)
|
||||
{
|
||||
$model = new SegmentConstant();
|
||||
$model->name = $object->getName();
|
||||
$model->reference = $object->getReference();
|
||||
$model->value = json_encode($object->getValue());
|
||||
$model->detail = json_encode($object->getDetail());
|
||||
|
||||
return $this->handler($segment->constants(), $model);
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Segments\Services;
|
||||
|
||||
class RemoveItemFromConstantValueArray
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param $item
|
||||
* @return array
|
||||
*/
|
||||
public function execute($array, $item): array {
|
||||
foreach($array as $key => $value){
|
||||
if($array[$key] == $item){
|
||||
unset($array[$key]);
|
||||
}
|
||||
}
|
||||
return array_values($array);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,8 +17,9 @@ class UpdatesConstant extends AbstractUpdateRecord
|
||||
*/
|
||||
public function execute(SegmentConstant $model, ConstantObject $object)
|
||||
{
|
||||
$model->name = $object->getName();
|
||||
$model->reference = $object->getReference();
|
||||
$model->value = json_encode($object->getValue());
|
||||
$model->detail = json_encode($object->getDetail());
|
||||
|
||||
return $this->handler($model);
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Segments\Services;
|
||||
|
||||
class UpdatesConstantValueByState
|
||||
{
|
||||
|
||||
/**
|
||||
* @param $json
|
||||
* @param int $status_id
|
||||
* @param int $rate
|
||||
* @return string
|
||||
*/
|
||||
public function execute($json, int $status_id, int $rate) {
|
||||
|
||||
$newArray = $json;
|
||||
foreach($json->config as $key => $object){
|
||||
if($object->status_id == $status_id){
|
||||
$newArray->config[$key] = (object) [
|
||||
'rate' => $rate,
|
||||
'status_id' => $object->status_id,
|
||||
'outstation_rate' => $object->outstation_rate,
|
||||
];
|
||||
}else{
|
||||
$newArray->config[$key] = $object;
|
||||
}
|
||||
}
|
||||
return $newArray;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,8 +15,9 @@ class ConstantValidation extends AbstractValidation
|
||||
protected function data($object): array {
|
||||
|
||||
$data = [
|
||||
'name' => $object->getName(),
|
||||
'reference' => $object->getReference(),
|
||||
'value' => $object->getValue()
|
||||
'detail' => $object->getDetail()
|
||||
];
|
||||
|
||||
return $data;
|
||||
@@ -27,8 +28,9 @@ class ConstantValidation extends AbstractValidation
|
||||
*/
|
||||
protected function rules(): array {
|
||||
return [
|
||||
'name' => 'required',
|
||||
'reference' => 'required',
|
||||
'value' => 'required'
|
||||
'detail' => 'required'
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
+9
-30
@@ -20,11 +20,7 @@ use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\PackageType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionDetailType;
|
||||
|
||||
use App\Models\Document;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@@ -90,11 +86,7 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
{
|
||||
$packing_list = $this->fetchesPackingList->execute(['id' => $request->input('packing_list_id')]);
|
||||
|
||||
$cbm = $packing_list->packages->where('type', '!=', PackageType::OVER_WEIGHT)->sum(function($package) {
|
||||
return ($package->width / 100) * ($package->height / 100) *($package->length / 100) * ($package->quantity);
|
||||
});
|
||||
|
||||
$over_weight_cbm = $packing_list->packages->where('type', PackageType::OVER_WEIGHT)->sum(function($package) {
|
||||
$cbm = $packing_list->packages->sum(function($package) {
|
||||
return ($package->width / 100) * ($package->height / 100) *($package->length / 100) * ($package->quantity);
|
||||
});
|
||||
|
||||
@@ -151,7 +143,7 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
}
|
||||
|
||||
$price_cbm = $base_price + $warehouse_rate + $state_rate;
|
||||
$total_cbm = $price_cbm * ($cbm + $over_weight_cbm);
|
||||
$total_cbm = $price_cbm * $cbm;
|
||||
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('SHIP-');
|
||||
|
||||
@@ -173,28 +165,16 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
ApprovalStatus::PENDING_SUBMISSION
|
||||
);
|
||||
|
||||
/** @var Transaction $invoice_transaction */
|
||||
$invoice_transaction = $this->createsTransaction->execute($packing_list, $object);
|
||||
|
||||
$object_detail = new TransactionDetailObject(
|
||||
'SHIPPING_FEE',
|
||||
TransactionDetailType::SHIPPING_FEE,
|
||||
$cbm,
|
||||
$price_cbm
|
||||
$invoice_transaction->bill_no,
|
||||
$invoice_transaction->bill_no,
|
||||
1,
|
||||
$invoice_transaction->amount,
|
||||
$invoice_transaction->amount
|
||||
);
|
||||
|
||||
$this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
|
||||
|
||||
if ($over_weight_cbm > 0) {
|
||||
$object_detail = new TransactionDetailObject(
|
||||
'OVER_WEIGHT_CHARGES',
|
||||
TransactionDetailType::OVER_WEIGHT_CHARGES,
|
||||
$over_weight_cbm,
|
||||
$price_cbm
|
||||
);
|
||||
|
||||
$this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
|
||||
}
|
||||
$transaction_detail = $this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
|
||||
|
||||
$transaction_invoice_pdf = LaravelMpdf::loadView('pages.pdfs.shipping_invoice', ['invoice_transaction' => $invoice_transaction]);
|
||||
|
||||
@@ -205,12 +185,11 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
ApprovalStatus::COMPLETED,
|
||||
'shipping_invoice'
|
||||
);
|
||||
|
||||
/** @var Document $document */
|
||||
$document = $this->createsDocument->execute($invoice_transaction, $document_object);
|
||||
|
||||
$this->createsFile->execute($document, $document_object);
|
||||
|
||||
// dd('yess');
|
||||
return $this->response([]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class TransactionDetailObject implements DataTransferObject
|
||||
/** @var string|null */
|
||||
private $name;
|
||||
|
||||
/** @var float|null */
|
||||
/** @var int|null */
|
||||
private $quantity;
|
||||
|
||||
/** @var float|null */
|
||||
@@ -22,10 +22,10 @@ class TransactionDetailObject implements DataTransferObject
|
||||
* TransactionDetailObject constructor.
|
||||
* @param string $reference
|
||||
* @param string $name
|
||||
* @param float $quantity
|
||||
* @param int $quantity
|
||||
* @param float $price
|
||||
*/
|
||||
public function __construct(?string $reference, ?string $name , ?float $quantity, ?float $price)
|
||||
public function __construct(?string $reference, ?string $name , ?int $quantity, ?float $price)
|
||||
{
|
||||
$this->reference = $reference;
|
||||
$this->name = $name;
|
||||
@@ -50,9 +50,9 @@ class TransactionDetailObject implements DataTransferObject
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
* @return int
|
||||
*/
|
||||
public function getQuantity(): ?float
|
||||
public function getQuantity(): ?int
|
||||
{
|
||||
return $this->quantity;
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\ValueObjects\Constants;
|
||||
|
||||
final class TransactionDetailType {
|
||||
|
||||
public const SHIPPING_FEE = 'Shipping Fee';
|
||||
|
||||
public const OVER_WEIGHT_CHARGES = 'Over weight charges';
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Exports;
|
||||
|
||||
use App\Classes\Modules\Exports\Services\ExportsPendingArrangementDeliveryList;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Maatwebsite\Excel\Excel;
|
||||
|
||||
class ExportPendingArrangementPackingListController
|
||||
{
|
||||
/**
|
||||
* ExportPendingArrangementPackingListController constructor.
|
||||
* @param Request $request
|
||||
*/
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$token = Auth::fromUser(User::find(1));
|
||||
$request->headers->set('Authorization', 'Bearer '.$token);
|
||||
}
|
||||
|
||||
public function export(Request $request) {
|
||||
$exportsPendingArrangementDeliveryList = new ExportsPendingArrangementDeliveryList($request);
|
||||
$response = $exportsPendingArrangementDeliveryList->download('pending-arrangement-packing-list.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
||||
ob_end_clean();
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ class DownloadOrderQrPdfController
|
||||
$warehousePrefix = '';
|
||||
$deliveryPrefix = '';
|
||||
$customerMarking = '';
|
||||
$remark = $warehouse->remarks()->first();
|
||||
$remark = $warehouse->remarks()->first()->content;
|
||||
|
||||
if($warehouse->reference === WarehouseReferences::VT_GUANG_ZHOU || $warehouse->reference === WarehouseReferences::VT_YIWU) {
|
||||
$customerMarking = $order->companyModule->connections()->first()->invitee_reference.'/';
|
||||
@@ -44,11 +44,11 @@ class DownloadOrderQrPdfController
|
||||
if($warehouse->reference === WarehouseReferences::YD_GUANG_ZHOU){
|
||||
$warehousePrefix = 'YD/';
|
||||
|
||||
if(strtolower($deliveryAddress->state->name) === 'sabah' || strtolower($deliveryAddress->state->name) === 'labuan' || in_array(strtolower($deliveryAddress->district->name), ['limbang', 'lawas'])) {
|
||||
if(strtolower($deliveryAddress->state->name) === 'sabah' || strtolower($deliveryAddress->state->name) === 'labuan') {
|
||||
$warehousePrefix = 'KK/';
|
||||
}
|
||||
|
||||
if(strtolower($deliveryAddress->state->name) === 'sarawak' && !in_array(strtolower($deliveryAddress->district->name), ['limbang', 'lawas'])) {
|
||||
if(strtolower($deliveryAddress->state->name) === 'sarawak') {
|
||||
$warehousePrefix = 'KU/';
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ class DownloadOrderQrPdfController
|
||||
'delivery_address' => $deliveryAddress,
|
||||
'warehouse_address' => $warehouseAddress,
|
||||
'warehouse_contacts' => $warehouseContacts,
|
||||
'remark' => $remark ? $remark->content : ''
|
||||
'remark' => $remark
|
||||
];
|
||||
|
||||
$pdf = LaravelMpdf::loadView('pdfs.qr', $data, [], [
|
||||
|
||||
@@ -200,62 +200,4 @@ class MonthlyReportController
|
||||
})->sum('quantity'),
|
||||
]]))->handler();
|
||||
}
|
||||
|
||||
public function customerActivityReport(Request $request): JsonResponse {
|
||||
|
||||
$active_start = $request->input('active_start');
|
||||
$active_end = $request->input('active_end');
|
||||
$inactive_start = $request->input('inactive_start');
|
||||
$inactive_end = $request->input('inactive_end');
|
||||
$minCbm = $request->input('cbm');
|
||||
$minOrders = $request->input('minOrders');
|
||||
|
||||
$activeCompanies = CompanyModule::where('type', \App\Classes\ValueObjects\Constants\BusinessType::IMPORTER)->whereHas('orderPackingLists', function($query) use($inactive_start, $inactive_end) {
|
||||
return $query->where('packing_lists.type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('transports', function ($query) use ($inactive_start, $inactive_end) {
|
||||
return $query->where('drop_date', '>=', \Carbon\Carbon::parse($inactive_start))->where('drop_date', '<=', \Carbon\Carbon::parse($inactive_end)->addDay());
|
||||
});
|
||||
})->pluck('id');
|
||||
|
||||
$companies = CompanyModule::where('type', \App\Classes\ValueObjects\Constants\BusinessType::IMPORTER)->whereHas('orderPackingLists', function($query) use($active_start, $active_end) {
|
||||
return $query->where('packing_lists.type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('transports', function ($query) use ($active_start, $active_end) {
|
||||
return $query->whereDate('drop_date', '>=', \Carbon\Carbon::parse($active_start))->whereDate('drop_date', '<=', \Carbon\Carbon::parse($active_end)->addDay());
|
||||
});
|
||||
})->whereNotIn('id', $activeCompanies)->get();
|
||||
|
||||
$customerActivityData = [];
|
||||
$counter = 1;
|
||||
|
||||
foreach ($companies as $key => $company){
|
||||
$connection = $company->inviters()->withPivot('invitee_reference')->first();
|
||||
$marking = $connection ? $connection->pivot->invitee_reference:'';
|
||||
$packingList = $company->orderPackingLists()->where('packing_lists.type', \App\Classes\ValueObjects\Constants\PackingListType::SHIPPING_PACKING_LIST)->get();
|
||||
$totalCbm = $packingList->flatMap(function ($packingList) {
|
||||
return $packingList->packages;
|
||||
})->sum(function($package){
|
||||
return (( (float) $package->width / 100) * ( (float) $package->length / 100) * ( (float) $package->height / 100)) * $package->quantity;
|
||||
});
|
||||
|
||||
if ($minCbm != 'null' && $totalCbm < $minCbm) { continue; }
|
||||
|
||||
if ($minOrders != 'null' && $packingList->count() < $minOrders) { continue; }
|
||||
|
||||
array_push($customerActivityData, array(
|
||||
'key' => $counter,
|
||||
'marking' => $marking,
|
||||
'packingListCount'=> $packingList->count(),
|
||||
'totalCbm'=> $totalCbm,
|
||||
));
|
||||
$counter ++;
|
||||
}
|
||||
|
||||
return (new ApiResponseObject('fetch service report Successful',
|
||||
'',
|
||||
HttpStatus::OK_WITH_MESSAGE, ['data' => [
|
||||
'active_start' => Carbon::parse($active_start)->format('d/m/Y'),
|
||||
'active_end' => Carbon::parse($active_end)->format('d/m/Y'),
|
||||
'inactive_start' => Carbon::parse($inactive_start)->format('d/m/Y'),
|
||||
'inactive_end' => Carbon::parse($inactive_end)->format('d/m/Y'),
|
||||
'customerActivityData' => $customerActivityData,
|
||||
]]))->handler();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Segments;
|
||||
|
||||
use App\Classes\Modules\Segments\ControllersLogic\UpdateConstantPostcodeLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdateConstantPostcodeController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param UpdateConstantPostcodeLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function update(Request $request, UpdateConstantPostcodeLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Segments;
|
||||
|
||||
use App\Classes\Modules\Segments\ControllersLogic\UpdateConstantStateLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdateConstantStateController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param UpdateConstantStateLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function update(Request $request, UpdateConstantStateLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,8 +19,9 @@ class ConstantResource extends JsonResource
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'reference' => $this->reference,
|
||||
'value' => (App()->make(ConvertsConstantDetailsToResource::class))->execute($this->resource)
|
||||
'detail' => (App()->make(ConvertsConstantDetailsToResource::class))->execute($this->resource)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class TransportResource extends JsonResource
|
||||
@@ -16,7 +15,6 @@ class TransportResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$currentSchedule = $this->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first();
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'type' => $this->type,
|
||||
@@ -25,10 +23,8 @@ class TransportResource extends JsonResource
|
||||
'dispatch_date' => $this->dispatch_date ? $this->dispatch_date->format('d-m-Y') : $this->dispatch_date,
|
||||
'drop_date' => $this->drop_date ? $this->drop_date->format('d-m-Y') : $this->drop_date,
|
||||
'status' => $this->status,
|
||||
'current_schedule' => new ScheduleResource($currentSchedule),
|
||||
'schedule_history' => ScheduleResource::collection($this->schedules()->where('status', '=', ApprovalStatus::EXPIRED)->get()),
|
||||
'dropped_days' => Carbon::now()->diffInDays($this->drop_date, false),
|
||||
'schedule_complete' => $currentSchedule ? $currentSchedule->eta <= Carbon::now() : false
|
||||
'current_schedule' => new ScheduleResource($this->schedules()->where('status', '=', ApprovalStatus::APPROVED)->first()),
|
||||
'schedule_history' => ScheduleResource::collection($this->schedules()->where('status', '=', ApprovalStatus::EXPIRED)->get())
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
+1
-3
@@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
use Tymon\JWTAuth\Contracts\JWTSubject;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
@@ -25,9 +24,8 @@ class User extends AbstractModel implements
|
||||
AuthorizableContract,
|
||||
CanResetPasswordContract
|
||||
{
|
||||
use HasRoles, Notifiable, Authenticatable, Authorizable, CanResetPassword, MustVerifyEmail, SoftDeletes;
|
||||
use HasRoles, Notifiable, Authenticatable, Authorizable, CanResetPassword, MustVerifyEmail;
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
/**
|
||||
* Get the identifier that will be stored in the subject claim of the JWT.
|
||||
|
||||
@@ -18,7 +18,7 @@ class CreateTransactionDetailsTable extends Migration
|
||||
$table->foreignId('transaction_id')->unsigned();
|
||||
$table->string('reference');
|
||||
$table->string('name');
|
||||
$table->decimal('quantity', 25, 5)->default(0.00);
|
||||
$table->integer('quantity')->default(0);
|
||||
$table->decimal('price', 25, 5)->default(0.00);
|
||||
$table->decimal('amount', 25, 5)->default(0.00);
|
||||
$table->softDeletes();
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddDeletedAtToUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.6 KiB |
@@ -317,6 +317,12 @@ hr{
|
||||
background-color: $color-primary-lighter !important;
|
||||
}
|
||||
|
||||
.bg-primary-lighter-hover {
|
||||
&:hover {
|
||||
background-color: $color-primary-lighter !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Complete
|
||||
------------------------------------
|
||||
*/
|
||||
|
||||
@@ -82,35 +82,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row parentContainer" v-if="!item.identification">
|
||||
<div class="col">
|
||||
<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="row">
|
||||
<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>
|
||||
<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>
|
||||
|
||||
+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>
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
</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">{{item.transport ? item.transport.current_schedule.eta : 'n/a'}}</p>
|
||||
</div>
|
||||
<div class="col-auto text-right" v-if="!item.transport">
|
||||
<div class="row m-b-5">
|
||||
@@ -36,7 +35,7 @@
|
||||
<div v-if="!item.order" class="text-danger">Unclaimed</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row hide" v-if="false">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div v-if="!item.shippng_transaction">
|
||||
<div class="btn btn-xs btn-primary pointer" @click="generateInvoice()">Generate Invoice</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>
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<small class="fs-10 all-caps muted">Status</small>
|
||||
<p class="no-margin bold">{{item.container ? item.container.transport.schedule_complete && status === 'Shipping' ? 'Custom Clearance' : status : status}}</p>
|
||||
<p class="no-margin bold">{{status}}</p>
|
||||
</div>
|
||||
<div class="col-auto" v-if="$store.getters.isAdmin">
|
||||
<small class="fs-10 all-caps muted">Container</small>
|
||||
|
||||
@@ -22,18 +22,17 @@
|
||||
<p class="no-margin all-caps fs-10 light">Arrival Date</p>
|
||||
<p class="no-margin text-success bold">{{data.transport ? data.transport.drop_date : 'n/a'}}</p>
|
||||
</div>
|
||||
<div class="col text-right" v-if="$store.getters.isSuperAdmin">
|
||||
<div class="col text-right">
|
||||
<button type="button" class="btn b-rad-none btn-primary fs-11 requestModal" data-type="claimPackingList">Claim</button>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="claimPackingList">
|
||||
<claim-packinglist-form-component :data="data.id"></claim-packinglist-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="claimPackingList">
|
||||
<claim-packinglist-form-component :data="data.id"></claim-packinglist-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
+10
-16
@@ -7,28 +7,22 @@
|
||||
</div>
|
||||
</div>
|
||||
<error-message-component class="m-b-20" :error="error"></error-message-component>
|
||||
<div class="row m-b-25">
|
||||
<div class="col p-r-5">
|
||||
<validation-wrapper-component :validator="$v.parameters.receive_date">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.receive_date">
|
||||
<label class="text-primary">Receive Date</label>
|
||||
<date-picker-component v-model="parameters.receive_date"></date-picker-component>
|
||||
<date-picker-component :parameters="parameters" :value="'receive_date'"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<validation-wrapper-component :validator="$v.parameters.tracking">
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.tracking">
|
||||
<label class="text-primary">Tracking</label>
|
||||
<input type="text" class="form-control fs-12" v-model.trim="parameters.tracking">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<package-form-component :section="section" :packages="parameters.packages"></package-form-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-15 align-items-center justify-content-center" v-if="parameters.packages.length > 0">
|
||||
<div class="col">
|
||||
<div class="btn btn-block btn-lg btn-primary b-rad-none no-border" @click="submitForm">Submit</div>
|
||||
<div class="row m-t-15 align-items-center justify-content-center">
|
||||
<div class="col">
|
||||
<div class="btn btn-block btn-lg btn-primary b-rad-none no-border" @click="submitForm">Submit</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,101 +1,121 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row no-margin">
|
||||
<div class="col p-t-25 p-t-25">
|
||||
<div class="row">
|
||||
<div class="col p-b-10 b-b b-grey">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto p-r-0" style="min-width: 40px;">
|
||||
<div class="font-heading all-caps fs-10"></div>
|
||||
</div>
|
||||
<div class="col p-r-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Type</div>
|
||||
</div>
|
||||
<div class="col-4 p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Description</div>
|
||||
</div>
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Width</div>
|
||||
</div>
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Height</div>
|
||||
</div>
|
||||
<div class="col-1 text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Length</div>
|
||||
</div>
|
||||
<div class="col-1 text-right p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Weight</div>
|
||||
</div>
|
||||
<div class="col-1 text-right p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Quantity</div>
|
||||
</div>
|
||||
<div class="col-1 text-right p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10 muted">Reference</div>
|
||||
</div>
|
||||
<div class="col-auto text-center">
|
||||
<button class="btn btn-xs btn-outline-success b-rad-none invisible"><i class="fa fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<div class="row" v-if="!submitted">
|
||||
<div class="col p-b-10 p-t-10 b-b b-grey">
|
||||
<div class="row align-items-center m-b-15">
|
||||
<div class="col p-b-5 p-t-5 b-b b-grey">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto p-r-0" style="min-width: 40px;">
|
||||
<div class="font-heading all-caps fs-10"></div>
|
||||
</div>
|
||||
<div class="col p-r-5">
|
||||
<validation-wrapper-component :validator="$v.product.description">
|
||||
<label class="text-primary">Description</label>
|
||||
<input type="text" class="form-control fs-12" v-model="product.description">
|
||||
</validation-wrapper-component>
|
||||
<select-component :options="[{'id': 0, 'text': 'Carton'}, {'id': 1, 'text': 'Pallet'}]" v-model="product.type"></select-component>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<validation-wrapper-component :validator="$v.product.quantity">
|
||||
<label class="text-primary">Quantity</label>
|
||||
<input type="text" class="form-control fs-12" v-model="product.quantity">
|
||||
</validation-wrapper-component>
|
||||
<div class="col-4 p-r-5 p-l-5">
|
||||
<textarea class="form-control fs-10 b-rad-none" placeholder="Description" rows="1" @keyup="onlyEnglish($event)" v-model="product.description"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-15">
|
||||
<div class="col p-r-5">
|
||||
<validation-wrapper-component :validator="$v.product.width">
|
||||
<label class="text-primary">Width</label>
|
||||
<input type="text" class="form-control fs-12" v-model="product.width">
|
||||
</validation-wrapper-component>
|
||||
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<input type="text" class="form-control fs-10 b-rad-none text-center" placeholder="Width" v-model.lazy="product.width"/>
|
||||
</div>
|
||||
<div class="col p-r-5 p-l-5">
|
||||
<validation-wrapper-component :validator="$v.product.height">
|
||||
<label class="text-primary">Height</label>
|
||||
<input type="text" class="form-control fs-12" v-model="product.height">
|
||||
</validation-wrapper-component>
|
||||
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<input type="text" class="form-control fs-10 b-rad-none text-center" placeholder="Height" v-model.lazy="product.height"/>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<validation-wrapper-component :validator="$v.product.length">
|
||||
<label class="text-primary">Length</label>
|
||||
<input type="text" class="form-control fs-12" v-model="product.length">
|
||||
</validation-wrapper-component>
|
||||
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<input type="text" class="form-control fs-10 b-rad-none text-center" placeholder="Length" v-model.lazy="product.length"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button class="btn btn-success btn-block b-rad-none" @click="addPackage()">Add Package</button>
|
||||
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<input type="text" class="form-control fs-10 b-rad-none text-center" placeholder="Weight" v-model.lazy="product.weight"/>
|
||||
</div>
|
||||
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<input type="text" class="form-control fs-10 b-rad-none text-center" placeholder="Quantity" v-model.lazy="product.quantity"/>
|
||||
</div>
|
||||
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<input type="text" class="form-control fs-10 b-rad-none text-center" placeholder="Reference" v-model.lazy="product.reference"/>
|
||||
</div>
|
||||
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-xs btn-outline-success b-rad-none" @click="addPackage()"><i class="fa fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-for="(item, index) in packages">
|
||||
<div class="col p-b-10 p-t-10 b-b b-grey">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row align-items-center m-b-15">
|
||||
<div class="col-auto">
|
||||
<div @click="removePackage(index)" class="pointer">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
width="25" height="25"
|
||||
viewBox="0 0 172 172"
|
||||
style=" fill:#000000;"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g fill="#e74c3c"><path d="M18.87987,153.12013c2.23887,2.23819 5.86807,2.23819 8.10693,0l59.0132,-59.0132l59.0132,59.0132c2.24964,2.17277 5.82555,2.1417 8.03709,-0.06984c2.21154,-2.21154 2.24261,-5.78745 0.06984,-8.03709l-59.0132,-59.0132l59.0132,-59.0132c1.49042,-1.43949 2.08815,-3.57117 1.56346,-5.57571c-0.52469,-2.00454 -2.09015,-3.57 -4.09469,-4.09469c-2.00454,-0.52469 -4.13622,0.07305 -5.57571,1.56346l-59.0132,59.0132l-59.0132,-59.0132c-2.24964,-2.17277 -5.82555,-2.1417 -8.03709,0.06984c-2.21154,2.21154 -2.24261,5.78745 -0.06984,8.03709l59.0132,59.0132l-59.0132,59.0132c-2.23819,2.23887 -2.23819,5.86807 0,8.10693z"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<p class="m-b-0 small muted">Description</p>
|
||||
<p class="m-b-0 bold">{{item.description}}</p>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<p class="m-b-0 small muted">Quantity</p>
|
||||
<p class="m-b-0 bold">{{item.quantity}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto">
|
||||
<p class="m-b-0 small muted">Width</p>
|
||||
<p class="m-b-0 bold">{{item.width}}</p>
|
||||
</div>
|
||||
<div class="col-auto text-center">
|
||||
<p class="m-b-0 small muted">Height</p>
|
||||
<p class="m-b-0 bold">{{item.height}}</p>
|
||||
</div>
|
||||
<div class="col-auto text-center">
|
||||
<p class="m-b-0 small muted">Length</p>
|
||||
<p class="m-b-0 bold">{{item.length}}</p>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<p class="m-b-0 small muted">Total CBM</p>
|
||||
<p class="m-b-0 bold text-success">{{(Math.round((((item.width / 100) * (item.height / 100) * (item.length / 100) * item.quantity)) * 1000) / 1000).toFixed(3)}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto p-r-0" style="min-width: 40px;">
|
||||
<div class="font-heading all-caps fs-10">{{index + 1}}</div>
|
||||
</div>
|
||||
<div class="col p-r-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.type}}</div>
|
||||
</div>
|
||||
<div class="col-4 p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.description}}</div>
|
||||
</div>
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.width}}</div>
|
||||
</div>
|
||||
<div class="col text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.height}}</div>
|
||||
</div>
|
||||
<div class="col-1 text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.length}}</div>
|
||||
</div>
|
||||
<div class="col-1 text-center p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.weight}}</div>
|
||||
</div>
|
||||
<div class="col-1 text-right p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.quantity}}</div>
|
||||
</div>
|
||||
<div class="col-1 text-right p-r-5 p-l-5">
|
||||
<div class="font-heading all-caps fs-10">{{item.reference}}</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button class="btn btn-xs btn-outline-danger b-rad-none" v-if="!submitted" @click="removePackage(index)"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -109,7 +129,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { required, numeric } from "vuelidate/lib/validators";
|
||||
import formHandler from '../../../general/mixins/formHandler';
|
||||
export default {
|
||||
props: {
|
||||
@@ -122,7 +141,7 @@
|
||||
return {
|
||||
submitted: false,
|
||||
product: {
|
||||
type: 0,
|
||||
type: '',
|
||||
description: '',
|
||||
width: 0,
|
||||
height: 0,
|
||||
@@ -133,40 +152,15 @@
|
||||
},
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
product: {
|
||||
type: {
|
||||
required
|
||||
},
|
||||
description: {
|
||||
required
|
||||
},
|
||||
width: {
|
||||
required,
|
||||
numeric
|
||||
},
|
||||
height: {
|
||||
required,
|
||||
numeric
|
||||
},
|
||||
length: {
|
||||
required,
|
||||
numeric
|
||||
},
|
||||
weight: {
|
||||
required,
|
||||
numeric
|
||||
},
|
||||
quantity: {
|
||||
required,
|
||||
numeric
|
||||
},
|
||||
reference: {
|
||||
required
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onlyEnglish(event){
|
||||
let value = event.target.value,
|
||||
regex = /^[^~`!@#$%^&*()_+=[\]\{}|;':",.\/<>?a-zA-Z0-9-]+$/;
|
||||
event.preventDefault();
|
||||
if(regex.test(value)){
|
||||
this.product.description = value.replace(regex, '');
|
||||
}
|
||||
},
|
||||
addPackage(){
|
||||
this.packages.push({
|
||||
type: this.product.type,
|
||||
@@ -179,19 +173,17 @@
|
||||
reference: this.product.reference,
|
||||
});
|
||||
|
||||
this.resetProduct();
|
||||
},
|
||||
resetProduct(){
|
||||
this.product = {
|
||||
type: '',
|
||||
description: '',
|
||||
width: 0,
|
||||
height: 0,
|
||||
length: 0,
|
||||
weight: 0,
|
||||
quantity: 1,
|
||||
reference: 0,
|
||||
};
|
||||
this.product = {
|
||||
type: '',
|
||||
description: '',
|
||||
width: 0,
|
||||
height: 0,
|
||||
length: 0,
|
||||
weight: 0,
|
||||
quantity: 1,
|
||||
reference: 0,
|
||||
};
|
||||
|
||||
},
|
||||
removePackage(index){
|
||||
this.packages.splice(index, 1);
|
||||
|
||||
@@ -273,11 +273,9 @@
|
||||
viewBox="0 0 172 172"
|
||||
style=" fill:#000000;"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g fill="#000000"><path d="M8.6,23.65c-2.37676,0 -4.3,1.92324 -4.3,4.3c0,2.37676 1.92324,4.3 4.3,4.3c2.37676,0 4.3,-1.92324 4.3,-4.3c4.77031,0 8.6,3.82969 8.6,8.6v85.10137c0,8.28926 6.76074,15.05 15.05,15.05h0.50391c0.99941,2.98145 3.72051,5.19863 7.02109,5.19863h4.43438c-0.74746,1.26816 -1.20938,2.72949 -1.20938,4.3c0,4.72832 3.87168,8.6 8.6,8.6c4.72832,0 8.6,-3.87168 8.6,-8.6c0,-1.57051 -0.46191,-3.03184 -1.20938,-4.3h66.91875c-0.74746,1.26816 -1.20937,2.72949 -1.20937,4.3c0,4.72832 3.87168,8.6 8.6,8.6c4.72832,0 8.6,-3.87168 8.6,-8.6c0,-1.57051 -0.46191,-3.03184 -1.20937,-4.3h4.43437c3.36777,0 6.13926,-2.30117 7.08828,-5.375h0.43672v-2.15c0,-3.90527 -3.04863,-7.12188 -6.87832,-7.45781c0.26035,-0.69707 0.42832,-1.43613 0.42832,-2.21719v-40.85c0,-1.67129 -0.73066,-3.14941 -1.78887,-4.3c1.0582,-1.15059 1.78887,-2.62871 1.78887,-4.3v-43c0,-3.53574 -2.91426,-6.45 -6.45,-6.45h-94.6c-3.53574,0 -6.45,2.91426 -6.45,6.45v43c0,1.67129 0.73066,3.14941 1.78887,4.3c-1.0582,1.15059 -1.78887,2.62871 -1.78887,4.3v40.85c0,0.78105 0.16797,1.52012 0.42832,2.21719c-3.15781,0.27715 -5.75293,2.51953 -6.57598,5.48418h-0.30234c-5.96289,0 -10.75,-4.78711 -10.75,-10.75v-85.10137c0,-7.09668 -5.80332,-12.9 -12.9,-12.9zM49.45,30.1h94.6c1.21777,0 2.15,0.93223 2.15,2.15v43c0,1.21777 -0.93223,2.15 -2.15,2.15c-1.17578,0.0168 -2.11641,0.97422 -2.11641,2.15c0,1.17578 0.94062,2.1332 2.11641,2.15c1.21777,0 2.15,0.93223 2.15,2.15v40.85c0,1.21777 -0.93223,2.15 -2.15,2.15h-94.6c-1.21777,0 -2.15,-0.93223 -2.15,-2.15v-40.85c0,-1.21777 0.93223,-2.15 2.15,-2.15c1.17578,-0.0168 2.11641,-0.97422 2.11641,-2.15c0,-1.17578 -0.94063,-2.1332 -2.11641,-2.15c-1.21777,0 -2.15,-0.93223 -2.15,-2.15v-43c0,-1.21777 0.93223,-2.15 2.15,-2.15zM88.15,38.7c-0.77266,-0.0084 -1.49492,0.39473 -1.88965,1.0666c-0.38633,0.67188 -0.38633,1.49492 0,2.1668c0.39473,0.67188 1.11699,1.075 1.88965,1.0666h17.2c0.77266,0.0084 1.49492,-0.39473 1.88965,-1.0666c0.38633,-0.67187 0.38633,-1.49492 0,-2.1668c-0.39472,-0.67187 -1.11699,-1.075 -1.88965,-1.0666zM58.05,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM66.65,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM75.25,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM83.85,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM92.45,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM101.05,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM109.65,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM118.25,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM126.85,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM135.45,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM88.15,90.3c-0.77266,-0.0084 -1.49492,0.39473 -1.88965,1.0666c-0.38633,0.67188 -0.38633,1.49492 0,2.1668c0.39473,0.67188 1.11699,1.075 1.88965,1.0666h17.2c0.77266,0.0084 1.49492,-0.39473 1.88965,-1.0666c0.38633,-0.67187 0.38633,-1.49492 0,-2.1668c-0.39472,-0.67187 -1.11699,-1.075 -1.88965,-1.0666zM44.075,131.15h105.35c1.80566,0 3.225,1.41934 3.225,3.225c0,1.80566 -1.41934,3.225 -3.225,3.225h-105.35c-1.80566,0 -3.225,-1.41934 -3.225,-3.225c0,-1.80566 1.41934,-3.225 3.225,-3.225zM55.9,141.9c2.40195,0 4.3,1.89805 4.3,4.3c0,2.40195 -1.89805,4.3 -4.3,4.3c-2.40195,0 -4.3,-1.89805 -4.3,-4.3c0,-2.40195 1.89805,-4.3 4.3,-4.3zM137.6,141.9c2.40195,0 4.3,1.89805 4.3,4.3c0,2.40195 -1.89805,4.3 -4.3,4.3c-2.40195,0 -4.3,-1.89805 -4.3,-4.3c0,-2.40195 1.89805,-4.3 4.3,-4.3z"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="$store.getters.isSuperAdmin">
|
||||
<div class="col">
|
||||
<div data-type="createWarehousePackageList" class="text-complete pointer requestModal fs-11 all-caps text-underline">Add Arrived Parcel</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="stick-up" type="createWarehousePackageList" >
|
||||
<div class="col-auto" v-if="false">
|
||||
<div data-type="createWarehousePackageList" class="btn btn-sm btn-block bg-white text-info b-rad-sm pointer requestModal">Add</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="stick-up" type="createWarehousePackageList" size="large">
|
||||
<create-warehouse-package-list-form-component :id="order.id" :section="section"></create-warehouse-package-list-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
|
||||
-63
@@ -1,63 +0,0 @@
|
||||
<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>
|
||||
-145
@@ -1,145 +0,0 @@
|
||||
<template>
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row m-l-0 m-r-0 bg-master-light padding-10" @keyup.enter="submitSearch()">
|
||||
<div class="col-12 col-md mb-2 mb-md-0">
|
||||
<div class="row">
|
||||
<div class="col p-r-0 h-100">
|
||||
<validation-wrapper-component :validator="$v.numOrders">
|
||||
<label class="all-caps">Number Of Orders</label>
|
||||
<input class="form-control" v-model.lazy="numOrders">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col p-l-0 h-100">
|
||||
<validation-wrapper-component :validator="$v.cbm">
|
||||
<label class="all-caps">CBM</label>
|
||||
<input class="form-control" v-model.lazy="cbm">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md mb-2 mb-md-0">
|
||||
<div class="row">
|
||||
<div class="col p-r-0 h-100">
|
||||
<validation-wrapper-component :validator="$v.activeDateFrom">
|
||||
<label class="all-caps">Active Date From</label>
|
||||
<date-picker-component v-model.lazy="activeDateFrom"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col p-l-0 h-100">
|
||||
<validation-wrapper-component :validator="$v.activeDateTo">
|
||||
<label class="all-caps">Active Date To</label>
|
||||
<date-picker-component v-model.lazy="activeDateTo"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md mb-2 mb-md-0">
|
||||
<div class="row">
|
||||
<div class="col p-r-0 h-100">
|
||||
<validation-wrapper-component :validator="$v.inactiveDateFrom">
|
||||
<label class="all-caps">Inactive Date From</label>
|
||||
<date-picker-component v-model.lazy="inactiveDateFrom"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col p-l-0 h-100">
|
||||
<validation-wrapper-component :validator="$v.inactiveDateTo">
|
||||
<label class="all-caps">Inactive Date To</label>
|
||||
<date-picker-component v-model.lazy="inactiveDateTo"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto mb-2 mb-md-0">
|
||||
<div class="row h-100">
|
||||
<div class="col p-r-0 h-100">
|
||||
<div class="btn btn-primary b-rad-none w-100 h-100 d-flex justify-content-center align-items-center p-l-30 p-r-30" @click="submitSearch()">
|
||||
Search
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-l-0 h-100">
|
||||
<div class="btn btn-secondary b-rad-none w-100 h-100 d-flex justify-content-center align-items-center p-l-30 p-r-30" @click="resetSearch()">
|
||||
Reset
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<loading-component style="height: 100%; top: 0;" key="1" color="success" v-show="isLoading"></loading-component>
|
||||
<div class="row" v-show="!isLoading" v-if="activityData">
|
||||
<div class="col">
|
||||
<h4>List of customers active between <span style="color: green; font-weight: bold">{{ activityData.active_start }} - {{ activityData.active_end }}</span> & inactive between <span style="color: red; font-weight: bold">{{ activityData.active_start }} - {{ activityData.active_end }}</span></h4>
|
||||
<table>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>marking</th>
|
||||
<th>Number of Orders</th>
|
||||
<th>CBM</th>
|
||||
</tr>
|
||||
<tr v-for="item in activityData.customerActivityData" >
|
||||
<td>{{item.key}}</td>
|
||||
<td><a :href="route('customer.profile', item.marking)" target="_blank">{{ item.marking }}</a></td>
|
||||
<td>{{ item.packingListCount }}</td>
|
||||
<td>{{ item.totalCbm }} </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import componentHandler from "../../../general/mixins/componentHandler";
|
||||
import { required } from "vuelidate/lib/validators";
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
section: 'customerActivityReportSection',
|
||||
isLoading: false,
|
||||
cbm: null,
|
||||
numOrders: null,
|
||||
activeDateFrom: '',
|
||||
activeDateTo: '',
|
||||
inactiveDateFrom: '',
|
||||
inactiveDateTo: '',
|
||||
activityData: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitSearch(){
|
||||
this.$store.dispatch('toggleSection', {name: this.section, status: true});
|
||||
this.submit(route('api.report.customerActivity') + '?active_start=' + this.activeDateFrom + '&active_end=' + this.activeDateTo + '&inactive_start=' + this.inactiveDateFrom + '&inactive_end=' + this.inactiveDateTo + '&cbm=' + this.cbm + '&minOrders=' + this.numOrders, 'get', this.section, false, false);
|
||||
this.isLoading = true;
|
||||
},
|
||||
resetSearch() {
|
||||
this.$store.dispatch('toggleSection', {name: this.section, status: false});
|
||||
this.cbm = null;
|
||||
this.numOrders = null;
|
||||
this.activeDateFrom = '';
|
||||
this.activeDateTo = '';
|
||||
this.inactiveDateFrom = '';
|
||||
this.inactiveDateTo = '';
|
||||
this.activityData = null;
|
||||
},
|
||||
successHandler(response){
|
||||
this.activityData = response.payload.data;
|
||||
this.isLoading = false;
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
cbm: { },
|
||||
numOrders: { },
|
||||
activeDateFrom: { required },
|
||||
activeDateTo: { required },
|
||||
inactiveDateFrom: { required },
|
||||
inactiveDateTo: { required }
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
};
|
||||
</script>
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps">{{data.reference}}</div>
|
||||
<div class="font-heading all-caps">{{data.name}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,42 +2,37 @@
|
||||
@section('inner_content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<customer-activity-report-section-component></customer-activity-report-section-component>
|
||||
<div class="row" v-show="!$store.getters.isShowing('customerActivityReportSection')">
|
||||
<div class="col">
|
||||
<customer-report-section-component></customer-report-section-component>
|
||||
<div class="row d-none" :class="[{'d-flex': $store.getters.isAdmin}]" v-if="$store.getters.isAdmin">
|
||||
<div class="col-6">
|
||||
<div class="row p-b-5 b-b b-grey m-b-10 m-l-0 m-r-0">
|
||||
<div class="col no-padding">
|
||||
<h6>Customers List</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-l-0 m-r-0">
|
||||
<div class="col">
|
||||
<list-component key="2" section="customerListSection" :endpoint="route('api.company.list')" :options="{'has_business_module_type': 1}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<company-component :data="data"></company-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
<customer-report-section-component></customer-report-section-component>
|
||||
<div class="row d-none" :class="[{'d-flex': $store.getters.isAdmin}]" v-if="$store.getters.isAdmin">
|
||||
<div class="col-6">
|
||||
<div class="row p-b-5 b-b b-grey m-b-10 m-l-0 m-r-0">
|
||||
<div class="col no-padding">
|
||||
<h6>Customers List</h6>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="row p-b-5 b-b b-grey m-b-10 m-l-0 m-r-0">
|
||||
<div class="col no-padding">
|
||||
<h6>Customers Without Confirmed Orders</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-l-0 m-r-0">
|
||||
<div class="col">
|
||||
<list-component key="2" section="customerWithoutConfirmedOrdersListSection" :endpoint="route('api.company.list')" :options="{'has_business_module_type': 1, 'created_after': '18-09-2021','without_confirmed_orders': true}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<company-component :data="data"></company-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-l-0 m-r-0">
|
||||
<div class="col">
|
||||
<list-component key="2" section="customerListSection" :endpoint="route('api.company.list')" :options="{'has_business_module_type': 1}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<company-component :data="data"></company-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="row p-b-5 b-b b-grey m-b-10 m-l-0 m-r-0">
|
||||
<div class="col no-padding">
|
||||
<h6>Customers Without Confirmed Orders</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-l-0 m-r-0">
|
||||
<div class="col">
|
||||
<list-component key="2" section="customerWithoutConfirmedOrdersListSection" :endpoint="route('api.company.list')" :options="{'has_business_module_type': 1, 'created_after': '18-09-2021','without_confirmed_orders': true}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<company-component :data="data"></company-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -44,20 +44,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row p-b-5 b-b b-grey m-b-10 m-l-0 m-r-0">
|
||||
<div class="col no-padding">
|
||||
<h6>Unclaimed Packing Lists</h6>
|
||||
</div>
|
||||
</div>
|
||||
<list-component section="unclaimedPackingListSection" :endpoint="route('api.packing_list.list')" :options="{claimant_id: 2037, owner_id: 1, status: 4}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<unclaimed-packinglist-component :data="data"></unclaimed-packinglist-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
<profit-model-report-section-component></profit-model-report-section-component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -75,79 +75,55 @@
|
||||
<div class="col bg-master-lightest p-1 p-sm-4">
|
||||
<div class="row tabsContainer tabContent" tab-name="pendingArrangement">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a href="{{route('packaging_list.pending_arrangement.export')}}" target="_blank">
|
||||
<button type="button" class="btn btn-sm p-t-10 p-b-10 p-r-35 p-l-35 btn-primary b-rad-none">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto p-r-0 p-l-0">
|
||||
<i class="fa fa-file-excel-o fs-16"></i>
|
||||
</div>
|
||||
<div class="col p-r-5">Export To Excel</div>
|
||||
</div>
|
||||
</button>
|
||||
</a>
|
||||
<div class="row align-items-center m-t-10 p-t-10 p-b-10 b-t b-grey muted all-caps fs-10">
|
||||
<div class="col-2">Marking</div>
|
||||
<div class="col-1 text-center">Quantity</div>
|
||||
<div class="col-1">CBM</div>
|
||||
<div class="col-1">Overweight CBM</div>
|
||||
<div class="col-1">Total CBM</div>
|
||||
<div class="col-1 text-center">status</div>
|
||||
<div class="col-3">Delivery Details</div>
|
||||
<div class="col">Delivery Date</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center m-b-5 p-b-10 b-b b-grey muted all-caps fs-10">
|
||||
<div class="col-2">Marking</div>
|
||||
<div class="col text-center">Quantity</div>
|
||||
<div class="col">CBM</div>
|
||||
<div class="col">Overweight CBM</div>
|
||||
<div class="col">Total CBM</div>
|
||||
<div class="col">status</div>
|
||||
<div class="col">Delivery Date</div>
|
||||
<div class="col text-right">Action</div>
|
||||
</div>
|
||||
<list-component section="activeContainerListSection" :endpoint="route('api.packing_list.list')" :options="{packing_list_type: 2, 'packing_list_delivery_status': 1, with_arrival_date: true ,'per_page': 10, order_by: {column: 'arrival_date', DESC: true}}">
|
||||
<list-component section="activeContainerListSection" :endpoint="route('api.packing_list.list')" :options="{type: 2, 'packing_list_delivery_status': 1, 'per_page': 30}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<packing-list-component :data="data"></packing-list-component>
|
||||
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row tabsContainer tabContent hide" tab-name="pendingDelivery">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row align-items-center p-t-10 p-b-10 b-t b-grey muted all-caps fs-10">
|
||||
<div class="col-2">Marking</div>
|
||||
<div class="col-1 text-center">Quantity</div>
|
||||
<div class="col-1">CBM</div>
|
||||
<div class="col-1">Overweight CBM</div>
|
||||
<div class="col-1">Total CBM</div>
|
||||
<div class="col-1 text-center">status</div>
|
||||
<div class="col-3">Delivery Details</div>
|
||||
<div class="col">Delivery Date</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center m-b-5 p-b-10 b-b b-grey muted all-caps fs-10">
|
||||
<div class="col-2">Marking</div>
|
||||
<div class="col text-center">Quantity</div>
|
||||
<div class="col">CBM</div>
|
||||
<div class="col">Overweight CBM</div>
|
||||
<div class="col">Total CBM</div>
|
||||
<div class="col">status</div>
|
||||
<div class="col">Delivery Date</div>
|
||||
</div>
|
||||
<list-component section="arrivedContainerListSection" :endpoint="route('api.packing_list.list')" :options="{packing_list_type: 2, 'packing_list_delivery_status': 2, with_arrival_date: true ,'per_page': 10, order_by: {column: 'arrival_date', DESC: true}}">
|
||||
<list-component section="arrivedContainerListSection" :endpoint="route('api.packing_list.list')" :options="{type: 2, 'packing_list_delivery_status': 2,'per_page': 30}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<packing-list-component :data="data"></packing-list-component>
|
||||
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row tabsContainer tabContent hide" tab-name="delivered">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row align-items-center p-t-10 p-b-10 b-t b-grey muted all-caps fs-10">
|
||||
<div class="col-2">Marking</div>
|
||||
<div class="col-1 text-center">Quantity</div>
|
||||
<div class="col-1">CBM</div>
|
||||
<div class="col-1">Overweight CBM</div>
|
||||
<div class="col-1">Total CBM</div>
|
||||
<div class="col-1 text-center">status</div>
|
||||
<div class="col-3">Delivery Details</div>
|
||||
<div class="col">Delivery Date</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center m-b-5 p-b-10 b-b b-grey muted all-caps fs-10">
|
||||
<div class="col-2">Marking</div>
|
||||
<div class="col text-center">Quantity</div>
|
||||
<div class="col">CBM</div>
|
||||
<div class="col">Overweight CBM</div>
|
||||
<div class="col">Total CBM</div>
|
||||
<div class="col">status</div>
|
||||
<div class="col">Delivery Date</div>
|
||||
</div>
|
||||
<list-component section="completeContainerListSection" :endpoint="route('api.packing_list.list')" :options="{packing_list_type: 2, 'packing_list_delivery_status': 3, with_arrival_date: true ,'per_page': 10, order_by: {column: 'arrival_date', DESC: true}}">
|
||||
<list-component section="completeContainerListSection" :endpoint="route('api.packing_list.list')" :options="{type: 2, 'packing_list_delivery_status': 3, 'per_page': 30}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<packing-list-component :data="data"></packing-list-component>
|
||||
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -7,14 +7,12 @@
|
||||
<h6>Arrived Parcel</h6>
|
||||
</div>
|
||||
</div>
|
||||
<list-component section="warehouseListSection" :endpoint="route('api.packing_list.list')" :options="{packing_list_type: 1, packing_list_status: 2, per_page: 20, order_by: {column: 'arrival_date', DESC: true}, with_arrival_date: true}" >
|
||||
<list-component section="warehouseListSection" :endpoint="route('api.packing_list.list')" :options="{packing_list_type: 1, packing_list_status: 2, per_page: 5, order_by: {column: 'arrival_date', DESC: true}, with_arrival_date: true}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<parcel-component v-for="packages in data.packages" :data="packages" :key="packages.id"></parcel-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row p-b-5 b-b b-grey m-b-10 m-l-0 m-r-0">
|
||||
<div class="col no-padding">
|
||||
@@ -31,7 +29,7 @@
|
||||
<div class="col">Delivery Date</div>
|
||||
<div class="col"></div>
|
||||
</div>
|
||||
<list-component section="onHoldParcel" :endpoint="route('api.packing_list.list')" :options="{status_in: [5], packing_list_type: 2, per_page: 20}">
|
||||
<list-component section="onHoldParcel" :endpoint="route('api.packing_list.list')" :options="{status_in: [5, 0], per_page: 5}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
|
||||
</template>
|
||||
|
||||
@@ -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
@@ -40,7 +40,7 @@
|
||||
<p style="font-size: 30px; margin-bottom: 0 !important; margin-top: 10px !important;">仓库地址:</p>
|
||||
<p style="margin-top: 5px !important; margin-bottom: 5px !important; word-wrap: break-word; font-size: 30px;">{{$warehouse_address->state->name.' '.$warehouse_address->district->name.' '.$warehouse_address->street_one.' '.$warehouse_address->street_two.' 邮编:'.$warehouse_address->postcode}}</p>
|
||||
<p style="margin-top: 5px !important; margin-bottom: 0px !important; font-size: 30px;">联系:@foreach($warehouse_contacts as $contact){{ $loop->first ? '' : ' / ' }}{{ $contact->phone.' '.$contact->reference }}@endforeach</p>
|
||||
<p style="margin-top: 5px !important; margin-bottom: 0px !important; font-size: 30px;">{!! $remark !!}</p>
|
||||
<p style="margin-top: 5px !important; margin-bottom: 0px !important; font-size: 30px;">{{$remark}}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
Vendored
-13
@@ -6,19 +6,6 @@
|
||||
'routes' => collect(\Route::getRoutes())->mapWithKeys(function ($route) { return [$route->getName() => $route->uri()]; })
|
||||
]) !!};
|
||||
</script>
|
||||
@if(!App::environment('production'))
|
||||
<script type="text/javascript">
|
||||
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
|
||||
(function(){
|
||||
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
|
||||
s1.async=true;
|
||||
s1.src='https://embed.tawk.to/623d8cdd2abe5b455fc195aa/1fv06sgtf';
|
||||
s1.charset='UTF-8';
|
||||
s1.setAttribute('crossorigin','*');
|
||||
s0.parentNode.insertBefore(s1,s0);
|
||||
})();
|
||||
</script>
|
||||
@endif
|
||||
<script src="{{ asset('js/vendor.js') }}" type="text/javascript"></script>
|
||||
<script src="{{mix('vue/app.js')}}"></script>
|
||||
<script src="{{ asset('js/site.js') }}" type="text/javascript"></script>
|
||||
|
||||
@@ -10,6 +10,4 @@ Route::group(['prefix' => 'report', 'as' => 'report.', 'namespace' => 'Reports']
|
||||
Route::get('/profit/{model}/{value}/{from?}/{to?}', 'MonthlyReportController@profitModelReport')->name('profit');
|
||||
|
||||
Route::get('/service', 'MonthlyReportController@serviceReport')->name('service');
|
||||
|
||||
Route::get('/customers/active', 'MonthlyReportController@customerActivityReport')->name('customerActivity');
|
||||
});
|
||||
|
||||
@@ -13,7 +13,5 @@ Route::group(['prefix' => 'segment', 'as' => 'segment.', 'namespace' => 'Segment
|
||||
Route::put('/service/update', 'UpdateCustomServiceConstantController@update')->name('service.update');
|
||||
Route::put('/update', 'UpdateConstantController@update')->name('update');
|
||||
Route::get('/show/{reference}', 'FetchConstantController@fetch')->name('show');
|
||||
Route::put('/update/state', 'UpdateConstantStateController@update')->name('update.state');
|
||||
Route::put('/update/postcode', 'UpdateConstantPostcodeController@update')->name('update.postcode');
|
||||
});
|
||||
});
|
||||
+6
-71
@@ -125,7 +125,7 @@ Route::get('/orders/refresh', function(){
|
||||
|
||||
Route::get('/containers/refresh', function(){
|
||||
|
||||
(App()->make(\App\Classes\Modules\PackingLists\Processors\FetchWarehouseReceiveListFromVTPortalProcessor::class))->execute();
|
||||
(App()->make(\App\Classes\Modules\PackingLists\Processors\FetchPackingListFromVTPortalProcessor::class))->execute();
|
||||
// FetchLoadedContainersFromVTPortalJob::dispatch();
|
||||
// FetchContainersStatusUpdateFromVTPortalJob::dispatch();
|
||||
|
||||
@@ -231,7 +231,6 @@ Route::get('/warehouse/{id}/show', function ($id) {
|
||||
})->name('warehouse.show');
|
||||
Route::get('/export/customer-latest-order-date/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@export');
|
||||
Route::get('/export/packing-list/{id}', 'Exports\ExportContainerPackingListController@export')->name('container.packaging_list.export');
|
||||
Route::get('/export/pending-arrangement-delivery-list', 'Exports\ExportPendingArrangementPackingListController@export')->name('packaging_list.pending_arrangement.export');
|
||||
|
||||
Route::get('/settings', function () {
|
||||
return view('pages.settings');
|
||||
@@ -240,56 +239,6 @@ Route::get('/settings', function () {
|
||||
return view('pages.settings');
|
||||
})->name('settings');
|
||||
|
||||
Route::get('/customer/{company_module_id}/summary', 'Exports\ExportCompanyModuleSummaryController@export')->name('customer.summary.export');
|
||||
|
||||
Route::get('/customer/summary/monthly', function () {
|
||||
// $containers = Container::whereMonth('loading_date', 1)->where('owner_id', 3)->get();
|
||||
$containers = Container::whereIn('reference', ['EPS-3850', 'EPS-3863', 'WP-1331', 'EPS-3856'])->get();
|
||||
foreach ($containers as $container){
|
||||
$packingLists = $container->packingLists()->get()->filter(function ($packingList) {
|
||||
return $packingList->owner->company_module_id === 248;
|
||||
});
|
||||
|
||||
if (!count($packingLists)) continue;
|
||||
|
||||
echo '<table>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Full Marking</th>
|
||||
<th>Container</th>
|
||||
<th>Description</th>
|
||||
<th>Ctns</th>
|
||||
<th>L (cm)</th>
|
||||
<th>H (cm)</th>
|
||||
<th>W (cm)</th>
|
||||
<th>CBM</th>
|
||||
</tr>';
|
||||
foreach ($packingLists as $packingList){
|
||||
if($packingList->packingLists->first()){
|
||||
$packingList = $packingList->packingLists->first();
|
||||
}
|
||||
$packages = $packingList->packages;
|
||||
foreach ($packages as $package){
|
||||
echo '<tr>
|
||||
<td>-</td>
|
||||
<td>MS/CIEF/769SMC/'.$packingList->owner->reference.'</td>
|
||||
<td>'.$container->reference.'</td>
|
||||
<td>'.$package->description.'</td>
|
||||
<td>'.$package->quantity.'</td>
|
||||
<td>'.$package->length.'</td>
|
||||
<td>'.$package->height.'</td>
|
||||
<td>'.$package->width.'</td>
|
||||
<td>'.((($package->length / 100) * ($package->height / 100) * ($package->width / 100)) * $package->quantity).'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
echo '</table>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Route::get('/customers/active/{active_start}/{active_end}/{inactive_start?}/{inactive_end?}/{with_cbm?}', function ($active_start, $active_end, $inactive_start=null, $inactive_end=null, $with_cbm = false) {
|
||||
$activeCompanies = CompanyModule::where('type', \App\Classes\ValueObjects\Constants\BusinessType::IMPORTER)->whereHas('orderPackingLists', function($query) use($inactive_start, $inactive_end) {
|
||||
return $query->where('packing_lists.type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('transports', function ($query) use ($inactive_start, $inactive_end) {
|
||||
@@ -304,18 +253,10 @@ Route::get('/customers/active/{active_start}/{active_end}/{inactive_start?}/{ina
|
||||
})->whereNotIn('id', $activeCompanies)->get();
|
||||
|
||||
echo '<h4>List of customers active between <span style="color: green; font-weight: bold">'.\Carbon\Carbon::parse($active_start)->format('d/m/Y'). ' - '.\Carbon\Carbon::parse($active_end)->format('d/m/Y').'</span> & inactive between <span style="color: red; font-weight: bold">'.\Carbon\Carbon::parse($inactive_start)->format('d/m/Y'). ' - '.\Carbon\Carbon::parse($inactive_end)->format('d/m/Y').'</span></h4>';
|
||||
echo '<table>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>marking</th>
|
||||
<th>Number of Orders</th>
|
||||
<th>CBM</th>
|
||||
</tr>';
|
||||
foreach ($companies as $key => $company){
|
||||
$connection = $company->inviters()->withPivot('invitee_reference')->first();
|
||||
$marking = $connection ? $connection->pivot->invitee_reference:'';
|
||||
$packingList = collect();
|
||||
$totalCbm = 0;
|
||||
|
||||
if($with_cbm){
|
||||
$packingList = $company->orderPackingLists()->where('packing_lists.type', \App\Classes\ValueObjects\Constants\PackingListType::SHIPPING_PACKING_LIST)->get();
|
||||
$totalCbm = $packingList->flatMap(function ($packingList) {
|
||||
@@ -325,19 +266,13 @@ Route::get('/customers/active/{active_start}/{active_end}/{inactive_start?}/{ina
|
||||
});
|
||||
}
|
||||
|
||||
echo '<tr>
|
||||
<td>'.$key.'</td>
|
||||
<td><a href="'.route('customer.profile', $marking).'" target="_blank">'.$marking.'</a></td>
|
||||
<td>'. $packingList->count() .'</td>
|
||||
<td>'. $totalCbm .'</td>
|
||||
</tr>';
|
||||
$totalCbm = ($with_cbm ? '['. $packingList->count().'] ('. $totalCbm .')' : '');
|
||||
|
||||
echo $key + 1 .'. <a href="'.\route('customer.profile', $marking).'" target="_blank">'.$marking.'</a> '.$totalCbm.'<br><br>';
|
||||
}
|
||||
echo '</table>';
|
||||
|
||||
});
|
||||
|
||||
Route::get('/online_payment/redirect', 'Billplz\CallbackBillplzController@callback')->name('online_payment.redirect');
|
||||
|
||||
Route::get('/order/{id}', function ($id) {
|
||||
return view('pages.orders.profile', ['id' => $id]);
|
||||
})->name('order.details');
|
||||
Route::get('/notifications/list', 'Notifications\ListNotificationsController@list')->name('notifications.list');
|
||||
|
||||
Reference in New Issue
Block a user