mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-23 06:24:03 +00:00
Add credit note controller and logic
This commit is contained in:
@@ -75,6 +75,8 @@ class CreateBookingRefundLogic extends AbstractControllerLogic
|
||||
$booking = Booking::find($request->route('id'));
|
||||
|
||||
$transaction = $this->fetchesTransaction->execute(['id' => $request->route('payment_id')]);
|
||||
|
||||
$this->updatesTransactionStatus->execute($transaction, ApprovalStatus::REFUNDED);
|
||||
|
||||
$paymentAttemptLimit = $this->fetchesCompanyPaymentAttemptLimit->execute($booking->company);
|
||||
|
||||
@@ -87,8 +89,6 @@ class CreateBookingRefundLogic extends AbstractControllerLogic
|
||||
$transaction->tax, $transaction->service_charge, Carbon::now()->addMinutes($paymentAttemptLimit), ApprovalStatus::PENDING_VERIFICATION);
|
||||
|
||||
$transaction = $this->createsTransaction->execute($booking, $object);
|
||||
|
||||
$this->updatesTransactionStatus->execute($transaction, ApprovalStatus::REFUNDED);
|
||||
|
||||
return $this->resourceResponse(new TransactionResource($transaction));
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ Route::group(['prefix' => 'booking', 'as' => 'booking.', 'namespace' => 'Booking
|
||||
|
||||
Route::group(['prefix' => '{id}/refund', 'as' => 'refund.'], function () {
|
||||
Route::post('{payment_id}/create', 'CreateBookingRefundController@create')->name('create');
|
||||
Route::post('{payment_id}/credit_note/create', 'CreateBookingRefundCreditNoteController@create')->name('credit_note.create');
|
||||
});
|
||||
|
||||
Route::post('{id}/purchase_order/verification', 'ApprovePurchaseOrderController@approve')->name('po.approval');
|
||||
|
||||
Reference in New Issue
Block a user