{% extends '../template.html' %}
{% block subcontent %}
<h1>Detail Bagi Hasil</h1>
<h3>{{dokter}}</h3>
<h3>Bulan {{tgl}}</h3>
<br/><br/>
<a href="{% nav bendahara_gaji_dokter %}?monthly_month={{bln}}&monthly_year={{thn}}"><i class="fas fa-long-arrow-alt-left"></i> Kembali</a>
<br/><br/>
<table class="data_polos">
	<tr>
		<th>Tanggal</th>
		<th>Pasien</th>
		<th>Golongan</th>
		<th>Konsul/Tindakan</th>
		<th>Harga</th>
		<th>Total</th>
		<th>Persen</th>
		<th>Hasil</th>
		<th></th>
	</tr>
	{% for row1 in data %}
	{% for k2, row2 in row1.pasien %}
	{% if row2.tindakan.length == 0 %}
	<tr>	
		{% if k2 == 0 %}
		<td style="border-top:solid 1px #ccc;text-align:center">{{row1.tanggal}}</td>
		{% else %}
		<td></td>
		{% endif %}
		<td {% if k2 == 0 %}style="border-top:solid 1px #ccc"{% endif %}>{{row2.nama}}</td>
		<td {% if k2 == 0 %}style="border-top:solid 1px #ccc"{% endif %}>{{row2.golongan}}</td>
		<td {%if k2 == 0%}style="border-top:solid 1px #ccc"{%endif%}></td>
		<td {%if k2 == 0%}style="border-top:solid 1px #ccc"{%endif%}></td>
		<td {%if k2 == 0%}style="border-top:solid 1px #ccc"{%endif%}></td>
		<td {%if k2 == 0%}style="border-top:solid 1px #ccc"{%endif%}></td>
		<td {%if k2 == 0%}style="border-top:solid 1px #ccc"{%endif%}></td>
		<td {%if k2 == 0%}style="border-top:solid 1px #ccc"{%endif%}></td>
	</tr>
	{% endif %}
	{% for k3, row3 in row2.tindakan %}
	<tr>
		{% if k2 == 0 %}
		{% if k3 == 0 %}
		<td style="border-top:solid 1px #ccc;text-align:center">{{row1.tanggal}}</td>
		{% else %}
		<td></td>
		{% endif %}
		{% else %}
		<td></td>
		{% endif %}
		{% if k3 == 0 %}
		<td rowspan={{row2.tindakan.length}} {% if k2 == 0 %}style="border-top:solid 1px #ccc"{% endif %}>{{row2.nama}}</td>
		<td rowspan={{row2.tindakan.length}} {% if k2 == 0 %}style="border-top:solid 1px #ccc"{% endif %}>{{row2.golongan}}</td>
		{% endif %}
		<td {%if k2 == 0%}{%if k3 == 0%}style="border-top:solid 1px #ccc"{%endif%}{%endif%}>[{{row3.kode}}] {{row3.nama}}</td>
		<td style="text-align:right{%if k2 == 0%}{%if k3 == 0%};border-top:solid 1px #ccc{%endif%}{%endif%}">{{row3.jumlah}} x {{row3.harga | currency}}</td>
		<td style="text-align:right{%if k2 == 0%}{%if k3 == 0%};border-top:solid 1px #ccc{%endif%}{%endif%}">{{row3.total | currency}}</td>
		<td style="text-align:right{%if k2 == 0%}{%if k3 == 0%};border-top:solid 1px #ccc{%endif%}{%endif%}">{{row3.persen}}%</td>
		<td style="text-align:right{%if k2 == 0%}{%if k3 == 0%};border-top:solid 1px #ccc{%endif%}{%endif%}">{{row3.hasil | currency}}</td>
		<td {%if k2 == 0%}{%if k3 == 0%}style="border-top:solid 1px #ccc"{%endif%}{%endif%}></td>
	</tr>
	{% endfor %}
	{% endfor %}
	{% if row1.total > 0 %}
	<tr>
		<td colspan=8></td>
		<td style="text-align:right"><b>{{row1.total | currency}}</b></td>
	</tr>
	{% endif %}
	{% endfor %}
	<tr>
		<td colspan=8 style="font-size:16px;border-top:solid 1px #ccc">TOTAL</td>
		<td style="font-size:16px;text-align:right;border-top:solid 1px #ccc"><b>{{total | currency}}<b></td>
	</tr>
</table>
<br/><br/>
{% endblock %}
{% block script %}
<script type="text/javascript">
	$(document).ready(function() {
		menuSelected("mGaji","smDokter");
	});
</script>
{% endblock %}