From 60f5f38ffeac6842d0ed41cc0809aa0b2b0c8ef3 Mon Sep 17 00:00:00 2001 From: Tb Fajri Date: Fri, 18 Jul 2025 09:59:27 +0700 Subject: [PATCH] update status manual jika ada cancel / waiting billing --- app/Console/Commands/AutoUpdateLogStatus.php | 6 +++--- .../dashboard/src/pages/CustomerService/Request/Detail.tsx | 2 +- .../dashboard/src/pages/CustomerService/Request/List.tsx | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/AutoUpdateLogStatus.php b/app/Console/Commands/AutoUpdateLogStatus.php index 56e20079..0a238063 100644 --- a/app/Console/Commands/AutoUpdateLogStatus.php +++ b/app/Console/Commands/AutoUpdateLogStatus.php @@ -57,18 +57,18 @@ class AutoUpdateLogStatus extends Command $cancelLogs = RequestLog::where('final_log', 0) ->whereNull('deleted_at') ->where('submission_date', '<', $sixMonthsAgo) - ->where('status', '!=', 'cancel') + ->where('status', '!=', 'canceled') ->get(); foreach ($cancelLogs as $log) { RequestLogHistory::create([ 'request_log_id' => $log->id, 'old_status' => $log->status, - 'new_status' => 'cancel', + 'new_status' => 'canceled', 'notes' => 'Auto update status via cronjob', 'changed_at' => now(), ]); - $log->update(['status' => 'cancel']); + $log->update(['status' => 'canceled']); } $this->info("Auto update selesai. Billing: " . count($billingLogs) . ", Cancel: " . count($cancelLogs)); diff --git a/frontend/dashboard/src/pages/CustomerService/Request/Detail.tsx b/frontend/dashboard/src/pages/CustomerService/Request/Detail.tsx index d192b013..f74d7c6b 100755 --- a/frontend/dashboard/src/pages/CustomerService/Request/Detail.tsx +++ b/frontend/dashboard/src/pages/CustomerService/Request/Detail.tsx @@ -190,7 +190,7 @@ export default function Detail() { */} - {requestLog?.status == 'requested' ? ( + {requestLog?.status == 'requested' || requestLog?.status == 'canceled' || requestLog?.status == 'waiting_billing' ? ( <> diff --git a/frontend/dashboard/src/pages/CustomerService/Request/List.tsx b/frontend/dashboard/src/pages/CustomerService/Request/List.tsx index b3e2bec9..7f27f73d 100755 --- a/frontend/dashboard/src/pages/CustomerService/Request/List.tsx +++ b/frontend/dashboard/src/pages/CustomerService/Request/List.tsx @@ -380,6 +380,9 @@ export default function List() { row.status == "canceled" ? () : + row.status == "waiting_billing" ? + () + : () }