{% extends "base.html" %}

{% block title %}
	&raquo; DC Contracts &raquo; {{batch.contract.name}} &raquo; Batches &raquo; 
 	{{batch.reference}} &raquo; Edit
{% endblock %}

{% block nav %}
	<a href="/e/dc_contracts">DC Contracts</a> &raquo; 
	<a href="/e/dc_contracts/{{batch.contract.id}}">{{batch.contract.name}}</a>
	&raquo; 
	<a href="/e/dc_contracts/{{batch.contract.id}}/batches">Batches</a>
	&raquo; 
	<a href="/e/dc_batches/{{batch.id}}">{{batch.reference}}</a> &raquo; Edit
{% endblock %}

{% block content %}


	<form method="post">
		<fieldset>
			<legend>Update batch</legend>
			<label>Reference</label> {{input_text('reference', batch.reference)}}
			<label>Description</label> {{input_text('description', batch.description)}}
			<input type="submit" name="update" value="Update">
		</fieldset>
	</form>

	<form hx-post="/e/dc_batches/{{batch.id}}/edit"
				hx-confirm="Are you sure you want to delete all the bills in this batch?">
		<fieldset>
			<legend>Delete All The Bills In This Batch</legend>
			<input type="submit" name="delete_bills" value="Delete">
		</fieldset>
	</form>

	<form hx-post="/e/dc_batches/{{batch.id}}/edit"
			hx-confirm="Are you sure you want to delete all the bills in this batch and then re-import bills from the files?">
		<fieldset>
			<legend>Delete All The Bills In This Batch And Then Re-Import From The Files</legend>
			<input type="submit" name="delete_import_bills" value="Re-Import">
		</fieldset>
	</form>

	<form hx-post="/e/dc_batches/{{batch.id}}/edit" hx-confirm="Are you sure you want to import the bills from the files into this batch?">
		<fieldset>
			<legend>
				Import The Bills From The Files Into This Batch
			</legend>
			<input type="submit" name="import_bills" value="Import">
		</fieldset>
	</form>

	<form hx-delete="/e/dc_batches/{{batch.id}}/edit"
		 	  hx-confirm="Are you sure you want to delete this batch and all its bills?">
		<fieldset>
			<legend>Delete this batch</legend>
			<input type="submit" name="delete" value="Delete">
		</fieldset>
	</form>

{% endblock %}
