{% extends '../template.html' %}
{% block subcontent %}

	<h2><div style="float:right">{{order.date_detail.mday}}-{{order.date_detail.mon}}-{{order.date_detail.year}} {{order.date_detail.hours}}:{{order.date_detail.minutes}}  </div>
	Detail Order - <small>Order ID: {{ order.id }}</small></h2>
	<div style="margin-left:35px;">
		<table class="data" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td><b>Telepon</b></td>
				<td><b>{{ customer.telepon }}</b></td>
			</tr>
			<tr>
				<td style="width:100px;">Nama</td>
				<td style="width:400px;">
					{{ order.nama }} {% if customer.nama != order.nama %}({{customer.nama}}){% endif %}
				</td>
			</tr>
			<tr>
				<td>Alamat</td>
				<td>{{ order.alamat }}</td>
			</tr>
			<tr>
				<td>Telepon Lain</td>
				<td>{{ order.telepon_lain }}</td>
			</tr>
			<tr valign="top">
				<td><b>Store</b></td>
				<td>
				{% if store.nama != "" %}
				<b>{{ store.nama }}</b> <br/>{{ store.alamat }} (Telp. {{store.telepon}})	
				{% else %}
					- belum ada store -
				{% endif %}
				</td>
			</tr>
			<tr valign="top">
				<td><b>Rider</b></td>
				<td><b>{{ kurir }}</b></td>
			</tr>
			<tr valign="top">
				<td><b>Remarks</b></td>
				<td><b>{{ remarks }}</b></td>
			</tr>
		</table>
	</div>
	<hr/>
	<h2 style="text-align:center;margin-bottom:5px;">Status: <span style="text-transform:capitalize">{{ order.status }}</span></h2>
	<center>{{ order.keterangan }}</center>
	<hr/>
	<h2>Menu (Kategori {{ store.kategori_menu }}):</h2>
	<div style="vertical-align:top">
	{% for m in menu %}
	<div class="menu" style="width:250px;">
		<div style="font-size:22px;">{{ m.nama }}</div>
		<div style="float:left;font-size:16px;">Jml: {{ m.jml }}</div>
		<div style="float:right;font-size:16px;">Total: {{m.total | currency}}
			<br/><small style="font-size:11px;float:right;">@{{m.harga | currency}}</small>
		</div>
		<div class="clearfix"></div>
	</div>
	{% endfor %}
	</div>
	<br/><br/>
	<h2 style="margin:0px;">Total: <span class="total_price">{{ totalprice | currency }}</span></h2> 
	<h2 style="margin:0px;">Dibayar: <span class="dibayar">{{ order.dibayar | currency }}</span></h2> 
	<h2 style="margin:0px;">Kembali: Rp <span class="kembali">- loading -</span></h2> 

{% endblock %}
{% block script %}
<script type="text/javascript">
	$(document).ready(function() {
		var total_price = $(".total_price").text().replace('Rp ','').replace(/\./g,'');
		var dibayar = $(".dibayar").text().replace('Rp ','').replace(/\./g,'');
		$(".kembali").text((dibayar - total_price ).formatMoney(0,'.','.'));
	});
</script>
{% endblock %}



