<html>
<head>
    <title><?php echo @$title ?></title>
    <link rel="stylesheet" href="<?php echo base_url('assets/css/nota.css?time='. md5(time())) ?>">
</head>
<body class="struk" onload="printOut()">
    <section class="sheet">
        <table cellpadding="0" cellspacing="0">
        <tr>
            <td align="center"><?php echo @$toko ?></td>
        </tr>
        <tr>
            <td align="center"><?php echo @$alamat.'<br>Telepon: '.@$telepon ?></td>
        </tr>
        </table>
        <?php echo str_repeat("=", 38).'<br/>' ?>
        <table cellpadding="0" cellspacing="0" style="width:100%">
        <tr>
            <td colspan="3" align="center">NOTA RETUR<hr></td>
        </tr>
        <tr>
            <td align="left" class="txt-left">Tanggal&nbsp;</td>
            <td align="left" class="txt-left">:</td>
            <td align="left" class="txt-left">&nbsp;<?php echo @$tanggal ?></td>
        </tr>
        <tr>
            <td align="left" class="txt-left">Nota&nbsp;</td>
            <td align="left" class="txt-left">:</td>
            <td align="left" class="txt-left">&nbsp;<?php echo @$invoice ?></td>
        </tr>
        <tr>
            <td align="left" class="txt-left">Kasir</td>
            <td align="left" class="txt-left">:</td>
            <td align="left" class="txt-left">&nbsp;<?php echo @$pegawai ?></td>
        </tr>
        </table>
        <br>
        <table cellpadding="0" cellspacing="0" style="width:100%" border="0">
        <tr>
            <td align="center" class="txt-left">Item</td>
            <td align="center" width="15%">Qty</td>
            <td align="left" width="20%">Harga</td>
            <td align="right" width="24%">Total</td>
        </tr>
        <tr>
            <td align="left" colspan="4" class="txt-left"><?php echo str_repeat("=",38) ?></td>
        </tr>
        <?php
        $subtot=0;
        foreach($dataretur as $hasil) {
            ?>
            <tr>
                <td align="left" class="txt-left" colspan="4"><?php echo $hasil->barang ?></td>
            </tr>
            <tr>
                <td align="right" valign="bottom">
                    <?php
                    echo $hasil->jumlah_retur.' '.$hasil->satuan;
                    ?>
                </td>
                <td align="center" valign="bottom"><?php echo 'x' ?></td>
                <td align="left" valign="bottom"><?php echo number_format($hasil->harga_jual,0,',','.') ?></td>
                <td align="right" valign="bottom"><?php echo number_format($hasil->total_harga,0,',','.') ?></td>
            </tr>
            <?php
            $subtot=$subtot+$hasil->total_harga;
        }
        ?>
        <tr>
            <td align="left" colspan="4" class="txt-left"><?php echo str_repeat('-',38) ?></td>
        </tr>
        <tr>
            <td align="left" colspan="3">Total Retur</td>
            <td align="right"><?php echo number_format($subtot,0,',','.') ?></td>
        </tr>
        </table>
        <br>
        <?php
        $footer = 'Terima kasih atas kunjungan anda';
        $starSpace = ( 32 - strlen($footer) ) / 2;
        $starFooter = str_repeat('*', $starSpace+1);
        echo($starFooter. '&nbsp;'.$footer . '&nbsp;'. $starFooter."<br/><br/><br/><br/>");
        echo '<p>&nbsp;</p>';
        ?>
</section>
<script>
var lama=1000;
t=null;
function printOut() {
    window.print();
    t=setTimeout("self.close()",lama);
}
</script>
</body>
</html>