Compare commits

..

18 Commits

Author SHA1 Message Date
Aqqil Azman 6094bf03ca added vue multi-select component "address-extra-details-component" 2024-06-21 10:41:45 +08:00
Aqqil Azman c58886eeff initial commit, vue multi-select for Address extra details 2024-06-21 10:41:10 +08:00
edmondlang 4a9ac3de02 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into address-extra-fields 2024-06-20 10:03:57 +08:00
edmondlang 1e6fafef28 make address line 2 required 2024-06-20 10:02:15 +08:00
Dillon Ngo fd75da5778 Merge branch 'dillon/51.5-vue-store-update' into 'master'
A minor fix to not allow non-admin user to see admin data by navigating to the...

See merge request CIEFWorldwideSdnBhd/shipping-portal!229
2024-06-17 00:58:05 +00:00
Dillon Ngo b593605c72 A minor fix to not allow non-admin user to see admin data by navigating to the url /payment-and-billing-2 2024-06-17 08:51:09 +08:00
Dillon Ngo 8d75012390 Merge branch 'dillon/62.1-fixes' into 'master'
Reinstate original code after data patch

See merge request CIEFWorldwideSdnBhd/shipping-portal!228
2024-06-16 06:14:47 +00:00
Dillon Ngo 2d98757c1c Data patch meant to fix a group payment with group id 609 and transaction id 16803 that got stuck after making paying 2024-06-16 14:13:09 +08:00
Dillon Ngo b329f232f2 Merge branch 'dillon/62.1-fixes' into 'master'
Data patch meant to fix a group payment with group id 609 and transaction id...

See merge request CIEFWorldwideSdnBhd/shipping-portal!227
2024-06-16 06:06:54 +00:00
Dillon Ngo 713922d2ee Data patch meant to fix a group payment with group id 609 and transaction id 16803 that got stuck after making paying 2024-06-16 14:04:16 +08:00
Dillon Ngo 74d11f8305 Merge branch 'dillon/62.1-fixes' into 'master'
Fix a rounding problem in group payment which will result in goods cannot be...

See merge request CIEFWorldwideSdnBhd/shipping-portal!226
2024-06-14 21:58:25 +00:00
Dillon Ngo ea920717a1 Fix a rounding problem in group payment which will result in goods cannot be released through CallbackBillplzLogic 2024-06-15 05:56:23 +08:00
Dillon Ngo e1b49f6be0 Merge branch 'dillon/46.13-missing-payment-proof-feature' into 'master'
Restore missing payment proof feature

