From 1e7468fc023ee5f3825da7cb8ceb042cf1195d1b Mon Sep 17 00:00:00 2001 From: Linksehat Staging Server Date: Sun, 11 Feb 2024 07:19:18 +0700 Subject: [PATCH] penyesuaian ambil data submission ke created at --- .../Transformers/RequestLogResource.php | 3 +- .../Transformers/RequestLogShowResource.php | 3 +- .../pages/CustomerService/FinalLog/Detail.tsx | 50 ++++++++++--------- .../pages/CustomerService/FinalLog/List.tsx | 4 +- .../CustomerService/FinalLog/Model/Types.tsx | 4 +- 5 files changed, 36 insertions(+), 28 deletions(-) diff --git a/Modules/Internal/Transformers/RequestLogResource.php b/Modules/Internal/Transformers/RequestLogResource.php index 4bf3cdfe..c0b59bc3 100644 --- a/Modules/Internal/Transformers/RequestLogResource.php +++ b/Modules/Internal/Transformers/RequestLogResource.php @@ -20,10 +20,11 @@ class RequestLogResource extends JsonResource return [Str::slug($file->type, '_') => $file]; }); $provider = Organization::where('id', $this->organization_id)->first(); - + $data = [ 'id' => $this->id, 'code' => $this->code, + 'created_at' => $this->created_at, 'submission_date' => $this->submission_date, 'submission_date_fgl' => $this->approved_final_log_at, 'member_name' => $this->member->name, diff --git a/Modules/Internal/Transformers/RequestLogShowResource.php b/Modules/Internal/Transformers/RequestLogShowResource.php index 26fa5409..73f0ccf2 100644 --- a/Modules/Internal/Transformers/RequestLogShowResource.php +++ b/Modules/Internal/Transformers/RequestLogShowResource.php @@ -106,7 +106,8 @@ class RequestLogShowResource extends JsonResource 'principal_id' => $requestLog['member']['principal_id'] ? $requestLog['member']['principal_id'] : '-', 'principal_name' => $requestLog['member']['principal_id'] ? Helper::principalName($requestLog['member']['principal_id']) : '-', 'relation_with_principal' => Helper::relationWithPrincipal($requestLog['member']['relation_with_principal']), - 'submission_date' => $requestLog['submission_date'], + 'admission_date' => $requestLog['submission_date'], // admission mengacu pada tanggal submit + 'submission_date' => $requestLog['created_at'], // submission mengacu pada tanggal buat 'approved_final_log_at' => $requestLog['approved_final_log_at'], // submission final log 'discharge_date' => $requestLog['discharge_date'], 'service_type' => Helper::serviceName($requestLog['service_code']), diff --git a/frontend/dashboard/src/pages/CustomerService/FinalLog/Detail.tsx b/frontend/dashboard/src/pages/CustomerService/FinalLog/Detail.tsx index 48044d83..1c721e62 100644 --- a/frontend/dashboard/src/pages/CustomerService/FinalLog/Detail.tsx +++ b/frontend/dashboard/src/pages/CustomerService/FinalLog/Detail.tsx @@ -45,7 +45,7 @@ import DialogHospitalCare from './Components/DialogHospitalCare'; import DialogBenefit from './Components/DialogBenefit'; import DialogMedicine from './Components/DialogMedicine'; import DialogDeleteBenfit from './Components/DialogDeleteBenefit'; -import DialogEditBenefit from './Components/DialogEditBenefit'; +import DialogEditBenefit from './Components/DialogEditBenefit'; import DialogDeleteMedicine from './Components/DialogDeleteMedicine' import MoreMenu from '@/components/MoreMenu'; @@ -66,7 +66,7 @@ export default function Detail() { const navigate = useNavigate(); const { themeStretch } = useSettings(); const [requestLog, setRequestLog] = useState(); - + const { id } = useParams(); @@ -107,7 +107,7 @@ export default function Detail() { // Handel Delete Detail Benefit const [idBenefitData, setIdBenefitData] = useState(); const [openDialogDeleteBenefit, setDialogDeleteBenefit] = useState(false) - + const [idMedicineData, setIdMedicineData] = useState(); const [openDialogDeleteMedicine, setDialogDeleteMedicine] = useState(false) @@ -117,7 +117,7 @@ export default function Detail() { const [openDialogEditBenefit, setDialogEditBenefit] = useState(false) const [BenefitConfigurationData, setBenefitConfigurationData] = useState(); - // Buat total data + // Buat total data const totalAmountIncurred = (requestLog?.benefit_data || []).reduce((accumulator, item) => { return accumulator + (item.amount_incurred || 0); }, 0); @@ -130,7 +130,7 @@ export default function Detail() { const totalExcessPaid = (requestLog?.benefit_data || []).reduce((accumulator, item) => { return accumulator + (item.excess_paid || 0); }, 0); - + return ( @@ -143,7 +143,7 @@ export default function Detail() { {/* Detail */} - + Detail @@ -164,7 +164,7 @@ export default function Detail() { } /> ) : null } - + Provider @@ -192,7 +192,11 @@ export default function Detail() { Submission Date - {requestLog?.approved_final_log_at ? fDateTimesecond(requestLog?.approved_final_log_at) : '-'} + {requestLog?.submission_date ? fDateTimesecond(requestLog?.submission_date) : '-'} + + + Admission Date + {requestLog?.admission_date ? fDateTimesecond(requestLog?.admission_date) : '-'} @@ -245,16 +249,16 @@ export default function Detail() { {/* Service */} - - + {/* Exclusion */} - {/* */} @@ -276,7 +280,7 @@ export default function Detail() { requestLog={requestLog} openDialog={openDialogHospital} setOpenDialog={setDialogHospital} - + > */} @@ -294,7 +298,7 @@ export default function Detail() { {requestLog?.benefit_data?.map((item, index) => ( - + @@ -415,14 +419,14 @@ export default function Detail() { - + ))}

{requestLog?.benefit_data && requestLog.benefit_data.length > 0 ? ( - + @@ -431,7 +435,7 @@ export default function Detail() { Total Benefit - + @@ -504,13 +508,13 @@ export default function Detail() { - + - ) + ) : ( null - )} + )} {/* PR Buat pindahin ke componen */} @@ -523,7 +527,7 @@ export default function Detail() { requestLog={requestLog} openDialog={openDialogBenefit} setOpenDialog={setDialogBenefit} - + /> {/* Dialog Edit */} {/* Dialog Delete */} - {/* Dialog Edit Detai; */} - ) : null} - +
diff --git a/frontend/dashboard/src/pages/CustomerService/FinalLog/List.tsx b/frontend/dashboard/src/pages/CustomerService/FinalLog/List.tsx index 960e2674..13ce5f18 100644 --- a/frontend/dashboard/src/pages/CustomerService/FinalLog/List.tsx +++ b/frontend/dashboard/src/pages/CustomerService/FinalLog/List.tsx @@ -350,7 +350,7 @@ export default function List() { {row.code} {row.provider} {row.member_name} - + {row.service_name} {row.payment_type_name} @@ -577,7 +577,7 @@ export default function List() { {/* Dialog Delete */} -