{% extends "base.html" %}

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

{% block nav %}
	&raquo; <a href="/dc_contracts">DC Contracts</a> &raquo;
	<a href="/dc_contracts/{{batch.contract.id}}">{{batch.contract.name}}</a> &raquo;
	<a href="/dc_batches?dc_contract_id={{batch.contract.id}}">Batches</a> &raquo;
	<a href="/dc_batches/{{batch.id}}">{{batch.reference}}</a>
 	&raquo; Bill Imports
{% endblock %}

{% block content %}
	<!-- Layer Section -->
        <div class="layer-section">
            <!-- Section Header -->
            <div class="section-header">
                <h2>Import Bill File</h2>
            </div>
            <!-- End Section Header -->
            <!-- Section Content -->
            <div class="section-content">
                <div class="section-data">
                    <div class="standardForm">
                        <form enctype="multipart/form-data" method="post">
            				<fieldset>
    		                    <div class="standardForm">
            					<input type="hidden" name="dc_batch_id" value="{{batch.id}}">
            					<div class="row">
		                            <div class="col-sm-6">
                						<input type="file" name="import_file">
                                    	<input type="submit" value="Import">
            					    </div>
            					</div>
    		                    </div>

            					<p>Valid file name extensions are {{parser_names}}.</p>
            		                        
		                        <div class="noWrap">
		                            <table class="DataTable">
		                                <caption>The '.csv' Format</caption>
		                                <tbody>
		                                    <tr>
		                                        <td># Bill Type (N - Normal, W - Withdrawn or F -Final)</td>
		                                        <td>Account Reference</td>
		                                        <td>Mpans</td>
		                                        <td>Invoice Reference</td>
		                                        <td>Issue Date (YYYY-mm-dd HH:MM)</td>
		                                        <td>Start Date (YYYY-mm-dd HH:MM)</td>
		                                        <td>Finish Date (YYYY-mm-dd HH:MM)</td>
		                                        <td>kWh</td>
		                                        <td>Net</td>
		                                        <td>VAT</td>
		                                        <td>Gross</td>
		                                        <td>Breakdown</td>
		                                        <td>R1 Meter Serial Number</td>
		                                        <td>R1 MPAN</td>
		                                        <td>R1 Coefficient</td>
		                                        <td>R1 Units (kWh, kW, kVA or kVArh)</td>
		                                        <td>R1 TPR (Blank if kW or kVA)</td>
		                                        <td>R1 Previous Read Date</td>
		                                        <td>R1 Previous Read Value</td>
		                                        <td>R1 Previous Read Type</td>
		                                        <td>R1 Present Read Date</td>
		                                        <td>R1 Present Read Value</td>
		                                        <td>R1 Present Read Type</td>
		                                    </tr>
		                                </tbody>
		                            </table>
		                        </div>
		                        <p>
		                            The register read block of fields can be repeated for each register, or
		                            can be left out entirely if the bill doesn't have any readings
		                            associated with it.
		                        </p>
            				</fieldset>
            			</form>
                    </div>
        			{% if importer_ids %}
        				<ul>
        					{% for id in importer_ids %}
        						<li>
        							<a href="/dc_bill_imports/{{id}}">{{id}}</a>
        						</li>
        					{% endfor %}
        				</ul>
        			{% endif %}
                </div>
            </div>
            <!-- End Section Content -->
        </div>
        <!-- End Layer Section -->

	
	
{% endblock %}
