diff --git a/Modules/Internal/Services/RequestLogService.php b/Modules/Internal/Services/RequestLogService.php index 5f810546..2455e2ad 100644 --- a/Modules/Internal/Services/RequestLogService.php +++ b/Modules/Internal/Services/RequestLogService.php @@ -177,6 +177,16 @@ class RequestLogService $serviceCode = 'Unk'; } + $benefit = Benefit::where('code', $row['benefit_id'])->first(); + + if (!$benefit){ + $statusFinalLog = 'requested'; + $final_log = 0; + } else { + $statusFinalLog = $status; + $final_log = 1; + } + $requestLog = RequestLog::updateOrCreate( [ 'code' => $code @@ -188,8 +198,8 @@ class RequestLogService 'discharge_date' => $row['submission_date'], 'payment_type' => 'cashless', 'status' => $status, - 'status_final_log' => $row['status_final_log'] == 'Y' ? 1 : 0, - 'final_log' =>$row['status_final_log'] == 'Y' ? 1 : 0, + 'status_final_log' => $statusFinalLog, + 'final_log' =>$final_log, 'import_system' =>TRUE, 'catatan' => $row['catatan'], 'policy_id' => $member->currentPolicy->id ?? null, @@ -198,7 +208,7 @@ class RequestLogService 'approved_final_log_at' => $row['approved_final_log_at'], ]); - $benefit = Benefit::where('code', $row['benefit_id'])->first(); + if ($benefit) { // jika tidak ada benefit nya maka belum ngisi benefit nya RequestLogBenefit::updateOrCreate( [ diff --git a/frontend/dashboard/src/@types/claims.ts b/frontend/dashboard/src/@types/claims.ts index 61e098cc..4329ae71 100644 --- a/frontend/dashboard/src/@types/claims.ts +++ b/frontend/dashboard/src/@types/claims.ts @@ -105,5 +105,7 @@ export type Import = { result_file: { url: string, name: string, + total_success_row: number, + total_failed_row: number } -} \ No newline at end of file +} diff --git a/frontend/dashboard/src/pages/CustomerService/Request/List.tsx b/frontend/dashboard/src/pages/CustomerService/Request/List.tsx index 8b0390cd..4388ae08 100644 --- a/frontend/dashboard/src/pages/CustomerService/Request/List.tsx +++ b/frontend/dashboard/src/pages/CustomerService/Request/List.tsx @@ -265,10 +265,19 @@ export default function List() { )} - {importResult && ( + + {importResult && ( - Last Import Result Report :{' '} + Last Import Result :{' '} + + {importResult.total_success_row ?? 0} + {' '} + Row Processed,{' '} + + {importResult.total_failed_row} + {' '} + Failed, Report :{' '} {importResult.result_file?.name ?? '-'} @@ -365,7 +374,7 @@ export default function List() { { row.status == "requested" ? () : - row.status == "declined" ? + row.status == "declined" ? () : () @@ -378,7 +387,7 @@ export default function List() { Detail - + } />