<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Rekap Harian</title>
<link rel="icon" type="image/png" href="<?php echo base_url('assets/') ?>/img/favicon.png"/>
<?php $kdtoko = $this->session->userdata('kd_toko'); ?>
<?php if($kdtoko=='KDR04' or $kdtoko=='KDR05' or $kdtoko=='JBG01' or $kdtoko=='JBG03' ) { ?>
    <style type="text/css">
    body {
	    font-family: Calibri;
	    font-size: 8pt;
	    color: #000;
	
        }
        th, tr, td {
        padding: 2px;
    }
    </style>
<?php } ?>

<?php if($kdtoko !='KDR04' && $kdtoko !='KDR05' && $kdtoko !='JBG01' && $kdtoko !='JBG03' ) { ?>
    <style type="text/css">
    body {
	    font-family: Calibri;
	    font-size: large;
	    color: #000;
	
        }
        th, tr, td {
        padding: 2px;
    }
    </style>
<?php } ?>

</head>
<body onload="print()">
<table width="250" border="0" align="center">
  <tr>
    <td colspan="4" align="center"><font color="#000000" size="+2" style="text-transform:uppercase"><?php echo $toko->nm_toko; ?></font></td>
  </tr>
  <tr>
    <td align="center">REKAP PENJUALAN DAN PENGELUARAN</td>
  </tr>
  <tr>
    <td align="center"><?php echo date_indo($tgl) . " " . $waktu ?></td>
  </tr>
  </table>
 
<table width="250" align="center" style="border-collapse: collapse;">
    <tr style="border-bottom: 1px solid #ddd;">
        <td colspan='3' align="left"><strong>PENJUALAN</strong></td>
    </tr>
    <tr>
        <td align="right"><strong>Bruto</strong></td>
        <td align="right"><strong>PB1</strong></td>
        <td align="right"><strong>Nilai</strong></td>
    </tr>    
  
  <?php foreach ($trekap->result() as $key): ?>
    <tr>
        <td><div align="right"><?php echo number_format(($key->bruto2+$key->bruto1), 0, ',', '.') ?></div></td>
        <td><div align="right"><?php echo number_format($key->nppn, 0, ',', '.') ?></div></td>
	    <td><div align="right"><?php echo number_format($key->omset, 0, ',', '.') ?></div></td>
    </tr>
    <tr>
        <td colspan='3'><b>TOTAL PENJUALAN</b></td>
    </tr>
    <tr>
        <td><b><div align="right"><strong><?php echo number_format(($key->bruto2+$key->bruto1), 0, ',', '.') ?></strong></div></b></td>
        <td><b><div align="right"><strong><?php echo number_format($key->nppn, 0, ',', '.') ?></strong></div></b></td>
	    <td><b><div align="right"><strong><?php echo number_format($key->omset, 0, ',', '.') ?></strong></div></b></td>
    </tr>
    <?php endforeach?>
</table>
<br />  

<table width="250" align="center" style="border-collapse: collapse;">
  <tr style="border-bottom: 1px solid #ddd;">
    <td align="left"><strong>Rekap Penjualan</strong></td>
    <td align="right"><strong>PB1</strong></td>
	<td align="right"><strong>Nilai</strong></td>
  </tr>
  <?php foreach ($rekap->result() as $key): ?>
  <tr style="border-bottom: 1px solid #ddd;">
    <td><?php echo $key->keterangan ?></td>
    <td><div align="right"><?php echo number_format($key->nppn, 0, ',', '.') ?></div></td>
	<td><div align="right"><?php echo number_format(($key->nilai+$key->nppn), 0, ',', '.') ?></div></td>
    
  </tr>
<?php
$total_debet += $key->nilai;
$total_ppn += $key->nppn;
?>
 <?php endforeach?>
  <tr>
    <td><b>TOTAL PENJUALAN<b></td>
    <td><b><div align="right"><strong><?php echo number_format($total_ppn, 0, ',', '.') ?></strong></div></b></td>
	<td><b><div align="right"><strong><?php echo number_format(($total_debet+$total_ppn), 0, ',', '.') ?></strong></div></b></td>
  </tr>
