{config_load file="$language_path_admin/$language.conf" section="general"}
{config_load file="$language_path_admin/$language.conf" section="invoices_overview"}

<script type="text/javascript">
snippets = new Array();
snippets[0] = new Array('snippet_history','history','&class=invoices&id={$id}');

window.onload=load_snippets();
{literal}
function load_snippets(){
	if(snippets.length > 0 && snippet_counter <= (snippets.length-1) ){
		snippet_div = snippets[snippet_counter][0];
		snippet_page = snippets[snippet_counter][1];
		snippet_params = snippets[snippet_counter][2];
		ajax_show_snippet(snippet_div,snippet_page,snippet_params);
	}
}

/*
 * PRUEFT OB BEIM HINZUFUEGEN VON IMPORT KOSTEN AUCH
 * EIN DATENSATZ GEWAEHLT WURDE
*/
function check_add_costs_form(){
	dom = document.forms['invoice_costs'];
	checked = false;
	for(i=0;i<dom.elements['import_costs_id[]'].length;i++){
		if(dom.elements['import_costs_id[]'][i].checked == true){
			return true;
		}
	}
	return false;
}

/*
 * PRUEFT OB BEIM HINZUFUEGEN VON IMPORT SCHIFF KOSTEN AUCH
 * EIN DATENSATZ GEWAEHLT WURDE
*/
function check_add_ship_costs_form(){
	dom = document.forms['invoice_ship_costs'];
	checked = false;
	for(i=0;i<dom.elements['import_ship_costs_id[]'].length;i++){
		if(dom.elements['import_ship_costs_id[]'][i].checked == true){
			return true;
		}
	}
	return false;
}
{/literal}
</script>



<div id="page_title">{#heading_title#} {$invoice.invoice_number}</div>

{if $invoice.action_array}
	{draw_actions items=$invoice.action_array}
{/if}

<div class="main">
	<div class="main" style="float:left;">
	<table border="0" cellspacing="0" cellpadding="3">
	<tr>
		<th class="main">{#date_added#}</td><td class="main">{$invoice.date_added|date_format:"%d.%m.%Y"}</td>
	</tr>
	<tr>
		<th class="main">{#status#}</td><td class="main">{$invoice.status_name}</td>
	</tr>
	<tr>
		<th class="main">{#import_number#}</td><td class="main">{$invoice.import_number}</td>
	</tr>
	</table>
	</div>
	<div style="clear:both;"></div>
	

	<div class="main" style="float:left;">{draw_address_table title=#recipient_address# values=$invoice.recipient_address source="company"}</div>
	<div style="clear:both;"></div>

	{if $invoice.comments != ''}
	<br />
		{if $invoice.comments != ''}
	<div class="main" style="float:left;">{include file="snippet_import_comments.html"}</div>
		{/if}
	<div style="clear:both;"></div>
	<br />
	{/if}
</div>
<br />

<div class="main">
	{include file="snippet_invoice_import_costs.html"}
</div>
<br />

<div class="main">
	{include file="snippet_invoice_import_ship_costs.html"}
</div>
<br />

<div class="main">
	{include file="snippet_invoice_entries.html"}
</div>
<br />

<div class="main">
	<b>{#history#}</b>
	<div id="snippet_history"></div>
</div>