diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php index f8a1e8cf..95efc7c5 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CreateBookingRefundLogic.php @@ -146,14 +146,19 @@ class CreateBookingRefundLogic extends AbstractControllerLogic $service_charges_to_refund = $isFullyRefund ? $quotationBeforeCurrentRefund->getServiceCharge() : $quotationBeforeCurrentRefund->getServiceCharge() - $quotationAfterRefund->getServiceCharge(); } - // 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; - } + // refund service charges if booking is not E2E - starts + // if ($booking->service_id !== 5) { + // $refundTotal = $refundTotal + $service_charges_to_refund + $transaction->tax; + // } else { + // $service_charges_to_refund = 0; + // } + // refund service charges if booking is not E2E - ends + + //Reinstate refund service charges to all services, no checking if it is E2E or otherwise + $refundTotal = $refundTotal + $service_charges_to_refund + $transaction->tax; $object = new TransactionObject($billNumber, TransactionType::REFUND, 1, $booking->company->id, 1, PaymentMethodType::CASH, diff --git a/app/Classes/Modules/Bookings/Processors/RegenerateInvoiceBookingV2Processor.php b/app/Classes/Modules/Bookings/Processors/RegenerateInvoiceBookingV2Processor.php index e5246f32..c72a2526 100644 --- a/app/Classes/Modules/Bookings/Processors/RegenerateInvoiceBookingV2Processor.php +++ b/app/Classes/Modules/Bookings/Processors/RegenerateInvoiceBookingV2Processor.php @@ -133,10 +133,10 @@ class RegenerateInvoiceBookingV2Processor } //for E-INVOICE else { - $transaction = $booking->transactions()->whereIn('type', [TransactionType::SUPPLIER_DELIVER])->get(); - foreach ($transaction as $key => $row) { - $this->deletesTransaction->execute($row); - } + // $transaction = $booking->transactions()->whereIn('type', [TransactionType::SUPPLIER_DELIVER])->get(); + // foreach ($transaction as $key => $row) { + // $this->deletesTransaction->execute($row); + // } } $document = $booking->documents()->whereIn('document_type', [DocumentType::PURCHASE_ORDER, DocumentType::INVOICE, DocumentType::EINVOICE, DocumentType::DELIVER_ORDER, DocumentType::SUPPLIER_DELIVER_ORDER])->get(); diff --git a/app/Classes/Modules/Transactions/Processors/CreateInvoiceTransactionV2Processor.php b/app/Classes/Modules/Transactions/Processors/CreateInvoiceTransactionV2Processor.php index cef5e803..9d50ae1a 100644 --- a/app/Classes/Modules/Transactions/Processors/CreateInvoiceTransactionV2Processor.php +++ b/app/Classes/Modules/Transactions/Processors/CreateInvoiceTransactionV2Processor.php @@ -347,24 +347,32 @@ class CreateInvoiceTransactionV2Processor } if($transactionTypeBill){ - $transaction_object = new TransactionObject( - $billNumber, - TransactionType::SUPPLIER_DELIVER, - $transactionTypeBill->issuer, - $transactionTypeBill->receiver, - $transactionTypeBill->recipient_bank_account_id, - $transactionTypeBill->payment_method, - $payable_amount, - $booking_amount, - $transactionTypeBill->currency_id, - $transactionTypeBill->original_currency_id, - $booking_currency_average_rate, - $total_tax, - $total_service_charge, - null, - ApprovalStatus::APPROVED - ); - $supplier_deliver_order_transaction = $this->createsTransaction->execute($purchaseOrder->booking, $transaction_object); + $supplier_deliver_order_transaction = $booking->transactions() + ->whereIn('type', [TransactionType::SUPPLIER_DELIVER]) + ->complete() + ->latest() + ->first(); + + if(!$supplier_deliver_order_transaction){ + $transaction_object = new TransactionObject( + $billNumber, + TransactionType::SUPPLIER_DELIVER, + $transactionTypeBill->issuer, + $transactionTypeBill->receiver, + $transactionTypeBill->recipient_bank_account_id, + $transactionTypeBill->payment_method, + $payable_amount, + $booking_amount, + $transactionTypeBill->currency_id, + $transactionTypeBill->original_currency_id, + $booking_currency_average_rate, + $total_tax, + $total_service_charge, + null, + ApprovalStatus::APPROVED + ); + $supplier_deliver_order_transaction = $this->createsTransaction->execute($purchaseOrder->booking, $transaction_object); + } // supply deliver order $this->invoiceDocumentProcessor->execute($supplier_deliver_order_transaction, $purchaseOrder, $supplier, DocumentType::SUPPLIER_DELIVER_ORDER, null); diff --git a/resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue b/resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue index 9a9d492c..48e4df78 100644 --- a/resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue +++ b/resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue @@ -201,7 +201,7 @@ const rules = computed(() => ({ }, password_confirmation: { required: requiredIf(step.value === 2), - sameAs: sameAs(parameters.password) + sameAs: sameAs(parameters.password, 'password') } } })); diff --git a/resources/assets/vue/components/bookings/forms/ConfirmQuotationFormComponent.vue b/resources/assets/vue/components/bookings/forms/ConfirmQuotationFormComponent.vue index acb21022..edfe4f78 100644 --- a/resources/assets/vue/components/bookings/forms/ConfirmQuotationFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/ConfirmQuotationFormComponent.vue @@ -126,6 +126,7 @@ const submitForm = () => { successHandler: (response: any) => { isLoading.value = false; if (response.payload.data.payment_method === 5) { + closeModal(); window.location.href = route('billplz.bill', response.payload.data.payment_reference) + '?auto_submit=true'; } else { emit('cancelQuotation'); diff --git a/resources/assets/vue/components/bookings/forms/EditBookingAmountFormComponent.vue b/resources/assets/vue/components/bookings/forms/EditBookingAmountFormComponent.vue index 3853c010..19f5ed3e 100644 --- a/resources/assets/vue/components/bookings/forms/EditBookingAmountFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/EditBookingAmountFormComponent.vue @@ -12,7 +12,7 @@