diff --git a/app/Classes/Modules/Transactions/ControllersLogic/UpdateTransactionStatusLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/UpdateTransactionStatusLogic.php index 1f6085e4..171d4e61 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/UpdateTransactionStatusLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/UpdateTransactionStatusLogic.php @@ -50,13 +50,18 @@ class UpdateTransactionStatusLogic extends AbstractControllerLogic $approvalArray = [ 'approve' => ApprovalStatus::APPROVED, 'expire' => ApprovalStatus::EXPIRED, + 'reject' => ApprovalStatus::REJECTED, ]; $approvalStatus = $approvalArray[$request->route('status')]; $transaction = $this->fetchesTransaction->execute(['id' => $request->route('id')]); - $transaction = $this->updatesTransactionStatus->execute($transaction, $approvalStatus); + if ($request->route('status') === 'reject') { + $transaction->delete(); + } else { + $transaction = $this->updatesTransactionStatus->execute($transaction, $approvalStatus); + } return $this->resourceResponse(new TransactionResource($transaction)); } diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue index b7078f02..d7756791 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue @@ -84,9 +84,15 @@
+
+ +
+ + + diff --git a/resources/assets/vue/components/paymentsBilling/forms/DeleteShippingInvoiceFormComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/DeleteShippingInvoiceFormComponent.vue new file mode 100644 index 00000000..2e27eb60 --- /dev/null +++ b/resources/assets/vue/components/paymentsBilling/forms/DeleteShippingInvoiceFormComponent.vue @@ -0,0 +1,31 @@ + + \ No newline at end of file diff --git a/routes/transaction.php b/routes/transaction.php index 5da80295..3d847135 100644 --- a/routes/transaction.php +++ b/routes/transaction.php @@ -6,7 +6,7 @@ Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' => Route::get('/list', 'ListTransactionsController@list')->name('list'); Route::delete('/suspend/{id}', 'SuspendTransactionController@suspend')->name('suspend'); - Route::put('{id}/status/update/{status}', 'UpdateTransactionStatusController@update')->where('status', 'approve|expire')->name('update'); + Route::put('{id}/status/update/{status}', 'UpdateTransactionStatusController@update')->where('status', 'approve|expire|reject')->name('update'); Route::group(['prefix' => 'payment', 'as' => 'payment.'], function () { Route::post('/create', 'CreatePaymentTransactionController@create')->name('create');