<div style="position:relative;left:10px;width:1000px;">

<h2>Bestellung {$mod}</h2>

<form id="admin_order_editor_form" class="edit" method="post" action="./index.php?admin_modul=admin_order_editor&action=submit" >

{if $order->id}
	<input id="order_id" type="hidden" name="id" value="{$order->id}" />
{/if}

{if $order->order_number}
	<input type="hidden" name="orderInfo[order_number]" value="{$order->order_number}" />
{/if}

{if $order->order_revision}
	<input type="hidden" name="orderInfo[order_revision]" value="{$order->order_revision}" />
{/if}

{if $order->order_addendum}
	<input type="hidden" name="orderInfo[order_addendum]" value="{$order->order_addendum}" />
{/if}

{if $order->export_to_shipping}
	<input type="hidden" name="export_to_shipping" value="{$order->export_to_shipping}" />
{/if}

<input type="hidden" name="paypal[paypal_token]" value="{$order->paypal_token}" />
<input type="hidden" name="paypal[paypal_email]" value="{$order->paypal_email}" />
<input type="hidden" name="paypal[paypal_payerid]" value="{$order->paypal_payerid}" />
<input type="hidden" name="paypal[paypal_transaction_id]" value="{$order->paypal_transaction_id}" />

<input type="hidden" name="klarna[klarna_invoice_number]" value="{$order->klarna_invoice_number}" />

<input type="hidden" name="paymorrow[paymorrow_request_id]" value="{$order->paymorrow_request_id}" />
<input type="hidden" name="paymorrow[paymorrow_transaction_id]" value="{$order->paymorrow_transaction_id}" />
<input type="hidden" name="paymorrow[paymorrow_response_result_code]" value="{$order->paymorrow_response_result_code}" />
<input type="hidden" name="paymorrow[paymorrow_response_status_code]" value="{$order->paymorrow_response_status_code}" />
<input type="hidden" name="paymorrow[paymorrow_response_timestamp]" value="{$order->paymorrow_response_timestamp}" />
<input type="hidden" name="paymorrow[paymorrow_bic]" value="{$order->paymorrow_bic}" />
<input type="hidden" name="paymorrow[paymorrow_iban]" value="{$order->paymorrow_iban}" />
<input type="hidden" name="paymorrow[paymorrow_national_bank_code]" value="{$order->paymorrow_national_bank_code}" />
<input type="hidden" name="paymorrow[paymorrow_national_bank_account_number]" value="{$order->paymorrow_national_bank_account_number}" />
<input type="hidden" name="paymorrow[paymorrow_payment_reference]" value="{$order->paymorrow_payment_reference}" />

<!-- INVENTORY MANAGEMENT -->
<input type="hidden" name="inventory_management[inventory_decremented]" value="{$order->inventory_decremented}" />
<input type="hidden" name="inventory_management[inventory_decremented_date]" value="{$order->inventory_decremented_date}" />
<input type="hidden" name="inventory_management[inventory_incremented]" value="{$order->inventory_incremented}" />
<input type="hidden" name="inventory_management[inventory_incremented_date]" value="{$order->inventory_incremented_date}" />
<!-- END INVENTORY MANAGEMENT -->

