{% extends "base.html" %}

{% block title %}
	&raquo; MOP Contracts &raquo; {{batch.contract.name}} &raquo; Batches &raquo; 
 	{{batch.reference}} &raquo; Add Bill
{% endblock %}

{% block inside_head %}
	<style>
		label {
			width: 6em;
			float: left;
		}
	</style>
{% endblock %}

{% block nav %}
	<a href="/e/mop_contracts">MOP Contracts</a> &raquo; 
	<a href="/e/mop_contracts/{{batch.contract.id}}">{{batch.contract.name}}</a> &raquo; 
	<a href="/e/mop_batches?mop_contract_id={{batch.contract.id}}">Batches</a> &raquo; 
	<a href="/e/mop_batches/{{batch.id}}">{{batch.reference}}</a>
 	&raquo; Add Bill
{% endblock %}

{% block content %}

	<form method="post">
		<fieldset>
			<legend>Add A Bill</legend>
			<label>MPAN Core</label> {{input_text('mpan_core')}}
			<label>Reference</label> {{input_text('reference')}}
			<fieldset>
				<legend>Issue Date</legend>
				{{input_date('issue')}}
			</fieldset>
				
			<fieldset>
				<legend>Start Date</legend>
				{{input_date('start')}}
			</fieldset>
				
			<fieldset>
				<legend>Finish Date</legend>
				{{input_date('finish')}}
			</fieldset>
			<label>kWh</label> {{input_text('kwh', '0')}}
			<label>Net</label> {{input_text('net', '0')}}
			<label>VAT</label> {{input_text('vat', '0')}}
			<label>Gross</label> {{input_text('gross', '0')}}
			<label>Account</label> {{input_text('account', '0')}}
			<label>Type</label> 
			<select name="bill_type_id">
				{% for bill_type in bill_types %}
					{{input_option('bill_type_id', bill_type.id, bill_type.code, bill_type.description)}}
				{% endfor %}
			</select>
			<label>Breakdown</label> {{input_text('breakdown', '{}')}}
			<input type="submit" value="Add">
		</fieldset>
	</form>
{% endblock %}