</table>
<br /> 
<table width="250" align="center" style="border-collapse: collapse;">
  <tr style="border-bottom: 1px solid #ddd;">
    <td align="left"><strong>Rekap Promosi</strong></td>
    <td align="right"><strong>Nilai</strong></td>
  </tr>
  <?php foreach ($pengeluaran->result() as $key): ?>
  <tr style="border-bottom: 1px solid #ddd;">
    <td><?php echo $key->keterangan ?></td>
    <td><div align="right"><?php echo number_format($key->nilai, 0, ',', '.') ?></div></td>
    
  </tr>
<?php
$total_promo += $key->nilai;
?>
 <?php endforeach?>
  <tr>
    <td><b>TOTAL PROMOSI</b></td>
    <td><b><div align="right"><strong><?php echo number_format($total_promo, 0, ',', '.') ?></strong></div></b></td>
  </tr>
</table>
<br /> 

<table width="250" align="center" style="border-collapse: collapse;">
  <tr style="border-bottom: 1px solid #ddd;">
    <td align="left"><strong>Rekapitulasi</strong></td>
	<td align="right"><strong>PB1</strong></td>
    <td align="right"><strong>Nilai</strong></td>
  </tr>
    <?php foreach ($trekap->result() as $key): ?>
  <tr style="border-bottom: 1px solid #ddd;">
    <td>Total Penjualan</td>
	 <td><div align="right"><?php echo number_format($key->nppn, 0, ',', '.') ?></div></td>
	 <td><div align="right"><?php echo number_format($key->omset, 0, ',', '.') ?></div></td>
  </tr>
  <tr>
     <td>Total Promosi</td>
	 <td><div align="right"><?php echo number_format($key->nppnd, 0, ',', '.') ?></div></td>
	 <td><div align="right"><?php echo number_format($key->discount, 0, ',', '.') ?></div></td>
  </tr> 
  <tr>
    <td><b>NETTO OMSET</b></td>
	<td><b><div align="right"><strong><?php echo number_format($key->nppn, 0, ',', '.') ?></strong></div></b></td>
    <td><b><div align="right"><strong><?php echo number_format($key->netomset, 0, ',', '.') ?></strong></div></b></td>
  </tr>
  <?php endforeach?>
</table>
<br/>

<table width="250" align="center" style="border-collapse: collapse;">
  <tr style="border-bottom: 1px solid #ddd;">
    <td align="left"><strong>Pendapatan Lain2</strong></td>
    <td align="right"><strong>Nilai</strong></td>
  </tr>
    <?php foreach ($trekap->result() as $key): ?>
  <tr style="border-bottom: 1px solid #ddd;">
    <td>Ongkir</td>
	 <td><div align="right"><?php echo number_format($key->ongkir, 0, ',', '.') ?></div></td>
  </tr>
  <tr style="border-bottom: 1px solid #ddd;">
    <td>Penjualan</td>
	 <td><div align="right"><?php echo number_format($key->pjual, 0, ',', '.') ?></div></td>
  </tr>
  <tr style="border-bottom: 1px solid #ddd;">
    <td>Parkir</td>
	 <td><div align="right"><?php echo number_format($key->pbulat, 0, ',', '.') ?></div></td>
  </tr>
  <tr style="border-bottom: 1px solid #ddd;">
    <td>Lain Lain</td>
	 <td><div align="right"><?php echo number_format($key->plain, 0, ',', '.') ?></div></td>
  </tr>
<?php
$total_ongkir += ($key->ongkir+$key->pjual+$key->pbulat+$key->plain);

?>  
<?php endforeach?>
  <tr>
    <td><b>TOT. PEND. LAIN2</b></td>
	<td><b><div align="right"><strong>Rp. <?php echo number_format($total_ongkir, 0, ',', '.') ?></strong></div></b></td>
	
  </tr>
  
</table>
<br/>


