Merge branch 'development' into 'master'

if company doesn't have billing address - hide generate invoice and show...

See merge request CIEFWorldwideSdnBhd/shipping-portal!135
This commit is contained in:
omair saleh
2022-09-21 00:54:20 +00:00
79 changed files with 2196 additions and 198 deletions
@@ -2,6 +2,7 @@
namespace App\Classes\General\Eloquent\Filters;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder;
class DoesNotHaveTransactionType implements Filter
@@ -15,6 +16,8 @@ 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('01-09-2022'));
});
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class OwnerIdNotIn implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->whereNotIn('owner_id', $value);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class PaymentReference implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->where('payment_reference', '=', $value);
}
}
@@ -0,0 +1,20 @@
<?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);
}
}
@@ -5,6 +5,7 @@ namespace App\Classes\Modules\Announcements\Services;
use App\Classes\General\Eloquent\AbstractUpdateRecord;
use App\Classes\Modules\Announcements\DataTransferObjects\AnnouncementObject;
use App\Models\Announcement;
use DateTime;
class CreatesAnnouncement extends AbstractUpdateRecord
{
@@ -18,9 +19,17 @@ class CreatesAnnouncement extends AbstractUpdateRecord
$model = new Announcement();
$model->title = $object->getTitle();
$model->description = $object->getDescription();
$model->starting_on = $object->getStartingOn();
$model->ending_on = $object->getEndingOn();
// $model->starting_on = $object->getStartingOn();
$model->starting_on = $this->convertDateFormat($object->getStartingOn());
// $model->ending_on = $object->getEndingOn();
$model->ending_on = $this->convertDateFormat($object->getEndingOn());
return $this->handler($model);
}
public function convertDateFormat($value) {
$value = DateTime::createFromFormat('d-m-Y', $value)->format('Y-m-d H:i:s');
return $value;
}
}
@@ -2,6 +2,8 @@
namespace App\Classes\Modules\Billplzs\ControllersLogic;
use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
use App\Classes\Modules\Orders\Processors\UpdateDoFromYDPortalProcessor;
use App\Classes\Modules\Wallets\DataTransferObjects\WalletObject;
use App\Classes\Modules\Wallets\Services\UpdatesWallet;
@@ -21,6 +23,7 @@ use App\Classes\Modules\Billplzs\DataTransferObjects\BillplzXSignatureObject;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
@@ -35,21 +38,27 @@ class CallbackBillplzLogic
/** @var UpdatesTransactionStatus */
private $updatesTransactionStatus;
/** @var UpdatesWalletBalance */
private $updatesWalletBalance;
/** @var UpdateDoFromVTPortalProcessor */
private $updateDoFromVTPortalProcessor;
/** @var UpdateDoFromYDPortalProcessor */
private $updateDoFromYDPortalProcessor ;
/**
* CallbackBillplzLogic constructor.
* @param GetBillplzBill $getBillplzBill
* @param FetchesTransaction $fetchesTransaction
* @param UpdatesTransactionStatus $updatesTransactionStatus
* @param UpdatesWalletBalance $updatesWalletBalance
* @param UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor
* @param UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor
*/
public function __construct(GetBillplzBill $getBillplzBill, FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus)
public function __construct(GetBillplzBill $getBillplzBill, FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor, UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor)
{
$this->getBillplzBill = $getBillplzBill;
$this->fetchesTransaction = $fetchesTransaction;
$this->updatesTransactionStatus = $updatesTransactionStatus;
$this->updateDoFromVTPortalProcessor = $updateDoFromVTPortalProcessor;
$this->updateDoFromYDPortalProcessor = $updateDoFromYDPortalProcessor;
}
@@ -58,6 +67,8 @@ class CallbackBillplzLogic
* @return bool|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @throws MalformedRequestException
* @throws ResourceNotFoundException
* @throws \App\Classes\Exceptions\InternalServerErrorException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function execute(Request $request)
{
@@ -73,6 +84,10 @@ class CallbackBillplzLogic
$transaction = $this->fetchesTransaction->execute(['payment_reference' => $billplzXSignatureObject->getBillPlzId()]);
$invoice = $transaction->owner;
$packingList = $invoice->owner;
$order = $packingList->owner;
if($billPlz->state === 'paid') {
$status = ApprovalStatus::APPROVED;
}
@@ -84,8 +99,23 @@ class CallbackBillplzLogic
$token = Auth::fromUser(User::find(1));
$request->headers->set('Authorization', 'Bearer '.$token);
$marking = $transaction->owner()->first()->owner()->first();
$this->updatesTransactionStatus->execute($transaction, ApprovalStatus::APPROVED);
return $request->method() === 'POST' ? true : view('pages.payments_redirect', ['marking' => $marking->reference, 'transaction' => $transaction, 'status' => $status]);
if($transaction->amount - $invoice->amount < 0.01) {
$this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED);
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
if(app()->environment('production')){
$this->updateDoFromVTPortalProcessor->execute($packingList);
$this->updateDoFromYDPortalProcessor->execute($packingList);
}
}
return $request->method() === 'POST' ? true : view('pages.payments_redirect', ['marking' => $order->reference, 'transaction' => $transaction, 'status' => $status]);
}
}
@@ -23,7 +23,7 @@ class CreatesBillplzBill
try{
// config('billplz.maybank')
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->post(config('billplz.base_url').'/api/v3/bills', [
'collection_id' => $wallet ? config('billplz.wallet_collection_id') : config('billplz.collection_id'),
'collection_id' => config('billplz.collection_id'),
'name' => $name,
'email' => $email,
'description' => $description,
@@ -4,6 +4,7 @@ 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;
@@ -19,8 +20,9 @@ class AssignsCompanyToSegment extends AbstractUpdateRecord
public function execute(Company $company, Segment $segment)
{
try {
$company->segments()->attach($segment);
$companyModule = $company->companyModules()->where('type', BusinessType::IMPORTER)->first();
$connection = $companyModule->connections()->where('inviter_reference', 'CIEF');
$connection->segments()->attach($segment);
return $company;
@@ -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);
@@ -25,8 +25,8 @@ class UpdateConstantPostcodeLogic extends AbstractControllerLogic
*/
protected function notification():array {
return [
'title' => 'Updated Segment Constant',
'message' => 'You have successfully updated the Segment Constant'
'title' => 'Updated Postcode Constant',
'message' => 'You have successfully updated the Postcode Constant'
];
}
@@ -70,7 +70,8 @@ class UpdateSegmentLogic extends AbstractControllerLogic
$segment_query = $this->fetchesSegment->execute(['id' => $request->route('id')]);
$segment_object = new SegmentObject(
$request->input('name', $segment_query->name)
$request->input('name'),
$segment_query->company_module_id
);
$this->canUpdateSegment->passes($segment_object);
$segment_query = $this->updatesSegment->execute($segment_query, $segment_object);
@@ -0,0 +1,124 @@
<?php
namespace App\Classes\Modules\Segments\ControllersLogic;
use App\Classes\Exceptions\ResourceNotFoundException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Segments\DataTransferObjects\ConstantObject;
use App\Classes\Modules\Segments\DataTransferObjects\SegmentObject;
use App\Classes\Modules\Segments\Services\CreatesConstant;
use App\Classes\Modules\Segments\Services\CreatesSegment;
use App\Classes\Modules\Segments\Services\FetchesConstant;
use App\Classes\Modules\Segments\Services\FetchesSegment;
use App\Classes\Modules\Segments\Standards\Rules\CanCreateConstant;
use App\Classes\Modules\Segments\Standards\Rules\CanUpdateConstant;
use App\Classes\Modules\Segments\Services\UpdatesConstant;
use App\Http\Resources\ConstantResource;
use App\Models\SegmentConstant;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Classes\Modules\Segments\Services\UpdatesConstantValue;
class UpdateSegmentPriceLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Updated Segment Price',
'message' => 'You have successfully updated the Segment Price'
];
}
/** @var CanUpdateConstant */
private $canUpdateConstant;
/** @var UpdatesConstant */
private $updatesConstant;
/** @var FetchesSegment */
private $fetchesSegment;
/** @var FetchesConstant */
private $fetchesConstant;
/** @var CanCreateConstant */
private $canCreateConstant;
/** @var CreatesConstant */
private $createsConstant;
/** @var CreatesSegment */
private $createsSegment;
/** @var UpdatesConstantValue */
private $updatesConstantValue;
/**
* UpdateConstantLogic constructor.
* @param CanUpdateConstant $canUpdateConstant
* @param UpdatesConstant $updatesConstant
* @param FetchesSegment $fetchesSegment
* @param FetchesConstant $fetchesConstant
* @param CanCreateConstant $canCreateConstant
* @param CreatesConstant $createsConstant
* @param UpdatesConstantValueByState $updatesConstantValueByState
* @param CreatesSegment $createsSegment
*/
public function __construct(
CanUpdateConstant $canUpdateConstant,
UpdatesConstant $updatesConstant,
FetchesSegment $fetchesSegment,
FetchesConstant $fetchesConstant,
CanCreateConstant $canCreateConstant,
CreatesConstant $createsConstant,
UpdatesConstantValue $updatesConstantValue,
CreatesSegment $createsSegment
)
{
$this->canUpdateConstant = $canUpdateConstant;
$this->updatesConstant = $updatesConstant;
$this->fetchesSegment = $fetchesSegment;
$this->fetchesConstant = $fetchesConstant;
$this->canCreateConstant = $canCreateConstant;
$this->createsConstant = $createsConstant;
$this->updatesConstantValue = $updatesConstantValue;
$this->createsSegment = $createsSegment;
}
/**
* @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')]);
try {
$constant = $this->fetchesConstant->execute(['segment_id' => $segment->id, 'reference' => $request->input('reference')]);
$object = new ConstantObject($request->input('reference'), [$request->input('value')]);
$this->canUpdateConstant->passes($object);
} catch (ResourceNotFoundException $exception){
$object = new ConstantObject(
$request->input('reference'),
[$request->input('value')]
);
$constant = $this->createsConstant->execute($segment, $object);
}
$constant = $this->updatesConstant->execute($constant, $object);
return $this->resourceResponse(new ConstantResource($constant));
}
}
@@ -9,6 +9,8 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Documents\Services\ApprovesDocument;
use App\Classes\Modules\Documents\Services\FetchesDocument;
use App\Classes\Modules\Documents\Services\RejectsDocument;
use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
use App\Classes\Modules\Orders\Processors\UpdateDoFromYDPortalProcessor;
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
@@ -20,20 +22,22 @@ use Illuminate\Http\Request;
class ApprovePaymentTransactionLogic extends AbstractControllerLogic
{
/**
* ApprovePaymentVerificationLogic constructor.
* ApprovePaymentTransactionLogic constructor.
* @param FetchesTransaction $fetchesTransaction
* @param UpdatesTransactionStatus $updatesTransactionStatus
* @param ApprovesDocument $approvesDocument
* @param RejectsDocument $rejectsDocument
* @param FetchesDocument $fetchesDocument
* @param CreateInvoiceTransactionProcessor $createInvoiceTransactionProcessor
* @param UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor
* @param UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor
*/
public function __construct(FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument)
public function __construct(FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor, UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor)
{
$this->fetchesTransaction = $fetchesTransaction;
$this->updatesTransactionStatus = $updatesTransactionStatus;
$this->approvesDocument = $approvesDocument;
$this->rejectsDocument = $rejectsDocument;
$this->updateDoFromVTPortalProcessor = $updateDoFromVTPortalProcessor;
$this->updateDoFromYDPortalProcessor = $updateDoFromYDPortalProcessor;
}
/**
@@ -58,10 +62,18 @@ class ApprovePaymentTransactionLogic extends AbstractControllerLogic
/** @var RejectsDocument */
private $rejectsDocument;
/** @var UpdateDoFromVTPortalProcessor */
private $updateDoFromVTPortalProcessor;
/** @var UpdateDoFromYDPortalProcessor */
private $updateDoFromYDPortalProcessor ;
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\InternalServerErrorException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function logic(Request $request) : JsonResponse
{
@@ -74,7 +86,25 @@ class ApprovePaymentTransactionLogic extends AbstractControllerLogic
$this->updatesTransactionStatus->execute($transaction, $status === 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
// $this->createInvoiceTransactionProcessor->execute($transaction->booking);
if($transaction->status === ApprovalStatus::APPROVED){
$invoice = $transaction->owner;
$packingList = $invoice->owner;
if($transaction->amount - $invoice->amount < 0.01) {
$this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED);
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
if(app()->environment('production')){
$this->updateDoFromVTPortalProcessor->execute($packingList);
$this->updateDoFromYDPortalProcessor->execute($packingList);
}
}
}
return $this->response([]);
}
@@ -69,7 +69,7 @@ class ApproveShippingInvoiceTransactionLogic extends AbstractControllerLogic
{
$packing_list = $this->fetchesPackingList->execute(['id' => $request->route('id')]);
$invoice_transaction = $packing_list->transactions->where('type', TransactionType::SHIPPING_INVOICE)->first();
$invoice_transaction = $packing_list->transactions()->where('transactions.type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::PENDING_SUBMISSION])->first();
$this->updatesTransactionStatus->execute($invoice_transaction, ApprovalStatus::APPROVED);
@@ -18,6 +18,7 @@ use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\TransactionResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
@@ -83,7 +84,7 @@ class CreatePaymentTransactionLogic extends AbstractControllerLogic
$payment_method = PaymentMethodType::PAYMENT_GATEWAY;
$billPlzBill = $this->createsBillplzBill->execute(
$company_module->name,
$company_module->employees()->first()->email,
(app()->environment(['production'])) ? $company_module->employees()->first()->email : 'uldvstar@gmail.com',
'This payment is for the invoice number . ' . $invoice_transaction->bill_no,
$amount,
$billNumber,
@@ -119,6 +120,6 @@ class CreatePaymentTransactionLogic extends AbstractControllerLogic
$payment_transaction = $this->createsPaymentTransaction->execute($invoice_transaction, $object);
return $this->response([]);
return $this->resourceResponse(new TransactionResource($payment_transaction));
}
}
@@ -16,6 +16,7 @@ use App\Classes\Modules\Transactions\DataTransferObjects\TransactionDetailObject
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use App\Classes\ValueObjects\Constants\PackingListType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
@@ -25,6 +26,7 @@ use App\Classes\ValueObjects\Constants\SegmentConstants;
use App\Classes\ValueObjects\Constants\TransactionDetailType;
use App\Models\Document;
use App\Models\PackingList;
use App\Models\Transaction;
use Carbon\Carbon;
use Illuminate\Http\JsonResponse;
@@ -91,16 +93,23 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
public function logic(Request $request) : JsonResponse
{
$packing_list = $this->fetchesPackingList->execute(['id' => $request->input('packing_list_id')]);
$packing_list = PackingList::where('reference', $packing_list->reference)->where('type', PackingListType::SHIPPING_PACKING_LIST)->first();
$cbm = $packing_list->packages->where('type', '!=', PackageType::OVER_WEIGHT)->sum(function($package) {
$billable_packing_list = $packing_list->packingLists()->first();
$billable_packing_list = $billable_packing_list ? $billable_packing_list : $packing_list;
$cbm = $billable_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) {
$over_weight_cbm = $billable_packing_list->packages->where('type', PackageType::OVER_WEIGHT)->sum(function($package) {
return ($package->width / 100) * ($package->height / 100) *($package->length / 100) * ($package->quantity);
});
$order = $packing_list->owner;
$companyModule = $order->companyModule;
$connection = $companyModule->connections()->first();
$address = $order->addresses()->first();
$base_price_constant = $this->fetchesSegmentConstant->execute(['segment_id' => 1, 'reference' => SegmentConstants::BASE_PRICE]);
@@ -109,12 +118,22 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
$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]);
$noMinimumCharge = $connection->segments()->where('segments.id', 2)->first();
$base_price = 0;
$warehouse_rate = 0;
$state_rate = 0;
$minimum_cbm = 0.3;
$segment_price = 0;
$state_select = '';
$base_price = $this->getConstantByKey($base_price_constant, date('Y-m-d'));
$segment_price = $connection->segments()->whereHas('constants')->get()->map(function($segment){
return (float) $segment->constants()->first()->value[0];
})->sort()->first();
$segment_price = $segment_price ? $segment_price : 0;
$packing_list_drop_date = 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);
$warehouseId = $order->orderRoles()->where('role_id', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->company_module_id;
$selected_warehouse_rate = $this->getConstantByKey($warehouse_rate_constant, $warehouseId);
@@ -130,8 +149,42 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
$state_rate_constant = (array)$state_rate_constant;
$state_rate = $state_select == '' ? 0 : $state_rate_constant[$state_select];
$price_cbm = $base_price + $warehouse_rate + $state_rate;
$total_cbm = $price_cbm * ($cbm + $over_weight_cbm);
$container = $packing_list->containers()->first();
$containerPackingLists = collect();
$hasMinimumCharge = null;
foreach ($container->packingLists as $packingList){
if($packingList->owner->companyModule->id !== $companyModule->id) continue;
$containerPackingLists->push($packingList);
if(!$hasMinimumCharge) {
$hasMinimumCharge = $packingList->transactions()->whereHas('transactionDetails', function ($query){
$query->where('reference', 'MIN_CBM_CHARGES');
})->first();
}
}
$totalContainerCbm = $containerPackingLists->sum(function($packingList){
$billable_packing_list = $packingList->packingLists()->first();
$billable_packing_list = $billable_packing_list ? $billable_packing_list : $packingList;
return $billable_packing_list->packages->where('type', '!=', PackageType::OVER_WEIGHT)->sum(function($package) {
return ($package->width / 100) * ($package->height / 100) *($package->length / 100) * ($package->quantity);
});
});
$minimum_charge = $minimum_cbm - $totalContainerCbm;
$minimum_charge = $minimum_charge < 0 ? 0 : $minimum_charge;
$minimum_charge = $noMinimumCharge ? 0 : $minimum_charge;
if($hasMinimumCharge) {
$minimum_charge = 0;
}
$price_cbm = $base_price + $segment_price + $warehouse_rate + $state_rate;
$total_cbm = $price_cbm * ($cbm + $minimum_charge + $over_weight_cbm);
$billNumber = $this->generatesTransactionBillNumber->execute('SHIP-');
@@ -158,13 +211,13 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
$object_detail = new TransactionDetailObject(
'SHIPPING_FEE',
TransactionDetailType::SHIPPING_FEE,
TransactionDetailType::SHIPPING_FEE.'<br>'.round($packing_list->packages->sum('quantity'), 3).' CTNS - '.round($cbm, 3).' CBM',
$cbm,
$price_cbm
);
$this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
if ($over_weight_cbm > 0) {
$object_detail = new TransactionDetailObject(
'OVER_WEIGHT_CHARGES',
@@ -176,6 +229,17 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
$this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
}
if ($minimum_charge > 0) {
$object_detail = new TransactionDetailObject(
'MIN_CBM_CHARGES',
TransactionDetailType::MIN_CBM_CHARGES,
$minimum_charge,
$price_cbm
);
$this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
}
return $this->response([]);
}
@@ -183,6 +247,7 @@ class CreateShippingInvoiceTransactionLogic extends AbstractControllerLogic
if ($segmentConstantObject) {
$base_rate = (array) $segmentConstantObject->value;
$base_rate = array_key_exists($key, $base_rate) === true ? $base_rate[$key] : 0;
return $base_rate;
}
}
@@ -50,10 +50,10 @@ class SuspendTransactionLogic extends AbstractControllerLogic
$transaction = $this->fetchesTransaction->execute(['id' => $request->route('id')]);
$this->updatesTransactionStatus->execute($transaction, ApprovalStatus::SUSPENDED);
return $this->response([]);
$transaction = $this->updatesTransactionStatus->execute($transaction, ApprovalStatus::SUSPENDED);
return $this->resourceResponse(new TransactionResource($transaction));
}
@@ -85,7 +85,7 @@ class UpdateShippingInvoiceTransactionLogic extends AbstractControllerLogic
{
$invoice_transaction = $this->fetchesTransaction->execute(['id' => $request->route('id')]);
$old_transaction_details = $invoice_transaction->transactionDetails->whereNotIn('reference', ['SHIPPING_FEE', 'OVER_WEIGHT_CHARGES'])->pluck('id')->toArray();
$old_transaction_details = $invoice_transaction->transactionDetails->whereNotIn('reference', ['SHIPPING_FEE', 'OVER_WEIGHT_CHARGES', 'MIN_CBM_CHARGES'])->pluck('id')->toArray();
$new_transaction_details = collect($request->input('transaction_details'));
@@ -104,7 +104,7 @@ class UpdateShippingInvoiceTransactionLogic extends AbstractControllerLogic
foreach($new_transaction_details as $transaction_detail){
$transaction_detail = (object) $transaction_detail;
if(!in_array($transaction_detail->reference, ['SHIPPING_FEE', 'OVER_WHEIGHT_CHARGES'])){
if(!in_array($transaction_detail->reference, ['SHIPPING_FEE', 'OVER_WEIGHT_CHARGES', 'MIN_CBM_CHARGES'])){
$object_detail = new TransactionDetailObject(
'CUSTOM_CHARGES',
isset($transaction_detail->name) ? $transaction_detail->name : TransactionDetailType::CUSTOM_CHARGES,
@@ -117,8 +117,6 @@ class UpdateShippingInvoiceTransactionLogic extends AbstractControllerLogic
}else{
$new_transaction_detail = $this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
}
$total_cbm += $new_transaction_detail->amount;
}
}
@@ -129,8 +127,8 @@ class UpdateShippingInvoiceTransactionLogic extends AbstractControllerLogic
$invoice_transaction->issuer,
1,
PaymentMethodType::CASH,
$total_cbm,
$total_cbm,
$invoice_transaction->transactionDetails()->sum('amount'),
$invoice_transaction->transactionDetails()->sum('amount'),
1,
1,
0,
@@ -0,0 +1,66 @@
<?php
namespace App\Classes\Modules\Transactions\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
use App\Classes\Modules\Transactions\Services\ListsTransactions;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\BookingResource;
use App\Http\Resources\TransactionResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UpdateTransactionStatusLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Update Transaction Status',
'message' => 'You have successfully updated the Transaction Status'
];
}
/** @var FetchesTransaction */
private $fetchesTransaction;
/** @var UpdatesTransactionStatus */
private $updatesTransactionStatus;
/**
* SuspendTransactionLogic constructor.
* @param FetchesTransaction $fetchesTransaction
* @param UpdatesTransactionStatus $updatesTransactionStatus
*/
public function __construct(FetchesTransaction $fetchesTransaction, UpdatesTransactionStatus $updatesTransactionStatus)
{
$this->fetchesTransaction = $fetchesTransaction;
$this->updatesTransactionStatus = $updatesTransactionStatus;
}
public function logic(Request $request) : JsonResponse
{
$approvalArray = [
'approve' => ApprovalStatus::APPROVED,
'expire' => ApprovalStatus::EXPIRED,
];
$approvalStatus = $approvalArray[$request->route('status')];
$transaction = $this->fetchesTransaction->execute(['id' => $request->route('id')]);
$transaction = $this->updatesTransactionStatus->execute($transaction, $approvalStatus);
return $this->resourceResponse(new TransactionResource($transaction));
}
}
@@ -22,6 +22,7 @@ class CreatesPaymentTransaction extends AbstractUpdateRelationshipRecord
$model->receiver = $object->getReceiver();
$model->recipient_bank_account_id = $object->getRecipientBankAccountId();
$model->payment_method = $object->getPaymentMethod();
$model->payment_reference = $object->getPaymentReference();
$model->amount = $object->getAmount();
$model->original_amount = $object->getOriginalAmount();
$model->currency_id = $object->getCurrencyId();
@@ -4,9 +4,11 @@ namespace App\Classes\ValueObjects\Constants;
final class TransactionDetailType {
public const SHIPPING_FEE = 'Shipping Fee';
public const SHIPPING_FEE = 'X1 Freight Service Charge';
public const OVER_WEIGHT_CHARGES = 'Over weight charges';
public const OVER_WEIGHT_CHARGES = 'Overweight Charges';
public const MIN_CBM_CHARGES = 'Minimum Charge for 0.3 CBM Per Container';
public const CUSTOM_CHARGES = 'Custom charges';
}
@@ -10,7 +10,7 @@ class AssignCompanyConnectionToConnectionSegmentController
{
/**
* @param Request $request
* @param AssignCompanyToSegmentLogic $logic
* @param AssignCompanyConnectionToConnectionSegmentLogic $logic
* @return JsonResponse
*/
public function assign(Request $request, AssignCompanyConnectionToConnectionSegmentLogic $logic): JsonResponse {
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Segments;
use App\Classes\Modules\Segments\ControllersLogic\UpdateSegmentPriceLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UpdateSegmentPriceController
{
/**
* @param Request $request
* @param UpdateSegmentLogic $logic
* @return JsonResponse
*/
public function update(Request $request, UpdateSegmentPriceLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,21 @@
<?php
namespace App\Http\Controllers\Transactions;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Classes\Modules\Transactions\ControllersLogic\UpdateTransactionStatusLogic;
class UpdateTransactionStatusController
{
/**
* @param Request $request
* @param SuspendTransactionLogic $logic
* @return JsonResponse
*/
public function update(Request $request, UpdateTransactionStatusLogic $logic) : JsonResponse {
return $logic->execute($request);
}
}
+4 -2
View File
@@ -21,11 +21,11 @@ class AddressResource extends JsonResource
$centerPostcodeConstantObject = SegmentConstant::where('reference', SegmentConstants::CENTER_POSTCODE)->get();
$centerPostcodeConstant = $centerPostcodeConstantObject->isEmpty() ? [] : (array)$centerPostcodeConstantObject->first()->value;
$postcodeArea = in_array($this->postcode, $centerPostcodeConstant) ? 'CENTER_POSTCODE' : '';
$postcodeArea = in_array((String)$this->postcode, $centerPostcodeConstant) ? 'CENTER_POSTCODE' : null;
$outstationPostcodeConstantObject = SegmentConstant::where('reference', SegmentConstants::OUTSTATION_POSTCODE)->get();
$outstationPostcodeConstant = $outstationPostcodeConstantObject->isEmpty() ? [] : (array)$outstationPostcodeConstantObject->first()->value;
in_array($this->postcode, $outstationPostcodeConstant) ? $postcodeArea = 'OUTSTATION_POSTCODE' : '';
in_array((String)$this->postcode, $outstationPostcodeConstant) ? $postcodeArea = 'OUTSTATION_POSTCODE' : null;
return [
'id' => $this->id,
@@ -34,6 +34,7 @@ class AddressResource extends JsonResource
'street_two' => $this->street_two,
'district' => $this->district,
'state' => $this->state,
'postcode' => $this->postcode,
'post_code' => $this->postcode,
'post_code_area' => $postcodeArea,
'country' => $this->country,
@@ -41,6 +42,7 @@ class AddressResource extends JsonResource
'status' => (int) $this->status,
'contact' => new ContactResource($this->contacts->first()),
'remark' => new RemarkResource($this->remarks->first()),
'type' => $this->type,
$this->mergeWhen($this->relationLoaded('owner'), [
'owner' => $this->when($this->owner instanceof Order, [
'reference' => $this->owner->reference,
@@ -3,6 +3,7 @@
namespace App\Http\Resources;
use App\Classes\Modules\Companies\Services\FetchesCompanyServices;
use App\Classes\ValueObjects\Constants\AddressType;
use App\Classes\ValueObjects\Constants\BankAccountType;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\DocumentType;
@@ -41,10 +42,12 @@ class CompanyModuleResource extends JsonResource
'name' => $this->name,
'reference' => $this->reference,
'address' => new AddressResource($defaultAddress),
'billingAddress' => new AddressResource($this->addresses()->where('type', AddressType::BILLING)->first()),
'company' => new CompanyResource($this->whenLoaded('company')),
'remarks' => RemarkResource::collection($this->remarks),
'marking' => $marking,
'warehouseCharges' => array_key_exists($this->id, $segmentConstant) ? $segmentConstant[$this->id] : null,
'connections' => $this->connections,
];
}
+1
View File
@@ -27,6 +27,7 @@ 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),
+1
View File
@@ -46,6 +46,7 @@ class OrderResource extends JsonResource
'received_packages' => PackingListResource::collection($this->packingLists()->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('packages')->get()),
];
}),
'invoices' => TransactionResource::collection($this->transactions()->whereNotIn('transactions.status', [0, 1])->get()),
'remarks' => RemarkResource::collection($this->remarks),
'created_at' => $this->created_at->format('d-m-Y')
];
+4 -1
View File
@@ -2,6 +2,7 @@
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;
@@ -34,7 +35,9 @@ class PackingListResource extends JsonResource
$this->mergeWhen($this->owner instanceof Order, [
'order' => New OrderResource($this->owner)
]),
'shippng_transaction' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->first()),
'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()),
];
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ class SegmentResource extends JsonResource
return [
'id' => $this->id,
'name' => $this->name,
'price' => $constant ? $constant->value : 0
'price' => $constant ? $constant->value[0] : 0
];
}
}
@@ -26,6 +26,8 @@ class TransactionResource extends JsonResource
'type' => (int) $this->type,
'bill_no' => $this->bill_no,
'amount' => (double) $this->amount,
'payment_method' => (int) $this->payment_method,
'payment_reference' => $this->payment_reference,
'outstanding' => (double) $this->amount - ($this->transactions()->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount')),
'service_charge' => (double) $this->service_charge,
'tax' => (double) $this->tax,
@@ -47,6 +49,7 @@ class TransactionResource extends JsonResource
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::COMPLETED, ApprovalStatus::REJECTED])
->get()
),
'remarks' => RemarkResource::collection($this->remarks),
'expires_on' => Carbon::parse($this->expires_on)->format('d-m-Y h:s:i'),
'updated_at' => Carbon::parse($this->update_at)->format('d-m-Y')
];
+8 -5
View File
@@ -16,10 +16,13 @@ use Illuminate\Database\Eloquent\Relations\HasManyThrough;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Staudenmeir\EloquentHasManyDeep\HasManyDeep;
use Staudenmeir\EloquentHasManyDeep\HasRelationships;
class Order extends AbstractModel implements Addressable, Packable, Remarkable, Notifiable
{
use SoftDeletes;
use HasRelationships;
protected $table = 'orders';
@@ -160,10 +163,10 @@ class Order extends AbstractModel implements Addressable, Packable, Remarkable,
}
/**
* @return morphMany
* @return hasManyDeep
*/
// public function transactions(): morphMany
// {
// return $this->morphMany(Transaction::class, 'owner');
// }
public function transactions(): hasManyDeep
{
return $this->hasManyDeep(Transaction::class, [PackingList::class], ['owner_id', 'owner_id'], ['id', 'id']);
}
}
+13 -1
View File
@@ -3,6 +3,7 @@
namespace App\Models;
use App\Classes\General\Interfaces\Documentable;
use App\Classes\General\Interfaces\Remarkable;
use App\Classes\General\Interfaces\Transactionable;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\TransactionType;
@@ -12,9 +13,12 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class Transaction extends AbstractModel implements Documentable, Transactionable
class Transaction extends AbstractModel implements Documentable, Transactionable, Remarkable
{
use SoftDeletes;
protected $table = 'transactions';
public function owner(): morphTo
@@ -122,4 +126,12 @@ class Transaction extends AbstractModel implements Documentable, Transactionable
{
return $query->whereIn('status', [ApprovalStatus::COMPLETED]);
}
/**
* @return MorphMany
*/
public function remarks(): morphMany
{
return $this->morphMany(Remark::class, 'owner');
}
}
@@ -28,10 +28,7 @@ class SegmentConstantsTableSeeder extends Seeder
$today = date("Y-m-d");
$prices = [];
for($ii=0; $ii<$n_days;$ii++){
$prices[] = [
"date" => date('Y-m-d', strtotime($today. ' + '.$ii.' days')),
"price" => rand(10, 30) / 10
];
$prices[date('Y-m-d', strtotime($today. ' + '.$ii.' days'))] = rand(10, 30) / 10;
}
$this->insertData(1, SegmentConstants::BASE_PRICE, $prices);
@@ -127,9 +124,7 @@ class SegmentConstantsTableSeeder extends Seeder
$this->insertData(1, SegmentConstants::OUTSTATION_POSTCODE, $prices);
// insert customer prices
$prices = [
['id'=> 1, 'price' => 15 ]
];
$prices = [15];
$this->insertData(2, SegmentConstants::CUSTOMER_RATE, $prices);
}
+5 -5
View File
@@ -16,11 +16,11 @@ class SegmentsTableSeeder extends Seeder
'company_module_id' => 1,
'name' => 'Default Segment',
],
[
'id' => 2,
'company_module_id' => 2,
'name' => 'Normal Member',
],
[
'id' => 2,
'company_module_id' => 1,
'name' => 'No Minimum Charge',
]
]
);
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