<!--  EMAIL INVOICING -->
<input type="hidden" name="invoice_email[invoice_email_sent]" value="{$order->invoice_email_sent}" />
<input type="hidden" name="invoice_email[invoice_email_date]" value="{$order->invoice_email_date}" />
<input type="hidden" name="invoice_email[invoice_email_recipient]" value="{$order->invoice_email_recipient}" />
<!-- END EMAIL INVOICING -->
<div id="adminLeftFloater">

	<div title="Stammdaten" id="base">
	
		<span id="item_tax_marking" style="float:right;">{if $order->id && $order->group_show_tax == 1}Brutto{elseif $order->id && $order->group_show_tax == 0}Netto{/if}</span>
		
		<div class="edit_title">Artikelsuche</div>
		<div class="edit_element_3_5">
			<input type="text" id="item_search" autocomplete="off" {if !$order->customer_id}disabled="disabled"{/if} />
			<div id="item_search_results" class="search_results hidden"></div>
		</div>
		<div class="edit_element_2_5">
			<span id="item_search_hits"></span>
		</div>
		<div class="edit_endline"></div>
		
		<div class="edit_title">Artikelliste</div>
		{$order_list}
		<div class="edit_endline" style="margin-top:10px;" ></div>

		
		<input type="checkbox" name="set_inventory" value="1" {if $order->set_inventory}checked{/if} style="display:inline;" /><label for="set_inventory" style="display:inline;">Artikellagerbestand gebucht</label>
		<div class="edit_endline" style="margin-top:10px;" ></div>
		
		
		{if !$order->customer_id}
		<div id="customer_search_widget">
			<div class="edit_title">Kundensuche</div>
			<div>
				<div class="edit_element_3_5">
					<input type="text" id="customer_search" autocomplete="off"/>
					<div id="customer_search_results" ></div>
				</div>
			</div>
			<a target="_blank" href="./index.php?admin_modul=admin_customer_editor" class="order_editor_button" />Neuen Kunden Anlegen</a>
			<div class="edit_endline"></div>
		</div>
		{/if}
			
		<div class="edit_title">Rechnungsadresse</div>
		<div>
			<!-- block null -->
			<div class="edit_element_5_5" style="margin-top:10px; margin-bottom:10px;">
				<label>Rechnungsadresse ausw&auml;hlen.</label>
				<select id="billing_address">
					<option value="-1">Adresse ausw&auml;hlen</option>
					{if $addresses}
						{foreach from=$addresses key=num item=address}
							<option value="{$num}" {if $use_default_address && $address->isDefault}selected="selected"{/if} >{$address->firstname}, {$address->surname}, {$address->street}, {$address->house_number}, {$address->city}</option>
						{/foreach}
					{/if}
				</select>
			</div>
			<!-- end block null -->
		
			<!-- block one -->
			<div class="edit_element_1_5">
				<label>Anrede</label>
				<select name="billingAddress[honorific]">
					<option value="0" {if $order->billing_honorific == '0'}selected="selected"{/if} >Herr</option>
					<option value="1" {if $order->billing_honorific == '1'}selected="selected"{/if} >Frau</option>
					<option value="2" {if $order->billing_honorific == '2'}selected="selected"{/if} >Firma</option>
				</select>
			</div>
			
			<div class="edit_element_2_5">
				<label>Vorname</label><input type="text" name="billingAddress[firstname]" value="{$order->billing_firstname}" />
			</div>
			
			<div class="edit_element_2_5">
				<label>Nachname</label><input type="text" name="billingAddress[surname]" value="{$order->billing_surname}" />
			</div>
			<!-- end block one -->
			
			<!-- block company -->
			<div class="edit_element_5_5" style="margin-top:10px; margin-bottom:10px;">
				<label>Firma</label>
				<input type="text" name="billingAddress[company]" value="{$order->billing_company}" />
			</div>
			<!-- end block company -->
			
			<!-- block two -->
			<div class="edit_element_3_5">
				<label>Strasse</label><input type="text" name="billingAddress[street]" value="{$order->billing_street}" />
			</div>
			
			<div class="edit_element_2_5">
				<label>Haus-Nr.</label><input type="text" name="billingAddress[house_number]" value="{$order->billing_house_number}" />
			</div>
			<!-- end block two -->
			
			<!-- block three -->
			<div class="edit_element_1_5">
				<label>PLZ</label><input type="text" name="billingAddress[zip_code]" value="{$order->billing_zip_code}" />
			</div>
			
			<div class="edit_element_2_5">
				<label>Ort</label><input type="text" name="billingAddress[city]" value="{$order->billing_city}" />
			</div>
			
			<div class="edit_element_2_5">
				<label>Land</label>
				<select id="billingAddresscountry" name="billingAddress[country]">
					{foreach from=$countries item=country}
						<option value="{$country->id}" {if $country->id == $order->billing_country}selected="selected"{/if}>{$country->name}</option>
					{/foreach}
				</select>
			</div>
			<!-- end block three -->
			
		</div>
		<div class="edit_endline"></div>
		
		<div class="edit_title">Versandadresse</div>
		<div>
			<!--  block null -->
			<div class="edit_element_5_5" style="margin-top:5px; margin-bottom:10px;">
				<label>Versandadresse ausw&auml;hlen.</label>
				<select id="shipping_address">
					<option value="-1">Adresse ausw&auml;hlen</option>
					{if $addresses}
						{foreach from=$addresses key=num item=address}
							<option value="{$num}" {if $use_default_address && $address->isDefault}selected="selected"{/if}>{$address->firstname}, {$address->surname}, {$address->street}, {$address->house_number}, {$address->city}</option>
						{/foreach}
					{/if}
				</select>
			</div>
			<!-- end block null -->
			
			<!-- block one -->
			<div class="edit_element_1_5">
				<label>Anrede</label>
				<select name="shippingAddress[honorific]">
					<option value="0" {if $order->shipping_honorific == '0'}selected="selected"{/if} >Herr</option>
					<option value="1" {if $order->shipping_honorific == '1'}selected="selected"{/if} >Frau</option>
					<option value="2" {if $order->shipping_honorific == '2'}selected="selected"{/if} >Firma</option>
				</select>
			</div>
			
			<div class="edit_element_2_5">
				<label>Vorname</label>
				<input type="text" name="shippingAddress[firstname]" value="{$order->shipping_firstname}"/>
			</div>
			
			<div class="edit_element_2_5">
				<label>Nachname</label>
				<input type="text" name="shippingAddress[surname]" value="{$order->shipping_surname}"/>
			</div>
			<!-- end block one -->
			
			<!-- block company -->
			<div class="edit_element_5_5" style="margin-top:5px; margin-bottom:10px;">
				<label>Firma</label>
				<input type="text" name="shippingAddress[company]" value="{$order->shipping_company}" />
			</div>
			<!-- end block company -->
			
			<!-- block two -->
			<div class="edit_element_3_5">
				<label>Strasse</label><input type="text" name="shippingAddress[street]" value="{$order->shipping_street}"/>
			</div>
			
			<div class="edit_element_2_5">
				<label>Haus-Nr.</label><input type="text" name="shippingAddress[house_number]" value="{$order->shipping_house_number}"/>
			</div>
			<!-- end block two -->
			
			<!-- block three -->
			<div class="edit_element_1_5">
				<label>PLZ</label><input type="text" name="shippingAddress[zip_code]" value="{$order->shipping_zip_code}"/>
			</div>
			
			<div class="edit_element_2_5">
				<label>Ort</label><input type="text" name="shippingAddress[city]" value="{$order->shipping_city}"/>
			</div>
			
			<div class="edit_element_2_5">
				<label>Land</label>
				<select id="shippingAddressCountry" name="shippingAddress[country]">
					{foreach from=$countries item=country}
						<option value="{$country->id}" {if $country->id == $order->shipping_country}selected="selected"{/if}>{$country->name}</option>
					{/foreach}
				</select>
			</div>
			<!-- end block three -->
			
		</div>
		<div class="edit_endline"></div>
	
		{if $order->order_status == 9}
			<p style="text-align:center;color:red;">Nachlieferungen werden automatisch generiert, bitte editieren sie die Bestellung selber.</p>
		{else}
			{if $order->order_status == 6 or $order->order_status == 7}
				<p style="text-align:center;color:red;">Bestellungen die ein endgültiges Stadium erreicht haben sollten nicht mehr editiert werde.</p>
			{/if}
			
			<input type="submit" id="submit" value="Bestellung speichern" style="position:relative;left:185px;width: 200px;" />
		{/if}
	</div>
	
	<div title="Kommunikation" id="communication">
		<div class="edit_icon_bar" style="left:380px;">
			<a href="./index.php?admin_modul=admin_cs_ticket_editor&action=add_ticket&order_id={$order->id}"><img class="edit_icon" src="{$THEME_DIR}/media/images/new_item2.png" title="Neue Nachricht" /></a>
		</div>
		<b>Tickets:</b><br>
	
			{if $tickets}
				<table width="100%">
					<thead>
						<tr>
							<th>Ticketnummer</th>
							<th>Erstelldatum</th>
							<th>Titel</th>
							<th>Status</th>
						</tr>
					</thead>
					<tbody>
						{foreach from=$tickets item=ticket}
						<tr>
							<td><a href="./index.php?admin_modul=admin_cs_ticket_editor&action=edit&id={$ticket->id}">{$ticket->number}</a></td>
							<td>{$ticket->create_time}</td>
							<td>{$ticket->first_message->subject}</td>
							<td>
								{if $ticket->state_id == 1}
								neu
								{/if}
								{if $ticket->state_id == 2}
								in Bearbeitung
								{/if}
								{if $ticket->state_id == 3}
								geschlossen
								{/if}
							</td>
						</tr>
						{/foreach}
					</tbody>
				</table>
			{else}
				<p>Keine Tickets vorhanden</p>
			{/if}
	</div>
	
	<div title="DHL" id="dhl">
		
		<b>Pakete:</b><br>
		<div class="edit_element_1_3">
			<label>Verfahren</label>
			<select name="dhl_parcel_type">
				<option value="0">National</option>
				<option value="0">Regionalpaket &Ouml;sterreich</option>
				<option value="0">International EU</option>
				<option value="0">International Non-EU</option>
				<option value="0">Europapaket (Europack)</option>
			</select>
		</div>
		
		<div class="edit_element_1_3">
			<label>Produkt</label>
			<select name="dhl_parcel_type">
				<option value="101">EUROPACK NATIONAL / DHL PAKET (VPP)</option>
				<option value="108">HAUS ZU HAUS BEHÄLTER</option>
			</select>
		</div>
		
		<div class="edit_element_1_3">
			<label>Services</label>
			<select name="dhl_parcel_type">
				<option value="109">Mehrpaket Zustellung Teilauslieferung möglich</option>
				<option value="110">Rückschein</option>
			</select>
		</div>
		
		<div class="edit_element_1_3" style="margin-top:5px; margin-bottom:10px;">
			<label>Gewicht</label>
			<input type="text" name="dhl_parcel_weight" value="0" />
		</div>
		
		
		<div class="edit_element_1_3" style="margin-top:5px; margin-bottom:10px;">
			<label>Teilnahme</label>
			<input type="text" name="dhl_parcel_weight" value="" />
		</div>
		
		
		<div class="edit_element_1_3" style="margin-top:5px; margin-bottom:10px;">
			<label>Zollinhaltserkl&auml;rung</label>
			<input type="text" name="dhl_parcel_weight" value="Aquaristik/Zubeh&ouml;r" />
		</div>
		
		<div class="edit_endline"></div>
		
	</div>
	
	<div title="History" id="history">
		<h3>Bestellung Revisionen</h3>
		
		{if $order_history}
			<table id="order_editor_history_talbe">
				<thead>
					<tr>
						<th>Bestellnummer</th>
						<th>Datum</th>
						<th>Bearbeitet/Erstellt</th>
					</tr>
				</thead>
			{foreach $order_history as $old_order}
				{if $old_order->id == $order->id}
					<tr>
						<td>{$old_order->order_number}{if $old_order->order_revision}-{$old_order->order_revision}{/if}{if $old_order->order_addendum} {$old_order->order_addendum}{/if}</td>
						<td>{$old_order->order_date}</td>
						<td><a href="./index.php?admin_modul=admin_customer_editor&id={$old_order->revisor_id}">{$old_order->revisor_name}</a></td>
					</tr>
				{else}
					<tr>
						<td><a href="./index.php?admin_modul=admin_order_editor&action=edit&id={$old_order->id}">{$old_order->order_number}{if $old_order->order_revision}-{$old_order->order_revision}{/if}{if $old_order->order_addendum} {$old_order->order_addendum}{/if}</a></td>
						<td>{$old_order->order_date}</td>
						<td><a href="./index.php?admin_modul=admin_customer_editor&id={$old_order->revisor_id}">{$old_order->revisor_name}</a></td>
					</tr>
				{/if}
			{/foreach}
			</table>
		{else}
			<p>Keine Bestellungsrevisionen vorhanden</p>
		{/if}
	</div> 
