Merge remote-tracking branch 'origin/staging' into origin/production
This commit is contained in:
@@ -569,6 +569,12 @@ class CorporateController extends Controller
|
|||||||
"file_url" => url('files/Template Update Status Request LOG.xlsx')
|
"file_url" => url('files/Template Update Status Request LOG.xlsx')
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
|
case 'template-request-log':
|
||||||
|
return Helper::responseJson([
|
||||||
|
'file_name' => "Template Import Request LOG.xlsx.xlsx",
|
||||||
|
"file_url" => url('files/Template Import Request LOG.xlsx.xlsx')
|
||||||
|
]);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return Helper::responseJson([], 'error', 404);
|
return Helper::responseJson([], 'error', 404);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class RequestLogService
|
|||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
public $field_to_doc_headers_map = [
|
public $field_to_doc_headers_map = [
|
||||||
"submission_date" => "Date Of Request",
|
"submission_date" => "Date Of Request",
|
||||||
"submission_date" => "Date Addmission",
|
"submission_date" => "Date Addmission",
|
||||||
"member_id" => "Member ID Peserta",
|
"member_id" => "Member ID Peserta",
|
||||||
@@ -56,7 +56,7 @@ class RequestLogService
|
|||||||
"amount_not_approval" => "Amount Not Approval",
|
"amount_not_approval" => "Amount Not Approval",
|
||||||
"status_final_log" => "QC 1" ,
|
"status_final_log" => "QC 1" ,
|
||||||
"ingestion_code" => "Ingestion Code",
|
"ingestion_code" => "Ingestion Code",
|
||||||
"ingestion_status" => "Ingestion Status",
|
"ingestion_status" => "Ingestion Status",
|
||||||
];
|
];
|
||||||
|
|
||||||
public $result_doc_headers = [
|
public $result_doc_headers = [
|
||||||
@@ -73,7 +73,7 @@ class RequestLogService
|
|||||||
"Total Billing",
|
"Total Billing",
|
||||||
"Amount Approval",
|
"Amount Approval",
|
||||||
"Amount Not Approval",
|
"Amount Not Approval",
|
||||||
"QC 1",
|
"QC 1",
|
||||||
"Ingestion Code",
|
"Ingestion Code",
|
||||||
"Ingestion Status",
|
"Ingestion Status",
|
||||||
];
|
];
|
||||||
@@ -92,7 +92,7 @@ class RequestLogService
|
|||||||
"Total Billing",
|
"Total Billing",
|
||||||
"Amount Approval",
|
"Amount Approval",
|
||||||
"Amount Not Approval",
|
"Amount Not Approval",
|
||||||
"QC 1",
|
"QC 1",
|
||||||
"Ingestion Code",
|
"Ingestion Code",
|
||||||
"Ingestion Status",
|
"Ingestion Status",
|
||||||
];
|
];
|
||||||
@@ -153,13 +153,13 @@ class RequestLogService
|
|||||||
$organization_id = DB::table('organizations')
|
$organization_id = DB::table('organizations')
|
||||||
->insertGetId([
|
->insertGetId([
|
||||||
'name' => $row['organization_id'],
|
'name' => $row['organization_id'],
|
||||||
'code' => $kodeOrganisasi,
|
'code' => $kodeOrganisasi,
|
||||||
'type' => 'hospital',
|
'type' => 'hospital',
|
||||||
'created_at' => now(),
|
'created_at' => now(),
|
||||||
'created_by' => auth()->user()->id
|
'created_by' => auth()->user()->id
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'source' => 'H',
|
'source' => 'H',
|
||||||
'provideCode' => $kodeOrganisasi ,
|
'provideCode' => $kodeOrganisasi ,
|
||||||
@@ -178,7 +178,15 @@ class RequestLogService
|
|||||||
}
|
}
|
||||||
|
|
||||||
$benefit = Benefit::where('code', $row['benefit_id'])->first();
|
$benefit = Benefit::where('code', $row['benefit_id'])->first();
|
||||||
|
|
||||||
|
if (!$benefit){
|
||||||
|
$statusFinalLog = 'requested';
|
||||||
|
$final_log = 0;
|
||||||
|
} else {
|
||||||
|
$statusFinalLog = $status;
|
||||||
|
$final_log = 1;
|
||||||
|
}
|
||||||
|
|
||||||
$requestLog = RequestLog::updateOrCreate(
|
$requestLog = RequestLog::updateOrCreate(
|
||||||
[
|
[
|
||||||
'code' => $code
|
'code' => $code
|
||||||
@@ -190,8 +198,8 @@ class RequestLogService
|
|||||||
'discharge_date' => $row['submission_date'],
|
'discharge_date' => $row['submission_date'],
|
||||||
'payment_type' => 'cashless',
|
'payment_type' => 'cashless',
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
'status_final_log' => $status,
|
'status_final_log' => $statusFinalLog,
|
||||||
'final_log' =>$row['status_final_log'] == 'Y' ? 1 : 0,
|
'final_log' =>$final_log,
|
||||||
'import_system' =>TRUE,
|
'import_system' =>TRUE,
|
||||||
'catatan' => $row['catatan'],
|
'catatan' => $row['catatan'],
|
||||||
'policy_id' => $member->currentPolicy->id ?? null,
|
'policy_id' => $member->currentPolicy->id ?? null,
|
||||||
@@ -200,20 +208,24 @@ class RequestLogService
|
|||||||
'approved_final_log_at' => $row['approved_final_log_at'],
|
'approved_final_log_at' => $row['approved_final_log_at'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$requestLogBenefit = RequestLogBenefit::updateOrCreate(
|
|
||||||
[
|
|
||||||
'request_log_id' => $requestLog->id,
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'request_log_id' => $requestLog->id,
|
|
||||||
'benefit_id' => $benefit->id,
|
|
||||||
'amount_incurred' => $row['total_billing'],
|
|
||||||
'amount_approved' => $row['amount_approval'],
|
|
||||||
'amount_not_approved' => $row['amount_not_approval'],
|
|
||||||
'excess_paid' => $row['amount_not_approval'],
|
|
||||||
'created_by' => auth()->user()->id,
|
|
||||||
|
|
||||||
]);
|
if ($benefit) { // jika tidak ada benefit nya maka belum ngisi benefit nya
|
||||||
|
RequestLogBenefit::updateOrCreate(
|
||||||
|
[
|
||||||
|
'request_log_id' => $requestLog->id,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'request_log_id' => $requestLog->id,
|
||||||
|
'benefit_id' => $benefit->id,
|
||||||
|
'amount_incurred' => $row['total_billing'],
|
||||||
|
'amount_approved' => $row['amount_approval'],
|
||||||
|
'amount_not_approved' => $row['amount_not_approval'],
|
||||||
|
'excess_paid' => $row['amount_not_approval'],
|
||||||
|
'created_by' => auth()->user()->id,
|
||||||
|
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Commit transaksi
|
// Commit transaksi
|
||||||
DB::commit();
|
DB::commit();
|
||||||
@@ -259,7 +271,7 @@ class RequestLogService
|
|||||||
return $cells;
|
return $cells;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function makeCode($next_number, $data)
|
public function makeCode($next_number, $data)
|
||||||
{
|
{
|
||||||
$sparator = '.';
|
$sparator = '.';
|
||||||
|
|||||||
@@ -105,5 +105,7 @@ export type Import = {
|
|||||||
result_file: {
|
result_file: {
|
||||||
url: string,
|
url: string,
|
||||||
name: string,
|
name: string,
|
||||||
|
total_success_row: number,
|
||||||
|
total_failed_row: number
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ export default function List() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MenuItem onClick={handleImportButton}>Import</MenuItem>
|
<MenuItem onClick={handleImportButton}>Import</MenuItem>
|
||||||
<MenuItem onClick={() => {handleGetTemplate('request-log')}}>Download Template</MenuItem>
|
<MenuItem onClick={() => {handleGetTemplate('template-request-log')}}>Download Template</MenuItem>
|
||||||
<MenuItem onClick={() => {handleGetData('data-request-log')}}>Download Request LOG</MenuItem>
|
<MenuItem onClick={() => {handleGetData('data-request-log')}}>Download Request LOG</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
{/* <Button
|
{/* <Button
|
||||||
@@ -265,10 +265,19 @@ export default function List() {
|
|||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
{importResult && (
|
|
||||||
|
{importResult && (
|
||||||
<Stack direction={'row'} sx={{ px: 2, pb: 2 }}>
|
<Stack direction={'row'} sx={{ px: 2, pb: 2 }}>
|
||||||
<Box sx={{ color: 'text.secondary' }}>
|
<Box sx={{ color: 'text.secondary' }}>
|
||||||
Last Import Result Report :{' '}
|
Last Import Result :{' '}
|
||||||
|
<Box sx={{ color: 'success.main', display: 'inline' }}>
|
||||||
|
{importResult.total_success_row ?? 0}
|
||||||
|
</Box>{' '}
|
||||||
|
Row Processed,{' '}
|
||||||
|
<Box sx={{ color: 'error.main', display: 'inline' }}>
|
||||||
|
{importResult.total_failed_row}
|
||||||
|
</Box>{' '}
|
||||||
|
Failed, Report :{' '}
|
||||||
<a href={importResult.result_file?.url ?? '#'}>
|
<a href={importResult.result_file?.url ?? '#'}>
|
||||||
{importResult.result_file?.name ?? '-'}
|
{importResult.result_file?.name ?? '-'}
|
||||||
</a>
|
</a>
|
||||||
@@ -365,7 +374,7 @@ export default function List() {
|
|||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
{ row.status == "requested" ?
|
{ row.status == "requested" ?
|
||||||
(<Label variant='ghost' color='primary'>{capitalizeFirstLetter(row.status)}</Label>) :
|
(<Label variant='ghost' color='primary'>{capitalizeFirstLetter(row.status)}</Label>) :
|
||||||
row.status == "declined" ?
|
row.status == "declined" ?
|
||||||
(<Label color='error'> {capitalizeFirstLetter(row.status)}</Label>)
|
(<Label color='error'> {capitalizeFirstLetter(row.status)}</Label>)
|
||||||
:
|
:
|
||||||
(<Label color='success'> {capitalizeFirstLetter(row.status)}</Label>)
|
(<Label color='success'> {capitalizeFirstLetter(row.status)}</Label>)
|
||||||
@@ -378,7 +387,7 @@ export default function List() {
|
|||||||
<FindInPageOutlinedIcon />
|
<FindInPageOutlinedIcon />
|
||||||
Detail
|
Detail
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
} />
|
} />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|||||||
Reference in New Issue
Block a user