update status manual jika ada cancel / waiting billing
This commit is contained in:
@@ -57,18 +57,18 @@ class AutoUpdateLogStatus extends Command
|
|||||||
$cancelLogs = RequestLog::where('final_log', 0)
|
$cancelLogs = RequestLog::where('final_log', 0)
|
||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->where('submission_date', '<', $sixMonthsAgo)
|
->where('submission_date', '<', $sixMonthsAgo)
|
||||||
->where('status', '!=', 'cancel')
|
->where('status', '!=', 'canceled')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
foreach ($cancelLogs as $log) {
|
foreach ($cancelLogs as $log) {
|
||||||
RequestLogHistory::create([
|
RequestLogHistory::create([
|
||||||
'request_log_id' => $log->id,
|
'request_log_id' => $log->id,
|
||||||
'old_status' => $log->status,
|
'old_status' => $log->status,
|
||||||
'new_status' => 'cancel',
|
'new_status' => 'canceled',
|
||||||
'notes' => 'Auto update status via cronjob',
|
'notes' => 'Auto update status via cronjob',
|
||||||
'changed_at' => now(),
|
'changed_at' => now(),
|
||||||
]);
|
]);
|
||||||
$log->update(['status' => 'cancel']);
|
$log->update(['status' => 'canceled']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->info("Auto update selesai. Billing: " . count($billingLogs) . ", Cancel: " . count($cancelLogs));
|
$this->info("Auto update selesai. Billing: " . count($billingLogs) . ", Cancel: " . count($cancelLogs));
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ export default function Detail() {
|
|||||||
</Stack> */}
|
</Stack> */}
|
||||||
</Card>
|
</Card>
|
||||||
</Grid>
|
</Grid>
|
||||||
{requestLog?.status == 'requested' ? (
|
{requestLog?.status == 'requested' || requestLog?.status == 'canceled' || requestLog?.status == 'waiting_billing' ? (
|
||||||
<Grid item xs={12} md={12}>
|
<Grid item xs={12} md={12}>
|
||||||
<Stack direction="row" padding={4} sx={{ justifyContent: 'space-between' }}>
|
<Stack direction="row" padding={4} sx={{ justifyContent: 'space-between' }}>
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -380,6 +380,9 @@ export default function List() {
|
|||||||
row.status == "canceled" ?
|
row.status == "canceled" ?
|
||||||
(<Label color='warning'> {capitalizeFirstLetter(row.status)}</Label>)
|
(<Label color='warning'> {capitalizeFirstLetter(row.status)}</Label>)
|
||||||
:
|
:
|
||||||
|
row.status == "waiting_billing" ?
|
||||||
|
(<Label color='info'> {capitalizeFirstLetter(row.status)}</Label>)
|
||||||
|
:
|
||||||
(<Label color='success'> {capitalizeFirstLetter(row.status)}</Label>)
|
(<Label color='success'> {capitalizeFirstLetter(row.status)}</Label>)
|
||||||
}
|
}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|||||||
Reference in New Issue
Block a user