Add credit note controller and logic

This commit is contained in:
ahmedsophyudden
2021-08-28 11:40:04 +08:00
parent f3cb50c231
commit 43530352ee
2 changed files with 3 additions and 2 deletions
@@ -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));
}
+1
View File
@@ -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');