mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class PackingListDeliveryStatus implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $value == 1 ? $builder->whereDoesntHave('transports') : ($value == 2 ? $builder->whereHas('transports', function (Builder $query) use ($value) {
|
||||
$query->whereDoesntHave('schedules', function (Builder $query) use ($value) {
|
||||
$query->where('status', '!=', ApprovalStatus::EXPIRED)->where('eta', '>', Carbon::now());
|
||||
});
|
||||
}) : $builder->whereHas('transports', function (Builder $query) use ($value) {
|
||||
$query->whereHas('schedules', function (Builder $query) use ($value) {
|
||||
$query->where('status', '!=', ApprovalStatus::EXPIRED)->where('eta', '<', Carbon::now());
|
||||
});
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Companies\ControllersLogic;
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
|
||||
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
|
||||
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
|
||||
use App\Http\Resources\CompanyModuleResource;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CreateCompanyRemarkLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Created Company Module Remark',
|
||||
'message' => 'You have successfully created a new Company Module Remark'
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/** @var FetchesCompanyModule */
|
||||
private $fetchesCompanyModule;
|
||||
|
||||
/** @var CreateRemarkProcessor */
|
||||
private $createRemarkProcessor;
|
||||
|
||||
/**
|
||||
* CreateCompanyRemarkLogic constructor.
|
||||
* @param FetchesCompany $fetchesCompany
|
||||
* @param CreateRemarkProcessor $createRemarkProcessor
|
||||
*/
|
||||
public function __construct(FetchesCompanyModule $fetchesCompanyModule, CreateRemarkProcessor $createRemarkProcessor)
|
||||
{
|
||||
$this->fetchesCompanyModule = $fetchesCompanyModule;
|
||||
$this->createRemarkProcessor = $createRemarkProcessor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
{
|
||||
$companyModule = $this->fetchesCompanyModule->execute(['id' => $request->route('id')]);
|
||||
|
||||
$object = new RemarkObject($request->input('content'), auth()->user()->id);
|
||||
|
||||
$this->createRemarkProcessor->execute($companyModule, $object);
|
||||
|
||||
return $this->resourceResponse(new CompanyModuleResource($companyModule));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Companies;
|
||||
|
||||
use App\Classes\Modules\Companies\ControllersLogic\CreateCompanyRemarkLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CreateCompanyModulesRemarkController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param CreateCompanyModulesRemarkLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function create(Request $request, CreateCompanyRemarkLogic $logic): JsonResponse
|
||||
{
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ class CompanyModuleResource extends JsonResource
|
||||
'reference' => $this->reference,
|
||||
'address' => new AddressResource($defaultAddress),
|
||||
'company' => new CompanyResource($this->whenLoaded('company')),
|
||||
'remarks' => RemarkResource::collection($this->remarks),
|
||||
'marking' => $marking
|
||||
];
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use PhpParser\Node\Expr\AssignOp\Mod;
|
||||
use Staudenmeir\EloquentHasManyDeep\HasManyDeep;
|
||||
use Staudenmeir\EloquentHasManyDeep\HasRelationships;
|
||||
use App\Classes\General\Interfaces\Remarkable;
|
||||
|
||||
/**
|
||||
* Class CompanyModule
|
||||
@@ -32,7 +33,7 @@ use Staudenmeir\EloquentHasManyDeep\HasRelationships;
|
||||
* @property integer type
|
||||
* @property integer status
|
||||
*/
|
||||
class CompanyModule extends AbstractModel implements Addressable, Documentable, Contactable, ContainerOwner, Packable
|
||||
class CompanyModule extends AbstractModel implements Addressable, Documentable, Contactable, ContainerOwner, Packable, Remarkable
|
||||
{
|
||||
use HasRelationships;
|
||||
use SoftDeletes;
|
||||
@@ -177,6 +178,14 @@ class CompanyModule extends AbstractModel implements Addressable, Documentable,
|
||||
return $query->where('type', '=', BusinessType::WAREHOUSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return MorphMany
|
||||
*/
|
||||
public function remarks(): morphMany
|
||||
{
|
||||
return $this->morphMany(Remark::class, 'owner');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -42,11 +42,11 @@
|
||||
<div class="col d-flex align-items-center pl-3 pl-md-0" v-if="order.remarks.length >= 1 && !isEditRemark">
|
||||
<h6 class="no-margin">{{order.remarks[0].content}}</h6>
|
||||
<span class="btn btn-md btn-default m-l-10" @click="isEditRemark = !isEditRemark">
|
||||
<i class="fa fa-edit"></i>
|
||||
</span>
|
||||
<i class="fa fa-edit"></i>
|
||||
</span>
|
||||
<span class="btn btn-md btn-default m-l-5 requestModal" data-type="deleteOrderRemark">
|
||||
<i class="fa fa-trash"></i>
|
||||
</span>
|
||||
<i class="fa fa-trash"></i>
|
||||
</span>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="deleteOrderRemark">
|
||||
<delete-order-remark-form-component :section="section" :data="order.remarks[0]" v-on:submit="addComment=false"></delete-order-remark-form-component>
|
||||
</modal-component>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="35" height="35" 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="#333333"><path d="M15.05,25.8v105.35h4.3v2.15c0,3.53669 2.91331,6.45 6.45,6.45h50.5376c1.67444,3.75213 5.30105,6.45 9.6624,6.45c4.36203,0 7.98734,-2.69797 9.6624,-6.45h50.5376c3.53669,0 6.45,-2.91331 6.45,-6.45v-2.15h4.3v-105.35h-64.5c-2.60352,0 -4.86855,1.23893 -6.45,3.08643c-1.58145,-1.8475 -3.84648,-3.08643 -6.45,-3.08643zM19.35,30.1h60.2c2.40083,0 4.3,1.89917 4.3,4.3c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-2.40083 1.89917,-4.3 4.3,-4.3h60.2v96.75h-60.2c-2.60352,0 -4.86855,1.23893 -6.45,3.08643c-1.58145,-1.8475 -3.84648,-3.08643 -6.45,-3.08643h-60.2zM86,40.85c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM86,49.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM119.68193,53.57363v4.12783c-8.0754,0.7482 -12.97979,5.32437 -12.97979,12.23232c0,5.8351 3.64818,9.8429 10.31748,11.54785l2.66231,0.68867v13.63906c-4.45695,-0.50955 -7.33113,-2.99253 -7.62998,-6.55078h-6.33662c0.0301,6.9402 5.41175,11.63533 13.9666,12.20293v3.88428h4.09844v-3.91367c8.7634,-0.7482 13.81963,-5.32289 13.81963,-12.65224c0,-6.192 -3.53195,-9.99125 -11.03975,-11.8166l-2.77988,-0.62568v-12.8958c3.9474,0.47945 6.64034,3.04917 6.76074,6.34082h6.24844c-0.1806,-6.67145 -5.26273,-11.39315 -13.00918,-12.08115v-4.12783zM86,58.05c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM119.68193,63.4124v12.05596c-4.3086,-0.8686 -6.58018,-2.99112 -6.58018,-6.07207c0,-3.26155 2.75103,-5.77534 6.58018,-5.98389zM86,66.65c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM86,75.25c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM123.78037,82.94717c5.08475,1.01695 7.44521,3.07924 7.44521,6.52139c0,3.79905 -2.71951,6.12871 -7.44521,6.39961zM86,83.85c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM86,92.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM86,101.05c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM86,109.65c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM86,118.25c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM23.65,131.15h55.9c2.40083,0 4.3,1.89917 4.3,4.3h4.3c0,-2.40083 1.89917,-4.3 4.3,-4.3h55.9v2.15c0,1.21481 -0.93519,2.15 -2.15,2.15h-53.56523l-0.41992,1.6083c-0.72235,2.78276 -3.19533,4.8417 -6.21484,4.8417c-3.01952,0 -5.49455,-2.05645 -6.21484,-4.8375l-0.41992,-1.6125h-53.56523c-1.21481,0 -2.15,-0.93519 -2.15,-2.15z"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="col-2">
|
||||
<div class="row">
|
||||
<div class="col-auto p-r-10">
|
||||
<div class="font-heading all-caps fs-8 muted">Warehouse Name</div>
|
||||
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="col-2">
|
||||
<div class="row">
|
||||
<div class="col-auto p-r-10">
|
||||
<div class="font-heading all-caps fs-8 muted">Extra Charges</div>
|
||||
@@ -34,6 +34,24 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col-auto p-r-10">
|
||||
<div class="font-heading all-caps fs-8 muted">Remarks</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col" v-if="data.remarks.length > 0">
|
||||
<div class="font-heading all-caps">{{ data.remarks[0].content }} <i class="fa fa-edit pointer fa-fw m-l-5 requestModal text-primary" data-type="warehouseRemark"></i></div>
|
||||
</div>
|
||||
<div v-if="data.remarks.length == 0" class="col muted hover-primary pointer fs-10 requestModal" data-type="warehouseRemark">
|
||||
<i class="fa fa-plus"></i> Add
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" type="warehouseRemark">
|
||||
<warehouse-remark-form-component :data="data" section="warhouseListSection"></warehouse-remark-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<loading-component style="height: 50px; top: 0;" key="1" color="success" v-show="$store.getters.isLoading(section)"></loading-component>
|
||||
<div class="row" v-show="!$store.getters.isLoading(section)">
|
||||
<div class="col">
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<h6 class="all-caps m-b-5 bold no-margin">{{ data.remarks.length > 0 ? 'Edit' : 'Create' }} Remark</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-5 animate__animated animate__fadeInUpBig animate__fast" v-if="error">
|
||||
<div class="col">
|
||||
<small class="bold fs-10 text-danger">{{error}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.parameters.content">
|
||||
<label>Remark</label>
|
||||
<input type="text" class="form-control" v-model="parameters.content">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-r-5">
|
||||
<div class="btn btn-sm btn-default bg-master-lightest 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()">{{ data.remarks.length > 0 ? 'Edit' : 'Create' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
|
||||
import { required, requiredIf } from "vuelidate/lib/validators";
|
||||
export default {
|
||||
props: {
|
||||
data:{
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
parameters: {
|
||||
content: this.data.remarks.length > 0 ? this.data.remarks[0].content : '',
|
||||
}
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
parameters: {
|
||||
content: {
|
||||
required: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitForm() {
|
||||
this.submit(this.data.remarks.length > 0 ? this.route('api.remark.update', this.data.remarks[0].id) : this.route('api.company.module.remark.create', this.data.id), this.data.remarks.length > 0 ? 'put' : 'post', this.section, true, true);
|
||||
}
|
||||
},
|
||||
mixins: [ModalFormHandler]
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -83,8 +83,9 @@
|
||||
<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="{'status_in': [4], 'per_page': 5}">
|
||||
<list-component section="activeContainerListSection" :endpoint="route('api.packing_list.list')" :options="{'packing_list_delivery_status': 1, 'per_page': 30}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
|
||||
</template>
|
||||
@@ -102,7 +103,7 @@
|
||||
<div class="col">status</div>
|
||||
<div class="col">Delivery Date</div>
|
||||
</div>
|
||||
<list-component section="arrivedContainerListSection" :endpoint="route('api.packing_list.list')" :options="{'status_in': [2], 'per_page': 5}">
|
||||
<list-component section="arrivedContainerListSection" :endpoint="route('api.packing_list.list')" :options="{'packing_list_delivery_status': 2 , 'per_page': 30}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
|
||||
</template>
|
||||
@@ -120,7 +121,7 @@
|
||||
<div class="col">status</div>
|
||||
<div class="col">Delivery Date</div>
|
||||
</div>
|
||||
<list-component section="completeContainerListSection" :endpoint="route('api.packing_list.list')" :options="{'status_in': [3], 'per_page': 5}">
|
||||
<list-component section="completeContainerListSection" :endpoint="route('api.packing_list.list')" :options="{'packing_list_delivery_status': 3, 'per_page': 30}">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<warehouse-packing-list-component :data="data"></warehouse-packing-list-component>
|
||||
</template>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
<div class="ref">Ref# {{ $invoice_transaction->owner->owner->reference }}</div>
|
||||
<!-- <div class="d-none">{{ $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference }}</div> -->
|
||||
<div class="date">Date: {{ invoice_transaction->created_at }}</div>
|
||||
<div class="date">Date: {{ $invoice_transaction->created_at }}</div>
|
||||
<div> </div>
|
||||
</div>
|
||||
</td>
|
||||
@@ -66,7 +66,10 @@
|
||||
{{ $addresses->country()->first()->name }}
|
||||
</div>
|
||||
<div>
|
||||
Phone: {{ $companyModule->contacts()->first()->phone }}
|
||||
@php
|
||||
$contact = $companyModule->contacts()->first();
|
||||
@endphp
|
||||
Phone: {{ $contact ? $contact->phone : '' }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
+2
-1
@@ -34,4 +34,5 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani
|
||||
|
||||
Route::get('/module/list', 'ListCompanyModulesController@list')->name('module.list');
|
||||
|
||||
});
|
||||
Route::post('module/{id}/remark/create', 'CreateCompanyModulesRemarkController@create')->name('module.remark.create');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user