Update cetak final LOG

This commit is contained in:
ivan-sim
2023-12-29 13:35:06 +07:00
parent 2134de863a
commit 7c2df15a9f
8 changed files with 697 additions and 9 deletions

View File

@@ -377,4 +377,110 @@ class RequestLogController extends Controller
return response($pdf->output(), 200, $headers);
}
public function downlodFinalLog($request_log_id)
{
$dataRequestLog = DB::table('request_logs')
->where('request_logs.id', '=', $request_log_id)
->first();
$dataMember = DB::table('members')
->where('members.id', '=', $dataRequestLog->member_id)
->select(
'members.principal_id',
'members.name',
'members.birth_date',
'members.member_id',
'members.gender',
DB::raw('
(Select persons.nik FROM persons WHERE persons.id = members.person_id LIMIT 1) AS nik
'),
DB::raw('
"Link Sehat" AS penjamin
'),
DB::raw('
(Select corporates.name FROM corporates
INNER JOIN corporate_employees ON corporate_employees.corporate_id = corporates.id
WHERE corporate_employees.member_id = members.id LIMIT 1) AS nama_perusahaan
'),
DB::raw('
(Select member_policies.policy_id FROM member_policies WHERE member_policies.member_id = members.member_id LIMIT 1) AS no_polis
'),
DB::raw('
(Select member_policies.status FROM member_policies WHERE member_policies.member_id = members.member_id LIMIT 1) AS status_polis
'),
DB::raw('
(Select plans.code FROM member_plans
INNER JOIN plans ON plans.id = member_plans.plan_id
WHERE member_plans.member_id = members.id LIMIT 1) AS code_plan
'),
DB::raw('
(Select plans.limit_rules FROM member_plans
INNER JOIN plans ON plans.id = member_plans.plan_id
WHERE member_plans.member_id = members.id LIMIT 1) AS limit_rules
'),
DB::raw('
"IDR" AS mata_uang
'),
'members.members_effective_date AS mulai',
'members.members_expire_date AS akhir'
)
->first();
$data['namaKaryawan'] = '';
if($dataMember->principal_id)
{
$dataNamaKaryawan = DB::table('members')
->where('members.member_id', '=', $dataMember->principal_id)
->select('members.name')
->limit(1)
->first();
$data['namaKaryawan'] = $dataNamaKaryawan->name;
}
else{
$data['namaKaryawan'] = $dataMember->name;
}
$data['dataMember'] = $dataMember;
$data['request_logs'] = $dataRequestLog;
$dataClaimLog = DB::table('request_log_benefits')
->where('request_log_benefits.request_log_id', '=', 2)
->select(
'*',
DB::raw('
(Select benefits.description FROM benefits
WHERE benefits.id = request_log_benefits.benefit_id LIMIT 1) AS benfit
')
)
->get();
$data['dataClaimLog'] = $dataClaimLog;
$pdf = new Dompdf();
$options = new Options();
$options->set('isHtml5ParserEnabled', true);
$options->set('isPhpEnabled', true);
$options->set(['isRemoteEnabled' => true]);
$pdf->setOptions($options);
// Halaman 1
$html1 = view('pdf.final_log_page_1', $data);
// Halaman 2
$html2 = view('pdf.final_log_page_2', $data);
// Gabung konten HTML dari dua tampilan
$htmlCombined = $html1 . $html2;
$pdf->loadHtml($htmlCombined);
$pdf->render();
$headers = [
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'inline; filename="file.pdf"',
];
return response($pdf->output(), 200, $headers);
}
}

View File

@@ -55,6 +55,7 @@ Route::prefix('v1')->group(function() {
Route::get('get-final-log', 'getFinalLog');
Route::post('request-final-log', 'requestFinalLog');
Route::get('download-log/{request_log_id}', 'downlodLog');
Route::get('download-final-log/{request_log_id}', 'downlodFinalLog');
});
//Notification
Route::controller(NotificationController::class)->group(function() {

View File

@@ -86,10 +86,10 @@ export default function AccountPopover() {
>
<Box sx={{ my: 1.5, px: 2.5 }}>
<Typography variant="subtitle2" noWrap>
Rayan Moran
Hospital Admin
</Typography>
<Typography variant="body2" sx={{ color: 'text.secondary' }} noWrap>
rayan.moran@gmail.com
hospitaladmin@gmail.com
</Typography>
</Box>

View File

@@ -16,7 +16,7 @@ export default function NavbarDocs() {
<div>
<Typography gutterBottom variant="subtitle1">
Hi, Rayan Moran
Hi, Hospital Admin
</Typography>
<Typography variant="body2" sx={{ color: 'text.secondary' }}>
Need help?
@@ -25,7 +25,7 @@ export default function NavbarDocs() {
</div>
<Button variant="contained">Documentation</Button>
<Typography variant='body2'>Hak Cipta © 2023 - 2024 Link Medis Sehat</Typography>
<Typography variant='body2'>Hak Cipta © 2023 - 2024 Link Sehat</Typography>
</Stack>
</>
);

View File

@@ -38,8 +38,17 @@ export default function TableListFinalLog() {
const [data, setData] = useState([]);
// Download LOG
async function handleDownloadLog(claimRequest:any) {
enqueueSnackbar('Sorry, this feature is currently being processed', { variant: 'error' });
async function handleDownloadLog(request_log_id:any) {
return axios
.get(`download-final-log/${request_log_id}`, {
responseType: 'blob',
})
.then((response) => {
window.open(URL.createObjectURL(response.data), '_blank');
})
.catch((response) => {
enqueueSnackbar(response.message, { variant: 'error' });
});
}
/* -------------------------------------------------------------------------- */
@@ -334,9 +343,9 @@ export default function TableListFinalLog() {
View
</MenuItem>
{obj.status === 'approved' ? (
<MenuItem onClick={() => handleDownloadLog(obj.claim_request_id)}>
<MenuItem onClick={() => handleDownloadLog(obj.id)}>
<Iconify icon="eva:download-fill" />
Download LOG
Download Final LOG
</MenuItem>
):''}
{!obj.check_claim && obj.status === 'approved' ? (

View File

@@ -0,0 +1,318 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.triangle1 {
width: 0;
height: 0;
border-left: 10.24px solid transparent;
border-right: 318.24px solid transparent;
border-bottom: 75.5px solid #008C8C;
position: absolute;
top: -55.12px;
left: -60.91px;
transform: rotate(-12deg);
}
.triangle2 {
width: 0;
height: 0;
border-left: 10.24px solid transparent;
border-right: 550.24px solid transparent;
border-bottom: 110.5px solid #19BBBB;
position: absolute;
top: -55.12px;
left: -100.91px;
transform: rotate(-20deg);
}
body {
margin: 0;
padding: 0;
height: 100vh;
background-color: #ffffff; /* Ganti dengan warna latar belakang yang diinginkan */
}
.content {
padding: 20px;
text-align: left;
}
.content img {
width: 25%;
max-width: 600px; /* batasan lebar maksimum gambar */
margin-top: 20px; /* jarak antara segitiga dan gambar */
}
.corner-text {
font-family: 'Calibri', sans-serif;
font-size: 14px;
color: #666666;
position: absolute;
}
.top-right {
top: 10px;
right: 10px;
}
.bottom-right {
bottom: 10px;
right: 10px;
}
.bottom-left {
bottom: 10px;
left: 10px;
text-align: left;
}
.title-container {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
position: relative;
margin-top: 40px;
}
.title {
font-family: 'Calibri', sans-serif;
font-size: 18px;
margin-bottom: 5px;
}
.additional-text {
font-family: 'Calibri', sans-serif;
font-size: 12px;
}
.claim-info {
font-family: 'Calibri', sans-serif;
font-size: 14px;
/* color: #008C8C; */
text-align: left;
margin-top: 20px;
}
.table-items {
font-family: 'Calibri', sans-serif;
font-size: 14px;
/* color: #008C8C; */
text-align: left;
margin-top: 20px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 10px;
}
table, th, td {
/* border: 1px solid #008C8C; */
}
th, td {
padding: 4px;
text-align: left;
}
.hot-line {
font-family: 'Calibri', sans-serif;
background-color: #048B8C;
text-align: center;
align-items: center;
font-size: 14px;
margin-top: 10px;
padding: 2px;
color: #ffffff;
}
.txt-tindakan {
font-family: 'Calibri', sans-serif;
margin-top: 10px;
font-size: 14px;
}
.txt-pernyataan {
font-family: 'Calibri', sans-serif;
margin-top: 40px;
font-size: 14px;
}
</style>
</head>
<body>
<div class="triangle2"></div>
<div class="triangle1"></div>
<div class="content">
<div class="corner-text top-right">
The Future Of Healthcare At Your Fingertips
</div>
<img src="data:image/png;base64,{{ base64_encode(file_get_contents( public_path('images/logo-default.png') )) }}">
<div class="title-container">
<div class="title">
<b>SURAT JAMINAN</b>
</div>
<div class="additional-text">
(SURAT JAMINAN INI HARUS DITANDATANGANI OLEH PASIEN)
</div>
</div>
<table class="claim-info">
<tr>
<td style="width: 20%;">No. Klaim</td>
<td style="width: 1%;">:</td>
<td style="width: 29%;">{{$request_logs->code}}</td>
<td style="width: 20%;">Tanggal</td>
<td style="width: 1%;">:</td>
<td style="width: 29%;">{{ \Carbon\Carbon::parse($request_logs->submission_date)->format('d M Y') }}</td>
</tr>
<tr>
<td>Kepada</td>
<td>:</td>
<td></td>
<td>Plan Polis</td>
<td>:</td>
<td>{{ $dataMember->code_plan }}</td>
</tr>
</table>
<div class="hot-line">
(HOT LINE LINK SEHAT)
</div>
<div class="txt-tindakan">
Link Sehat bertindak mewakili perusahaan asuransi/penanggung untuk mengeluarkan Surat Jaminan Awal untuk peserta dibawah ini :
</div>
<table class="claim-info">
<tr>
<td style="width: 20%;">Jenis Surat Jaminan</td>
<td style="width: 1%;">:</td>
<td style="width: 29%;"><b>SURAT JAMINAN AKHIR</b></td>
<td style="width: 20%;">Penjamin</td>
<td style="width: 1%;">:</td>
<td style="width: 29%;">{{ $dataMember->penjamin }}</td>
</tr>
<tr>
<td>Nama Peserta</td>
<td>:</td>
<td>{{ $dataMember->name }}</td>
<td>Nama Perusahaan</td>
<td>:</td>
<td>{{ $dataMember->nama_perusahaan }}</td>
</tr>
<tr>
<td>Nama Karyawan</td>
<td>:</td>
<td>{{ $namaKaryawan }}</td>
<td>No. Polis</td>
<td>:</td>
<td>{{ $dataMember->code_plan }}</td>
</tr>
<tr>
<td>Tanggal Lahir</td>
<td>:</td>
<td>{{ \Carbon\Carbon::parse($dataMember->birth_date)->format('d M Y') }}</td>
<td>Produk</td>
<td>:</td>
<td>{{ $dataMember->no_polis }}</td>
</tr>
<tr>
<td>Jenis Kelamin</td>
<td>:</td>
<td>{{ $dataMember->gender == 'male' ? 'Laki-Laki' : 'Perempuan' }}</td>
<td>Tipe</td>
<td>:</td>
<td>{{ $dataMember->limit_rules == '999999999' ? 'As Charge' : 'Max Amount, Rp '.number_format($dataMember->limit_rules, 2, ',', '.') }}</td>
</tr>
<tr>
<td>Member ID</td>
<td>:</td>
<td>{{ $dataMember->member_id }}</td>
<td>Status Polis</td>
<td>:</td>
<td>{{ $dataMember->status_polis == 'active' ? 'Aktif' : 'Tidak Aktif' }}</td>
</tr>
<tr>
<td>Identitas Peserta</td>
<td>:</td>
<td>{{ $dataMember->nik }}</td>
<td>Tanggal Mulai Akhir</td>
<td>:</td>
<td>{{ \Carbon\Carbon::parse($dataMember->mulai)->format('d M Y') }} - {{ \Carbon\Carbon::parse($dataMember->akhir)->format('d M Y') }}</td>
</tr>
<tr>
<td>Hak Kamar Pasien</td>
<td>:</td>
<td></td>
<td>Mata Uang</td>
<td>:</td>
<td>{{ $dataMember->mata_uang }}</td>
</tr>
<tr>
<td>Tanggal Pembayaran</td>
<td>:</td>
<td></td>
<td>Rumah Sakit</td>
<td>:</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td>Alamat</td>
<td>:</td>
<td></td>
</tr>
</table>
<table class="table-items">
<thead>
<tr style="background-color: #F4F6F8;">
<td style="width: 5%; text-align: left;"><b>No.</b></td>
<td style="width: 25%; text-align: left;"><b>Item Layanan</b></td>
<td style="width: 15%; text-align: left;"><b>Total Klaim</b></td>
<td style="width: 20%; text-align: left;"><b>Total Disetujui</b></td>
<td style="width: 20%; text-align: left;"><b>Total Selisih</b></td>
<td style="width: 15%; text-align: left;"><b>Keterangan</b></td>
</tr>
</thead>
<tbody>
@php
$No = 1;
$total_claim = 0;
$total_disetujui = 0;
$total_selisih = 0;
@endphp
@foreach($dataClaimLog as $claimLog)
@php
$total_claim += $claimLog->amount_incurred;
$total_disetujui += $claimLog->amount_approved;
$total_selisih += $claimLog->excess_paid;
@endphp
<tr>
<td>{{ $No++ }}</td>
<td>{{ $claimLog->benfit}}</td>
<td>{{ number_format($claimLog->amount_incurred, 2, ',', '.') }}</td>
<td>{{ number_format($claimLog->amount_approved, 2, ',', '.') }}</td>
<td>{{ number_format($claimLog->excess_paid, 2, ',', '.') }}</td>
<td>{{ $claimLog->keterangan}}</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<td style="background-color: #F4F6F8;" colspan="2"><b>Total</b></td>
<td style="background-color: #F4F6F8;" ><b>{{ number_format($total_claim, 2, ',', '.') }}</b></td>
<td style="background-color: #F4F6F8;" ><b>{{ number_format($total_disetujui, 2, ',', '.') }}</b></td>
<td style="background-color: #F4F6F8;" ><b>{{ number_format($total_selisih, 2, ',', '.') }}</b></td>
<td style="background-color: #F4F6F8;" ></td>
</tr>
</tfoot>
</table>
<div class="corner-text bottom-right">
The Future Of Healthcare At Your Fingertips
</div>
<div class="corner-text bottom-left">
<b>PT Link Medis Sehat</b><br>
<b>Primaya Hospital Corporate</b><br>
Graha Cempaka Mas Blok D5-6<br>
Jl. Let. Jend. Suprapto, Jakarta Pusat 10640, Indonesia<br>
<b>Telp</b> (021) 4217746/47
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,254 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.triangle1 {
width: 0;
height: 0;
border-left: 10.24px solid transparent;
border-right: 318.24px solid transparent;
border-bottom: 75.5px solid #008C8C;
position: absolute;
top: -55.12px;
left: -60.91px;
transform: rotate(-12deg);
}
.triangle2 {
width: 0;
height: 0;
border-left: 10.24px solid transparent;
border-right: 550.24px solid transparent;
border-bottom: 110.5px solid #19BBBB;
position: absolute;
top: -55.12px;
left: -100.91px;
transform: rotate(-20deg);
}
body {
margin: 0;
padding: 0;
height: 100vh;
background-color: #ffffff; /* Ganti dengan warna latar belakang yang diinginkan */
}
.content {
padding: 20px;
text-align: left;
}
.content img {
width: 25%;
max-width: 600px; /* batasan lebar maksimum gambar */
margin-top: 20px; /* jarak antara segitiga dan gambar */
}
.corner-text {
font-family: 'Calibri', sans-serif;
font-size: 14px;
color: #666666;
position: absolute;
}
.top-right {
top: 10px;
right: 10px;
}
.bottom-right {
bottom: 10px;
right: 10px;
}
.bottom-right-ttd {
color: #000000;
bottom: 120px;
right: 10px;
}
.bottom-left {
bottom: 10px;
left: 10px;
text-align: left;
}
.bottom-left-ttd {
color: #000000;
bottom: 120px;
left: 10px;
text-align: left;
}
.bottom-left-ttd-1 {
color: #000000;
bottom: 250px;
left: 10px;
text-align: left;
}
.title-container-page {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
position: relative;
margin-top: 40px;
border: 1px solid; /* Warna garis tepi dan lebar dapat disesuaikan */
padding: 10px;
}
.title {
font-family: 'Calibri', sans-serif;
font-size: 18px;
margin-bottom: 5px;
}
.additional-text {
font-family: 'Calibri', sans-serif;
font-size: 12px;
}
.claim-info {
font-family: 'Calibri', sans-serif;
font-size: 12px;
/* color: #008C8C; */
text-align: left;
margin-top: 20px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 10px;
}
table, th, td {
/* border: 1px solid #008C8C; */
}
th, td {
padding: 4px;
text-align: left;
}
.hot-line {
font-family: 'Calibri', sans-serif;
background-color: #048B8C;
text-align: center;
align-items: center;
font-size: 14px;
margin-top: 10px;
padding: 2px;
color: #ffffff;
}
.txt-tindakan {
font-family: 'Calibri', sans-serif;
margin-top: 10px;
font-size: 14px;
}
.txt-pernyataan {
font-family: 'Calibri', sans-serif;
margin-top: 40px;
font-size: 14px;
}
.txt-syarat {
font-family: 'Calibri', sans-serif;
font-size: 14px;
text-align: left;
}
container {
position: relative;
height: 100vh;
}
.left-bottom {
position: absolute;
bottom: 10px;
left: 10px;
text-align: left;
}
.right-bottom {
position: absolute;
bottom: 10px;
right: 10px;
text-align: right;
}
</style>
</head>
<body>
<div class="triangle2"></div>
<div class="triangle1"></div>
<div class="content">
<div class="corner-text top-right">
The Future Of Healthcare At Your Fingertips
</div>
<img src="data:image/png;base64,{{ base64_encode(file_get_contents( public_path('images/logo-default.png') )) }}">
<div class="title-container-page">
<div class="txt-syarat">SYARAT DAN KETENTUAN</div>
<table class="claim-info">
<tr>
<td style="width: 100%;">1.&nbsp;Surat jaminan ini hanya berlaku untuk diagnosa yang tercantum diatas.
Apabila ditemukan adanya perubahan atau penambahan diagnosa, maka Link Sehat berhak membatalkan surat jaminan.
Mohon untuk menghubungi Link Sehat apabila ada perubahan diagnosa dan diagnosa tambahan.</td>
</tr>
<tr>
<td style="width: 100%;">2.&nbsp;Surat jaminan ini dinyatakan berlaku apabila disertai surat jaminan akhir dengan
nominal yang tertera pada kolom diatas.</td>
</tr>
<tr>
<td style="width: 100%;">3.&nbsp;Surat jaminan ini tidak berlaku untuk biaya diluar medis seperti makan/minum
diluar ketentuan, tagihan telepon, binatu, dan lain-lain. Mohon ditagihkan langsung kepeserta.</td>
</tr>
<tr>
<td style="width: 100%;">4.&nbsp;Rumah sakit harap segera menghubungi Link Sehat apabila biaya rumah sakit melebihi batas tertanggung diatas.</td>
</tr>
<tr>
<td style="width: 100%;">5.&nbsp;Rumah sakit wajib menghubungi Link Sehat sebelum pasien meninggalkan rumah sakit
dapat menghubungi biaya apa saja yang dijamin oleh Link Sehat. Jika peserta meninggalkan rumah sakit sebelum mengkonfirmasikan ke Link Sehat,
maka Link Sehat tidak bertanggung jawab atas biaya yang tidak dijamin oleh pihak asuransi.</td>
</tr>
<tr>
<td style="width: 100%;">6.&nbsp;Peserta bertanggung jawab untuk menyelesaikan secara langsung kepada pihak rumah sakit dan penyedia jasa medis
apabila terjadi selisih biaya (ekses) atas seluruh biaya perawatan, biaya medis, dan yang lain yang telah terjadi sehubungan
dengan rawat inap, maupun atas perihal perawatan medis yang tidak tercakup dalam polis asuransi dikarenakan karena alasan apapun.
Apabila biaya-biaya tersebut telah dijamin oleh Link Sehat atas nama nasabah, maka peserta akan membayar kembali ke pihak Link Sehat
secara penuh termasuk biaya berhubungan dengan penagihan (apabila ada) yang terjadi ke pihak Link Sehat atas biaya yang tidak termasuk dalam manfaat polis.</td>
</tr>
<tr>
<td style="width: 100%;">7.&nbsp;Dengan ini perserta menyatakan mengetahui dan menyetujui ketentuan selisih biaya yang telah disebutkan diatas.</td>
</tr>
<tr>
<td style="width: 100%;">8.&nbsp;Dalam hal surat jaminan ini tidak ditandatangani oleh peserta yang bersangkutan maka rumah sakit berkewajiban untuk menyampaikan keadaan tersebut
kepada Link Sehat dalam kurun waktu paling lambat 1x24 jam, dalam hal tidak ada perubahan dalam jangka waktu yang telah ditentukan tersebut
maka dianggap peserta yang bersangkutan telah setuju dengan ketentuan yang terdapat dalam surat jaminan ini.</td>
</tr>
</table>
</div>
<!-- <div class="container">
<div class="left-bottom">
Hormat Kami,<br>
Acknowledged,<br>
[Nama Analyst]
</div>
</div> -->
<div class="corner-text bottom-left-ttd-1">
Hormat Kami,<br>
Acknowledged,
</div>
<div class="corner-text bottom-left-ttd">
[..................................................]
</div>
<div class="corner-text bottom-right-ttd">
[{{ $dataMember->name }}]
</div>
<div class="corner-text bottom-right">
The Future Of Healthcare At Your Fingertip
</div>
<div class="corner-text bottom-left">
<b>PT Link Medis Sehat</b><br>
<b>Primaya Hospital Corporate</b><br>
Graha Cempaka Mas Blok D5-6<br>
Jl. Let. Jend. Suprapto, Jakarta Pusat 10640, Indonesia<br>
<b>Telp</b> (021) 4217746/47
</div>
</div>
</body>
</html>

View File

@@ -156,7 +156,7 @@
<tr>
<td>Kepada</td>
<td>:</td>
<td>{{ $dataMember->name }}</td>
<td></td>
<td>Plan Polis</td>
<td>:</td>
<td>{{ $dataMember->code_plan }}</td>