148 lines
6.0 KiB
PHP
148 lines
6.0 KiB
PHP
<script>
|
|
jQuery(document).ready(function(){
|
|
jQuery('.print').click(function(){
|
|
var idxdaftar = jQuery(this).attr('rel');
|
|
jQuery.get('<?php echo _BASE_; ?>print_rekapbill.php?idxdaftar='+idxdaftar+'&nomr=<?php echo $_REQUEST['nomr']; ?>',function(data){
|
|
|
|
jQuery('#tmp_print').html(data);
|
|
w=window.open();
|
|
//w.document.write(jQuery('#show_print').html());
|
|
w.document.write(jQuery('#tmp_print').html());
|
|
w.print();
|
|
//jQuery('#show_print').empty();
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<div align="left">
|
|
<style type="text/css" media="screen">
|
|
#tmp_print{display:none;}
|
|
</style>
|
|
<style type="text/css" media="print">
|
|
#tmp_print{display:block;}
|
|
</style>
|
|
|
|
<div id="tmp_print"></div>
|
|
<div id="frame">
|
|
<div id="frame_title"><h5>Rekap Bill Rawat Inap</h5></div>
|
|
<div class="container-fluid">
|
|
<div class="text-right">
|
|
<input type="button" name="back" onClick="javascript:history.back(1)" value="Kembali" class="btn btn-danger">
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<dl class="row text-left">
|
|
<dt class="col-sm-2">No RM</dt>
|
|
<dd class="col-sm-10">: <?=$_GET['nomr']?></dd>
|
|
|
|
<dt class="col-sm-2">Nama</dt>
|
|
<dd class="col-sm-10">: <?=$_GET['nama']?></dd>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
<table width="95%" style="margin:10px;" border="0" class="table table-hover table-bordered table-striped table-sm" cellspacing="1" cellspading="1">
|
|
<tr align="center" class="bg-success text-light">
|
|
<th style="width:30px;text-align:center;">No</th>
|
|
<th style="width:30px;">Tanggal</th>
|
|
<th style="width:30px;text-align:center;">Nobill</th>
|
|
<th style="width:30px;text-align:center;">Nonota</th>
|
|
<th style="width:50px;text-align:center;" >Kode Tarif</th>
|
|
<th style="width:200px;text-align:center;" >Jenis Tindakan</th>
|
|
<th style="width:100px;text-align:center;" >QTY</th>
|
|
<th style="width:100px;text-align:center;" >Harga</th>
|
|
<th style="width:100px;text-align:center;" >Jumlah Harga</th>
|
|
<th style="width:30px;text-align:center;" >Ket</th>
|
|
|
|
</tr>
|
|
<?php
|
|
$sql_billrajal = "SELECT b.idxbill,b.tanggal,b.nobill,b.nonota,l.lunas, d.kode_tarif,d.uraian_tarif as nama_jasa, b.idxdaftar, b.tarifrs,b.qty
|
|
FROM t_billrajal b
|
|
left join t_pendaftaran c on c.idxdaftar=b.idxdaftar
|
|
left join m_tarif_rs d on b.kodetarif = d.kode_tarif
|
|
left join t_admission e on e.nomr=b.nomr
|
|
left join m_statuskeluar k on c.status=k.status
|
|
left join t_bayarrajal l on l.idxbill=b.idxbill
|
|
WHERE c.status='2' and b.idxdaftar={$_REQUEST['idx']} and b.status <> 'BATAL'
|
|
|
|
UNION ALL
|
|
";
|
|
$sql_billanak = "
|
|
SELECT l.lunas, d.uraian_tarif as nama_jasa, b.idxdaftar, b.tarifrs,b.qty
|
|
FROM t_billrajal b
|
|
left join t_pendaftaran c on c.idxdaftar=b.idxdaftar
|
|
left join m_tarif_rs d on b.kodetarif = d.kode_tarif
|
|
left join t_admission e on e.nomr=b.nomr
|
|
left join m_statuskeluar k on c.status=k.status
|
|
left join t_bayarrajal l on l.idxbill=b.idxbill
|
|
left join m_pasien x on b.nomr = x.nomr
|
|
WHERE x.PARENT_NOMR='{$_REQUEST['nomr']}'
|
|
|
|
UNION ALL";
|
|
// sql get kunjungan poliklinik
|
|
$sql = '';
|
|
$tmp_sql = $db->query("SELECT kdpoly from t_pendaftaran where idxdaftar = {$_REQUEST['idx']}");
|
|
$dt_kunjungan = $tmp_sql->fetchFirst();
|
|
if($dt_kunjungan['kdpoly'] == $_SESSION['poli_igd']) {
|
|
$sql .= $sql_billrajal;
|
|
}
|
|
|
|
|
|
$sql .= "SELECT distinct b.idxbill,b.tanggal,b.nobill,b.nonota,l.lunas ,d.kode_tarif,case when b.kodetarif in ('DEPOSIT','IURBEA') then b.kodetarif else d.uraian_tarif end as nama_jasa, b.idxdaftar, b.tarifrs,b.qty
|
|
FROM t_billranap b
|
|
left join m_tarif_rs d on b.kodetarif = d.kode_tarif
|
|
left join t_admission e on e.nomr=b.nomr
|
|
left join t_bayarranap l on l.idxbill=b.idxbill
|
|
WHERE b.idxdaftar={$_REQUEST['idx']} and b.kodetarif not in ('DEPOSIT') and tarifrs > 0 and b.status <> 'BATAL'
|
|
ORDER BY nonota
|
|
";
|
|
$total = 0;
|
|
$no = 1;
|
|
$tot = 0;
|
|
$qry = $db->query($sql);
|
|
|
|
foreach($qry->fetchAll() as $data) {
|
|
|
|
$tot = $tot + ( $data['qty'] * $data['tarifrs']);
|
|
?>
|
|
|
|
<tr>
|
|
<td align ="center"><?php echo $no++; ?></td>
|
|
<td><?php echo date_to_id($data['tanggal']); ?></td>
|
|
<td><?php echo $data['nobill']; ?></td>
|
|
<td><?php echo $data['nonota']; ?></td>
|
|
<td><?php echo $data['kode_tarif']; ?></td>
|
|
<td><?php echo $data['nama_jasa']; ?></td>
|
|
<td style="width:100px;text-align:center;"><?php echo $data['qty']; ?></td>
|
|
<td style="text-align:right;"><?php echo "Rp. ".format_uang($data['tarifrs']); ?></td><?php
|
|
$total = $data['qty'] * $data['tarifrs'];?>
|
|
<td style="text-align:right;"><?php echo "Rp. ".format_uang($total); ?></td>
|
|
<td style="text-align:center;">
|
|
<?php if ($data['lunas'] == '1'){
|
|
echo "LUNAS";
|
|
}else{
|
|
echo "BELUM LUNAS";
|
|
}?>
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
<td colspan="6" style="background:#999; font-weight:bold; text-align:right; padding-right:10px;"><?php echo "TOTAL"; ?></td>
|
|
|
|
<td style="background:#999; font-weight:bold; text-align:right; padding-right:10px;"><?php echo "RP. ".format_uang($tot); ?></td>
|
|
<td style="background:#999; font-weight:bold; text-align:right; padding-right:10px;"></td>
|
|
</table>
|
|
<table width="95%" >
|
|
<tr >
|
|
<td></td>
|
|
<td></td>
|
|
<td >
|
|
<input type="button" name="print" value="Print" class="btn btn-success text print" id="print_<?php echo $_REQUEST['nomr']; ?>" rel="<?php echo $_REQUEST['idx']; ?>" style="display:block; float:right;"/><div id="callback_<?php echo $_REQUEST['nomr']; ?>" style="float:right;"></div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|