See merge request CIEFWorldwideSdnBhd/shipping-portal!224
2024-06-14 21:45:15 +00:00
edmondlang 1be405ca93 fix error message in admin dashbaord 2024-06-13 23:47:43 +08:00
edmondlang 9d0924c674 address extra fields 2024-06-12 12:02:31 +08:00
Dillon Ngo e63e3e707f 'Your Payment Proof' feature missing for order with storage invoices through group payment 2024-06-09 12:44:19 +08:00
Dillon Ngo aeaec32dcb 'Your Payment Proof' feature missing for order with storage invoices through group payment 2024-06-09 12:16:18 +08:00
Dillon Ngo b000c25e66 'Your Payment Proof' feature missing for order with storage invoices through group payment 2024-06-09 12:00:19 +08:00
21 changed files with 475 additions and 66 deletions
@@ -15,6 +15,7 @@ use App\Classes\Modules\Contacts\Processors\CreateContactProcessor;
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\RemarkTypes;
use App\Http\Resources\AddressResource;
use App\Models\Address;
use ErrorException;
@@ -100,6 +101,16 @@ class CreateAddressLogic extends AbstractControllerLogic
$this->createRemarkProcessor->execute($address, $remarkObject);
}
$addressExtraFields = [
'property_type' => $request->input('property_type'),
'tools_required_unload' => $request->input('tools_required_unload'),
'pickup_time_from' => $request->input('pickup_time_from'),
'pickup_time_to' => $request->input('pickup_time_to'),
];
$addressExtraFieldsObject = new RemarkObject(json_encode($addressExtraFields), Auth()->user()->id, RemarkTypes::ADDRESS_EXTRA_COLUMNS);
$this->createRemarkProcessor->execute($address, $addressExtraFieldsObject);
return $this->resourceResponse(new AddressResource($address));
}
@@ -15,6 +15,7 @@ use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
use App\Classes\ValueObjects\Constants\AddressType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\RemarkTypes;
use App\Http\Resources\AddressResource;
use App\Models\Address;
use Illuminate\Http\JsonResponse;
@@ -102,6 +103,16 @@ class UpdateAddressLogic extends AbstractControllerLogic
$this->createRemarkProcessor->execute($address, $remarkObject);
}
$addressExtraFields = [
'property_type' => $request->input('property_type'),
'tools_required_unload' => $request->input('tools_required_unload'),
'pickup_time_from' => $request->input('pickup_time_from'),
'pickup_time_to' => $request->input('pickup_time_to'),
];
$addressExtraFieldsObject = new RemarkObject(json_encode($addressExtraFields), Auth()->user()->id, RemarkTypes::ADDRESS_EXTRA_COLUMNS);
$this->createRemarkProcessor->execute($address, $addressExtraFieldsObject);
return $this->resourceResponse(new AddressResource($address));
}
@@ -13,10 +13,14 @@ class RemarkObject implements DataTransferObject
/** @var string*/
private $content;
public function __construct(string $content, int $commenterID)
/** @var int|null */
private $type;
public function __construct(string $content, int $commenterID, int $type = null)
{
$this->commenterID = $commenterID;
$this->content = $content;
$this->type = $type;
}
/**
@@ -35,4 +39,12 @@ class RemarkObject implements DataTransferObject
return $this->content;
}
/**
* @return int|null
*/
public function getType(): ?int
{
return $this->type;
}
}
@@ -24,6 +24,7 @@ class CreatesRemark extends AbstractUpdateRelationshipRecord
$model->commenter_id = $object->getCommenterId();
$model->content = $object->getContent();
$model->type = $object->getType();
return $this->handler($remarkable->remarks(), $model);
@@ -0,0 +1,188 @@
<?php
namespace App\Classes\Modules\Transactions\Processors;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
use App\Classes\Modules\Transactions\Services\CreatesPaymentTransaction;
use App\Classes\Modules\Transactions\Services\CreatesTransactionDetail;
use App\Classes\Modules\Billplzs\Services\CreatesBillplzBill;
use App\Classes\Modules\Transactions\Services\CreatesTransactionableTransaction;
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\Modules\Wallets\Services\UpdatesWalletBalance;
use App\Models\Transaction;
use App\Models\Wallet;
use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
use App\Classes\Modules\Orders\Processors\UpdateDoFromYDPortalProcessor;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use Illuminate\Support\Facades\Log;
//DATE: 20240616
//THIS IS A ONE TIME FIX PROCESSOR MEANT TO FIX A GROUP PAYMENT THAT GOT STUCK: https://izyim.cief-malaysia.com/customer/943GCC/payment-and-billing
//TRNASACTION WITH ID: 16803
//GROUP WITH ID: 609
class CreatePaymentTransactionOneTimeFixProcessor
{
/** @var GeneratesTransactionBillNumber */
private $generatesTransactionBillNumber;
/** @var CreatesPaymentTransaction */
private $createsPaymentTransaction;
/** @var CreatesBillplzBill */
private $createsBillplzBill;
/** @var CreatesTransactionableTransaction */
private $createsTransactionableTransaction;
/** @var UpdatesWalletBalance */
private $updatesWalletBalance;
/** @var UpdateDoFromVTPortalProcessor */
private $updateDoFromVTPortalProcessor;
/** @var UpdateDoFromYDPortalProcessor */
private $updateDoFromYDPortalProcessor ;
/** @var UpdatesTransactionStatus */
private $updatesTransactionStatus ;
/**
* @param FetchesTransaction $fetchesTransaction,
* @param GeneratesTransactionBillNumber $generatesTransactionBillNumber,
* @param CreatesPaymentTransaction $createsPaymentTransaction
* @param CreatesTransactionDetail $createsTransactionDetail
* @param CreatesBillplzBill $createsBillplzBil
* @param CreatesTransactionableTransaction $createsTransactionableTransaction
* @param UpdatesWalletBalance $updatesWalletBalance
* @param UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor
* @param UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor
* @param UpdatesTransactionStatus $updatesTransactionStatus
*/
public function __construct(
GeneratesTransactionBillNumber $generatesTransactionBillNumber,
CreatesPaymentTransaction $createsPaymentTransaction,
CreatesBillplzBill $createsBillplzBill,
CreatesTransactionableTransaction $createsTransactionableTransaction,
UpdatesWalletBalance $updatesWalletBalance,
UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor,
UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor,
UpdatesTransactionStatus $updatesTransactionStatus
)
{
$this->generatesTransactionBillNumber = $generatesTransactionBillNumber;
$this->createsPaymentTransaction = $createsPaymentTransaction;
$this->createsBillplzBill = $createsBillplzBill;
$this->createsTransactionableTransaction = $createsTransactionableTransaction;
$this->updatesWalletBalance = $updatesWalletBalance;
$this->updateDoFromVTPortalProcessor = $updateDoFromVTPortalProcessor;
$this->updateDoFromYDPortalProcessor = $updateDoFromYDPortalProcessor;
$this->updatesTransactionStatus = $updatesTransactionStatus;
}
/**
* @throws MalformedRequestException
*/
public function execute(Transaction $invoice, $payment_method, $bank_code, $date, $run = true)
{
$amount = $invoice->amount;
Log::info($invoice->owner);
$company_module = $invoice->owner->owner->companyModule()->first();
$approvalStatus = ApprovalStatus::PENDING_SUBMISSION;
$billNumber = $this->generatesTransactionBillNumber->execute('PYMT-');
$payment_reference = null;
if ($payment_method == PaymentMethodType::PAYMENT_GATEWAY) {
// create billplz transaction
$payment_method = PaymentMethodType::PAYMENT_GATEWAY;
$billPlzBill = $this->createsBillplzBill->execute(
$company_module->name,
(app()->environment(['production'])) ? $company_module->employees()->first()->email : 'uldvstar@gmail.com',
'This payment is for the invoice number . ' . $billNumber,
$amount,
$billNumber,
$bank_code,
true
);
$payment_reference = $billPlzBill->id;
}
else if ($payment_method === PaymentMethodType::WALLET) {
/** @var Wallet $wallet */
$wallet = $company_module->wallets()->first();
// if((float) number_format(($wallet->amount - $amount),2) < 0){
// throw new MalformedRequestException('Insufficient wallet balance. Please Top up your wallet.');
// }
$walletPaymentBillNumber = $this->generatesTransactionBillNumber->execute('PYMT-');
$transaction_object = new TransactionObject($walletPaymentBillNumber, TransactionType::PAYMENT, 1, $company_module->id, 1, PaymentMethodType::WALLET, $amount, $amount, 1, 1, 1, 0, 0, null, ApprovalStatus::APPROVED, [], '');
$transaction = $this->createsTransactionableTransaction->execute($wallet, $transaction_object);
$transaction->created_at = $date;
$transaction->updated_at = $date;
$transaction->save();
$payment_reference = $walletPaymentBillNumber;
$this->updatesWalletBalance->execute($wallet, ($amount * -1));
if($run)
{
$packingList = $invoice->owner;
$order = $packingList->owner;
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
if(app()->environment('production')){
$this->updateDoFromVTPortalProcessor->execute($packingList);
$this->updateDoFromYDPortalProcessor->execute($packingList);
}
}
// later use this variabke to create a approved payment transaction
$approvalStatus = ApprovalStatus::APPROVED;
// update invoice to completed
if($run){
$this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED);
}
}
else {
$payment_method = PaymentMethodType::CASH;
}
$object = new TransactionObject(
$billNumber,
TransactionType::PAYMENT,
$company_module->id,
1,
1,
$payment_method,
$amount,
$amount,
1,
1,
0,
0,
0,
null,
$approvalStatus,
null,
$payment_reference
);
$payment_transaction = $this->createsPaymentTransaction->execute($invoice, $object);
return $payment_transaction;
}
}
@@ -10,4 +10,6 @@ final class RemarkTypes
public const EXTERNAL = 1;
}
public const ADDRESS_EXTRA_COLUMNS = 2;
}
@@ -55,11 +55,12 @@ class OneTimeTransactionFixBillplzFailedCallback extends Command
$this->outputArray = [];
$start = new Carbon();
//This transaction, 15205 has approve payment but not its owner, shipping invoice
$transaction = Transaction::whereIn('id', [15205])->first();
$this->info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 15205 cron started.');
//Transaction fix with this one time fix command: 15205, 16803
//This transaction, 16803 has approve payment but not its owner, shipping invoice
$transaction = Transaction::whereIn('id', [16803])->first();
$this->info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 16803 cron started.');
if($transaction && $transaction->id == 15205){
if($transaction && $transaction->id == 16803){
$status = ApprovalStatus::APPROVED;
$this->callbackBillplzProcessor->execute($transaction, $status);
@@ -68,6 +69,6 @@ class OneTimeTransactionFixBillplzFailedCallback extends Command
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
$this->info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 15205 cron ended. ElapsedTime: ' . $elapsedTime);
$this->info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 16803 cron ended. ElapsedTime: ' . $elapsedTime);
}
}
+8
View File
@@ -27,6 +27,9 @@ class AddressResource extends JsonResource
$outstationPostcodeConstant = $outstationPostcodeConstantObject->isEmpty() ? [] : (array)$outstationPostcodeConstantObject->first()->value;
in_array((String)$this->postcode, $outstationPostcodeConstant) ? $postcodeArea = 'OUTSTATION_POSTCODE' : null;
$extrafields = json_decode($this->addressExtraFields->first());
$extrafields = $extrafields ? (isset($extrafields->content) ? json_decode($extrafields->content) : null) : null;
return [
'id' => $this->id,
'reference' => $this->reference,
@@ -43,6 +46,11 @@ class AddressResource extends JsonResource
'contact' => new ContactResource($this->contacts->first()),
'remark' => new RemarkResource($this->remarks->first()),
'type' => $this->type,
'extrafields' => $extrafields,
'property_type' => $extrafields ? $extrafields->property_type : null,
'tools_required_unload' => $extrafields ? $extrafields->tools_required_unload : null,
'pickup_time_from' => $extrafields ? $extrafields->pickup_time_from : null,
'pickup_time_to' => $extrafields ? $extrafields->pickup_time_to : null,
$this->mergeWhen($this->relationLoaded('owner'), [
'owner' => $this->when($this->owner instanceof Order, [
'reference' => $this->owner->reference,
@@ -28,7 +28,9 @@ class TransactionWithStorageResource extends JsonResource
$groupPaymentAttemptsFiltered = [];
$group_payment_expired = null;
$group_payment_history = null;
$group_payment_history_query = null;
$groupTotalAmount = 0;
$payment_history = null;
if ($this->owner instanceof Transaction) {
if ($this->owner) {
@@ -44,7 +46,8 @@ class TransactionWithStorageResource extends JsonResource
if($this->groups){
$group_payment_attempts = GroupForOrderV2Resource::collection($this->groups->whereNotIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]));
$group_payment_expired = GroupForOrderV2Resource::collection($this->groupsWithTrashed->whereIn('status', [ApprovalStatus::EXPIRED]));
$group_payment_history = GroupForOrderV2Resource::collection($this->groups->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::REJECTED]));
$group_payment_history_query = $this->groups->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::REJECTED]);
$group_payment_history = GroupForOrderV2Resource::collection($group_payment_history_query);
}
} else {
@@ -61,7 +64,7 @@ class TransactionWithStorageResource extends JsonResource
}
$ts = $this->groups->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION])->last();
if ($ts) {
if ($ts && $group_payment_history && $group_payment_attempts) {
$paymentTransaction = Transaction::where('payment_reference', $ts->reference)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION])->first();
if($paymentTransaction){
$groupTotalAmount = (double) $this->amount;
@@ -81,6 +84,21 @@ class TransactionWithStorageResource extends JsonResource
}
$payment_history = TransactionResource::collection($this->transactions()
->payments()
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::COMPLETED, ApprovalStatus::REJECTED])
->get());
//For 'Your Payment Proof' at frontend
if($group_payment_history_query && count($group_payment_history_query) > 0){
if($this->getReferenceForGroupPayment($group_payment_history_query)){
foreach ($payment_history as $item) {
$item['payment_reference'] = $this->getReferenceForGroupPayment($group_payment_history_query);
}
}
}
return [
'id' => $this->id,
'owner_type' => $this->owner_type,
@@ -117,12 +135,7 @@ class TransactionWithStorageResource extends JsonResource
->payments()->where('status', ApprovalStatus::EXPIRED)
->get()
),
'payment_history' => TransactionResource::collection(
$this->transactions()
->payments()
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::COMPLETED, ApprovalStatus::REJECTED])
->get()
),
'payment_history' => $payment_history,
'remarks' => RemarkResource::collection($this->remarks),
'packing_list_reference' => $packingListReference,
'storages' => $this->storages ? $this->storages : null, //from middleware
@@ -132,4 +145,12 @@ class TransactionWithStorageResource extends JsonResource
'created_at' => Carbon::parse($this->created_at)->format('d-m-Y')
];
}
private function getReferenceForGroupPayment($groups){
if(count($groups)){
$firstGroup = $groups[0];
return $firstGroup['reference'];
}
return null;
}
}
+9
View File
@@ -4,6 +4,7 @@ namespace App\Models;
use App\Classes\General\Interfaces\Contactable;
use App\Classes\General\Interfaces\Remarkable;
use App\Classes\ValueObjects\Constants\RemarkTypes;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
@@ -89,4 +90,12 @@ class Address extends AbstractModel implements Contactable, Remarkable
{
return $this->morphMany(Remark::class, 'owner');
}
/**
* @return MorphMany
*/
public function addressExtraFields(): MorphMany
{
return $this->morphMany(Remark::class, 'owner')->where('type', RemarkTypes::ADDRESS_EXTRA_COLUMNS);
}
}
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddTypeToRemarksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('remarks', function (Blueprint $table) {
$table->string('type')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('remarks', function (Blueprint $table) {
$table->dropColumn('type');
});
}
}
-1
View File
@@ -31,7 +31,6 @@
"vue": "^2.6.10",
"vue-avatar": "^2.1.8",
"vue-debounce": "^2.6.0",
"vue-gtag": "^1.16.1",
"vue-template-compiler": "^2.6.10",
"vue-the-mask": "^0.11.1",
"vuelidate": "^0.7.4",
+1 -12
View File
@@ -2,7 +2,6 @@
/** Dependencies */
import Vue from 'vue'
import store from './vuex/store';
import VueGtag from 'vue-gtag'
window.route = require('./general/functions/router');
@@ -44,7 +43,7 @@ Vue.mixin({
route: route
},
mixins: [request, crudHandler]
});
});
/** Components Registrations */
Vue.component(Avatar);
@@ -52,16 +51,6 @@ Vue.component(Avatar);
const files = require.context('./', true, /\.vue$/i);
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));
// Google Analytics 4 (GA4) Integration
Vue.use(VueGtag, {
property: {
id: 'G-SP04J05142',
params: {
user_id: store.getters.getUserId
}
}
});
const app = new Vue({
el: '#app',
store,
@@ -0,0 +1,58 @@
<template>
<div>
<label class="text-primary">卸货工具 Tools required to unload goods</label>
<vue-multi-select
ref="multiSelect"
:options="options"
:btnLabel="btnLabel"
@open="open"
@close="close"
:selectOptions="data">
<template v-slot:option="{ option }">
<input type="checkbox" :checked="option.selected"/>
<span>{{ option.name }}</span>
</template>
</vue-multi-select>
</div>
</template>
<script>
import vueMultiSelect from 'vue-multi-select';
import 'vue-multi-select/dist/lib/vue-multi-select.css';
export default {
data() {
return {
values: [],
data: [{
list: [
{ name: 'Manpower' },
{ name: 'Forklift' },
{ name: 'None of the above' }
],
}],
options: {
multi: true,
groups: true,
},
};
},
methods: {
open() {
console.log('open');
},
close() {
console.log('close');
},
btnLabel(values) {
if (values.length === 0) {
return 'Select Tools required';
}
return values.map(v => v.name).join(', ');
},
},
components: {
vueMultiSelect,
},
};
</script>
@@ -3,14 +3,6 @@
<div class="col">
<div class="row" v-if="![7,8].includes($store.getters.getCompanyModuleType)">
<div class="col">
<div class="row m-b-15">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.reference">
<label>Address Reference/Label</label>
<input class="form-control" name="reference" v-model="parameters.reference">
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-15">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.street_one">
@@ -41,6 +33,14 @@
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-15">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.reference">
<label>Address Name / Label</label>
<input class="form-control" name="reference" v-model="parameters.reference" placeholder="E.g. Home Address">
</validation-wrapper-component>
</div>
</div>
<div class="row">
<div class="col">
<div class="row">
@@ -59,14 +59,6 @@
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-15">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.remark">
<label>Delivery Remark</label>
<input class="form-control" name="remark" v-model="parameters.remark">
</validation-wrapper-component>
</div>
</div>
</div>
</div>
</div>
@@ -125,14 +117,48 @@
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-15">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.remark">
<label>Remark</label>
<input class="form-control" name="remark" v-model="parameters.remark">
</validation-wrapper-component>
</div>
</div>
</div>
</div>
<div class="row m-b-15">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.remark">
<label>Delivery Remark</label>
<input class="form-control" name="remark" v-model="parameters.remark">
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-15">
<div class="col-12 col-md pr-md-1 pb-3 pb-md-0">
<validation-wrapper-component :validator="$v.parameters.pickup_time_from">
<label>收货时间从 Available Hours From</label>
<input type="time" class="form-control" name="pickup_time" v-model="parameters.pickup_time_from">
</validation-wrapper-component>
</div>
<div class="col-12 col-md pl-md-1">
<validation-wrapper-component :validator="$v.parameters.pickup_time_to">
<label>最晚收货时间 Available Hours To</label>
<input type="time" class="form-control" name="latest_pickup_time" v-model="parameters.pickup_time_to">
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-15">
<div class="col-12 col-md pr-md-1 pb-3 pb-md-0">
<validation-wrapper-component selectable :validator="$v.parameters.property_type">
<label>房型 Receiver's property type</label>
<select-component :options="['住家Landed house', '公寓Condominium (Drop on lobby only)', '工厂Factory', '店面Shop', '商场Shopping Mall (Drop on loading bay only)', 'Others']" v-model="parameters.property_type"></select-component>
</validation-wrapper-component>
</div>
<div class="col-12 col-md pl-md-1 pb-3 pb-md-0">
<!-- <validation-wrapper-component selectable :validator="$v.parameters.tools_required_unload">
<label>卸货工具 Tools require to unload goods</label>
<select-component :options="['Manpower', 'Forklift', 'None of above']" v-model="parameters.tools_required_unload"></select-component>
</validation-wrapper-component> -->
<address-extra-details-component v-model="parameters.tools_required_unload"></address-extra-details-component>
</div>
</div>
<div class="row justify-content-center allign-items-center">
<div class="col-12 col-sm-7">
<h6 class="text-center fs-12 text-danger">**kindly reply within 2 hours while warehouse contact to arrange for delivery, otherwise, reschedule of delivery date will apply</h6>
</div>
</div>
<div class="row">
@@ -154,7 +180,7 @@
props: {
id: {
type: Number,
required: true
// required: true
},
type: {
type: Number,
@@ -174,6 +200,10 @@
remark: '',
phone: '',
person_in_charge: '',
property_type: '',
tools_required_unload: '',
pickup_time_from: '',
pickup_time_to: '',
}
}
@@ -189,12 +219,16 @@
this.parameters.phone = this.data.contact ? this.data.contact.phone : '';
this.parameters.person_in_charge = this.data.contact ? this.data.contact.reference : '';
this.parameters.remark = this.data.remark ? this.data.remark.content : '';
this.parameters.property_type = this.data.property_type ? this.data.property_type : '';
this.parameters.tools_required_unload = this.data.tools_required_unload ? this.data.tools_required_unload : '';
this.parameters.pickup_time_from = this.data.pickup_time_from ? this.data.pickup_time_from : '';
this.parameters.pickup_time_to = this.data.pickup_time_to ? this.data.pickup_time_to : '';
}
},
watch: {
'id': function () {
this.parameters.company_module_id = this.id;
}
},
},
methods:{
submitForm(){
@@ -116,9 +116,10 @@
},
sumAmount () {
var new_object = this.selectedInvoice;
return Object.keys(new_object).reduce(function(total, key) {
return total + Math.round(new_object[key].amount * 100) / 100;
var total = Object.keys(new_object).reduce(function(total, key) {
return total + new_object[key].amount;
}, 0).toFixed(2);
return Math.round(total * 100) / 100;
},
selectedIds () {
return this.selectedInvoice.map(s=>s.id);
@@ -17,7 +17,7 @@
<div class="col-auto hide" v-if="$store.getters.isSuperAdmin">
<button type="button" class="btn b-rad-none btn-danger fs-11 requestModal" data-type="deletePackingList"><i class="fa fa-times text-white fs-12"></i></button>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="deletePackingList">
<delete-packinglist-form-component :data="data"></delete-packinglist-form-component>
<delete-packinglist-form-component :data="data" :section="section"></delete-packinglist-form-component>
</modal-component>
<button type="button" class="btn b-rad-none btn-primary fs-11 requestModal" data-type="claimPackingList">Claim</button>
</div>
@@ -51,7 +51,7 @@
<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" data-dismiss="modal" @click="submit(route('api.packing_list.delete', item.id), 'delete', 'unclaimedPackingListSection', true, true)">Confirm</div>
<div class="btn btn-sm btn-danger btn-block b-rad-none" data-dismiss="modal" @click="submit(route('api.packing_list.delete', item.id), 'delete', section, true, true)">Confirm</div>
</div>
</div>
</div>
@@ -78,6 +78,12 @@
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
mixins: [componentHandler]
mixins: [componentHandler],
data() {
return {
isLoading: false,
section: 'unclaimedPackingListSection',
}
}
}
</script>
@@ -157,6 +157,13 @@
</div>
</a>
</div>
<div class="row no-margin" v-if="item.payment_method === 4 && item.payment_reference">
<a :href="route('billplz.bill', item.payment_reference)" target="_blank">
<div class="icon-thumbnail fs-11 text-white icon-25 bg-primary btn-rounded float-left m-r-5">
<i class="fa fa-file-image-o fs-10"></i>
</div>
</a>
</div>
</div>
</div>
</div>
@@ -181,9 +188,13 @@
},
methods: {
clickExpand(){
if(this.item
&& ((this.item.payment_method !== 5 && this. item.documents.length)
|| (this.item.payment_method === 5 && (this.item.status === 2 || this.item.status === 3)))){
// if(this.item
// && ((this.item.payment_method !== 5 && this. item.documents.length)
// || (this.item.payment_method === 5 && (this.item.status === 2 || this.item.status === 3)))){
// this.expandPaymentDetails = !this.expandPaymentDetails;
// }
if(this.item){
this.expandPaymentDetails = !this.expandPaymentDetails;
}
},
@@ -10,15 +10,20 @@ export default {
},
street_one: { required },
street_two: {
required: requiredIf(function(){
return [7,8].includes(this.$store.getters.getCompanyModuleType);
})
required
// required: requiredIf(function(){
// return [7,8].includes(this.$store.getters.getCompanyModuleType);
// })
},
district_id: { required },
post_code: { required },
remark: {},
phone: {required, numeric},
person_in_charge: { required },
property_type: { required },
tools_required_unload: { required },
pickup_time_from: { required },
pickup_time_to: { required },
}
},
mixins: [addressFormHandler]
+10
View File
@@ -4,6 +4,16 @@
@include('vendor/head')
</head>
<body class="horizontal-menu horizontal-app-menu bg-white overflow-hidden">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SP04J05142"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-SP04J05142');
</script>
<!-- End Google Tag Manager -->
<div id="app" style="min-height: 100%;">
@yield('content')
</div>
@@ -131,7 +131,7 @@
</div>
</div>
</div>
<div class="row">
<div class="row" v-if="$store.getters.isAdmin">
<div class="col">
<admin-payments-billing-polling-section-component></admin-payments-billing-polling-section-component>
</div>