From 3af3c95032ba9592d62d7085800c8840719c30aa Mon Sep 17 00:00:00 2001 From: edmondlang Date: Wed, 27 Mar 2024 01:09:55 +0800 Subject: [PATCH] show white form transactions in date range --- routes/web.php | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/routes/web.php b/routes/web.php index b90ef72e..d6798271 100644 --- a/routes/web.php +++ b/routes/web.php @@ -879,3 +879,61 @@ Route::get('/invoice/{marking}/{started_at}/{ended_at}/fix', function($marking, } ); })->name('invoice.fix.byCustomerMarking'); + + +Route::get('/show-white-form-transactions-in-date-range/{from_date}/{to_date}', function ($from_date, $to_date) { + $approvedTransactions = Transaction::where('type', TransactionType::PAYMENT)->where('status', ApprovalStatus::APPROVED)->where('owner_type', '!=', Wallet::class)->get(); + + echo '

Approved Payments

'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + foreach ($approvedTransactions as $approvedTransaction) { + echo ''; + echo ''; + echo ''; + echo ''; + } + + echo ''; + echo '
BookingPayment Date
' . $approvedTransaction->owner->marking . '' . $approvedTransaction->created_at . '
'; + + $startDate = Carbon::createFromFormat('d-m-Y', $from_date)->startOfDay(); + $endDate = Carbon::createFromFormat('d-m-Y', $to_date)->endOfDay(); + + $approvalSatatusArray = ApprovalStatus::APPROVAL_STATUS_ID; + + echo '

Bills in the date range

'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + + $datas = Transaction::where('type', TransactionType::BILL)->whereBetween('created_at', [$startDate, $endDate])->get(); + + foreach ($datas as $data) { + echo ''; + $payment = $data->owner; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + + echo ''; + echo '
StatusBills Created AtBookingPayment Date
' . $approvalSatatusArray[$data['status']] . '' . $data->created_at . '' . $data->owner->owner->marking . '' . $payment->created_at . '
'; +});