diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php index 058e4bc7..8c492eb1 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php @@ -132,8 +132,14 @@ class CreateBookingRefundLogic extends AbstractControllerLogic $service_charges_to_refund = $isFullyRefund ? $quotationBeforeCurrentRefund->getServiceCharge() : $quotationBeforeCurrentRefund->getServiceCharge() - $quotationAfterRefund->getServiceCharge(); - // refund service charges if is fully refund - $refundTotal = $refundAmount + $service_charges_to_refund + $transaction->tax; + // refund service charges if booking is not E2E + $refundTotal = $refundAmount; + + if ($booking->service_id !== 5) { + $refundTotal = $refundTotal + $service_charges_to_refund + $transaction->tax; + } else { + $service_charges_to_refund = 0; + } $object = new TransactionObject($billNumber, TransactionType::REFUND, 1, $booking->company->id, 1, PaymentMethodType::CASH, diff --git a/app/Console/Commands/OneTimeTestVoucherifyEmailCommand.php b/app/Console/Commands/OneTimeTestVoucherifyEmailCommand.php new file mode 100644 index 00000000..377bf052 --- /dev/null +++ b/app/Console/Commands/OneTimeTestVoucherifyEmailCommand.php @@ -0,0 +1,90 @@ +fetchesVoucher = $fetchesVoucher; + $this->generatesEmailVerificationAttempt = $generatesEmailVerificationAttempt; + $this->sendUserVerificationEmail = $sendUserVerificationEmail; + $this->generatesPasswordReset = $generatesPasswordReset; + $this->sendResetPasswordEmail = $sendResetPasswordEmail; + } + + /** + * Execute the console command. + * + * @return mixed + */ + public function handle() + { + try{ //In case voucher got deleted unintentionally + $user = User::where('id', 3974)->first(); //5436, 3974 + + Log::info(json_encode($user)); + $voucher = $this->fetchesVoucher->execute(['code' => Vouchers::WELCOME_50_PERCENT_OFF]); + Log::info(json_encode($voucher)); + if($voucher) SendWelcomeVoucherEmail::dispatch($user, $voucher, 1); + + // $attempt = $this->generatesEmailVerificationAttempt->execute($user); + // $this->sendUserVerificationEmail::dispatch($user, $attempt); + + // $attempt = $this->generatesPasswordReset->execute($user); + // $this->sendResetPasswordEmail::dispatch($user, $attempt); + } + catch(\Exception $e){} + + } + +} diff --git a/resources/assets/vue/components/bookings/forms/BookingFormComponent.vue b/resources/assets/vue/components/bookings/forms/BookingFormComponent.vue index 5e15867d..74641ebd 100644 --- a/resources/assets/vue/components/bookings/forms/BookingFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/BookingFormComponent.vue @@ -95,6 +95,8 @@
The recipient can expect to receive the transfer within 3-5 working days. Explore our BANK TRANSFER (SAVER) option for a better rate!
Enjoy a better rate with this option! The recipient will receive the transfer after 5-7 working days..
+Please ensure is a PERSONAL bank account details. Company bank account details only allow to use as E2E service.
+Cancellation of E2E service are strictly NO refund on the 2% transfer fee charge.
|
- {{ $transaction->type == 9 ? 'Credit' : 'Debit' }} Note
+ {{ $transaction->type == 9 ? $credit_title : 'Debit' }} Note
diff --git a/routes/web.php b/routes/web.php
index 7017b1b8..a7c87263 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -440,26 +440,54 @@ Route::get('/pending_orders', function(){
Route::get('/approve_refunds', function(Request $request){
$type = $request->query('type');
- $payments = Transaction::where('type', TransactionType::PAYMENT)->where('owner_type', Booking::class)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED, ApprovalStatus::REFUNDED])
- ->whereHas('transactions', function ($query) use ($type) {
- $query->where('type', TransactionType::REFUND)->where('status', ApprovalStatus::APPROVED);
- if (str_contains($type, 'partial')) {
- $query->whereColumn('original_amount', '!=','transactions.original_amount');
- } else {
- $query->whereColumn('original_amount', 'transactions.original_amount');
- }
- });
- if (str_contains($type, 'post')) {
- $payments->whereHas('transactions', function($query) {
- $query->where('type', TransactionType::SUPPLIER_REFUND);
+ $approve_refunds = Transaction::where('type', TransactionType::REFUND)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]);
+
+ if (str_contains($type, 'partial')) {
+ $approve_refunds->whereHas('owner', function ($q) {
+ $q->whereColumn('original_amount', '!=', 'transactions.original_amount');
});
} else {
- $payments->whereDoesntHave('transactions', function($query) {
- $query->where('type', TransactionType::SUPPLIER_REFUND);
+ $approve_refunds->whereHas('owner', function ($q) {
+ $q->whereColumn('original_amount', 'transactions.original_amount');
});
}
+ if (str_contains($type, 'post')) {
+ $approve_refunds->whereHas('owner', function ($q) {
+ $q->whereHas('transactions', function($query) {
+ $query->where('type', TransactionType::SUPPLIER_REFUND);
+ });
+ });
+ } else {
+ $approve_refunds->whereHas('owner', function ($q) {
+ $q->whereDoesntHave('transactions', function($query) {
+ $query->where('type', TransactionType::SUPPLIER_REFUND);
+ });
+ });
+ }
+
+
+ // $payments = Transaction::where('type', TransactionType::PAYMENT)->where('owner_type', Booking::class)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED, ApprovalStatus::REFUNDED])
+ // ->whereHas('transactions', function ($query) use ($type) {
+ // $query->where('type', TransactionType::REFUND)->where('status', ApprovalStatus::APPROVED);
+ // if (str_contains($type, 'partial')) {
+ // $query->whereColumn('original_amount', '!=','transactions.original_amount');
+ // } else {
+ // $query->whereColumn('original_amount', 'transactions.original_amount');
+ // }
+ // });
+
+ // if (str_contains($type, 'post')) {
+ // $payments->whereHas('transactions', function($query) {
+ // $query->where('type', TransactionType::SUPPLIER_REFUND);
+ // });
+ // } else {
+ // $payments->whereDoesntHave('transactions', function($query) {
+ // $query->where('type', TransactionType::SUPPLIER_REFUND);
+ // });
+ // }
+
echo '
|