diff --git a/routes/web.php b/routes/web.php index 079831aa..6a8ce6ca 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2,6 +2,7 @@ use App\Classes\Modules\Transactions\Processors\CreateInvoiceTransactionProcessor; use App\Http\Controllers\Accounting\BankStatementController; +use App\Models\Remark; use Carbon\Carbon; use App\Models\User; use App\Models\Wallet; @@ -969,10 +970,18 @@ Route::get('/invoice/{marking}/{started_at}/{ended_at}/fix', function($marking, ); })->name('invoice.fix.byCustomerMarking'); -require __DIR__.'/remark.php'; +route:: post('/transaction/{id}/create-remark',function ($transactionId) { + $transaction = Transaction::find($transactionId); + $remark = new Remark(); + $remark->content = request('content'); + $remark->transaction_id; + $remark->save(); + return redirect()->back(); +})->name('transaction.create-remark'); Route::get('/show-white-form-transactions-in-date-range/{from_date}/{to_date}', function ($from_date, $to_date) { + $approvedTransactions = Transaction::where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED])->where('owner_type', '!=', Wallet::class)->orderBy('status')->get(); echo '

Pending Orders Payments

'; @@ -997,9 +1006,10 @@ Route::get('/show-white-form-transactions-in-date-range/{from_date}/{to_date}', echo '' . ApprovalStatus::APPROVAL_STATUS_ID[$approvedTransaction->status] . ''; echo '' . $approvedTransaction->remarks . ''; echo '' ; - echo '
'; + echo ''; echo ''; echo ''; + echo csrf_field(); echo '
'; echo ''; echo ''; @@ -1048,4 +1058,6 @@ Route::get('/show-white-form-transactions-in-date-range/{from_date}/{to_date}', echo ''; echo ''; + + });