This commit is contained in:
edmondlang
2022-04-18 00:03:48 +08:00
13 changed files with 38 additions and 23 deletions
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\Billplzs\Services;
use Illuminate\Support\Facades\Http;
use App\Classes\Exceptions\MalformedRequestException;
use Illuminate\Support\Facades\Log;
class CreatesBillplzBill
{
@@ -43,6 +44,7 @@ class CreatesBillplzBill
return (object) $data;
}else{
Log::error($response);
return null;
}
}catch(\Exception $exception){
@@ -121,7 +121,7 @@ class CreateBookingPaymentLogic extends AbstractControllerLogic
$amount = $configurations->getTotal();
if(PaymentMethodType::PAYMENT_METHODS[$request->input('payment_method')] == PaymentMethodType::PAYMENT_GATEWAY){
$billPlzBill = $this->createsBillplzBill->execute($request->user()->name, $request->user()->email, 'This payment is made for transfer ref. '.$booking->marking, $configurations->getTotal(), $billNumber, $request->input('bank_code'));
$billPlzBill = $this->createsBillplzBill->execute($booking->company->name, $request->user()->email, 'This payment is made for transfer ref. '.$booking->marking, $configurations->getTotal(), $billNumber, $request->input('bank_code'));
$paymentReference = $billPlzBill->id;
}
@@ -26,7 +26,6 @@ class ExportsNullDebtors implements FromQuery, WithHeadings, WithHeadingRow, Wit
'Code',
'DebtorControlAcc',
'ControlAccount',
'AccNo',
'CompanyName',
'Desc2',
'DebtorType',
@@ -56,8 +55,12 @@ class ExportsNullDebtors implements FromQuery, WithHeadings, WithHeadingRow, Wit
{
return Company::where(function($query){
$query->whereNull('debtor')->orWhere('debtor', '');
})->whereNotIn('id', [2207, 2248, 2029])->where('business_type', BusinessType::IMPORTER)->where('status', ApprovalStatus::APPROVED)->whereHas('transactions', function($query){
return $query->whereIn('type', [TransactionType::PAYMENT, TransactionType::TOP_UP])->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED, ApprovalStatus::PENDING_VERIFICATION]);
})->whereNotIn('id', [2207, 2248, 2029])->where('business_type', BusinessType::IMPORTER)->where('status', ApprovalStatus::APPROVED)->where(function($query){
$query->whereHas('transactions', function($query){
return $query->whereIn('type', [TransactionType::PAYMENT, TransactionType::TOP_UP])->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED, ApprovalStatus::PENDING_VERIFICATION]);
})->orWhereHas('wallets', function($query){
return $query->whereHas('transactions');
});
});
}
@@ -72,7 +75,6 @@ class ExportsNullDebtors implements FromQuery, WithHeadings, WithHeadingRow, Wit
'<<New>>',
'300-0000',
'300-0000',
'300-0000',
$company->name.' (PURCHASE)',
$company->reference,
'',
@@ -39,7 +39,8 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
'DetailDescription',
'Qty',
'UnitPrice',
'AccNo'
'AccNo',
'DeptNo'
];
}
@@ -100,7 +101,8 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
'PLEASE REFER TO THE ATTACHED APPENDIX REF ' . $booking->marking,
1,
$transaction->amount,
'500-0000'
'500-0000',
'CIEF'
];
}
}
@@ -39,7 +39,8 @@ class ExportsWalletTransactions implements FromQuery, WithHeadings, WithHeadingR
'DetailDescription',
'Qty',
'UnitPrice',
'AccNo'
'AccNo',
'DeptNo'
];
}
@@ -80,7 +81,7 @@ class ExportsWalletTransactions implements FromQuery, WithHeadings, WithHeadingR
}
/**
* @param Company $transaction
* @param Transaction $transaction
*
* @return array
*/
@@ -99,7 +100,8 @@ class ExportsWalletTransactions implements FromQuery, WithHeadings, WithHeadingR
'CREDIT SALES',
1,
$transaction->amount,
'500-0000'
'500-0000',
'WALLET'
];
}
}
@@ -97,7 +97,7 @@ class CreateSupplierTransactionProcessor
$this->pushBill($billTransaction);
$transferFeeNumber = $this->generatesTransactionBillNumber->execute('TRFR-');
$transferFee = $this->calculatesTransactionTransferFee->execute($payment->original_amount, $constant);
$transferFee = $this->calculatesTransactionTransferFee->execute($billTransaction->amount, $constant);
$object = new TransactionObject($transferFeeNumber, TransactionType::TRANSFER_FEE, 1, $supplier->id,
$supplier->banks()->where('default', true)->first()->id, PaymentMethodType::CASH,
$payment->original_amount, $payment->original_amount, $payment->original_currency_id, $payment->original_currency_id,
@@ -31,7 +31,7 @@ class CalculatesTransactionServiceCharge
return 0;
}
$transfer_fee = $this->calculatesTransactionTransferFee->execute($amount, $service_charge);
$transfer_fee = $this->calculatesTransactionTransferFee->execute(($amount * (1 / $rate)), $service_charge);
return $service_charge->detail->amount->type === 'percentage' ? (($amount + $transfer_fee) * ( (float) $service_charge->detail->amount->value /100) * (1/$rate)) : (float) $service_charge->detail->amount->value;
}
@@ -102,7 +102,7 @@ class TopUpWalletLogic extends AbstractControllerLogic
throw new MalformedRequestException('Top up credit value must be greater than zero.');
}
$billPlzBill = $this->createsBillplzBill->execute($user->name, $user->email, 'This payment is credit topup for company ref. ' . $company->reference, $amount, $billNumber, $request->input('bank_code'), true);
$billPlzBill = $this->createsBillplzBill->execute($company->name, $user->email, 'This payment is credit topup for company ref. ' . $company->reference, $amount, $billNumber, $request->input('bank_code'), true);
$transaction_object = new TransactionObject($billNumber, TransactionType::TOP_UP, 1, $company->id, 1, PaymentMethodType::PAYMENT_GATEWAY, $amount, $amount, 1, 1, 1, 0, 0, null, ApprovalStatus::PENDING_SUBMISSION, [], $billPlzBill->id);
@@ -1,5 +1,5 @@
<template>
<div class="row m-b-10">
<div class="row m-b-10 p-b-10 b-b" style="border-bottom-width: 3px;">
<div class="col">
<div class="row">
<div class="col">
@@ -35,7 +35,7 @@
<div class="col bg-white padding-25">
<div class="row tabsContainer tabContent active" tab-name="complete">
<div class="col">
<list-component section="CompletePaymentProofSection" :endpoint="route('api.transaction.list')" :options="{status_in: [2, 3], type: 3, issuer_not_in: [2185, 1970, 1921]}">
<list-component section="CompletePaymentProofSection" :endpoint="route('api.transaction.list')" :options="{status_in: [2, 3], type: 3, issuer_not_in: [1921, 1970, 2185, 2327, 2351]}">
<template slot="list" slot-scope="{data}">
<payment-proof-component :data="data" class="m-b-15 m-r-0"></payment-proof-component>
</template>
@@ -125,7 +125,7 @@
<div class="col bg-white padding-25">
<div class="row tabsContainer tabContent active" tab-name="paymentProof">
<div class="col">
<list-component ref="paymentProofList" section="jackPaymentProofSection" :endpoint="route('api.transaction.list')" :options="{status: 1, type: 3, issuer_in: [2185, 1970, 1921]}">
<list-component ref="paymentProofList" section="jackPaymentProofSection" :endpoint="route('api.transaction.list')" :options="{status: 1, type: 3, issuer_in: [1921, 1970, 2185, 2327, 2351]}">
<template slot="list" slot-scope="{data}">
<payment-proof-component :data="data" class="m-b-15 m-r-0"></payment-proof-component>
</template>
@@ -134,7 +134,7 @@
</div>
<div class="row tabsContainer tabContent hide" tab-name="paymentProofVerification">
<div class="col">
<list-component ref="paymentProofList" section="jackPaymentProofVerificationSection" :endpoint="route('api.transaction.list')" :options="{status: 2, type: 3, issuer_in: [2185, 1970, 1921]}">
<list-component ref="paymentProofList" section="jackPaymentProofVerificationSection" :endpoint="route('api.transaction.list')" :options="{status: 2, type: 3, issuer_in: [1921, 1970, 2185, 2327, 2351, 2351]}">
<template slot="list" slot-scope="{data}">
<payment-proof-component :data="data" class="m-b-15 m-r-0"></payment-proof-component>
</template>
@@ -143,7 +143,7 @@
</div>
<div class="row tabsContainer tabContent hide" tab-name="complete">
<div class="col">
<list-component section="jackCompletePaymentProofSection" :endpoint="route('api.transaction.list')" :options="{status: 3, type: 3, issuer_in: [2185, 1970, 1921]}">
<list-component section="jackCompletePaymentProofSection" :endpoint="route('api.transaction.list')" :options="{status: 3, type: 3, issuer_in: [1921, 1970, 2185, 2327, 2351]}">
<template slot="list" slot-scope="{data}">
<payment-proof-component :data="data" class="m-b-15 m-r-0"></payment-proof-component>
</template>
@@ -2,14 +2,14 @@
<div class="col">
<div class="row">
<div class="col col-md-5 bg-white padding-25">
<list-component ref="paymentProofList" section="paymentProofSection" :endpoint="route('api.transaction.list')" :options="{status: 1, type: 3, issuer_in: [1921, 1970, 2185]}">
<list-component ref="paymentProofList" section="paymentProofSection" :endpoint="route('api.transaction.list')" :options="{status: 1, type: 3, issuer_in: [1921, 1970, 2185, 2327, 2351]}">
<template slot="list" slot-scope="{data}">
<payment-proof-component :data="data" class="m-b-15 m-r-0"></payment-proof-component>
</template>
</list-component>
</div>
<div class="col col-md-5 bg-white padding-25">
<list-component ref="paymentProofList" section="paymentProofHistorySection" :endpoint="route('api.transaction.list')" :options="{status_in: [2, 3], type: 3, issuer_in: [1921, 1970, 2185]}">
<list-component ref="paymentProofList" section="paymentProofHistorySection" :endpoint="route('api.transaction.list')" :options="{status_in: [2, 3], type: 3, issuer_in: [1921, 1970, 2185, 2327, 2351]}">
<template slot="list" slot-scope="{data}">
<payment-proof-component :data="data" class="m-b-15 m-r-0"></payment-proof-component>
</template>
@@ -10,10 +10,13 @@
Atvantic Import & Export Snd. Bhd (1309816-P)
@endif
@if(in_array($supplier_deliver_order_transaction->issuer, [1937, 1970]))
BK Gemilang Sdn Bhd (1403513-U)
BK Gemilang Sdn Bhd (1403513-U)
@endif
@if(in_array($supplier_deliver_order_transaction->issuer, [2165, 2185]))
YSN SOLUTION TRADING SDN BHD (1393892-D)
YSN SOLUTION TRADING SDN BHD (1393892-D)
@endif
@if(in_array($supplier_deliver_order_transaction->issuer, [2210]))
RACK SOLUTION INDUSTRIES SDN BHD (954723-W)
@endif
</td>
</tr>
+5 -1
View File
@@ -100,7 +100,11 @@ Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsP
Route::get('/fix_bills', function () {
ini_set('max_execution_time', '1000000');
Auth()->login(User::find(1));
$bookings = \App\Models\Booking::whereIn('id', [11257, 11268, 11281, 11287, 11288, 11290, 11292, 11293, 11296, 11298, 11299, 11302, 11303, 11307, 11314, 11324, 11345, 11346])->get();
$bookings = \App\Models\Booking::where('status', 3)->whereHas('transactions', function ($query){
return $query->where('type', 1)->whereHas('transactions', function($query){
return $query->where('type', 3)->where('issuer', 2210);
});
})->get();
foreach ($bookings as $booking){
$booking->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->delete();
$po = $booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->first();