<style type="text/css">
#body{
	margin: 20px;
	width: 750px;
	font-size: 12px;
}
._hed{
	text-align: center;
	font-weight: bold;
	font-size: 14px;
}
._isiHed{
	margin-top: -13px;
	margin-left: 120px;
}
._tabBody{
	margin-top: 10px;
}
._tabDet{
	border-top: 1px solid #000;
	border-bottom: 1px solid #000;
}
._tabDet tr th{
	padding: 3px;
	font-size: 12px;
	border-bottom: 1px solid #000;
}
._tabDet tr td{
	padding: 3px;
	font-size: 12px;
}
._tot{
	border-top: 1px solid #000;
}
._ttd{
	margin-top: 10px;
}
._ttd tr td{
	width: 150px;
	text-align: center;
}
</style>
<?php
$date = new Date;
?>
<div id="body">
	<div class="_hed">D R A F T &nbsp; P E N G I R I M A N  -  DETAIL BARANG </div>
	<table class="_tabBody">
		<tr>
			<td style="width: 375px">
				<div class="_label">No. Pengiriman</div>
				<div class="_isiHed">: <?php echo $this->data->data->nopak ?></div>
				<div class="_label">Tanggal</div>
				<div class="_isiHed">: <?php echo $date->tglIndo($this->data->data->tgl) ?></div>
				<div class="_label">Lokasi</div>
				<div class="_isiHed">: <?php echo $this->data->data->nm_gudang ?></div>
				<div class="_label">Keterangan</div>
				<div class="_isiHed">: <?php echo $this->data->data->ket.' '.$this->data->data->ket2.' '.$this->data->data->ket3 ?></div>
			</td>
			<td>
				<div class="_label">Sales</div>
				<div class="_isiHed">: <?php echo $this->data->data->nm_sales ?></div>
				<div class="_label">Tgl. Jatuh Tempo</div>
				<div class="_isiHed">: <?php echo $date->tglIndo($this->data->data->tgl) ?></div>
				<div class="_label">Sopir</div>
				<div class="_isiHed">: <?php echo $this->data->data->nm_sopir ?></div>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<table class="_tabDet" cellspacing="0" cellpadding="0">
					<thead>
						<tr>
							<th style="width: 10px">No</th>
							<th style="width: 100px">Kode Barang</th>
							<th style="width: 300px">Nama Barang</th>
							<th style="width: 150px">Kemasan</th>
							<th style="width: 100px; text-align: right">Jumlah</th>
						</tr>
					</thead>
					<tbody>
						<?php 
						$no = 1;
						$tot = 0;
						foreach($this->data->det as $r){ 
							$qtyA = $r->qty / $r->skala;
							$qtyA = (int)$qtyA;
							$qtyB = $qtyA * $r->skala;
							$qtyB = $r->qty - $qtyB;
						?>
							<tr>
								<td><?php echo $no++ ?></td>
								<td><?php echo $r->kd_inv ?></td>
								<td><div style="width: 300px"><?php echo $r->nm_inv ?></div></td>
								<td><?php echo $r->karton.' / '.number_format($r->skala, 2) ?></td>
								<td align="right"><?php echo $qtyA.' / '.$qtyB ?></td>
							</tr>
						<?php 
						} 
						?>
					</tbody>
				</table>
				
				<table class="_ttd">
					<tr>
						<td>Penerima Barang</td>
						<td>Bag Gudang</td>
						<td>Dibuat Oleh</td>
					</tr>
					<tr>
						<td style="height: 30px;">&nbsp;</td>
					</tr>
					<tr>
						<td>(...........................)</td>
						<td>(...........................)</td>
						<td>( <?php echo $this->login['kd_user'] ?> )</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</div>