</div> <!-- end adminLeftFloater -->

<div  id="adminRightFloater">

	<div title="Info" id="info_right">
		<div class="info_block">
			<div class="edit_title">Kundentext</div>
			<textarea style="width:300px;" rows="5" name="customer[customer_info]" readonly="readonly" style="width:100%;">{$order->customer_info}</textarea>
		</div>

		<div class="info_block">
			<div class="edit_title">Interna</div>
			<textarea style="width:300px;" rows="5" name="orderNotice[internal_info]" style="width:100%;">{$order->internal_info}</textarea>
		</div>

		<div class="info_block">
			<div class="edit_title">Bestellung</div>
			<p>Druckansicht dieser Bestellung</p>
			<a class="action_button" style="width:288px;" href="./index.php?admin_modul=admin_order_actions&action=get_bop_pdf&order_id={$order->id}" style="font-weight:bold;">Packzettel PDF Herunterladen</a>

            <br />
			<label>Bestellnummer</label>
			<input style="width:300px;" type="input" readonly="readonly" value="{$order->order_number}{if $order->order_revision}-{$order->order_revision}{/if}{if $order->order_addendum} {$order->order_addendum}{/if}" />

			<label>Bestellstatus</label>
			<select style="width:300px;" id="order_status_list" name="orderOptions[order_status]">
				{foreach from=$order_status_list item=status}
					<option value="{$status->id}" {if $status->id == $order->order_status}selected="selected"{/if}>{$status->name}</option>
				{/foreach}
			</select>
			
			<label>Bestelldatum</label>
			<input style="width:300px;" type="text" id="order_date" name="dateOptions[order_date]" value="{$order->order_date}" />
		</div>
		
		<div class="info_block">
			<div class="edit_title">Kunde</div>
			
			<input type="hidden" id="customer_id"  name="customer[customer_id]" value="{$order->customer_id}"/>
			<input type="hidden" id="customer_group_id" name="group_id" value="{$order->group_id}" />
		
			<label>Kundennummer</label>
			<input style="width:300px;" type="text" id="customer_number" name="customer[customer_number]" value="{$order->customer_number}" readonly="readonly" style="color:#003580;"/>
	
			<label>Kunden Name</label>
			<input style="width:300px;" type="text" id="customer_name" name="customer[customer_name]" value="{$order->customer_name}" readonly="readonly" style="color:#003580;"/>
			
			<label>Kunden Gruppe</label>
			<input type="hidden" id="customer_group_shows_taxes" name="show_taxes" value="{$order->group_show_tax}" />
			<input style="width:300px;" type="text" id="customer_group_name" value="{$order->group_name}"  readonly="readonly" style="color:#003580;"/>
			
			<div>
				<input id="is_eu_order" name="order[is_eu_order]" type="checkbox" style="display:inline;" {if $order->is_eu_order == 1}checked="checked"{/if} {if $order->group_show_tax != 0}disabled="disabled"{/if} /><label style="display:inline;">EU-Gesch&auml;fte</label>
			</div>
			
			<label>Ust-ID</label>
			<input id="customer_vat_reg_num" name="order[customer_vat_reg_num]" style="width:300px;" type="text" {if $order->is_eu_order != 1}readonly="readonly"{/if} value="{$order->customer_vat_reg_num}" />
		</div>
		
		<div class="info_block">
			<div class="edit_title">Zahlung</div>
			
			<label>Zahlungsart</label>
			<select style="width:300px;" id="payment_method_list" name="orderOptions[payment_method]">
				{if $payment_method_list}
					{foreach from=$payment_method_list item=method}
						<option value="{$method.id}" {if $method.id == $order->payment_method}selected="selected"{/if}>{$method.name}</option>
					{/foreach}
				{else}
					<option>Versandadressen abh&auml;ngig</option>
				{/if}
			</select>
			
			<label>Zahlungsstatus</label>
			<select style="width:300px;" id="billing_status_list" name="orderOptions[payment_status]">
				{foreach from=$billing_status_list item=status}
					<option value="{$status->id}" {if $status->id == $order->payment_status}selected="selected"{/if}>{$status->name}</option>
				{/foreach}
			</select>
			
			<label>Zahlungsdatum</label>
			<input style="width:300px;" type="text" id="payment_date" name="dateOptions[payment_date]" value="{$order->payment_date}" />
			
			{if $order->payment_method == 4}
			<label>PayPal E-Mail</label>
			<input style="width:300px;" type="text" readonly="readonly" value="{$order->paypal_email}" />
			
			<label>PayPal Kunden-ID</label>
			<input style="width:300px;" type="text" readonly="readonly" value="{$order->paypal_payerid}" />
			
			<label>PayPal Transaktions-ID</label>
			<input style="width:300px;" type="text" readonly="readonly" value="{$order->paypal_transaction_id}" />
			{/if}
			
			{if $order->payment_method == 8 or $order->payment_method == 9}
				<label>Klarna Rechnungsnummer</label>
				<input style="width:300px;" type="text" readonly="readonly" value="{$order->klarna_invoice_number}" />
			{/if}
			
			{if $order->payment_method == 10 or $order->payment_method == 11}
				<labal>Paymorrow Status</labal>
				<input style="width:300px;" type="text" readonly="readonly" value="{$order->paymorrow_response_result_code}" />
			{/if}
		</div>
		
		<div class="info_block">
			<div class="edit_title">Rechnung</div>
			
			{if $order->id and $order->order_status != 9 and $order->billing_date and $order->invoice_number}
				<p>Rechnungs PDF Herunterladen</p>
				<a class="action_button" style="width:288px;" href="./index.php?admin_modul=admin_order_actions&action=get_order_invoice_pdf&order_id={$order->id}" style="font-weight:bold;">PDF Herunterladen</a>
				<br />
				<p>Rechnungs PDF als E-Mail senden an:</p>
				<input style="width:300px;" type="text" id="email_for_invoice_pdf" value="{$order->customer_email}" />
				<a class="action_button" style="width:288px;{if $order->invoice_email_sent}color:green;border:1px solid green;{/if}" id="send_invoice_pdf_to_customer" style="font-weight:bold;">PDF senden</a>
			{else}
				{if !$invoice_number_manual}
					<input type="checkbox" name="generate_invoice_number" value="yes" style="display:inline;" /><label for="generate_invoice_number" style="display:inline;">Rechnung generieren</label>
				{/if}
			{/if}
			
			<label>Rechnungsdatum</label>
			<input style="width:300px;" type="text" id="billing_date" name="dateOptions[billing_date]" value="{$order->billing_date}"  />
			
			<label>Rechnungsnummer</label>
			<input style="width:300px;" type="text" name="orderOptions[invoice_number]" value="{$order->invoice_number}" {if !$invoice_number_manual}readonly="readonly"{/if} />
			
			<label>Rechnungs Nachricht</label>
			<textarea id="invoice_info_notice" style="width:300px;" rows="5" name="orderNotice[invoice_info]" style="width:100%;">{$order->invoice_info}</textarea>
		</div>
		
		<div class="info_block">
			<div class="edit_title">Lieferschein</div>
			
			{if $order->id and $order->shipping_list_number}
				<p>Lieferschein PDF Herunterladen</p>
				<a class="action_button" style="width:288px;" href="./index.php?admin_modul=admin_order_actions&action=get_order_delivery_note_pdf&order_id={$order->id}" style="font-weight:bold;">Lieferschein PDF</a>
				<br />
			{else}
				{if !$shipping_list_number_manual}
					<input type="checkbox" name="generate_shipping_list_number" value="yes" style="display:inline;" /><label for="generate_shipping_list_number" style="display:inline;">Lieferschein generieren</label>
				{/if}
			{/if}
			
			<label>Lieferscheinnummer</label>
			<input style="width:300px;" type="text" name="orderOptions[shipping_list_number]" value="{$order->shipping_list_number}" {if !$shipping_list_number_manual}readonly="readonly"{/if} />
			
			<label>Lieferant</label>
			<select style="width:300px;" id="deliverer_list" name="orderOptions[delivery_method]">
			{if $deliverers}
				{foreach $deliverers as $deliverer}
					<option value="{$deliverer->id}" {if $deliverer->id == $order->shipping_method}selected="selected"{/if}>{$deliverer->name}</option>
				{/foreach}
			{else}
				<option>Versandadressen abhängig</option>
			{/if}
			</select>
			
			<label>Lieferschein Nachricht</label>
			<textarea style="width:300px;" rows="5" name="orderNotice[delivery_note_info]" style="width:100%;">{$order->delivery_note_info}</textarea>
			
			<label>Tracking-Code</label>
			<input style="width:300px;" type=text" name="orderOptions[trackingcode]" value="{$order->trackingcode}" />
		</div>
				
		<div class="info_block">
			<div class="edit_title">Storno</div>
			
			<label>Stornodatum</label>
			<input style="width:300px;" type="text" id="cancellation_date" name="cancellationData[cancellation_date]" value="{$order->cancellation_date}" />
			
			<label>Stornostatus</label>
			<select style="width:300px;" name="cancellationData[cancellation_status]">
				<option value="0">-</option>
				<option value="1" {if $order->cancellation_status == '1'}selected="selected"{/if}>offen</option>
				<option value="2" {if $order->cancellation_status == '2'}selected="selected"{/if}>akzeptiert</option>
				<option value="3" {if $order->cancellation_status == '3'}selected="selected"{/if}>abgelehnt</option>
			</select>
			
			<label>Stornogr&uuml;nde</label>
			<select style="width:300px;" name="cancellationData[cancellation_reason_id]">
				<option>-</option>
				<optgroup label="Kunden Stornierung">
				{foreach $cancellation_reasons as $reason}
					{if $reason->type == '0'}
						<option value="{$reason->id}" {if $reason->id == $order->cancellation_reason_id}selected="selected"{/if}>{$reason->name}</option>
					{/if}
				{/foreach}
				</optgroup>
				<optgroup label="Shop Stornierung">
				{foreach $cancellation_reasons as $reason}
					{if $reason->type == '1'}
						<option value="{$reason->id}" {if $reason->id == $order->cancellation_reason_id}selected="selected"{/if}>{$reason->name}</option>
					{/if}
				{/foreach}
				</optgroup>
			</select>
			
			<label>Stornierungs Nachricht</label>
			<textarea style="width:300px;" rows="5" name="cancellationData[cancellation_info]" style="width:100%;">{$order->cancellation_info}</textarea>
		</div>
	</div>
