
<div id="body">
	<div class="_hed">
		<p>JOSEPH THEODORUS WULIANADI</p>
		<p style="font-size: 20px; font-weight: bold;">J O G E R</p>
		<p>PABRIK KATA-KATA</p>
		<p>JL. RAYA KUTA</p>
		<p>TUBAN - BALI</p>
		<p>Telp / Fax : 0361 - 752523</p>
		<p>NPWP : 04.078.781.4-905.000</p>
	</div>
	<div class="_hed">
		<?php echo $kode->getSama('-', $maxB, '-'); ?>
	</div>
	<div class="_hed">
		<p>Kpd : <?php echo $kode->getSama($this->data->hed->kd_cust, $maxB, ' '); ?></p>
	</div>
	<div class="_det">
		<p>
			<?php 
			$disp = nl2br($kode->getLeft('No. : '.$this->data->hed->no_pos, 20, '&nbsp;'));
			echo $disp;
			echo "&nbsp;&nbsp;";
			$disp = nl2br($kode->getLeft('Kasir : '.$this->data->hed->kd_kasir, 17, '&nbsp;'));
			echo $disp;
			?>
		</p>
		<p>
			<?php 
			$disp = nl2br($kode->getLeft('Tgl. : '.date("d/m/Y", strtotime($this->data->hed->tgl)), 21, '&nbsp;'));
			echo $disp;
			echo "&nbsp;&nbsp;";
			$disp = nl2br($kode->getLeft('Jam. : '.date("H:i", strtotime($this->data->hed->tgl)), 18, '&nbsp;'));
			echo $disp;
			?>
		</p>
	</div>
	<div class="_hed">
		<?php echo $kode->getSama('-', $maxB, '-'); ?>
	</div>
	<div class="_det">
		<?php 
		$qty = 0;
		$tot = 0;
		foreach($this->data->det as $r){ 
			$qty = $qty + $r->qty;
			$tot = $tot + $r->total;
		?>
			<p>
				<?php 
				$disp = nl2br($kode->getLeft($r->kd_inv, 13, '&nbsp;'));
				echo $disp;
				echo "&nbsp;&nbsp;";
				$disp = nl2br($kode->getLeft($r->nm_inv, 18, '&nbsp;'));
				echo $disp;
				?>
			</p>
			<p>
				<?php 
				$disp = nl2br($kode->getRight($r->qty.' x', 7, '&nbsp;'));
				echo $disp;
				echo "&nbsp;";
				$disp = nl2br($kode->getRight(number_format($r->harga), 8, '&nbsp;'));
				echo $disp;
				echo "&nbsp;";
				
				$dis = '';
				if($r->diskon > 0){
					$dis = 'Dis '.number_format($r->diskon, 2).'%';
				}
				
				$disp = nl2br($kode->getRight($dis, 10, '&nbsp;'));
				echo $disp;
				echo "&nbsp;=";
				$disp = nl2br($kode->getRight(number_format($r->total), 10, '&nbsp;'));
				echo $disp;
				?>
			</p>
		<?php } ?>
	</div>
	<div class="_hed">
		&nbsp;
	</div>
	<div class="_hed">
		<?php 
		echo count($this->data->det).' Item &nbsp;&nbsp; Total : '.$qty.' Pcs';
		?>
	</div>
	<div class="_hed">
		<?php echo $kode->getSama('-', $maxB, '-'); ?>
	</div>
	<div class="_det">
		<p style="font-size: 17px; font-weight: bold;">
			TOTAL
			<?php 
			$disp = nl2br($kode->getRight(number_format($this->data->hed->ttot), 21, '&nbsp;'));
			echo $disp;
			?>
		</p>
		<?php if($this->data->hed->cash > 0){ ?>
			<p>
				<?php 
				$disp = nl2br($kode->getLeft('* TUNAI', 10, '&nbsp;'));
				echo $disp;
				$disp = nl2br($kode->getRight(number_format($this->data->hed->cash), 29, '&nbsp;'));
				echo $disp;
				?>
			</p>
		<?php } ?>
		<?php if($this->data->hed->debet > 0){ ?>
			<p>
				<?php 
				$disp = nl2br($kode->getLeft('* DEBET', 10, '&nbsp;'));
				echo $disp;
				$disp = nl2br($kode->getRight(number_format($this->data->hed->debet), 29, '&nbsp;'));
				echo $disp;
				?>
			</p>
		<?php } ?>
		<?php if($this->data->hed->credit > 0){ ?>
			<p>
				<?php 
				$disp = nl2br($kode->getLeft('* CREDIT', 10, '&nbsp;'));
				echo $disp;
				$disp = nl2br($kode->getRight(number_format($this->data->hed->credit), 29, '&nbsp;'));
				echo $disp;
				?>
			</p>
		<?php } ?>
		<?php if($this->data->hed->change > 0){ ?>
			<p>
				<?php 
				$disp = nl2br($kode->getLeft('* KEMBALI', 10, '&nbsp;'));
				echo $disp;
				$disp = nl2br($kode->getRight(number_format($this->data->hed->change), 29, '&nbsp;'));
				echo $disp;
				?>
			</p>
		<?php } ?>
	</div>
	<div class="_hed">
		<?php echo $kode->getSama('-', $maxB, '-'); ?>
	</div>
	<div class="_hed">
		<p>Untuk Barang Kena Pajak,</p>
		<p>Harga Sudah Termasuk PPN.</p>
	</div>
	<div class="_hed">
		<?php echo $kode->getSama('-', $maxB, '-'); ?>
	</div>
	<div class="_hed">
		<p>Mohon, Barang Yang Sudah Dibeli</p>
		<p>Tidak Dapat Ditukar Kembali, Thank You</p>
	</div>
	<div class="_hed">
		<?php echo $kode->getSama('-', $maxB, '-'); ?>
	</div>
	<div class="_hed">
		<p>Produk-produk dengan cap dan</p>
		<p>tanda tangan joger tidak boleh</p>
		<p>di perjualbelikan di luar</p>
		<p>Pabrik kata-kata Joger,</p>
		<p>Kuta dan Luwus, Bali, TU</p>
	</div>
	<div class="_hed">
		<?php echo $kode->getSama('-', $maxB, '-'); ?>
	</div>
</div>