mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| db6412c5c0 | |||
| e77e82bac2 |
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class DoesNotHaveTransactionType implements Filter
|
||||
@@ -16,8 +15,6 @@ class DoesNotHaveTransactionType implements Filter
|
||||
{
|
||||
return $builder->whereDoesntHave('transactions', function (Builder $query) use($value) {
|
||||
$query->where('type', $value);
|
||||
})->whereHas('containers', function ($query){
|
||||
return $query->whereDate('loading_date', '>=', Carbon::parse('08-08-2022'));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class SegmentIdIn implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereIn('segment_id', $value);
|
||||
}
|
||||
|
||||
}
|
||||
+9
-9
@@ -97,15 +97,15 @@ 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);
|
||||
$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);
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace App\Classes\Modules\Companies\Services;
|
||||
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\General\Eloquent\AbstractUpdateRecord;
|
||||
use App\Classes\ValueObjects\Constants\BusinessType;
|
||||
use App\Models\Company;
|
||||
use App\Models\Segment;
|
||||
use Illuminate\Database\QueryException;
|
||||
@@ -20,9 +19,8 @@ class AssignsCompanyToSegment extends AbstractUpdateRecord
|
||||
public function execute(Company $company, Segment $segment)
|
||||
{
|
||||
try {
|
||||
$companyModule = $company->companyModules()->where('type', BusinessType::IMPORTER)->first();
|
||||
$connection = $companyModule->connections()->where('inviter_reference', 'CIEF');
|
||||
$connection->segments()->attach($segment);
|
||||
|
||||
$company->segments()->attach($segment);
|
||||
|
||||
return $company;
|
||||
|
||||
|
||||
@@ -37,7 +37,9 @@ class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping,
|
||||
*/
|
||||
public function query()
|
||||
{
|
||||
return PackingList::where('type', '=', 1)->where('status', '=', 2)->where('owner_type', Order::class);
|
||||
return PackingList::where('type', '=', 1)->where('status', '=', 2)->where('owner_type', Order::class)->whereHas('transports', function($query){
|
||||
return $query->where('drop_date', '>=',Carbon::now()->subMonth());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,13 +7,9 @@ use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
|
||||
use App\Classes\Modules\Schedules\Services\CreatesSchedule;
|
||||
use App\Classes\Modules\Schedules\Services\UpdatesScheduleStatus;
|
||||
use App\Classes\Modules\Schedules\DataTransferObjects\ScheduleObject;
|
||||
use App\Classes\Modules\Transports\DataTransferObjects\TransportObject;
|
||||
use App\Classes\Modules\Transports\Services\CreatesTransport;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\TransportType;
|
||||
use App\Http\Resources\PackingListResource;
|
||||
use App\Models\Transport;
|
||||
use ErrorException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -21,8 +17,6 @@ use Carbon\Carbon;
|
||||
|
||||
class ReschedulePackingListLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
@@ -39,31 +33,26 @@ class ReschedulePackingListLogic extends AbstractControllerLogic
|
||||
/** @var UpdatesScheduleStatus */
|
||||
private $updatesScheduleStatus;
|
||||
|
||||
/** @var CreatesTransport */
|
||||
private $createsTransport;
|
||||
|
||||
/** @var CreatesSchedule */
|
||||
private $createsSchedule;
|
||||
|
||||
/**
|
||||
* ReschedulePackingListLogic constructor.
|
||||
* DeleteContainerControllersLogic constructor.
|
||||
* @param FetchesPackingList $fetchesPackingList
|
||||
* @param UpdatesScheduleStatus $updatesScheduleStatus
|
||||
* @param CreatesTransport $createsTransport
|
||||
* @param CreatesSchedule $createsSchedule
|
||||
*/
|
||||
public function __construct(FetchesPackingList $fetchesPackingList, UpdatesScheduleStatus $updatesScheduleStatus, CreatesTransport $createsTransport, CreatesSchedule $createsSchedule)
|
||||
public function __construct(FetchesPackingList $fetchesPackingList, UpdatesScheduleStatus $updatesScheduleStatus, CreatesSchedule $createsSchedule)
|
||||
{
|
||||
$this->fetchesPackingList = $fetchesPackingList;
|
||||
$this->updatesScheduleStatus = $updatesScheduleStatus;
|
||||
$this->createsTransport = $createsTransport;
|
||||
$this->createsSchedule = $createsSchedule;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws ErrorException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
@@ -71,15 +60,9 @@ class ReschedulePackingListLogic extends AbstractControllerLogic
|
||||
|
||||
$transport = $packing_list->transports()->first();
|
||||
|
||||
if(!$transport) {
|
||||
$object = new TransportObject(TransportType::LAND, null, '', Carbon::parse($request->input('etd')), Carbon::parse($request->input('eta')),ApprovalStatus::APPROVED);
|
||||
/** @var Transport $transport */
|
||||
$transport = $this->createsTransport->execute($object, $packing_list);
|
||||
}
|
||||
$old_sechedule = $transport->schedules()->first();
|
||||
|
||||
$transport->schedules()->update([
|
||||
'status' => ApprovalStatus::REJECTED
|
||||
]);
|
||||
$this->updatesScheduleStatus->execute($old_sechedule, ApprovalStatus::REJECTED);
|
||||
|
||||
$scheduleObject = new ScheduleObject(
|
||||
Carbon::parse($request->input('eta')),
|
||||
|
||||
+5
-4
@@ -145,6 +145,7 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
$containersRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"VCustomercontainer","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"LoadedTime asc","Filter":'.$filter.'}}'), '');
|
||||
|
||||
$containers = $this->fetchesDataFRomVTPortal->getResponseBody($containersRequest);
|
||||
|
||||
foreach ($containers->Rows as $container){
|
||||
$filter = '["ContainerID:=%js%'.$container[12].'"]';
|
||||
$containerDetailRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"ParcelInContainer","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":null,"Filter":'.$filter.'}}'), '');
|
||||
@@ -154,6 +155,7 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
$containerObject = new ContainerObject($container[0], str_replace(' ', '', $container[24]), str_replace(' ', '', $container[16]), ContainerTypes::FORTY_FEET_DRY_CONTAINER, Carbon::parse($container[6]), ApprovalStatus::PENDING_VERIFICATION);
|
||||
$containerInfo = $container;
|
||||
|
||||
|
||||
try {
|
||||
$container = $this->fetchesContainer->execute(['reference' => $containerObject->getReference()]);
|
||||
} catch (ResourceNotFoundException $exception){
|
||||
@@ -161,8 +163,8 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $warehouseId === 11 ? 3 : 4]);
|
||||
$container = $this->createContainerProcessor->execute($containerObject, $originWarehouse);
|
||||
}
|
||||
|
||||
$eta = Carbon::parse($containerInfo[4]);
|
||||
|
||||
$etd = Carbon::parse($eta)->subDays(5);
|
||||
|
||||
$delayDate = $containerInfo[7];
|
||||
@@ -173,9 +175,7 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
|
||||
$transport = $container->transports()->first();
|
||||
|
||||
if(!$transport || $eta !== $transport->eta){
|
||||
$container->transports()->delete();
|
||||
|
||||
if(!$transport){
|
||||
$transportObject = new TransportObject(TransportType::SEA, null, null, $etd, null, ApprovalStatus::APPROVED);
|
||||
/** @var Transport $transport */
|
||||
$transport = $this->createsTransport->execute($transportObject, $container);
|
||||
@@ -183,6 +183,7 @@ class FetchLoadedContainersFromVTPortalProcessor
|
||||
}
|
||||
|
||||
if($delayDate){
|
||||
|
||||
$delayDate = Carbon::parse($delayDate);
|
||||
$transport = $container->transports()->first();
|
||||
|
||||
|
||||
+4
-22
@@ -132,7 +132,6 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
* @param Carbon|null $start
|
||||
* @param Carbon|null $end
|
||||
* @return void
|
||||
* @throws \GuzzleHttp\Exception\GuzzleException
|
||||
*/
|
||||
public function execute(?Carbon $start = null, ?Carbon $end = null)
|
||||
{
|
||||
@@ -171,6 +170,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
$rows = $this->fetchesDataFRomYDPortal->getResponseBody($trackingRequest);
|
||||
|
||||
if(!$rows){
|
||||
Log::debug($row->expressno);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,6 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
}
|
||||
|
||||
$rescheduleDate = $dates->sortDesc()->first();
|
||||
|
||||
if(!$delayDate || $rescheduleDate > $delayDate){
|
||||
/** @var Carbon $delayDate */
|
||||
$delayDate = $rescheduleDate;
|
||||
@@ -215,14 +214,11 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
|
||||
}
|
||||
|
||||
if ($trackingRow->tracking === '到港') {
|
||||
$delayDate = Carbon::parse($trackingRow->trackingtime);
|
||||
}
|
||||
|
||||
if ($trackingRow->tracking === '已开船') {
|
||||
$delayDate = Carbon::parse($trackingRow->trackingtime)->addDays('5');
|
||||
}
|
||||
|
||||
|
||||
if ($trackingRow->tracking === '货物已进目的港仓库') {
|
||||
$unstuffingDate = Carbon::parse($trackingRow->trackingtime);
|
||||
}
|
||||
@@ -232,21 +228,6 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
}
|
||||
}
|
||||
|
||||
$client = new \GuzzleHttp\Client(['cookies' => true, 'headers' => ['Cookie' => 'utc_offset=480']]);
|
||||
|
||||
$request = $client->request('get', 'https://main.universe.com.my/Tracking/User/Paging?sEcho=1&sTrackingNo='.$row->expressno.'&sOrgId=sti');
|
||||
$deliveryTracking = json_decode($request->getBody()->getContents());
|
||||
foreach (array_reverse($deliveryTracking->aaData) as $trackingRow) {
|
||||
$trackingDate = Carbon::createFromFormat('d/m/y H:i', $trackingRow->LocalDateTime);
|
||||
if (Str::contains($trackingRow->PublicDescription, ['accepted/picked'])){
|
||||
$unstuffingDate = $trackingDate;
|
||||
}
|
||||
|
||||
if (Str::contains($trackingRow->PublicDescription, ['delivered'])) {
|
||||
$deliveryDate = $trackingDate;
|
||||
}
|
||||
}
|
||||
|
||||
$customerno = preg_split('(-|\(|\)|\/)', $row->customerno);
|
||||
|
||||
$orderNumber = $customerno[array_key_last($customerno)];
|
||||
@@ -351,7 +332,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
|
||||
if($order instanceof Order){
|
||||
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
|
||||
if(!in_array($marking, ['2192KAA', '2353GFE', '6866DTR', '153DSR', '1291NSC', '8288MIB', '1152AAT', '962LOW', '3992WHE', '1290CSW', '9493TYS', '3397GSH'])){
|
||||
if(!in_array($marking, ['2192KAA', '2353GFE', '6866DTR', '153DSR', '1291NSC', '8288MIB'])){
|
||||
$this->fetchesDataFRomYDPortal->clientRequest('http://www.yd-wl.com/api/confirmsendorder.ashx', 'GET', [
|
||||
'expressno' => $row->expressno
|
||||
]);
|
||||
@@ -452,6 +433,7 @@ class FetchOrderListsFromYdPortalProcessor
|
||||
|
||||
}
|
||||
} catch (\Exception $exception) {
|
||||
dump($exception);
|
||||
Log::debug($exception);
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class UpdateConstantLogic extends AbstractControllerLogic
|
||||
|
||||
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $request->input('reference')]);
|
||||
|
||||
$constantValue = $this->updatesConstantValue->execute($constant->value, $request->input('id'), $request->input('value'));
|
||||
$constantValue = $this->updatesConstantValue->execute($constant->value, $request->input('id'), $request->input('rate'));
|
||||
|
||||
$object = new ConstantObject($request->input('reference'), $constantValue);
|
||||
|
||||
@@ -112,7 +112,7 @@ class UpdateConstantLogic extends AbstractControllerLogic
|
||||
|
||||
$constantObject = [];
|
||||
|
||||
$constantObject[$request->input('id')] = $request->input('value');
|
||||
$constantObject[$request->input('id')] = $request->input('rate');
|
||||
|
||||
$object = new ConstantObject(
|
||||
$request->input('reference'),
|
||||
|
||||
@@ -7,9 +7,9 @@ class UpdatesConstantValue
|
||||
|
||||
/**
|
||||
* @param $json
|
||||
* @param int $state_id
|
||||
* @param array $rate
|
||||
* @return array
|
||||
* @param int $status_id
|
||||
* @param Array $rate
|
||||
* @return Array
|
||||
*/
|
||||
public function execute($json, int $state_id, Array $rate) {
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ class CreatePaymentTransactionLogic extends AbstractControllerLogic
|
||||
$payment_method = PaymentMethodType::PAYMENT_GATEWAY;
|
||||
$billPlzBill = $this->createsBillplzBill->execute(
|
||||
$company_module->name,
|
||||
$company_module->employees()->first()->email,
|
||||
$company_module->employees()->first()->email ?? '',
|
||||
'This payment is for the invoice number . ' . $invoice_transaction->bill_no,
|
||||
$amount,
|
||||
$billNumber,
|
||||
|
||||
+23
-48
@@ -6,8 +6,6 @@ namespace App\Classes\Modules\Transactions\ControllersLogic;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\PackingLists\Services\FetchesPackingList;
|
||||
use App\Classes\Modules\SegmentConstants\Services\FetchesSegmentConstant;
|
||||
use App\Classes\Modules\Segments\Services\ListsConstants;
|
||||
use App\Classes\Modules\Segments\Services\ListsSegments;
|
||||
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
|
||||
use App\Classes\Modules\Transactions\Services\CreatesTransaction;
|
||||
use App\Classes\Modules\Transactions\Services\CreatesTransactionDetail;
|
||||
@@ -26,9 +24,7 @@ use App\Classes\ValueObjects\Constants\PackageType;
|
||||
use App\Classes\ValueObjects\Constants\SegmentConstants;
|
||||
use App\Classes\ValueObjects\Constants\TransactionDetailType;
|
||||
|
||||
use App\Http\Resources\PackingListResource;
|
||||
use App\Models\Document;
|
||||
use App\Models\PackingList;
|
||||
use App\Models\Transaction;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@@ -40,6 +36,7 @@ use Meneses\LaravelMpdf\Facades\LaravelMpdf;
|
||||
class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
@@ -56,9 +53,6 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
/** @var FetchesSegmentConstant */
|
||||
private $fetchesSegmentConstant;
|
||||
|
||||
/** @var ListsConstants */
|
||||
private $listsConstants;
|
||||
|
||||
/** @var GeneratesTransactionBillNumber */
|
||||
private $generatesTransactionBillNumber;
|
||||
|
||||
@@ -73,24 +67,20 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
|
||||
/** @var CreatesFiles */
|
||||
private $createsFile;
|
||||
|
||||
|
||||
/**
|
||||
* CreateShippingInvoiceTransactionLogic constructor.
|
||||
* @param FetchesPackingList $fetchesPackingList
|
||||
* @param FetchesSegmentConstant $fetchesSegmentConstant
|
||||
* @param ListsConstants $listsConstants
|
||||
* @param GeneratesTransactionBillNumber $generatesTransactionBillNumber
|
||||
* @param CreatesTransaction $createsTransaction
|
||||
* @param CreatesTransactionDetail $createsTransactionDetail
|
||||
* @param CreatesDocument $createsDocument
|
||||
* @param CreatesFiles $createsFile
|
||||
*/
|
||||
public function __construct(FetchesPackingList $fetchesPackingList, FetchesSegmentConstant $fetchesSegmentConstant, ListsConstants $listsConstants, GeneratesTransactionBillNumber $generatesTransactionBillNumber, CreatesTransaction $createsTransaction, CreatesTransactionDetail $createsTransactionDetail, CreatesDocument $createsDocument, CreatesFiles $createsFile)
|
||||
|
||||
public function __construct(
|
||||
FetchesPackingList $fetchesPackingList,
|
||||
FetchesSegmentConstant $fetchesSegmentConstant,
|
||||
GeneratesTransactionBillNumber $generatesTransactionBillNumber,
|
||||
CreatesTransaction $createsTransaction,
|
||||
CreatesTransactionDetail $createsTransactionDetail,
|
||||
CreatesDocument $createsDocument,
|
||||
CreatesFiles $createsFile
|
||||
)
|
||||
{
|
||||
|
||||
$this->fetchesPackingList = $fetchesPackingList;
|
||||
$this->fetchesSegmentConstant = $fetchesSegmentConstant;
|
||||
$this->listsConstants = $listsConstants;
|
||||
$this->generatesTransactionBillNumber = $generatesTransactionBillNumber;
|
||||
$this->createsTransaction = $createsTransaction;
|
||||
$this->createsTransactionDetail = $createsTransactionDetail;
|
||||
@@ -98,7 +88,6 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
$this->createsFile = $createsFile;
|
||||
}
|
||||
|
||||
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$packing_list = $this->fetchesPackingList->execute(['id' => $request->input('packing_list_id')]);
|
||||
@@ -111,33 +100,22 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
return ($package->width / 100) * ($package->height / 100) *($package->length / 100) * ($package->quantity);
|
||||
});
|
||||
|
||||
$minimum_charges = ($cbm + $over_weight_cbm) < 0.3 ? (0.3 - ($cbm + $over_weight_cbm)) : 0;
|
||||
|
||||
$order = $packing_list->owner;
|
||||
$address = $order->addresses()->first();
|
||||
|
||||
$segments = $order->companyModule->connections->first()->segments->pluck('id');
|
||||
|
||||
$segment_price = 0;
|
||||
$base_price_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::BASE_PRICE]);
|
||||
|
||||
if(count($segments)){
|
||||
$segment_price_constants = $this->listsConstants->execute(['segment_id_in' => $segments, 'reference' => SegmentConstants::CUSTOM_PRICE]);
|
||||
$segment_price_constant = $segment_price_constants->sortBy(function ($constant){
|
||||
return $constant->value[0];
|
||||
})->first();
|
||||
$segment_price = $segment_price_constant->value[0];
|
||||
|
||||
}
|
||||
|
||||
$warehouse_rate_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::WAREHOUSE_RATE]);
|
||||
$state_rate_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::STATE_RATE]);
|
||||
$center_postcode_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::CENTER_POSTCODE]);
|
||||
$outstation_postcode_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::OUTSTATION_POSTCODE]);
|
||||
|
||||
$base_price = 0;
|
||||
$warehouse_rate = 0;
|
||||
$state_rate = 0;
|
||||
$state_select = '';
|
||||
|
||||
$packing_list_drop_date = Carbon::parse(PackingList::where('reference', $packing_list->reference)->where('type', 1)->first()->transports->first()->drop_date)->format('Y-m-d');
|
||||
$base_price = $this->getConstantByKey($base_price_constant, $packing_list_drop_date);
|
||||
$base_price = $this->getConstantByKey($base_price_constant, date('Y-m-d'));
|
||||
|
||||
$warehouseId = $order->orderRoles()->where('role_id', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->company_module_id;
|
||||
$selected_warehouse_rate = $this->getConstantByKey($warehouse_rate_constant, $warehouseId);
|
||||
$warehouse_rate = is_object($selected_warehouse_rate) ? $selected_warehouse_rate->amount : 0;
|
||||
@@ -150,15 +128,12 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
$this->checkPostcodeExistInConstant($center_postcode_constant, $postcode) === true ? $state_select = 'center' : '' ;
|
||||
$this->checkPostcodeExistInConstant($outstation_postcode_constant, $postcode) === true ? $state_select = 'outstation' : '' ;
|
||||
$state_rate_constant = (array)$state_rate_constant;
|
||||
$state_rate = $state_select == '' ? 0 : $state_rate_constant['center'] + ($state_select === 'outstation' ? $state_rate_constant['outstation'] : 0);
|
||||
|
||||
$price_cbm = $base_price + $segment_price + $warehouse_rate + $state_rate;
|
||||
$state_rate = $state_select == '' ? 0 : $state_rate_constant[$state_select];
|
||||
|
||||
$price_cbm = $base_price + $warehouse_rate + $state_rate;
|
||||
$total_cbm = $price_cbm * ($cbm + $over_weight_cbm);
|
||||
|
||||
|
||||
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('SI-');
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('SHIP-');
|
||||
|
||||
$object = new TransactionObject(
|
||||
$billNumber,
|
||||
@@ -183,7 +158,7 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
|
||||
$object_detail = new TransactionDetailObject(
|
||||
'SHIPPING_FEE',
|
||||
TransactionDetailType::SHIPPING_FEE.'<br>'.round($packing_list->packages->sum('quantity'), 3).' CTNS - '.$cbm.' CBM',
|
||||
TransactionDetailType::SHIPPING_FEE,
|
||||
$cbm,
|
||||
$price_cbm
|
||||
);
|
||||
@@ -201,7 +176,7 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
$this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
|
||||
}
|
||||
|
||||
return $this->resourceResponse(new PackingListResource($packing_list));
|
||||
return $this->response([]);
|
||||
}
|
||||
|
||||
function getConstantByKey($segmentConstantObject, $key) {
|
||||
|
||||
@@ -11,8 +11,6 @@ class SegmentConstants
|
||||
|
||||
public const BASE_PRICE = 'BASE_PRICE';
|
||||
|
||||
public const CUSTOM_PRICE = 'CUSTOM_PRICE';
|
||||
|
||||
public const WAREHOUSE_RATE = 'WAREHOUSE_RATE';
|
||||
|
||||
public const STATE_RATE = 'STATE_RATE';
|
||||
|
||||
@@ -4,9 +4,9 @@ namespace App\Classes\ValueObjects\Constants;
|
||||
|
||||
final class TransactionDetailType {
|
||||
|
||||
public const SHIPPING_FEE = 'X1 Freight Service Charge';
|
||||
public const SHIPPING_FEE = 'Shipping Fee';
|
||||
|
||||
public const OVER_WEIGHT_CHARGES = 'Overweight Charges';
|
||||
public const OVER_WEIGHT_CHARGES = 'Over weight charges';
|
||||
|
||||
public const CUSTOM_CHARGES = 'Custom charges';
|
||||
}
|
||||
|
||||
@@ -43,9 +43,7 @@ final class WarehouseReferences {
|
||||
|
||||
public const YD_DESTINATION_WAREHOUSE = self::YD_KLANG;
|
||||
|
||||
public const YD_EXEMPT_LIST = [230, 294, 320, 652, 1248, 1726, 2349, 2574, 652];
|
||||
|
||||
public const MIN_CBM_EXEMPT_LIST = [230, 294, 320, 652, 1248, 1726, 2349, 2574];
|
||||
public const YD_EXEMPT_LIST = [230, 294, 320, 652, 1248, 1726, 2349, 2574];
|
||||
|
||||
public const REPLICA_WHITE_LIST = [502];
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ class AssignCompanyConnectionToConnectionSegmentController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param AssignCompanyConnectionToConnectionSegmentLogic $logic
|
||||
* @param AssignCompanyToSegmentLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function assign(Request $request, AssignCompanyConnectionToConnectionSegmentLogic $logic): JsonResponse {
|
||||
|
||||
@@ -45,7 +45,6 @@ class CompanyModuleResource extends JsonResource
|
||||
'remarks' => RemarkResource::collection($this->remarks),
|
||||
'marking' => $marking,
|
||||
'warehouseCharges' => array_key_exists($this->id, $segmentConstant) ? $segmentConstant[$this->id] : null,
|
||||
'connections' => $this->connections,
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ class CompanyResource extends JsonResource
|
||||
'type' => (int) $this->type,
|
||||
'business_type' => (int) $this->business_type,
|
||||
'status' => (int) $this->status,
|
||||
'segments' => SegmentResource::collection($companyModule->connections()->first()->segments),
|
||||
'contact' => new ContactResource ($this->when($this->has('contacts'), $this->contacts->first())),
|
||||
'employee' => new UserResource($companyModule->employees()->first()),
|
||||
'company_module' => new CompanyModuleResource($companyModule),
|
||||
|
||||
@@ -29,23 +29,23 @@ class OrderResource extends JsonResource
|
||||
'warehouse' => new CompanyModuleResource($this->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee),
|
||||
'address' => new AddressResource($this->addresses()->where('status', '=', ApprovalStatus::APPROVED)->first()),
|
||||
'address_change_request' => new AddressResource($this->addressesPendingVerification()->first()),
|
||||
// 'parcels' => $this->whenLoaded('packingLists', function() {
|
||||
// return [
|
||||
// 'origin_warehouse_packages' => PackingListResource::collection(
|
||||
// $this->originWarehousePackages()->get()
|
||||
// ),
|
||||
// 'in_transit_packages' => PackingListResource::collection(
|
||||
// $this->inTransitPackages()->get()
|
||||
// ),
|
||||
// 'destination_warehouse_packages' => PackingListResource::collection(
|
||||
// $this->destinationWarehousePackages()->get()
|
||||
// ),
|
||||
// 'delivered_packages' => PackingListResource::collection(
|
||||
// $this->deliveredPackages()->get()
|
||||
// ),
|
||||
// 'received_packages' => PackingListResource::collection($this->packingLists()->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('packages')->get()),
|
||||
// ];
|
||||
// }),
|
||||
'parcels' => $this->whenLoaded('packingLists', function() {
|
||||
return [
|
||||
'origin_warehouse_packages' => PackingListResource::collection(
|
||||
$this->originWarehousePackages()->get()
|
||||
),
|
||||
'in_transit_packages' => PackingListResource::collection(
|
||||
$this->inTransitPackages()->get()
|
||||
),
|
||||
'destination_warehouse_packages' => PackingListResource::collection(
|
||||
$this->destinationWarehousePackages()->get()
|
||||
),
|
||||
'delivered_packages' => PackingListResource::collection(
|
||||
$this->deliveredPackages()->get()
|
||||
),
|
||||
'received_packages' => PackingListResource::collection($this->packingLists()->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('packages')->get()),
|
||||
];
|
||||
}),
|
||||
'remarks' => RemarkResource::collection($this->remarks),
|
||||
'created_at' => $this->created_at->format('d-m-Y')
|
||||
];
|
||||
|
||||
@@ -2,13 +2,11 @@
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\PackingListType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\ValueObjects\Constants\RoleTypes;
|
||||
use App\Models\Order;
|
||||
use App\Models\PackingList;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class PackingListResource extends JsonResource
|
||||
@@ -29,17 +27,14 @@ class PackingListResource extends JsonResource
|
||||
'claimant_id' => $this->claimant_id,
|
||||
'reference' => $this->reference,
|
||||
'status' => $this->status,
|
||||
// 'transport' => new TransportResource($this->transports()->first()),
|
||||
'transport' => new TransportResource($this->transports()->first()),
|
||||
'type' => $this->type,
|
||||
// 'receive_packing_list' => $this->when($this->type === PackingListType::SHIPPING_PACKING_LIST, new PackingListResource(PackingList::where('reference', $this->reference)->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST)->first())),
|
||||
'receive_packing_list' => $this->when($this->type === PackingListType::SHIPPING_PACKING_LIST, new PackingListResource(PackingList::where('reference', $this->reference)->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST)->first())),
|
||||
'packages' => PackageResource::collection($packages),
|
||||
$this->mergeWhen($this->owner instanceof Order, [
|
||||
'order' => New OrderResource($this->owner)
|
||||
]),
|
||||
'shippng_transaction' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereNotIn('status', [ApprovalStatus::SUSPENDED, ApprovalStatus::EXPIRED])->first()),
|
||||
'suspended_invoice' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::SUSPENDED])->first()),
|
||||
// 'suspended_invoices' => TransactionResource::collection($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::SUSPENDED])->get()),
|
||||
'loading_days_ago' => $this->containers()->first()->loading_date->diffForHumans()
|
||||
'shippng_transaction' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->first()),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,11 +15,13 @@ class SegmentResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$constant = $this->constants->where('reference', SegmentConstants::CUSTOM_PRICE)->first();
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'price' => $constant ? $constant->value : 0
|
||||
// 'time_limit' => $this->when($this->whereHas('constants', function($query){
|
||||
// $query->where('reference', SegmentConstants::PAYMENT_ATTEMPT_DURATION_LIMIT);
|
||||
// }), $this->constants->where('reference', SegmentConstants::PAYMENT_ATTEMPT_DURATION_LIMIT)->first()),
|
||||
// 'services' => CustomServiceTypeResource::collection($this->constants->where('reference', SegmentConstants::CUSTOM_SERVICE_TYPE))
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAddonsTable extends Migration
|
||||
class CreateAddonsTables extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
@@ -13,7 +13,7 @@ class CreateAddonsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('addons', function (Blueprint $table) {
|
||||
Schema::table('addons', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->morphs('owner');
|
||||
$table->string('reference',200);
|
||||
|
||||
@@ -15,7 +15,12 @@ class SegmentsTableSeeder extends Seeder
|
||||
'id' => 1,
|
||||
'company_module_id' => 1,
|
||||
'name' => 'Default Segment',
|
||||
]
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'company_module_id' => 2,
|
||||
'name' => 'Normal Member',
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -30,32 +30,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="row align-items-center parentContainer">
|
||||
<div class="col-auto padding-5 b-a b-grey b-rad-lg pointer requestModal" data-type="assignSegment">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
width="30" height="30"
|
||||
viewBox="0 0 172 172"
|
||||
style=" fill:#000000;"><defs><linearGradient x1="86" y1="97.08594" x2="86" y2="105.31775" gradientUnits="userSpaceOnUse" id="color-1_43991_gr1"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="94.0625" y1="85.83338" x2="94.0625" y2="93.89588" gradientUnits="userSpaceOnUse" id="color-2_43991_gr2"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="77.9375" y1="85.83338" x2="77.9375" y2="93.89588" gradientUnits="userSpaceOnUse" id="color-3_43991_gr3"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="28.55469" x2="86" y2="143.10938" gradientUnits="userSpaceOnUse" id="color-4_43991_gr4"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient></defs><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g><path d="M77.9375,96.75c0,4.45319 3.60931,8.0625 8.0625,8.0625c4.45319,0 8.0625,-3.60931 8.0625,-8.0625z" fill="url(#color-1_43991_gr1)"></path><path d="M94.0625,86c-2.2264,0 -4.03125,1.80485 -4.03125,4.03125c0,2.2264 1.80485,4.03125 4.03125,4.03125c2.2264,0 4.03125,-1.80485 4.03125,-4.03125c0,-2.2264 -1.80485,-4.03125 -4.03125,-4.03125z" fill="url(#color-2_43991_gr2)"></path><path d="M77.9375,86c-2.2264,0 -4.03125,1.80485 -4.03125,4.03125c0,2.2264 1.80485,4.03125 4.03125,4.03125c2.2264,0 4.03125,-1.80485 4.03125,-4.03125c0,-2.2264 -1.80485,-4.03125 -4.03125,-4.03125z" fill="url(#color-3_43991_gr3)"></path><path d="M147.8125,51.0625h-18.8125v-8.0625c0,-4.44512 -3.61738,-8.0625 -8.0625,-8.0625h-11.2445c-1.11263,-3.12019 -4.06888,-5.375 -7.568,-5.375h-32.25c-3.49912,0 -6.45538,2.25481 -7.568,5.375h-11.2445c-4.44512,0 -8.0625,3.61738 -8.0625,8.0625v8.0625h-18.8125c-4.44513,0 -8.0625,3.61738 -8.0625,8.0625v59.125c0,4.44512 3.61737,8.0625 8.0625,8.0625h18.8125v8.0625c0,4.44512 3.61738,8.0625 8.0625,8.0625h69.875c4.44512,0 8.0625,-3.61738 8.0625,-8.0625v-8.0625h18.8125c4.44512,0 8.0625,-3.61738 8.0625,-8.0625v-59.125c0,-4.44512 -3.61737,-8.0625 -8.0625,-8.0625zM147.8125,56.4375c1.4835,0 2.6875,1.20669 2.6875,2.6875v51.0625h-2.88637c-0.80625,-6.09525 -4.28119,-11.78469 -9.47612,-15.25425c0.99437,-1.87319 1.6125,-3.98019 1.6125,-6.24575v-5.375c0,-6.48763 -4.62519,-11.91638 -10.75,-13.16606v-13.70894zM134.375,88.6875c0,3.49912 -2.25213,6.45538 -5.375,7.568v-20.50831c3.12287,1.11262 5.375,4.06887 5.375,7.568zM134.6545,99.1365c3.913,2.48056 6.62469,6.84506 7.47125,11.051h-13.12575v-8.33394c2.12044,-0.43269 4.02319,-1.41094 5.6545,-2.71706zM67.1875,37.625c0,-1.48081 1.204,-2.6875 2.6875,-2.6875h32.25c1.4835,0 2.6875,1.20669 2.6875,2.6875v2.6875c0,1.48081 -1.204,2.6875 -2.6875,2.6875h-32.25c-1.4835,0 -2.6875,-1.20669 -2.6875,-2.6875zM51.0625,40.3125h10.75c0,4.44512 3.61737,8.0625 8.0625,8.0625h32.25c4.44512,0 8.0625,-3.61738 8.0625,-8.0625h10.75c1.4835,0 2.6875,1.20669 2.6875,2.6875v83.3125h-3.34056c-1.73881,-9.23963 -7.19444,-17.45531 -15.06344,-22.66906c1.44319,-2.88906 2.279,-6.13556 2.279,-9.58094v-10.75c0,-11.85456 -9.64544,-21.5 -21.5,-21.5c-11.85456,0 -21.5,9.64544 -21.5,21.5v10.75c0,3.44537 0.83581,6.69188 2.28169,9.58094c-7.869,5.21375 -13.32463,13.42675 -15.06344,22.66906h-3.34325v-83.3125c0,-1.48081 1.204,-2.6875 2.6875,-2.6875zM102.125,94.0625c0,8.89294 -7.23206,16.125 -16.125,16.125c-8.89294,0 -16.125,-7.23206 -16.125,-16.125v-10.75c0,-8.89294 7.23206,-16.125 16.125,-16.125c8.89294,0 16.125,7.23206 16.125,16.125zM86,115.5625c6.48494,0 12.29531,-2.89981 16.24056,-7.45513c6.39088,4.22744 10.93006,10.77956 12.59363,18.20513h-57.66837c1.66356,-7.42556 6.20275,-13.97769 12.59631,-18.20244c3.94256,4.55531 9.75294,7.45244 16.23787,7.45244zM43,96.2555c-3.12288,-1.11263 -5.375,-4.06888 -5.375,-7.568v-5.375c0,-3.49912 2.25212,-6.45538 5.375,-7.568zM37.32669,99.12306c1.634,1.31419 3.54481,2.29512 5.67331,2.7305v8.33394h-13.18487c0.78475,-4.57412 3.526,-8.63225 7.51156,-11.06444zM24.1875,56.4375h18.8125v13.70894c-6.12481,1.24969 -10.75,6.67575 -10.75,13.16606v5.375c0,2.26287 0.61544,4.36719 1.60981,6.24038c-5.21106,3.44806 -8.686,9.05688 -9.47613,15.25963h-2.88369v-51.0625c0,-1.48081 1.204,-2.6875 2.6875,-2.6875zM24.1875,120.9375c-1.4835,0 -2.6875,-1.20669 -2.6875,-2.6875v-2.6875h21.5v5.375zM120.9375,137.0625h-69.875c-1.4835,0 -2.6875,-1.20669 -2.6875,-2.6875v-2.6875h75.25v2.6875c0,1.48081 -1.204,2.6875 -2.6875,2.6875zM147.8125,120.9375h-18.8125v-5.375h21.5v2.6875c0,1.48081 -1.204,2.6875 -2.6875,2.6875z" fill="url(#color-4_43991_gr4)"></path></g></g></svg>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row no-margin">
|
||||
<div class="col-auto no-padding m-r-10 m-b-5 m-t-5 parentContainer" v-for="segment in item.segments" v-bind:key="segment.id" v-if="segment.id !== 1">
|
||||
<div class="font-heading fs-10 lh-20 p-l-10 p-r-10 bg-master-lightest btn-rounded">
|
||||
{{segment.name}}
|
||||
<i class="fa fa-times muted m-l-10 pointer requestModal" data-type="detachSegment" ></i>
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="detachSegment">
|
||||
<detach-segment-form-component :data="segment" :company_id="item.id" section="customerProfileSection"></detach-segment-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="assignSegment">
|
||||
<assign-segment-form-component :data="item" section="customerProfileSection"></assign-segment-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="row">
|
||||
<div class="col-auto" v-if="item.employee">
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
<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-10">
|
||||
<div class="col">
|
||||
<h3 class="all-caps m-b-5 bold no-margin">Assign Segment</h3>
|
||||
<div class="fs-11">Select a segment to {{parameters.name}}</div>
|
||||
</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-15">
|
||||
<div class="col">
|
||||
<validation-wrapper-component selectable :validator="$v.parameters.segment_id">
|
||||
<label>Segment</label>
|
||||
<selectable-component :endpoint="route('api.segment.list') + '?filters=' + JSON.stringify({'id_not_in': currentSegmentIds})" :section="multiple?'segmentsListSection_'+data.id:'segmentsListSection'" valueColumn="id" :labelColumn="['name']" v-model="parameters.segment_id"></selectable-component>
|
||||
</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">Not Now</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div class="btn btn-sm btn-success btn-block b-rad-none" @click="submit(route('api.company.connection.assign', data.id, data.company_module.connections[0].id), 'post', section, true, false)">Assign Segment</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
|
||||
import { required } from "vuelidate/lib/validators";
|
||||
export default {
|
||||
props: {
|
||||
multiple: {
|
||||
default: false,
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
parameters: {
|
||||
segment_id: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
parameters: {
|
||||
segment_id: {
|
||||
required
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
currentSegmentIds(){
|
||||
return this.data.segments.map(function (value){
|
||||
return value.id;
|
||||
})
|
||||
}
|
||||
},
|
||||
mixins: [ModalFormHandler]
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -1,44 +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 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 justify-content-center" v-show="!isLoading">
|
||||
<div class="col">
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<h3 class="all-caps">Are you Sure?</h3>
|
||||
<div class="fs-11">Are you sure you want to detach custom from <span class="bold">{{this.item.name}}</span> segment?</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-r-5">
|
||||
<div class="btn btn-sm btn-success btn-block b-rad-none" data-dismiss="modal">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div class="btn btn-sm btn-danger btn-block b-rad-none" @click="submit(route('api.company.segment.detach', company_id, item.id), 'delete', 'customerProfileSection', true, true)">Remove Segment</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
|
||||
export default {
|
||||
props: {
|
||||
company_id: {
|
||||
required: true,
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
|
||||
mixins: [componentHandler, ModalFormHandler]
|
||||
}
|
||||
</script>
|
||||
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-md-3 p-l-5">
|
||||
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" @click="parameters.warehouse_id = 4" :class="{ 'b-primary': parameters.warehouse_id === 4, 'b-grey': parameters.warehouse_id !== 4 }">
|
||||
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" :class="{ 'b-primary': parameters.warehouse_id === 4, 'b-grey': parameters.warehouse_id !== 4 }" @click="parameters.warehouse_id = 4">
|
||||
<div class="row m-b-15 justify-content-center">
|
||||
<div class="col-8">
|
||||
<img src="/images/yiwu-map.png" class="w-100">
|
||||
@@ -53,7 +53,6 @@
|
||||
<div class="row text-center justify-content-center">
|
||||
<div class="col-8">
|
||||
<p class="m-b-0 text-danger m-t-15" v-if="parameters.warehouse_id === 3">近期由于船期的安排和马来西亚海关的运作等一些不可控因数,导致船期延迟,请大家提前做好采购安排。若有不便之处,敬请谅解。 <br>Due to inevitable circumstances, shipping arrangements and Malaysia custom clearance may have delays. Kindly plan your purchases in advance, thank you for your cooperation.</p>
|
||||
<p class="m-b-0 text-danger m-t-15" v-if="false">由于义乌船期不稳定,建议发广州仓库。<br>Due to unexpected shipping delays for Yiwu warehouse, you may select an alternative warehouse.</p>
|
||||
<p class="m-b-0 text-danger m-t-15" v-if="parameters.warehouse_id === 4">由于义乌船期不稳定,建议发广州仓库。<br>Due to unexpected shipping delays for Yiwu warehouse, you may select an alternative warehouse.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="false">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
|
||||
+9
-29
@@ -9,9 +9,9 @@
|
||||
<div class="no-margin">
|
||||
<div v-if="item.order">
|
||||
<a :href="route('customer.profile', item.order.company_module.marking)">{{item.order.company_module.marking}}</a>/<a :href="route('order.show', item.order.reference)">{{item.order.reference}}</a>
|
||||
<p>{{item.loading_days_ago}}</p>
|
||||
<p v-if="item.receive_packing_list">{{item.receive_packing_list.transport.drop_date}}</p>
|
||||
</div>
|
||||
<div v-else class="text-danger">Unclaimed Packing List</div>
|
||||
<div v-if="!item.order" class="text-danger">Unclaimed Packing List</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
@@ -28,7 +28,7 @@
|
||||
<div v-if="!item.shippng_transaction">n/a</div>
|
||||
<div v-if="item.shippng_transaction">MYR {{ item.shippng_transaction.amount.toFixed(2) }}</div>
|
||||
</div>
|
||||
<div class="col-auto p-l-0 p-r-0" v-if="['Pending Payment', 'Paid Invoice', 'Suspended Invoice'].includes(invoice_status)">
|
||||
<div class="col-auto p-l-0 p-r-0" v-if="['Pending Payment', 'Paid Invoice'].includes(invoice_status)">
|
||||
<div v-if="item.shippng_transaction">
|
||||
<div v-if="item.shippng_transaction.documents.length">
|
||||
<div v-for="file in item.shippng_transaction.documents[0].files" v-bind:key="file.id" class="col-auto no-padding">
|
||||
@@ -53,24 +53,7 @@
|
||||
<i class="fa" :class="{'fa-angle-down': !expanded, 'fa-angle-up': expanded}" ></i>
|
||||
</div>
|
||||
<div v-if="!item.shippng_transaction">
|
||||
<div v-if="item.order">
|
||||
<div v-if="!item.order.company_module.billingAddress">
|
||||
<div class="btn btn-primary btn-xs pointer requestModal btn-block" data-type="billingAddressComponent">Add Billing Address</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" size="extra-large" styleType="fill-in" type="billingAddressComponent">
|
||||
<address-form-component :id="item.order.company_module.id" section="addressList" :type=1></address-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
<div v-if="!item.order.address.post_code_area">
|
||||
<div class="btn btn-xs btn-primary pointer m-t-10 requestModal btn-block" data-type="defineLocation">Define Location</div>
|
||||
<modal-component class="animate_animated animatefast animate_fadeIn" styleType="fill-in" type="defineLocation">
|
||||
<declare-postcode-area-form-component :data="item.order.address"></declare-postcode-area-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
<div v-if="item.order.company_module.billingAddress && item.order.address.post_code_area" class="btn btn-outline-primary btn-lg pointer" @click="generateInvoice()">Generate Invoice</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="btn btn-outline-primary btn-lg pointer invisible">Generate Invoice</div>
|
||||
</div>
|
||||
<div class="btn btn-outline-primary btn-lg pointer" @click="generateInvoice()">Generate Invoice</div>
|
||||
</div>
|
||||
<div class="btn bg-grey no-border muted requestModal" v-if="item.shippng_transaction && invoice_status == 'Pending Approval'" data-type="confirmInvoice">
|
||||
<i class="fa fa-check fs-12"></i>
|
||||
@@ -82,23 +65,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded" v-if="item.shippng_transaction && ['Pending Approval', 'Suspended Invoice'].includes(invoice_status)">
|
||||
<div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded" v-if="item.shippng_transaction && invoice_status == 'Pending Approval'">
|
||||
<div class="col p-b-10">
|
||||
<div class="row">
|
||||
<div class="col p-l-20 p-r-20 p-t-10 p-b-10">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Container Reference</p>
|
||||
<div v-if="item.packages.length">{{ item.packages[0].container ? item.packages[0].container.container_reference : 'n/a' }}</div>
|
||||
<div v-else>n/a</div>
|
||||
<div>{{ item.packages.length ? item.packages[0].container.container_reference : 'n/a' }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Due Date</p>
|
||||
<div v-if="item.packages.length">
|
||||
<div v-if="item.packages[0].container">
|
||||
<div v-if="item.packages[0].container.transport">{{ item.packages[0].container.transport.drop_date == null ? item.packages[0].container.transport.current_schedule.etd : item.packages[0].container.transport.drop_date }}</div>
|
||||
<div v-else>n/a</div>
|
||||
</div>
|
||||
<div v-if="item.packages[0].container.transport">{{ item.packages[0].container.transport.drop_date == null ? item.packages[0].container.transport.current_schedule.etd : item.packages[0].container.transport.drop_date }}</div>
|
||||
<div v-else>n/a</div>
|
||||
</div>
|
||||
<div v-else>n/a</div>
|
||||
@@ -212,7 +191,8 @@
|
||||
<div class="font-heading fs-12">MYR {{(Math.round((item.shippng_transaction.outstanding + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-20" v-if="item.shippng_transaction.outstanding > 0">
|
||||
<!-- <div class="row m-t-20" v-if="item.shippng_transaction.outstanding > 0"> -->
|
||||
<div class="row m-t-20">
|
||||
<div class="col">
|
||||
<div class="btn btn-sm all-caps b-rad-none btn-success btn-block requestModal" data-type="makePayment">Make Payment</div>
|
||||
</div>
|
||||
|
||||
@@ -3,16 +3,67 @@
|
||||
<div class="col">
|
||||
<div class="row bg-white padding-40 b-rad-lg">
|
||||
<div class="col">
|
||||
<h3 class="text-center m-b-15">Outstanding: MYR <span class="text-success bold">{{ data.outstanding.toFixed(2) }}</span></h3>
|
||||
|
||||
<validation-wrapper-component :validator="$v.parameters.amount">
|
||||
<label>Amount</label>
|
||||
<input class="form-control" v-model="parameters.amount" v-money="{decimal: '.',thousands: '', precision: 2}">
|
||||
</validation-wrapper-component>
|
||||
|
||||
<div class="row m-t-15 w-100 text-center">
|
||||
<h3 class="text-center m-b-15">Make Payment</h3>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button class="btn btn-lg btn-primary" @click="submitForm()" data-dismiss="modal">Make Payment</button>
|
||||
<div class="row m-b-10">
|
||||
<div class="col">
|
||||
<div class="row m-b-5 animate__animated animate__fadeInUpBig animate__fast" v-if="error">
|
||||
<div class="col">
|
||||
<small class="bold fs-10 text-danger">{{error}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-r-0 m-b-15">
|
||||
<div class="col p-r-0">
|
||||
<validation-wrapper-component :validator="$v.parameters.amount">
|
||||
<label>Amount</label>
|
||||
<input class="form-control text-black" style="cursor: not-allowed;" disabled v-model="parameters.amount" v-money="{decimal: '.',thousands: '', precision: 2}">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-auto b-r b-t b-b b-grey">
|
||||
<div class="row h-100 align-items-center">
|
||||
<div class="col">
|
||||
<div class="font-heading fs-10 muted">MYR</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row p-l-15 p-r-15">
|
||||
<div class="col m-r-5 text-center bg-white">
|
||||
<div class="row h-100">
|
||||
<div class="col b-a padding-10 pointer" :class="{ 'b-primary': paymentMethod.name === 'Online Transfer', 'text-primary': paymentMethod.name === 'Online Transfer', 'b-grey': paymentMethod.name !== 'Online Transfer' }" @click="updatePaymentType({name: 'Online Transfer', id: 'payment_gateway'})">
|
||||
<div class="m-b-15 m-t-10 text-center">
|
||||
<img src="/images/fpx-logo-vector-01.png" alt="logo" height="25">
|
||||
</div>
|
||||
<p id="online-banking" class="no-margin bold all-caps">Online Banking</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col m-l-5 text-center bg-white">
|
||||
<div class="row h-100">
|
||||
<div class="col b-a padding-10 pointer" :class="{ 'b-primary': paymentMethod.name === 'Cash Deposit', 'text-primary': paymentMethod.name === 'Cash Deposit', 'b-grey': paymentMethod.name !== 'Cash Deposit' }" @click="updatePaymentType({name: 'Cash Deposit', id: 'cash'})">
|
||||
<div class="m-b-5 text-center">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="35" height="35" viewBox="0 0 172 172" style=" fill:#000000;"><defs><linearGradient x1="86" y1="15.45313" x2="86" y2="157.24562" gradientUnits="userSpaceOnUse" id="color-1_46094_gr1"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="86" y1="62.14844" x2="86" y2="87.68238" gradientUnits="userSpaceOnUse" id="color-2_46094_gr2"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient></defs><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g><path d="M142.4375,26.875h-18.8125v-5.375c0,-2.96431 -2.41069,-5.375 -5.375,-5.375h-64.5c-2.96431,0 -5.375,2.41069 -5.375,5.375v5.375h-18.8125c-4.44513,0 -8.0625,3.61737 -8.0625,8.0625v86c0,4.44512 3.61737,8.0625 8.0625,8.0625h40.3125v10.75h-10.75c-4.44512,0 -8.0625,3.61738 -8.0625,8.0625v2.6875h-10.75v5.375h10.75h69.875h10.75v-5.375h-10.75v-2.6875c0,-4.44512 -3.61738,-8.0625 -8.0625,-8.0625h-10.75v-10.75h40.3125c4.44512,0 8.0625,-3.61738 8.0625,-8.0625v-86c0,-4.44513 -3.61737,-8.0625 -8.0625,-8.0625zM123.625,96.75v-53.75h10.75v64.5h-96.75v-64.5h10.75v53.75zM107.5,91.375h-43v-48.64644c5.25675,-1.06962 9.40894,-5.22181 10.47856,-10.47856h22.04019c1.06963,5.25675 5.22181,9.40894 10.47856,10.47856v48.64644zM53.75,21.5h64.5v69.875h-5.375v-53.75h-2.6875c-4.44512,0 -8.0625,-3.61738 -8.0625,-8.0625v-2.6875h-32.25v2.6875c0,4.44512 -3.61737,8.0625 -8.0625,8.0625h-2.6875v53.75h-5.375zM112.875,145.125c1.4835,0 2.6875,1.204 2.6875,2.6875v2.6875h-59.125v-2.6875c0,-1.4835 1.204,-2.6875 2.6875,-2.6875h10.75h32.25zM96.75,139.75h-21.5v-10.75h21.5zM145.125,120.9375c0,1.4835 -1.204,2.6875 -2.6875,2.6875h-40.3125h-32.25h-40.3125c-1.4835,0 -2.6875,-1.204 -2.6875,-2.6875v-86c0,-1.4835 1.204,-2.6875 2.6875,-2.6875h18.8125v5.375h-10.75c-2.96431,0 -5.375,2.41069 -5.375,5.375v64.5c0,2.96431 2.41069,5.375 5.375,5.375h96.75c2.96431,0 5.375,-2.41069 5.375,-5.375v-64.5c0,-2.96431 -2.41069,-5.375 -5.375,-5.375h-10.75v-5.375h18.8125c1.4835,0 2.6875,1.204 2.6875,2.6875z" fill="url(#color-1_46094_gr1)"></path><path d="M86,64.5c-5.93706,0 -10.75,4.81294 -10.75,10.75c0,5.93706 4.81294,10.75 10.75,10.75c5.93706,0 10.75,-4.81294 10.75,-10.75c0,-5.93706 -4.81294,-10.75 -10.75,-10.75z" fill="url(#color-2_46094_gr2)"></path></g></g></svg>
|
||||
</div>
|
||||
<p id="manual-transfer" class="no-margin bold">Manual Transfer</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4 p-r-0">
|
||||
<div class="btn btn-sm all-caps b-rad-none btn-default bg-master-lighter btn-block" @click="expandPayment = false" data-dismiss="modal">Cancel</div>
|
||||
</div>
|
||||
<div class="col-8 p-l-0">
|
||||
<div class="btn btn-sm all-caps b-rad-none btn-default bg-success btn-block text-white" @click="submitForm()" :class="[{'hide': paymentMethod.name === ''}]" data-dismiss="modal">Cancel</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -29,8 +80,15 @@
|
||||
return {
|
||||
parameters : {
|
||||
amount: this.data.outstanding.toFixed(2),
|
||||
transaction_id: this.data.id
|
||||
}
|
||||
transaction_id: this.data.id,
|
||||
payment_method: '',
|
||||
},
|
||||
paymentMethod: {
|
||||
name: '',
|
||||
id: '',
|
||||
status: false
|
||||
},
|
||||
error: '',
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
@@ -40,8 +98,17 @@
|
||||
},
|
||||
methods:{
|
||||
submitForm(){
|
||||
this.parameters.payment_method = this.paymentMethod.id === 'payment_gateway' ? 5 : '';
|
||||
this.submit(this.route('api.transaction.payment.create'), 'post', this.section, true, true);
|
||||
}
|
||||
},
|
||||
updatePaymentType(payment){
|
||||
this.paymentMethod = {
|
||||
name: payment.name,
|
||||
id: payment.id,
|
||||
status: false,
|
||||
}
|
||||
this.error = '';
|
||||
},
|
||||
},
|
||||
mixins: [formHandler]
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps">MYR {{item.price[data.id].amount}} <i class="fa fa-edit pointer fa-fw m-l-5 requestModal text-primary" data-type="editSegmentPrice"></i></div>
|
||||
<div class="font-heading all-caps">MYR 0.00 <i class="fa fa-edit pointer fa-fw m-l-5 requestModal text-primary" data-type="editSegmentPrice"></i></div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" type="editSegmentPrice">
|
||||
<edit-segment-price-form-component :data="item" :section="section"></edit-segment-price-form-component>
|
||||
</modal-component>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.value.amount">
|
||||
<label class="text-primary">Segment Price (MYR)</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="form-control fs-12" v-model.trim="parameters.price[data.id].amount" v-money="money">
|
||||
<input type="text" class="form-control fs-12" v-model.trim="parameters.value.amount" v-money="money">
|
||||
</div>
|
||||
</validation-wrapper-component>
|
||||
<div class="row m-t-15">
|
||||
@@ -41,9 +41,8 @@
|
||||
return {
|
||||
parameters: {
|
||||
reference: 'CUSTOM_PRICE',
|
||||
id: this.data.id,
|
||||
value : {
|
||||
amount: this.data.price[this.data.id].amount
|
||||
amount: 0
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,135 +11,9 @@
|
||||
|
||||
body {
|
||||
font-family: sun-extA;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.header {
|
||||
margin-top: 5em;
|
||||
}
|
||||
|
||||
.separator {
|
||||
text-align: right;
|
||||
border-bottom: 0.5px solid black;
|
||||
font-size: 0.7em;
|
||||
}
|
||||
|
||||
img.logo {
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
img {
|
||||
height: 6em;
|
||||
width: 9em;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 2em;
|
||||
font-weight: 1200;
|
||||
}
|
||||
|
||||
.details {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
|
||||
}
|
||||
|
||||
.sub-title {
|
||||
font-size: 1.3em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 1.1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.bill-to {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
th {
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 0.4em;
|
||||
/* text-align: center; */
|
||||
}
|
||||
|
||||
td.title {
|
||||
text-align: left;
|
||||
}
|
||||
td.description,
|
||||
th.description {
|
||||
text-align: justify;
|
||||
max-width: 40em;
|
||||
}
|
||||
|
||||
td.stock-code,
|
||||
th.stock-code {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
td,
|
||||
th {
|
||||
/* margin-top: 0.6em;
|
||||
margin-right: 0.6em; */
|
||||
}
|
||||
|
||||
.subtotal td {
|
||||
border-top: 1px solid black;
|
||||
}
|
||||
|
||||
.total {
|
||||
border-top: 1px solid black;
|
||||
border-bottom: 3px double black;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.address {}
|
||||
|
||||
*/ td.header-logo {
|
||||
/* text-align: left; */
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
td.header-cief-address {
|
||||
text-align: left;
|
||||
margin-left: -30px;
|
||||
}
|
||||
|
||||
td.header-details {
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
td.bill-to {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
td.document-detail {
|
||||
text-align: left;
|
||||
border: 1px solid black;
|
||||
padding: 1em 1em 1em 1em;
|
||||
width: 16em;
|
||||
}
|
||||
|
||||
td.address {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.right {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -17,28 +17,27 @@
|
||||
</strong>
|
||||
</span>
|
||||
<span class="company-reg">(1134596-M)</span><br>
|
||||
No. 72-3, Jalan Jalil 1,<br>
|
||||
The Earth Bukit Jalil,<br>
|
||||
57000 Kuala Lumpur<br>
|
||||
Tel: 03-8082 1252
|
||||
Malaysian Global Innovation & Creativity Center <br>
|
||||
Level 1 CWS, Block 3730, Persiaran APEC, <br>
|
||||
63000 Cyberjaya, Malaysian. <br>
|
||||
Tel: 018-2909252
|
||||
</td>
|
||||
<td class="header-details">
|
||||
<div class="title" style="font-size: 20px; text-transform: uppercase;">
|
||||
<div class="title">
|
||||
<strong>
|
||||
Invoice
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<div class="number">Invoice No: {{ $invoice_transaction->bill_no }}</div>
|
||||
<div class="number">EI#: {{ $invoice_transaction->bill_no }}</div>
|
||||
|
||||
@php
|
||||
$companyModule = $invoice_transaction->owner->owner->companyModule;
|
||||
@endphp
|
||||
|
||||
<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="ref">Order No: {{ $invoice_transaction->owner->owner->reference }}</div>
|
||||
<div class="ref">Container Ref: {{ $invoice_transaction->owner->containers()->first()->reference }}</div>
|
||||
{{--<div class="d-none">{{ $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference }}</div>--}}
|
||||
<div> </div>
|
||||
</div>
|
||||
</td>
|
||||
@@ -57,7 +56,7 @@
|
||||
</div>
|
||||
<div class="address">
|
||||
@php
|
||||
$addresses = $companyModule->addresses()->where('status', '=', \App\Classes\ValueObjects\Constants\ApprovalStatus::APPROVED)->where('type', '=', \App\Classes\ValueObjects\Constants\AddressType::BILLING)->first();
|
||||
$addresses = $invoice_transaction->owner->owner->addresses()->where('status', '=', 2)->first();
|
||||
@endphp
|
||||
{{ $addresses->street_one }}
|
||||
{{ $addresses->street_two }} ,
|
||||
@@ -83,53 +82,53 @@
|
||||
<tr>
|
||||
<th width="5%">No</th>
|
||||
<th class="description">Description</th>
|
||||
<th width="15%">Quantity</th>
|
||||
<th width="20%">Unit Price (RM)</th>
|
||||
<th width="20%">Total Amount<br>(RM)</th>
|
||||
<th width="10%">Quantity</th>
|
||||
<th width="15%">Unit Price (RM)</th>
|
||||
<th width="10%">Total Amount<br>(RM)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($invoice_transaction->transactionDetails as $key => $transaction_detail)
|
||||
<tr>
|
||||
<td width="5%" class="center top">{{ $key + 1 }}</td>
|
||||
<td class="description">{!! $transaction_detail->name !!}</td>
|
||||
<td width="15%" class="center top" style="text-align: center">{{ round($transaction_detail->quantity, 3) }}</td>
|
||||
<td width="20%" class="center top" style="text-align: center">
|
||||
{{ round($transaction_detail->price, 2) }}
|
||||
<td class="description">{{ $transaction_detail->name }}</td>
|
||||
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
|
||||
<td width="15%" class="center top">
|
||||
{{ $transaction_detail->price }}
|
||||
</td>
|
||||
<td width="20%" class="right top">
|
||||
{{ round($transaction_detail->amount, 2) }}
|
||||
{{ $transaction_detail->amount }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="subtotal">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="4"></td>
|
||||
<td class="right middle">Subtotal</td>
|
||||
<td class="right middle">
|
||||
{{ round($invoice_transaction->amount, 2) }}
|
||||
{{ number_format($invoice_transaction->amount, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="billingcharges">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="4"></td>
|
||||
<td class="right">Service Charges</td>
|
||||
<td class="right">
|
||||
{{ round($invoice_transaction->service_charge, 2) }}
|
||||
{{ number_format($invoice_transaction->service_charge, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
@if($invoice_transaction->tax > 0)
|
||||
<tr class="billingcharges">
|
||||
<td colspan="3"></td>
|
||||
<td colspan="4"></td>
|
||||
<td class="right">Tax</td>
|
||||
<td class="right">{{ number_format($invoice_transaction->tax, 2) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
<td colspan="4"></td>
|
||||
<td class="right middle">Total</td>
|
||||
<td class="total right middle">
|
||||
{{ round($invoice_transaction->amount, 2) }}
|
||||
{{ number_format($invoice_transaction->amount, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
<div class="row m-b-20">
|
||||
<div class="col">
|
||||
<!-- <list-component section="segmentsSection" :endpoint="route('api.segment.list')" :options="{'type': 2}"> -->
|
||||
<list-component section="segmentsSection" :endpoint="route('api.segment.list')" :options="{'id_not': 1}">
|
||||
<list-component section="segmentsSection" :endpoint="route('api.segment.list')">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<segment-component :data="data" section="segmentsSection"></segment-component>
|
||||
</template>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto hide">
|
||||
<div class="col-auto">
|
||||
<notification-section-component section="section"></notification-section-component>
|
||||
</div>
|
||||
<div class="col-auto p-r-20 d-md-none">
|
||||
|
||||
+4
-4
@@ -11,10 +11,10 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani
|
||||
|
||||
Route::post('/team/create', 'AddNewMemberController@create')->name('team.create');
|
||||
|
||||
// Route::group(['prefix' => '{id}/segment', 'as' => 'segment.'], function () {
|
||||
// Route::post('/assign', 'AssignCompanyToSegmentController@assign')->name('assign');
|
||||
// Route::delete('/detach/{segment_id}', 'RemoveCompanyFromSegmentController@detach')->name('detach');
|
||||
// });
|
||||
Route::group(['prefix' => '{id}/segment', 'as' => 'segment.'], function () {
|
||||
Route::post('/assign', 'AssignCompanyToSegmentController@assign')->name('assign');
|
||||
Route::delete('/detach/{segment_id}', 'RemoveCompanyFromSegmentController@detach')->name('detach');
|
||||
});
|
||||
|
||||
Route::group(['prefix' => '{id}/connection/{company_connection_id}', 'as' => 'connection.'], function () {
|
||||
Route::post('/assign', 'AssignCompanyConnectionToConnectionSegmentController@assign')->name('assign');
|
||||
|
||||
+12
-10
@@ -256,20 +256,22 @@ Route::get('/container/{reference}/refresh/', function (string $reference){
|
||||
$container = Container::where('reference', $reference)->first();
|
||||
$supplier = in_array($container->owner_id, [3, 4]) ? 'VT' : 'YD';
|
||||
|
||||
$arrivalDates = \App\Models\PackingList::whereIn('reference', $container->packingLists->pluck('reference'))->where('type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->get()->map(function($packingList){
|
||||
return $packingList->transports()->first()->drop_date;
|
||||
})->sortBy(function($date){
|
||||
return $date;
|
||||
});
|
||||
|
||||
$startDate = $arrivalDates->first()->subDay()->format('d-m-Y');
|
||||
$endDate = $arrivalDates->last()->addDay()->format('d-m-Y');
|
||||
|
||||
if($supplier === 'VT'){
|
||||
return (App()->make(\App\Classes\Modules\PackingLists\Processors\FetchLoadedContainersFromVTPortalProcessor::class))->execute(\Carbon\Carbon::parse($endDate), \Carbon\Carbon::parse($endDate)->addDays(5));
|
||||
$startDate = $container->loading_date->subDays(3);
|
||||
$endDate = $container->loading_date->addDay();
|
||||
(App()->make(\App\Classes\Modules\PackingLists\Processors\FetchLoadedContainersFromVTPortalProcessor::class))->execute($startDate, $endDate);
|
||||
}
|
||||
|
||||
if($supplier === 'YD'){
|
||||
$arrivalDates = \App\Models\PackingList::whereIn('reference', $container->packingLists->pluck('reference'))->where('type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->get()->map(function($packingList){
|
||||
return $packingList->transports()->first()->drop_date;
|
||||
})->sortBy(function($date){
|
||||
return $date;
|
||||
});
|
||||
|
||||
$startDate = $arrivalDates->first()->subDay()->format('d-m-Y');
|
||||
$endDate = $arrivalDates->last()->addDay()->format('d-m-Y');
|
||||
|
||||
return redirect(route('yd.refresh').'?start_date='.$startDate.'&end_date='.$endDate);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user