<table width="250" align="center" style="border-collapse: collapse;">
  <tr style="border-bottom: 1px solid #ddd;">
    <td align="left"><strong>Pendapatan</strong></td>
    <td align="right"><strong>PPn</strong></td>
    <td align="right"><strong>Nilai</strong></td>
  </tr>
    <?php foreach ($trekap->result() as $key): ?>
   <tr>
    <td><b>Net Omset</b></td>
	<td><b><div align="right"><strong><?php echo number_format($key->nppn, 0, ',', '.') ?></strong></div></b></td>
    <td><b><div align="right"><strong><?php echo number_format($key->netomset, 0, ',', '.') ?></strong></div></b></td>
  </tr>  
  <tr>
    <td><b>Pend. Lain2</b></td>
    <td colspan="2"><b><div align="right"><strong><?php echo number_format(($key->ongkir+$key->pjual+$key->pbulat), 0, ',', '.') ?></strong></div></b></td>
  </tr>  
  <tr>
    <td><b>TOTAL PENDAPATAN</b></td>
	<td><b><div align="right"><strong><?php echo number_format($key->nppn, 0, ',', '.') ?></strong></div></b></td>
    <td><b><div align="right"><strong><?php echo number_format($key->tomset, 0, ',', '.') ?></strong></div></b></td>
  </tr>  
  <tr>
<?php endforeach?>
  
</table>
<br/>


<table width="250" align="center" style="border-collapse: collapse;">
  <tr style="border-bottom: 1px solid #ddd;">
    <td align="left"><strong>Pengeluaran Tetap</strong></td>
	<td align="right"><strong>PB1</strong></td>
    <td align="right"><strong>Nilai</strong></td>
  </tr>
  <?php foreach ($tetap->result() as $key): ?>
  <tr style="border-bottom: 1px solid #ddd;">
    <td><?php echo $key->keterangan ?></td>
	<td><div align="right"><?php echo number_format($key->nppn, 0, ',', '.') ?></div></td>
    <td><div align="right"><?php echo number_format($key->nilai, 0, ',', '.') ?></div></td>
    
  </tr>
<?php
$total_tetap += $key->nilai;
$total_ppnt += $key->nppn;
?>
 <?php endforeach?>
  <tr>
    <td><b>TOTAL PENG. TETAP</b></td>
    <td><b><div align="right"><strong><?php echo number_format($total_ppnt, 0, ',', '.') ?></strong></div></b></td>
	<td><b><div align="right"><strong><?php echo number_format($total_tetap, 0, ',', '.') ?></strong></div></b></td>
  </tr>
</table>
<br /> 
<table width="250" align="center" style="border-collapse: collapse;">
  <tr style="border-bottom: 1px solid #ddd;">
    <td align="left"><strong>Pengeluaran Lain Lain</strong></td>
    <td align="right"><strong>Nilai</strong></td>
  </tr>
  <?php foreach ($biaya->result() as $key): ?>
  <tr style="border-bottom: 1px solid #ddd;">
    <td><?php echo $key->kode.' / '.$key->keterangan ?></td>
    <td><div align="right"><?php echo number_format($key->nilai, 0, ',', '.') ?></div></td>
    
  </tr>
<?php
$total_biaya += $key->nilai;
?>
 <?php endforeach?>
 <?php foreach ($pengeluaranp->result() as $key): ?>
  <tr style="border-bottom: 1px solid #ddd;">
    <td><?php echo $key->keterangan.' / '.number_format($key->nilai, 0, ',', '.').' Nota' ?></td>
    <td><div align="right"><?php echo number_format($key->nppn, 0, ',', '.') ?></div></td>
    
  </tr>
<?php
$total_biaya += $key->nppn;
?>
 <?php endforeach?>
 
  <tr>
    <td><b>TOTAL PENG. LAIN2</b></td>
    <td><b><div align="right"><strong><?php echo number_format($total_biaya, 0, ',', '.') ?></strong></div></b></td>
  </tr>
</table>
<br /> 

<table width="250" align="center" style="border-collapse: collapse;">
<?php foreach ($trekap->result() as $key): ?>
  <tr style="border-bottom: 1px solid #ddd;">
    <td align="left"><strong>TOTAL PENGELUARAN</strong></td>
    <td><strong><div align="right"><?php echo number_format($key->tbiaya, 0, ',', '.') ?></div></strong></td>
  </tr>
  <tr style="border-bottom: 1px solid #ddd;">
    <td align="left"><font size='4'><i><strong>TOTAL SETORAN</strong></i></font></td>
    <td><font size='4'><strong><div align="right"><?php echo number_format($key->saldo, 0, ',', '.') ?></div></strong></font></td>
  </tr>
 <?php endforeach?>
</table>

</body>
</html>