</div>

</form>
</div>
<script type="text/javascript" src="{$info->base_url}/themes/admin/media/js/admin_order_editor.js"></script>

<script type="text/javascript">
{if $addresses}
	var addresses = new Array();
	
	{foreach from=$addresses key=num item=address}
	addresses[{$num}] = {literal} { {/literal}
		company: '{$address->company}',
		honorific: '{$address->honorific}',
		firstname: '{$address->firstname}',
		surname: '{$address->surname}',
		street: '{$address->street}',
		house_number: '{$address->house_number}',
		zip_code: '{$address->zip_code}',
		city: '{$address->city}',
		country: '{$address->country}',
		phone: '{$address->phone}',
		email: '{$address->email}'
	{literal} } {/literal};
	{/foreach}
{else}
	var addresses = undefined;
{/if}

{if $deliverers}
	var deliverers = new Array();
	
	{foreach $deliverers as $deliverer}
	deliverers[{$deliverer->id}] = {
		price: '{$deliverer->price}',
		name: '{$deliverer->name}'
	};
	{/foreach}
{else}
	var deliverers = undefined;
{/if}

{if $order->id}
	current_shipping_country_id = {$order->shipping_country};
	current_billing_country_id = {$order->billing_country};
{else}
	current_shipping_country_id = 0;
	current_billing_country_id = 0;
{/if}
</script>

{if $info_message}<div class="info_message message">{$info_message}</div>{/if}
{if $warning_message}<div class="warning_message message">{$warning_message}</div>{/if}
{if $error_message}<div class="error_message message">{$error_message}</div>{/if}