@@ -52,8 +52,9 @@
value: {
required: false
},
'section': {
section: {
type: String,
default: 'addressSection'
}
},
File diff suppressed because one or more lines are too long
@@ -0,0 +1,68 @@
<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 view annoucment with title <span class="bold">{{parameters.title | truncate(10) }}</span></div> -->
<div class="fs-11">Select a segment to view annoucment with title <span class="bold">{{parameters.title }}</span></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="'segmentsListSection_'+data.id" 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.announcement.segment.assign', data.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 {
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>
@@ -0,0 +1,48 @@
<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 remove <span class="bold">{{this.item.name}}</span>from viewing this annoucment with title <span class="bold">{{ announcement_title | truncate(10)}}</span></div> -->
<div class="fs-11">Are you sure you want to remove <span class="bold">{{this.item.name}}</span>from viewing this annoucment with title <span class="bold">{{ announcement_title }}</span></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.announcement.segment.detach', announcement_id, item.id), 'delete', section, 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: {
announcement_id: {
required: true,
type: Number
},
announcement_title: {
required: true,
type: String
}
},
mixins: [componentHandler, ModalFormHandler]
}
</script>
@@ -0,0 +1,51 @@
<template>
<div class="row">
<div class="col">
<div class="alert alert-info padding-15" role="alert" v-show="!isLoading">
<div class="row">
<div class="col">
<h5 class="pull-left">{{item.title}}</h5>
</div>
<div class="col-auto">
<i class="fa fa-times text-info-darker pointer" data-dismiss="modal"></i>
</div>
</div>
<div class="row">
<div class="col">
<p v-html="item.description"></p>
</div>
</div>
</div>
<!--<div class="row bg-white" v-show="!isLoading">-->
<!--<div class="col">-->
<!--<div class="row m-b-20">-->
<!--<div class="col">-->
<!--<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="50" height="50" viewBox="0 0 172 172" style=" fill:#000000;"><defs><linearGradient x1="99.4375" y1="43.33594" x2="99.4375" y2="60.14625" gradientUnits="userSpaceOnUse" id="color-1_43971_gr1"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="106.15625" y1="26.875" x2="106.15625" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-2_43971_gr2"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="83.3125" y1="26.875" x2="83.3125" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-3_43971_gr3"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="73.90625" y1="26.875" x2="73.90625" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-4_43971_gr4"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="51.0625" y1="26.875" x2="51.0625" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-5_43971_gr5"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="51.0625" y1="26.875" x2="51.0625" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-6_43971_gr6"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="45.6875" y1="26.875" x2="45.6875" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-7_43971_gr7"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="43" y1="26.875" x2="43" y2="146.16775" gradientUnits="userSpaceOnUse" id="color-8_43971_gr8"><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="M112.875,59.125h-26.875c-1.4835,0 -2.6875,-1.204 -2.6875,-2.6875v-10.75c0,-1.4835 1.204,-2.6875 2.6875,-2.6875h26.875c1.4835,0 2.6875,1.204 2.6875,2.6875v10.75c0,1.4835 -1.204,2.6875 -2.6875,2.6875z" fill="url(#color-1_43971_gr1)"></path><path d="M155.875,96.75c0,-7.97381 -5.82381,-14.59581 -13.4375,-15.88313v-18.82325c0,-2.08819 -1.16906,-3.94525 -3.05031,-4.85094c-1.88125,-0.90031 -4.06081,-0.65575 -5.69481,0.64769l-21.48925,17.18925c-0.08062,0.0645 -0.13975,0.14781 -0.21769,0.21769h-31.36044c-7.40944,0 -13.4375,6.02806 -13.4375,13.4375h-5.375c-2.96431,0 -5.375,2.41069 -5.375,5.375v5.375c0,2.96431 2.41069,5.375 5.375,5.375h5.375c0,7.40944 6.02806,13.4375 13.4375,13.4375v16.125c0,5.92863 4.82138,10.75 10.75,10.75c5.92863,0 10.75,-4.82137 10.75,-10.75v-16.125h9.86044c0.07794,0.06988 0.13706,0.15319 0.22038,0.22037l21.48656,17.18925c0.98094,0.78475 2.16075,1.18519 3.35131,1.18519c0.79281,0 1.59369,-0.17738 2.3435,-0.5375c1.88125,-0.903 3.05031,-2.76275 3.05031,-4.84825v-18.82325c7.61369,-1.28731 13.4375,-7.90931 13.4375,-15.88312zM61.8125,99.4375v-5.375h5.375v5.375zM96.75,134.375c0,2.96431 -2.41069,5.375 -5.375,5.375c-2.96431,0 -5.375,-2.41069 -5.375,-5.375v-16.125h10.75zM80.625,112.875c-4.44513,0 -8.0625,-3.61738 -8.0625,-8.0625v-16.125c0,-4.44513 3.61737,-8.0625 8.0625,-8.0625h29.5625v32.25h-8.0625zM137.05175,131.46175l-21.48925,-17.19462v-35.04231l10.75,-8.59194v26.11713h5.375v-30.41175l5.375,-4.29462l0.00538,69.42887c0,0 -0.00538,-0.00269 -0.01613,-0.01075zM142.4375,107.11837v-20.73675c4.6225,1.20131 8.0625,5.375 8.0625,10.36838c0,4.99337 -3.44,9.16706 -8.0625,10.36838z" fill="url(#color-2_43971_gr2)"></path><path d="M77.9375,91.375v5.375h5.375v-5.375h5.375v-5.375h-5.375c-2.96431,0 -5.375,2.41069 -5.375,5.375z" fill="url(#color-3_43971_gr3)"></path><path d="M21.5,107.5v-67.1875c0,-4.44512 3.61737,-8.0625 8.0625,-8.0625h88.6875c4.44512,0 8.0625,3.61738 8.0625,8.0625v10.75h5.375v-10.75c0,-7.40944 -6.02806,-13.4375 -13.4375,-13.4375h-88.6875c-7.40944,0 -13.4375,6.02806 -13.4375,13.4375v67.1875c0,7.40944 6.02806,13.4375 13.4375,13.4375h32.25v-5.375h-32.25c-4.44513,0 -8.0625,-3.61737 -8.0625,-8.0625z" fill="url(#color-4_43971_gr4)"></path><path d="M32.25,43h37.625v5.375h-37.625z" fill="url(#color-5_43971_gr5)"></path><path d="M32.25,53.75h37.625v5.375h-37.625z" fill="url(#color-6_43971_gr6)"></path><path d="M32.25,64.5h26.875v5.375h-26.875z" fill="url(#color-7_43971_gr7)"></path><path d="M32.25,75.25h21.5v5.375h-21.5z" fill="url(#color-8_43971_gr8)"></path></g></g></svg>-->
<!--<label class="fs-20 all-caps"><b>{{item.title}}</b></label>-->
<!--<label class="float-right fs-10"><i>{{item.created_at}}</i></label>-->
<!--</div>-->
<!--</div>-->
<!--<div class="row m-b-20">-->
<!--<div class="col">-->
<!--<div class=""><b>{{item.description}}</b></div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="row justify-content-md-center p-b-10">-->
<!--<div class="col-3">-->
<!--<div class="btn btn-sm btn-success btn-block b-rad-none" data-dismiss="modal">OK</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
export default {
mixins: [componentHandler, ModalFormHandler]
}
</script>
@@ -0,0 +1,55 @@
<template>
<div class="col-12">
<div class="b-b b-dashed b-grey p-b-25" v-show="!this.show_details" v-if="company">
<div class="row align-items-center m-b-5 parentContainer">
<div class="col-10">
<div class="font-heading fs-10 muted all-caps">Announcement</div>
</div>
<div class="col-2 text-right pull-right">
<div class="font-heading fs-10 muted all-caps">Action</div>
</div>
</div>
<list-component :section="this.section" :endpoint="route('api.announcement.list')" :options="{has_segments:segments,is_published:true}">
<template slot="list" slot-scope="{data}">
<announcement-list-component :data="data"></announcement-list-component>
</template>
</list-component>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
data(){
return {
section: 'announcementsSection',
company: null,
show_details: false,
}
},
computed: {
segments(){
return this.company.segments.map(function (value){
return value.id;
})
}
},
created(){
this.$store.dispatch('updateListQueue', {'name': this.section});
this.fetchCompany();
},
methods: {
fetchCompany(){
this.submit(route('api.company.show', this.$store.getters.getCompanyId), 'get', this.section, false, false)
},
successHandler(response){
this.$store.dispatch('completeList', {'name': this.section, 'data': []});
this.company = response.payload.data;
}
},
mixins: [componentHandler]
}
</script>
@@ -30,6 +30,32 @@
</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" :connection="item.company_module.connections[0].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">
@@ -0,0 +1,73 @@
<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>
@@ -0,0 +1,48 @@
<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 customer 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.connection.detach', company_id, connection, 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
},
connection: {
required: true,
type: Number
}
},
mixins: [componentHandler, ModalFormHandler]
}
</script>
@@ -0,0 +1,32 @@
<template>
<div class="row w-100">
<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 padding-30" v-show="!isLoading"> -->
<div class="row justify-content-center" v-show="!isLoading">
<div class="col">
<div class="row" v-for="remark in data.remarks">
<div class="col">
<remark-list-component :section="section" :data="remark"></remark-list-component>
</div>
</div>
<remark-comment-form-component :section="section" :module_type="module_type" :id="data.id"></remark-comment-form-component>
</div>
</div>
</div>
</div>
</template>
<script>
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
export default {
props: {
module_type: {
type: String,
required: true
}
},
mixins: [ModalFormHandler]
}
</script>
@@ -0,0 +1,71 @@
<template>
<!-- <div class="row m-b-20 parentContainer"> -->
<div class="row m-b-20 parentContainer bg-white padding-10 rounded" style="margin: 10px">
<div class="col">
<div class="row justify-content-center align-items-center">
<div class="hide col-auto btn-rounded padding-10 d-flex justify-content-center align-items-center bg-master-lighter" style="width: 30px;height: 30px; box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.14);">
<span class="bold">{{item.commenter.name.substr(0, 1)}}</span>
</div>
<div class="col">
<div class="row">
<div class="col-auto">
<p class="no-margin muted bold fs-14">{{item.commenter.name}}</p>
</div>
<div class="col-auto">
<span class="fs-12 muted normal">{{item.long_ago}}</span>
</div>
<div class="col d-flex justify-content-end">
<div class="row">
<div class="col p-t-5 p-b-5 b-a b-grey">
<div class="row" v-if="!isEdit && $store.getters.isAdmin">
<div class="col">
<i class="fa fa-edit pointer" @click="isEdit = !isEdit"></i>
</div>
<div class="col">
<div class="requestModal pointer" data-type="deleteComment">
<i class="fa fa-trash"></i>
</div>
</div>
</div>
<div class="row" v-if="isEdit">
<div class="col">
<i class="fa fa-times pointer" @click="isEdit = !isEdit"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<p v-if="!isEdit">{{item.content}}</p>
<container-comment-form-component :section="section" :data="item" :id="item.owner_id" v-on:submit="isEdit=false" v-if="isEdit"></container-comment-form-component>
</div>
</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="deleteComment">
<delete-container-comment-form-component :section="section" :data="item"></delete-container-comment-form-component>
</modal-component>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
props: {
section: {
type: String,
required: true,
}
},
data(){
return {
isEdit: false,
}
},
mixins: [componentHandler]
}
</script>
@@ -0,0 +1,55 @@
<template>
<div class="row m-t-5">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.content">
<input type="text" class="form-control fs-12" placeholder="Write your comments..." v-model.trim="parameters.content">
</validation-wrapper-component>
</div>
<div class="col-auto b-a b-grey d-flex justify-content-center align-items-center rounded pointer">
<i class="fa fa-paper-plane" @click="submitForm"></i>
</div>
</div>
</template>
<script>
import modalFormHandler from '../../../general/mixins/modalFormHandler';
import { required } from "vuelidate/lib/validators";
export default {
props: {
id: {
type: Number,
required: true
},
module_type: {
type: String,
required: true
}
},
data() {
return {
parameters: {
// content: this.data.remarks.length > 0 ? this.data.remarks[0].content : '',
content: '',
model_type: this.module_type
}
};
},
validations: {
parameters: {
content: { required },
}
},
created() {
if (this.data) {
this.parameters.content = this.data.content;
}
},
methods: {
submitForm() {
this.submit(this.data ? this.route('api.remark.update', this.data.id) : this.route('api.remark.create', this.id), this.data ? 'put' : 'post', this.section, true, true);
this.$emit('submit')
}
},
mixins: [modalFormHandler]
}
</script>
@@ -134,6 +134,23 @@
</div>
</div>
</div>
<div class="row m-b-30" v-if="order.invoices.length">
<div class="col">
<div class="row m-b-20">
<div class="col">
<h4 class="bold">Invoices</h4>
<p>You can view your invoices here and make payment.</p>
</div>
</div>
<div class="row bg-master-lightest p-t-15" v-for="invoice in order.invoices">
<div class="col">
<customer-payments-billing-component :data="invoice" invoice_status="Pending Payment" :section="section"></customer-payments-billing-component>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="row m-b-20">
@@ -0,0 +1,130 @@
<template>
<div class="row m-b-15 m-l-5 m-r-10 parentContainer">
<div class="col bg-white rounded">
<div class="row">
<div class="col padding-20">
<div class="row align-items-center">
<div class="col">
<p class="no-margin fs-10 all-caps">Marking</p>
<div class="no-margin">
<div v-if="item.order">
<a :href="route('customer.profile', item.order.company_module.marking)">{{item.order.company_module.marking}}</a>/<a :href="route('order.show', item.order.reference)">{{item.order.reference}}</a>
</div>
<div v-else class="text-danger">Unclaimed Packing List</div>
</div>
</div>
<div class="col">
<p class="no-margin fs-10 all-caps">Invoice Date</p>
<div v-if="!item.suspended_invoice">n/a</div>
<div v-if="item.suspended_invoice"> {{ item.suspended_invoice.updated_at }}</div>
</div>
<div class="col">
<p class="no-margin fs-10 all-caps">Status</p>
<div class="all-caps">{{ invoice_status }}</div>
</div>
<div class="col">
<p class="no-margin fs-10 all-caps">Amount</p>
<div v-if="!item.suspended_invoice">n/a</div>
<div v-if="item.suspended_invoice">MYR {{ item.suspended_invoice.amount.toFixed(2) }}</div>
</div>
<div class="col" v-if="invoice_status == 'Suspended Invoice'">
<p class="no-margin fs-10 all-caps">Billing Question</p>
<div>{{ latestComment.content }} </div>
</div>
<div class="col-auto p-l-0 p-r-0" v-if="['Suspended Invoice'].includes(invoice_status)">
<div class="btn bg-grey no-border muted requestModal" data-type="deleteDispute">
<i class="fa fa-close"></i>
</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="deleteDispute">
<delete-dispute-form-component :data="item" :section="section"></delete-dispute-form-component>
</modal-component>
</div>
<div class="col-auto p-l-0 p-r-0" v-if="['Suspended Invoice'].includes(invoice_status)">
<div class="btn bg-grey no-border muted requestModal" data-type="regenerateInvoice">
<i class="fa fa-refresh"></i>
</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="regenerateInvoice">
<regenerate-dispute-invoice-form-component :data="item" :section="section"></regenerate-dispute-invoice-form-component>
</modal-component>
</div>
<div class="col-auto p-l-0 p-r-0" v-if="['Pending Payment', 'Paid Invoice', 'Suspended Invoice'].includes(invoice_status)">
<div v-for="file in item.suspended_invoice.documents[0].files" v-bind:key="file.id" class="col-auto no-padding">
<document-file-viewer-component :file="file">
<template slot="button">
<div class="btn bg-grey no-border muted">
<i class="fa fa-file-pdf-o"></i>
</div>
</template>
</document-file-viewer-component>
</div>
</div>
<div class="col-auto p-l-0 p-r-0" v-if="['Pending Payment', 'Paid Invoice', 'Suspended Invoice'].includes(invoice_status)">
<div class="btn bg-grey no-border" @click="expanded = !expanded">
<i class="fa" :class="{'fa-angle-down': !expanded, 'fa-angle-up': expanded}" ></i>
</div>
</div>
</div>
</div>
</div>
<div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded">
<div class="col padding-20">
<div class="row bg-master-lightest h-100 padding-20">
<div class="col">
<h6 class="all-caps m-b-5 no-margin text-underline bold">Billing question</h6>
<remark-component :section="section" :data="item.suspended_invoice" module_type="Transaction"></remark-component>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
props: {
invoice_status: {
type: String,
required: true
},
section:{
type: String,
required: true
}
},
data(){
return {
parameters: {
packing_list_id: null,
transaction_details: [],
},
expanded: false,
}
},
computed: {
cbm () {
return (Math.ceil((this.item.packages.reduce((total, obj) => (obj.type === 2 ? 0 : obj.cbm) + total, 0)) * 1000) / 1000).toFixed(3)
},
overweight(){
return (Math.ceil((this.item.packages.reduce((total, obj) => (obj.type === 2 ? obj.cbm : 0) + total, 0)) * 1000) / 1000).toFixed(3)
},
latestComment() {
let questions = this.item.suspended_invoice.remarks;
return questions.slice().reverse()[0];
}
},
created(){
this.parameters.packing_list_id = this.data.id;
},
methods: {
generateInvoice() {
this.submit(this.route('api.transaction.invoice.create'), 'post', this.section, true, true);
},
successHandler(response){
this.item = response.payload.data;
// this.$forceUpdate();
}
},
mixins: [componentHandler]
}
</script>
@@ -9,11 +9,15 @@
<div class="no-margin">
<div v-if="item.order">
<a :href="route('customer.profile', item.order.company_module.marking)">{{item.order.company_module.marking}}</a>/<a :href="route('order.show', item.order.reference)">{{item.order.reference}}</a>
<p v-if="item.receive_packing_list">{{item.receive_packing_list.transport.drop_date}}</p>
<p>{{item.loading_days_ago}}</p>
</div>
<div v-if="!item.order" class="text-danger">Unclaimed Packing List</div>
<div v-else class="text-danger">Unclaimed Packing List</div>
</div>
</div>
<div class="col">
<p class="no-margin fs-10 all-caps">Container</p>
<div v-if="item.packages[0].container"> {{item.packages[0].container.container_reference}}</div>
</div>
<div class="col">
<p class="no-margin fs-10 all-caps">Invoice Date</p>
<div v-if="!item.shippng_transaction">n/a</div>
@@ -28,7 +32,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'].includes(invoice_status)">
<div class="col-auto p-l-0 p-r-0" v-if="['Pending Payment', 'Paid Invoice', 'Suspended 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,7 +57,24 @@
<i class="fa" :class="{'fa-angle-down': !expanded, 'fa-angle-up': expanded}" ></i>
</div>
<div v-if="!item.shippng_transaction">
<div class="btn btn-outline-primary btn-lg pointer" @click="generateInvoice()">Generate Invoice</div>
<div 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>
<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>
@@ -65,19 +86,23 @@
</div>
</div>
</div>
<div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded" v-if="item.shippng_transaction && invoice_status == 'Pending Approval'">
<div class="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="col p-b-10">
<div class="row">
<div class="col p-l-20 p-r-20 p-t-10 p-b-10">
<div class="row align-items-center">
<div class="col">
<p class="no-margin fs-10 all-caps">Container Reference</p>
<div>{{ item.packages.length ? item.packages[0].container.container_reference : 'n/a' }}</div>
<div 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>
<div class="col">
<p class="no-margin fs-10 all-caps">Due Date</p>
<div v-if="item.packages.length">
<div v-if="item.packages[0].container.transport">{{ item.packages[0].container.transport.drop_date == null ? item.packages[0].container.transport.current_schedule.etd : item.packages[0].container.transport.drop_date }}</div>
<div v-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-else>n/a</div>
</div>
<div v-else>n/a</div>
@@ -165,7 +190,7 @@
<div class="font-heading fs-12">MYR {{(Math.round((item.shippng_transaction.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
</div>
</div>
<div class="row align-items-end m-b-10 text-success">
<div class="row align-items-end m-b-10 text-success hide">
<div class="col">
<div class="font-heading all-caps fs-12">Paid Total:</div>
</div>
@@ -174,7 +199,7 @@
<div class="font-heading fs-12">Paid Total</div>
</div>
</div>
<div class="row align-items-end m-b-10 ">
<div class="row align-items-end m-b-10 hide">
<div class="col">
<div class="font-heading all-caps fs-12">Floating Amount:</div>
</div>
@@ -191,8 +216,7 @@
<div class="font-heading fs-12">MYR {{(Math.round((item.shippng_transaction.outstanding + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
</div>
</div>
<!-- <div class="row m-t-20" v-if="item.shippng_transaction.outstanding > 0"> -->
<div class="row m-t-20">
<div class="row m-t-20" v-if="item.shippng_transaction.outstanding > 0">
<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>
@@ -0,0 +1,220 @@
<template>
<div class="row m-b-15 m-l-5 m-r-10 parentContainer">
<div class="col bg-white rounded">
<div class="row" :class="[{'b-danger': item.status == 5 ||item.status == 6, 'b-a': item.status == 5||item.status == 6}]">
<div class="col padding-20">
<div class="row align-items-center">
<div class="col-2">
<p class="no-margin fs-10 all-caps">Invoice Date</p>
<div> {{ item.updated_at }}</div>
</div>
<div class="col">
<p class="no-margin fs-10 all-caps">Status</p>
<div class="all-caps" v-if="item.status == 3">Payment Completed</div>
<div class="all-caps text-danger" v-else-if="item.status == 5">Dispute in progress</div>
<div class="all-caps" v-else-if="item.status == 6">Cancelled Invoice</div>
<div class="all-caps" v-else>Pending Payment</div>
</div>
<div class="col-2">
<p class="no-margin fs-10 all-caps">Amount</p>
<div>MYR {{ item.amount.toFixed(2) }}</div>
</div>
<div class="col-3" v-if="item.remarks.length">
<p class="no-margin fs-10 all-caps">Billing Question</p>
<div>
{{ latestComment.content }}
<span class="btn requestModal no-border" v-if="item.remarks.length" size="large" data-type="chatmodal">
<i class="fa fa-comment-o"></i>
</span>
</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="chatmodal">
<remark-component :section="section" :data="item" module_type="Transaction"></remark-component>
</modal-component>
</div>
<div class="col-3" v-else>
<p class="no-margin fs-10 all-caps invisible">Billing Question</p>
<div>
<span class="btn requestModal no-border invisible">
<i class="fa fa-edit"></i>
</span>
</div>
</div>
<div class="col-auto p-l-0 p-r-0 d-flex justify-content-center align-items-center">
<div :class="[{'invisible': [5, 6, 3].includes(item.status)}]">
<span class="d-inline-block m-r-15 text-primary bold text-underline pointer requestModal" data-type="billingRemark">Billing Question?</span>
</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="billingRemark">
<customer-invoice-remark-form-component module_type="Transaction" :data="item" :section="section"></customer-invoice-remark-form-component>
</modal-component>
<div v-if="item.documents.length">
<div v-for="file in item.documents[0].files" v-bind:key="file.id" class="col-auto no-padding">
<document-file-viewer-component :file="file">
<template slot="button">
<div class="btn bg-grey no-border muted">
<i class="fa fa-file-pdf-o"></i>
</div>
</template>
</document-file-viewer-component>
</div>
</div>
<div v-else>
<div class="btn bg-grey no-border muted invisible">
<i class="fa fa-file-pdf-o"></i>
</div>
</div>
</div>
<div class="col-auto">
<div class="btn bg-grey no-border" @click="expanded = !expanded">
<i class="fa" :class="{'fa-angle-down': !expanded, 'fa-angle-up': expanded}" ></i>
</div>
</div>
</div>
</div>
</div>
<div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded" v-if="![5, 6].includes(item.status)">
<div class="col-12 col-md-7 padding-20">
<div class="row bg-master-lightest h-100">
<div class="col">
<div class="row bg-master-lightest" v-if="item.payment_attempts.length">
<div class="col">
<div class="row m-t-10 m-b-10">
<div class="col">
<div class="font-head fs-10 all-caps">Payment Attempt</div>
</div>
</div>
<div class="row">
<div class="col">
<shipping-transaction-component v-for="item in item.payment_attempts" v-bind:key="item.id" :data="item" ></shipping-transaction-component>
</div>
</div>
</div>
</div>
<div class="row bg-master-lightest" v-if="item.payment_history.length">
<div class="col">
<div class="row m-t-10 m-b-10">
<div class="col">
<div class="font-head fs-10 all-caps">Payment History</div>
</div>
</div>
<div class="row">
<div class="col">
<payment-history-component v-for="item in item.payment_history" v-bind:key="item.id" :data="item" ></payment-history-component>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-5 padding-20 parentContainer">
<div class="row bg-master-lightest h-100">
<div class="col">
<div class="row padding-10">
<div class="col">
<div class="row align-items-end m-b-10 text-complete">
<div class="col">
<div class="font-heading all-caps fs-12">Total Amount:</div>
</div>
<div class="col-auto text-right">
<div class="font-heading fs-12">MYR {{(Math.round((item.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
</div>
</div>
<div class="row align-items-end m-b-10 text-success">
<div class="col">
<div class="font-heading all-caps fs-12">Paid Total:</div>
</div>
<div class="col-auto text-right">
<!-- <div class="font-heading fs-12">MYR {{(Math.round((item.shippng_transaction.paid_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div> -->
<div class="font-heading fs-12">Paid Total</div>
</div>
</div>
<div class="row align-items-end m-b-10">
<div class="col">
<div class="font-heading all-caps fs-12">Floating Amount:</div>
</div>
<div class="col-auto text-right">
<!-- <div class="font-heading fs-12">MYR {{(Math.round((item.shippng_transaction.floating_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div> -->
<div class="font-heading fs-12">Floating Amount</div>
</div>
</div>
<div class="row align-items-end bold text-danger">
<div class="col">
<div class="font-heading all-caps fs-12">OutStanding Total:</div>
</div>
<div class="col-auto text-right">
<div class="font-heading fs-12">MYR {{(Math.round((item.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.outstanding > 0">
<div class="col">
<div class="btn btn-sm all-caps b-rad-none btn-success btn-block requestModal" data-type="makePayment">Make Payment</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="makePayment">
<payment-form-component :data="item" :section="section"></payment-form-component>
</modal-component>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded" v-if="[5, 6].includes(item.status)">
<div class="col padding-20">
<div class="row bg-master-lightest h-100 padding-20">
<div class="col">
<h6 class="all-caps m-b-5 no-margin text-underline bold">Billing question</h6>
<remark-component :section="section" :data="item" module_type="Transaction"></remark-component>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
props: {
invoice_status: {
type: String,
required: true
},
section:{
type: String,
required: true
}
},
data(){
return {
parameters: {
packing_list_id: null,
transaction_details: [],
},
expanded: false,
}
},
computed: {
cbm () {
return (Math.ceil((this.item.packages.reduce((total, obj) => (obj.type === 2 ? 0 : obj.cbm) + total, 0)) * 1000) / 1000).toFixed(3)
},
overweight(){
return (Math.ceil((this.item.packages.reduce((total, obj) => (obj.type === 2 ? obj.cbm : 0) + total, 0)) * 1000) / 1000).toFixed(3)
},
latestComment() {
let questions = this.item.remarks;
return questions.slice().reverse()[0];
}
},
created(){
this.parameters.packing_list_id = this.data.id;
},
methods: {
successHandler(response){
this.item = response.payload.data;
// this.$forceUpdate();
}
},
mixins: [componentHandler]
}
</script>
@@ -9,7 +9,7 @@
<div class="col-auto">
<div class="font-heading fs-8 muted all-caps">Status</div>
<div class="font-heading fs-10 bold" :class="[{'text-danger': item.status === 1 || item.status === 4}, {'text-success': item.status !== 1 && item.status !== 4}]">
{{ item.status === 1 ? 'Pending Verification' : item.status === ( 4 || 5) ? 'Rejected' : 'Processing Payment'}}
{{ item.status === 1 ? 'Pending Verification' : item.status === ( 4 || 5) ? 'Rejected' : 'Approved'}}
</div>
</div>
<div class="col-auto p-l-0">
@@ -0,0 +1,66 @@
<template>
<div class="row bg-white padding-25">
<div class="col">
<div class="row m-b-20 text-info">
<div class="col text-center">
<h3>Please select the address where you want to receive this order</h3>
</div>
</div>
<div class="row justify-content-center m-b-15" v-if="error">
<div class="col-10">
<small class="text-danger">{{error}}</small>
</div>
</div>
<div class="row justify-content-center">
<div class="col col-md-10">
<list-component style="min-height: 50px;" class="m-b-20" section="addressList" :emptyListSection=false :endpoint="route('api.address.list')" :options="{per_page: 5, HasMorphCompanyModule: data.order.company_module.id}">
<template slot="list" slot-scope="{data}">
<select-address-component :data="data" :value="parameters.address_id" v-model="parameters.address_id"></select-address-component>
</template>
</list-component>
<div class="row m-b-10 animate__animated animate__fadeInUpBig animate__delay-1 animate__fast">
<div class="col b-a p-t-15 p-b-15 pointer" :class="{ 'b-primary': !parameters.address_id, 'b-grey': parameters.address_id}" @click="parameters.address_id = null">
<div class="row align-items-center">
<div class="col-auto p-r-0">
<i class="fa fs-20 p-t-5" :class="{'fa-circle-o': parameters.address_id, 'fa-check-circle': !parameters.address_id, 'text-primary': !parameters.address_id}"></i>
</div>
<div class="col-auto semi-bold">New Address</div>
</div>
<div class="row" v-show="!parameters.address_id">
<div class="col">
<address-form-component :id="data.order.company_module.id" section="addressList" @input="parameters.address_id = $event"></address-form-component>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row m-t-15 justify-content-center">
<div class="col-6 col-md-4 p-r-5">
<div class="btn btn-default w-100 btn-lg b-rad-none" data-dismiss="modal">Cancel</div>
</div>
<div class="col-6 col-md-4 p-l-5">
<!-- <div class="btn btn-primary w-100 btn-lg" @click="submit(route('api.segment.constant.update.postcode', 1), 'put', section, true, true)">Confirm</div> -->
<div class="btn btn-primary w-100 btn-lg">Confirm</div>
</div>
</div>
</div>
</div>
</template>
<script>
import modalFormHandler from '../../../general/mixins/modalFormHandler';
export default {
data() {
return {
error: '',
parameters : {
warehouse_id: '',
address_id: '',
}
}
},
mixins: [modalFormHandler]
}
</script>
@@ -0,0 +1,75 @@
<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">What is your billing question?</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>Billing Question</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()">Create</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
export default {
props: {
data:{
type: Object,
required: true
},
module_type: {
type: String,
required: true
}
},
data(){
return {
parameters: {
content: '',
model_type: this.module_type
}
}
},
validations: {
parameters: {
content: {
required: false
}
}
},
methods: {
submitForm() {
this.submit(this.route('api.transaction.suspend', this.data.id), 'delete', this.section, false, true);
this.submit(this.route('api.remark.create', this.data.id), 'post', this.section, true, true);
}
},
mixins: [ModalFormHandler]
}
</script>
@@ -0,0 +1,33 @@
<template>
<div class="row">
<div class="col">
<loading-component style="height: 300px; top: 0;" key="1" color="success" v-show="isLoading" ></loading-component>
<div class="row justify-content-center" v-show="!isLoading">
<div class="col">
<div class="row m-b-20">
<div class="col text-center">
<h3 class="all-caps">Are you Sure?</h3>
<div class="fs-11">Are you sure you want to delete this displute?</div>
</div>
</div>
<div class="row">
<div class="col p-r-5">
<div class="btn btn-sm btn-success btn-block b-rad-none" data-dismiss="modal">Cancel</div>
</div>
<div class="col p-l-5">
<div class="btn btn-sm btn-danger btn-block b-rad-none" @click="submit(route('api.transaction.update', item.suspended_invoice.id, 'approve'), 'put', section, true, true)">Delete</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
export default {
mixins: [componentHandler, ModalFormHandler]
}
</script>
@@ -21,12 +21,12 @@
<p class="m-b-0 small muted">Total</p>
<p class="m-b-0 bold text-success">{{currency}} {{(Math.round((productTotal + Number.EPSILON) * 100) / 100).toFixed(2)}}</p>
</div>
<div class="col-auto" :class="{ 'invisible': ['SHIPPING_FEE', 'OVER_WEIGHT_CHARGES'].includes(product.reference) }">
<div class="col-auto" :class="{ 'invisible': ['SHIPPING_FEE', 'OVER_WEIGHT_CHARGES', 'MIN_CBM_CHARGES'].includes(product.reference) }">
<div @click="isEdit = !isEdit" class="pointer">
<i class="fa fa-pencil" />
</div>
</div>
<div class="col-auto" :class="{ 'invisible': ['SHIPPING_FEE', 'OVER_WEIGHT_CHARGES'].includes(product.reference) }">
<div class="col-auto" :class="{ 'invisible': ['SHIPPING_FEE', 'OVER_WEIGHT_CHARGES', 'MIN_CBM_CHARGES'].includes(product.reference) }">
<div @click="$emit('remove')" class="pointer">
<i class="fa fa-close" />
</div>
@@ -59,8 +59,6 @@
</div>
</div>
<p>{{ data }}</p>
<div class="row m-t-15">
<div class="col">
<p class="m-b-0 small">Total</p>
@@ -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" v-if="false">
<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">Proceed</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,7 +98,23 @@
},
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 = '';
},
successHandler(response){
if (response.payload) {
if (response.payload.data.payment_method === 5) {
window.location.href = this.route('billplz.bill', response.payload.data.payment_reference) + '?auto_submit=true';
}
}
}
},
mixins: [formHandler]
@@ -0,0 +1,46 @@
<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 text-center">
<h3 class="all-caps">Are you Sure?</h3>
<div class="fs-11">Are you sure you want to regenerate this invoice?</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="submitForm()">Delete</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
export default {
data(){
return {
parameters: {
packing_list_id: this.data.id,
},
}
},
methods: {
submitForm() {
this.submit(this.route('api.transaction.update', this.item.suspended_invoice.id, 'expire'), 'put', this.section, false, true);
this.submit(this.route('api.transaction.invoice.create'), 'post', this.section, true, true);
}
},
mixins: [componentHandler, ModalFormHandler]
}
</script>
@@ -102,7 +102,7 @@
<div class="col bg-master-lightest p-1 p-sm-4">
<div class="row tabsContainer tabContent" tab-name="pendingInvoice">
<div class="col">
<list-component section="pendingInvoiceSection" :endpoint="route('api.packing_list.list')" :options="{does_not_have_transaction_type: 1}">
<list-component section="pendingInvoiceSection" :endpoint="route('api.packing_list.list')" :options="{does_not_have_transaction_type: 1, type: 2}">
<template slot="list" slot-scope="{data}">
<admin-payments-billing-component :data="data" invoice_status="Pending Invoice" section="pendingInvoiceSection" ></admin-payments-billing-component>
</template>
@@ -27,14 +27,14 @@
</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 {{item.price}} <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>
</div>
</div>
</div>
<div class="col-auto">
<div class="col-auto hide">
<div class="row">
<div class="col">
<button class="btn btn-xs btn-outline-danger b-rad-none m-r-5">
@@ -32,16 +32,16 @@
</div>
<div class="row m-b-20">
<div class="col-6">
<div class="col-6 p-r-0">
<validation-wrapper-component :validator="$v.parameters.starting_on">
<label>Start Date</label>
<input type="date" v-model="parameters.starting_on">
<date-picker-component v-model="parameters.starting_on"></date-picker-component>
</validation-wrapper-component>
</div>
<div class="col-6">
<div class="col-6 p-l-0">
<validation-wrapper-component :validator="$v.parameters.ending_on">
<label>End Date</label>
<input type="date" v-model="parameters.ending_on">
<date-picker-component v-model="parameters.ending_on"></date-picker-component>
</validation-wrapper-component>
</div>
</div>
@@ -50,7 +50,7 @@
<div class="btn btn-sm btn-default bg-master-lightest btn-block b-rad-none" :data-dismiss="closable ? 'modal' : ''" @click="$emit('close')">Cancel</div>
</div>
<div class="col p-l-5">
<div class="btn btn-sm btn-success btn-block b-rad-none" @click="submitForm()">{{this.data?"Update":"Create"}}</div>
<div class="btn btn-sm btn-success btn-block b-rad-none" @click="submitForm()">{{data ? "Update" : "Create"}}</div>
</div>
</div>
</div>
@@ -91,9 +91,6 @@
description: {
required
},
// segment_id: {
// required
// },
starting_on:{
required
},
@@ -101,26 +98,19 @@
required
},
}
},
computed:{
},
created(){
console.log("lado form");
if (this.data) {
this.parameters.starting_on = this.data.starting_on;
this.parameters.ending_on = this.data.ending_on;
this.parameters.title = this.data.title;
this.parameters.description = this.data.description;
}
},
methods: {
submitForm(){
//this.submit(route('api.announcement.create'), 'post', this.section, true, false);
this.submit((this.data ? this.route('api.announcement.update', this.data.id) : this.route('api.announcement.create')), (this.data ? 'put' : 'post'), this.section, true, false)
},
// successHandler(response){
// this.closeModal();
// //this.formHandler();
// this.resetForm();
// },
// errorHandler(error){
// this.formHandler(error.message);
// }
},
mixins: [ModalFormHandler],
@@ -48,11 +48,6 @@
import { required } from "vuelidate/lib/validators";
export default {
props: {
section: {
default: ''
},
},
data() {
return {
parameters: {
@@ -29,15 +29,6 @@
import { required } from "vuelidate/lib/validators";
export default {
props: {
data: {
type: Object,
required: false
},
section: {
default: ''
},
},
data() {
return {
parameters: {
@@ -6,10 +6,10 @@
<h3 class="text-center">Edit {{data.name}} Price</h3>
</div>
</div>
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.value.amount">
<validation-wrapper-component class="m-b-15" :validator="$v.parameters.value">
<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" v-money="money">
</div>
</validation-wrapper-component>
<div class="row m-t-15">
@@ -17,7 +17,7 @@
<div class="btn btn-lg btn-default b-rad-none" data-dismiss="modal">Cancel</div>
</div>
<div class="col p-l-5">
<div class="btn btn-primary w-100 btn-lg" @click="submit(route('api.segment.constant.update', data.id), 'put', section, true, true)">Confirm</div>
<div class="btn btn-primary w-100 btn-lg" @click="submit(route('api.segment.price.update', data.id), 'put', section, true, true)">Confirm</div>
</div>
</div>
</div>
@@ -28,31 +28,20 @@
import { required } from "vuelidate/lib/validators";
export default {
props: {
data: {
type: Object,
required: false
},
section: {
default: ''
},
},
data() {
return {
parameters: {
reference: 'CUSTOM_PRICE',
id: this.data.id,
value : {
amount: this.data.price[this.data.id].amount
amount: this.data.price
}
}
};
},
validations: {
parameters: {
value: {
amount: { required }
}
value: { required }
}
},
mixins: [modalFormHandler]
+127 -1
View File
@@ -11,9 +11,135 @@
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>
File diff suppressed because one or more lines are too long
@@ -28,23 +28,13 @@
<div class="row m-b-10">
<div class="col">
<h5 class="semi-bold text-success">Your Payment is Successful</h5>
<p class="hint-text">Thank you for your payment. {{$transaction->owner instanceof \App\Models\Booking ? 'Your transfer request is now being processed and you will be notified once its complete.' : 'The amount paid has been successfully credited into your wallet.'}}</p>
<p class="hint-text">Thank you for your payment. The amount paid has been successfully applied to your invoice.</p>
</div>
</div>
<div class="row m-b-20">
<div class="col">
@if($transaction->owner instanceof \App\Models\Booking)
<a href="{{route('dashboard')}}">
<div class="btn btn-sm all-caps btn-outline-success b-rad-none">Dashboard</div>
</a>
@endif
@if($transaction->owner instanceof \App\Models\Wallet)
<a href="{{route('wallet.details', $transaction->owner->owner->reference)}}">
<div class="btn btn-sm all-caps btn-outline-success b-rad-none">Transaction History</div>
</a>
@endif
<a href="{{route('order.details', $marking)}}">
<div class="btn btn-sm all-caps btn-success b-rad-none" >{{$transaction->owner instanceof \App\Models\Booking ? 'Back to': 'Last'}} Order</div>
<div class="btn btn-sm all-caps btn-success b-rad-none" >Back to Order</div>
</a>
</div>
</div>
@@ -65,7 +55,7 @@
<div class="btn btn-sm all-caps btn-outline-success b-rad-none">Dashboard</div>
</a>
<a href="{{route('order.details', $marking)}}">
<div class="btn btn-sm all-caps btn-success b-rad-none" >{{$transaction->owner instanceof \App\Models\Booking ? 'Back to': 'Last'}} Booking</div>
<div class="btn btn-sm all-caps btn-success b-rad-none" >Back to Order</div>
</a>
</div>
</div>
@@ -83,7 +73,7 @@
<div class="row m-b-20">
<div class="col">
<a href="{{route('order.details', $marking)}}">
<div class="btn btn-sm all-caps btn-outline-success b-rad-none" >{{$transaction->owner instanceof \App\Models\Booking ? 'Back to': 'Last'}} Booking</div>
<div class="btn btn-sm all-caps btn-outline-success b-rad-none" >Back to Order</div>
</a>
<a href="{{route('billplz.bill', $transaction->payment_reference)}}">
<div class="btn btn-sm all-caps btn-success b-rad-none">Retry Payment</div>
@@ -17,27 +17,28 @@
</strong>
</span>
<span class="company-reg">(1134596-M)</span><br>
Malaysian Global Innovation &amp; Creativity Center <br>
Level 1 CWS, Block 3730, Persiaran APEC, <br>
63000 Cyberjaya, Malaysian. <br>
Tel: 018-2909252
No. 72-3, Jalan Jalil 1,<br>
The Earth Bukit Jalil,<br>
57000 Kuala Lumpur<br>
Tel: 03-8082 1252
</td>
<td class="header-details">
<div class="title">
<div class="title" style="font-size: 20px; text-transform: uppercase;">
<strong>
Invoice
</strong>
</div>
<div class="number">EI#: {{ $invoice_transaction->bill_no }}</div>
<div class="number">Invoice No: {{ $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>&nbsp;</div>
</div>
</td>
@@ -56,7 +57,7 @@
</div>
<div class="address">
@php
$addresses = $invoice_transaction->owner->owner->addresses()->where('status', '=', 2)->first();
$addresses = $companyModule->addresses()->where('status', '=', \App\Classes\ValueObjects\Constants\ApprovalStatus::APPROVED)->where('type', '=', \App\Classes\ValueObjects\Constants\AddressType::BILLING)->first();
@endphp
{{ $addresses->street_one }}
{{ $addresses->street_two }} ,
@@ -82,53 +83,53 @@
<tr>
<th width="5%">No</th>
<th class="description">Description</th>
<th width="10%">Quantity</th>
<th width="15%">Unit Price (RM)</th>
<th width="10%">Total Amount<br>(RM)</th>
<th width="15%">Quantity</th>
<th width="20%">Unit Price (RM)</th>
<th width="20%">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="10%" class="center top">{{ $transaction_detail->quantity }}</td>
<td width="15%" class="center top">
{{ $transaction_detail->price }}
<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>
<td width="20%" class="right top">
{{ $transaction_detail->amount }}
{{ round($transaction_detail->amount, 2) }}
</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr class="subtotal">
<td colspan="4"></td>
<td colspan="3"></td>
<td class="right middle">Subtotal</td>
<td class="right middle">
{{ number_format($invoice_transaction->amount, 2) }}
{{ round($invoice_transaction->amount, 2) }}
</td>
</tr>
<tr class="billingcharges">
<td colspan="4"></td>
<td colspan="3"></td>
<td class="right">Service Charges</td>
<td class="right">
{{ number_format($invoice_transaction->service_charge, 2) }}
{{ round($invoice_transaction->service_charge, 2) }}
</td>
</tr>
@if($invoice_transaction->tax > 0)
<tr class="billingcharges">
<td colspan="4"></td>
<td colspan="3"></td>
<td class="right">Tax</td>
<td class="right">{{ number_format($invoice_transaction->tax, 2) }}</td>
</tr>
@endif
<tr>
<td colspan="4"></td>
<td colspan="3"></td>
<td class="right middle">Total</td>
<td class="total right middle">
{{ number_format($invoice_transaction->amount, 2) }}
{{ round($invoice_transaction->amount, 2) }}
</td>
</tr>
</tfoot>
+3 -3
View File
@@ -3,7 +3,7 @@
<div class="row">
<div class="col">
<div class="row tabsContainer">
<div class="col-12 col-md-auto">
<div class="col-12 col-md-3">
<div class="row">
<div class="col">
<div class="row m-b-5">
@@ -171,7 +171,7 @@
</div>
</div>
</div>
<div class="col bg-master-lightest p-l-25 p-r-25 p-t-15 p-b-15">
<div class="col-9 bg-master-lightest p-l-25 p-r-25 p-t-15 p-b-15">
<div class="row tabsContainer tabContent" tab-name="profile">
<div class="col">
<div class="row">
@@ -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')">
<list-component section="segmentsSection" :endpoint="route('api.segment.list')" :options="{'id_not': 1}">
<template slot="list" slot-scope="{data}">
<segment-component :data="data" section="segmentsSection"></segment-component>
</template>
+1 -1
View File
@@ -147,7 +147,7 @@
<a href="{{route('template.shipping-queue')}}"><h6 class="no-margin light fs-18 all-caps">Shipping Queue</h6></a>
</div>
</div>
<div class="row p-t-15 p-b-15 align-items-center justify-content-center hide">
<div class="row p-t-15 p-b-15 align-items-center justify-content-center">
<div class="col-auto p-r-0">
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
width="25" height="25"
+4 -4
View File
@@ -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');
+1
View File
@@ -7,6 +7,7 @@ Route::group(['prefix' => 'segment', 'as' => 'segment.', 'namespace' => 'Segment
Route::delete('/delete/{id}', 'DeleteSegmentController@destroy')->name('delete');
Route::get('/{id}/show', 'FetchSegmentController@fetch')->name('show');
Route::put('/update/{id}', 'UpdateSegmentController@update')->name('update');
Route::put('price/update/{id}', 'UpdateSegmentPriceController@update')->name('price.update');
Route::get('/list', 'ListSegmentsController@list')->name('list');
Route::get('/air-shipment/item-price/list', 'ListAirShipmentPriceController@list')->name('air_shipment.price.list');
+1
View File
@@ -6,6 +6,7 @@ Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' =>
Route::get('/list', 'ListTransactionsController@list')->name('list');
Route::delete('/suspend/{id}', 'SuspendTransactionController@suspend')->name('suspend');
Route::put('{id}/status/update/{status}', 'UpdateTransactionStatusController@update')->where('status', 'approve|expire')->name('update');
Route::group(['prefix' => 'payment', 'as' => 'payment.'], function () {
Route::post('/create', 'CreatePaymentTransactionController@create')->name('create');
+4
View File
@@ -418,4 +418,8 @@ Route::get('/payment-and-billing', function () {
})->name('admin.payment-and-billing');
Route::get('/notifications/list', 'Notifications\ListNotificationsController@list')->name('notifications.list');
Route::get('billplz/bills/{bill_no}', function($bill_no){
return redirect(env('BILLPLZ_BASE_URL').'/bills/'.$bill_no);
})->name('billplz.bill');
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace Tests;
use Illuminate\Contracts\Console\Kernel;
trait CreatesApplication
{
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
return $app;
}
}
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$response = $this->get('/swagger');
$response->assertStatus(200);
}
}
+10
View File
@@ -0,0 +1,10 @@
<?php
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
}
+19
View File
@@ -0,0 +1,19 @@
<?php
namespace Tests\Unit;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$this->assertTrue(true);
}
}