{% extends "base.html" %}

{% block title %}
	&raquo; Supplies &raquo; {{era.supply.id}} &raquo;
	Add Import Supplier Batch And Bill
{% endblock %}

{% block nav %}
	<a href="/e/supplies">Supplies</a> &raquo; 
	<a href="/e/supplies/{{era.supply.id}}">{{era.supply.name}}</a> &raquo; 
	Era {{era.start_date|hh_format}} Add Import Supplier Batch And Bill
{% endblock %}

{% block content %}
	<table>
		<tr>
			<th>Import Supplier Contract</th>
			<td>{{era.imp_supplier_contract.name}}</td>
		</tr>
		<tr>
			<th>Import MPAN Core</th>
			<td>{{era.imp_mpan_core}}</td>
		</tr>
	</table>

	<form action="/e/eras/{{era.id}}/add_supplier_bill" method="post">
		<fieldset>
			<legend>Add Import Supplier Batch And Bill</legend>
			<fieldset>
				<legend>Batch</legend>
				<label>Reference</label>
				{{input_text('batch_reference', next_batch_reference, size=20)}}
				<label>Description</label>
				{{input_text('batch_description', placeholder=next_batch_description)}}
			</fieldset>
			<br>
			<fieldset>
				<legend>Bill</legend>
				<label>Reference</label> {{input_text('bill_reference', size_20)}}
						
				<label>Issue Date</label>
				<fieldset>
					{{input_date('issue')}}
				</fieldset>
						
				<label>Start Date</label>
				<fieldset>
					{{input_date('start', start_date)}}
				</fieldset>
						
				<label>Finish Date</label>
				<fieldset>
					{{input_date('finish')}}
				</fieldset>
														
				<label>kWh</label> {{input_text('kwh', '0')}}
				<label>Net</label> {{input_text('net', '0.00')}}
				<label>VAT</label> {{input_text('vat', '0.00')}}
				<label>Gross</label> {{input_text('gross', '0.00')}}
				<label>Account</label> {{input_text('account', account)}}
				<label>Type</label>
				<select name="bill_type_id">
					{% for bill_type in bill_types %}
						<p>{{normal_bill_type_id}} {{bill_type.id}}</p>
							{{input_option('bill_type_id', bill_type.id, bill_type.code, normal_bill_type_id)}}
					{% endfor %}
				</select>
				<label>Breakdown</label>
				{{input_text('breakdown', '{}')}}
			</fieldset>
			<input type="submit" value="Add">
		</fieldset>
	</form>

{% endblock %}
