Compare commits

...

17 Commits

Author SHA1 Message Date
Aqqil Azman 679d53ab57 initial commit for ToolsRequiredComponent and its options 2024-06-19 11:55:11 +08:00
Aqqil Azman d9377c0196 use tools-required-component instead of select-component 2024-06-19 11:54:55 +08:00
Aqqil Azman e6fa771ecc added Vue-multi-select dependency 2024-06-19 11:53:59 +08:00
Aqqil Azman b2a22d2739 Merge branch 'change-delivery-address-form-update' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into vue-multi-select-implementation 2024-06-18 14:17:37 +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
Aqqil Azman 928430caec changed property type and tools required dropdown into vue Select-component 2024-06-12 01:39:45 +08:00
Aqqil Azman 5d01757d60 added pickup_time, latest_pickup_time, property_type and tools_required 2024-06-12 01:38:42 +08:00
Aqqil Azman 4f704ef6a0 updated address form component with Hours, Property Type and Tools Required 2024-06-11 10:20:09 +08:00
9 changed files with 321 additions and 13 deletions
@@ -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;
}
}
@@ -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);
}
}
+1
View File
@@ -31,6 +31,7 @@
"vue": "^2.6.10",
"vue-avatar": "^2.1.8",
"vue-debounce": "^2.6.0",
"vue-multi-select": "^4.6.0",
"vue-template-compiler": "^2.6.10",
"vue-the-mask": "^0.11.1",
"vuelidate": "^0.7.4",
@@ -71,6 +71,43 @@
</div>
</div>
</div>
<div class="row">
<div class="col">
<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">
<label>收货时间 Available Hours</label>
<input type="time" class="form-control" name="pickup_time" v-model="parameters.pickup_time">
</validation-wrapper-component>
</div>
<div class="col-12 col-md pl-md-1">
<validation-wrapper-component :validator="$v.parameters.latest_pickup_time">
<label>最晚收货时间 Latest Available Hours</label>
<input type="time" class="form-control" name="latest_pickup_time" v-model="parameters.latest_pickup_time">
</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 class="m-b-15" :validator="$v.parameters.property_type">
<label class="text-primary">房型 Receiver's Property Type</label>
<select-component :options="propertyOptions" v-model="parameters.property_type"></select-component>
</validation-wrapper-component>
</div>
<div class="col-12 col-md pl-md-1 ">
<tools-required-component></tools-required-component>
</div>
</div>
<div class="col no-padding">
<div class="row">
<div class="col"></div>
<div class="col-12 col-sm-7">
<h6 class="text-right fs-12 text-danger m-b-15 text-right">**kindly reply within 2 hours while warehouse contact to arrange for delivery, otherwise, reschedule of delivery date will apply.</h6>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" v-if="[7,8].includes($store.getters.getCompanyModuleType)">
@@ -174,8 +211,19 @@
remark: '',
phone: '',
person_in_charge: '',
}
pickup_time: '',
latest_pickup_time: '',
property_type: '',
tools_required: '',
},
propertyOptions: [
{ id: 1, text: '住家-Landed house' },
{ id: 2, text: '公寓-Condominium (Drop on lobby only)' },
{ id: 3, text: '工厂-Factory' },
{ id: 4, text: '店面-Shop' },
{ id: 5, text: '商场-Shopping Mall (Drop on loading bay only)' },
{ id: 6, text: 'Others' },
],
}
},
created(){
@@ -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);
@@ -0,0 +1,59 @@
<template>
<div>
<label class="text-primary">卸货工具 Tools required to unload goods</label>
<vue-multi-select
ref="multiSelect"
v-model="values"
: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>
@@ -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>
@@ -19,6 +19,10 @@ export default {
remark: {},
phone: {required, numeric},
person_in_charge: { required },
pickup_time: { required },
latest_pickup_time: { required },
property_type: {},
tools_required: {},
}
},
mixins: [addressFormHandler]
@@ -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>