<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="container">
	<center>
		PT. WIRASWASTA GEMILANG INDONESIA
		<br><br>
		GD. THE CITY TOWER LT. 5 UNIT 1 S
		<br>
		JL. MH. THAMRIN NO. 81 MENTENG
		<br>
		MENTENG JAKARTA PUSAT
		<h2 style="margin-bottom: 0px">PROFORMA INVOICE</h2>
		No PO : <?php echo $stba->ponumber ?>
		<br>
		Tanggal PO : <?php echo date('d/m/y', strtotime($stba->podate)) ?>
	</center>

	Kepada Yth,
	<br>
	<?php echo $supplier->suppname ?>
	<br>
	<?php echo nl2br($supplier->addr) ?>
	<?php if(!empty($supplier->phone)){echo '<br>Telp. '.$supplier->phone;} ?><?php if(!empty($supplier->fax)){echo ', Fax. '.$supplier->fax;} ?>
	<!--
	<br>
	NPWP : 01.338.618.0-091.000
	-->
	<br><br>
	<table class="table table-bordered">
		<tr>
			<td>No</td>
			<td>Nama Barang</td>
			<td>Satuan</td>
			<td>Quantity</td>
			<td>Harga Satuan</td>
			<td>Sub Total</td>
		</tr>
		<?php $no = 1 ?>
		<?php foreach($detail->result() as $row): ?>
		<tr>
			<td><?php echo $no++ ?></td>
			<td><?php echo $row->type ?></td>
			<td><?php echo $row->jtype ?></td>
			<td><?php echo number_format($row->qty) ?></td>
			<td>Rp <?php echo number_format($row->harga) ?></td>
			<td>Rp <?php echo number_format($row->subtotal) ?></td>
		</tr>
		<?php endforeach; ?>
		<tr align="right">
			<td colspan="6">Sub Total Rp <?php echo number_format($stba->total) ?></td>
		</tr>
		<tr align="right">
			<td colspan="6">PPN 10% Rp <?php echo number_format($pembayaran->tagihan * 0.10) ?></td>
		</tr>
		<tr align="right">
			<td colspan="6">Total Rp <?php echo number_format($pembayaran->tagihan * 0.10 + $pembayaran->tagihan) ?></td>
		</tr>
		<tr align="center">
			<td colspan="6">Terbilang : #<?php echo $this->fungsi->terbilang(round($pembayaran->tagihan * 0.10 + $pembayaran->tagihan)) ?>#</td>
		</tr>
		<tr align="center">
			<td colspan="6">
				Note : PEMBAYARAN MOHON DITRANSFER KE REK. <?php echo $norek->row('norek') ?>
				<br>
				BANK DANAMON A/N <?php echo $norek->row('nama') ?>
			</td>
		</tr>
	</table>
	<table style="display: inline;">
		<tr align="center">
			<td><?php echo $kacab->row('city') ?>, <?php echo date('d-m-Y', strtotime($stba->posting)) ?></td>
		</tr>
		<tr align="center">
			<td><?php echo ($kacab->row('cabname') == 'PUSAT' ? 'Refinery Logistic Pusat' : $kacab->row('cabname')) ?></td>
		</tr>
		<tr>
			<td height="100"></td>
		</tr>
		<tr align="center">
			<td><u><?php echo $kacab->row('dispname') ?></u></td>
		</tr>
		<tr align="center">
			<td>Mgr. Collecting Cabang</td>
		</tr>
	</table>
	<?php if($supplier->pic != ''): ?>
	<table style="display: inline;" align="right">
		<tr align="center">
			<td>....., ..........</td>
		</tr>
		<tr align="center">
			<td><?php echo $supplier->suppname ?></td>
		</tr>
		<tr>
			<td height="100"></td>
		</tr>
		<tr align="center">
			<td><u><?php echo $supplier->pic ?></u></td>
		</tr>
		<tr align="center">
			<td>&nbsp;</td>
		</tr>
	</table>
	<?php endif; ?>
	<center>
		<button onclick="window.print()" id="buttonOne">Print</button>
	</center>
</div>

<style type="text/css">
  @media print
  {
  	@page
  	{
  		size: a4;
  	}
    #buttonOne 
    {
      display: none;
    }
  }
</style>