<!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' or $kdtoko=='MLG01' ) { ?>
    <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'  or $kdtoko !='MLG01') { ?>
    <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>Total 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 style="border-bottom: 1px solid #ddd;">
        <td>Setoran I</td>
    </tr>
    <tr>
        <td><div align="right"><?php echo number_format(($key->bruto1), 0, ',', '.') ?></div></td>
	    <td><div align="right"><?php echo number_format($key->nppn1, 0, ',', '.') ?></div></td>
        <td><div align="right"><?php echo number_format($key->set1, 0, ',', '.') ?></div></td>
    </tr>
    <tr>	
        <td>Setoran II</td>
    </tr>
    <tr>
        <td><div align="right"><?php echo number_format(($key->bruto2), 0, ',', '.') ?></div></td>
        <td><div align="right"><?php echo number_format($key->nppn2, 0, ',', '.') ?></div></td>
	    <td><div align="right"><?php echo number_format($key->set2, 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+$key->nppn), 0, ',', '.') ?></div></td>
    
  </tr>
<?php
$total_promo += $key->nilai+$key->nppn;
?>
 <?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->netnppn, 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/>


</body>
</html>