<table class="order" style="width:100%;">

	<thead>
	
		<tr>
			<th class="buttons"></th>
			<th class="pos">Pos.</th>
			<th class="quantity">St.</th>
			<th class="item">Beschreibung/Art-Nr.</th>
			<th class="tax_rate">MwSt.</th>
			<th class="price">St&uuml;ckpreis</th>
			<th class="total">Gesamtpreis</th>
		</tr>
		
		<tr>
			<th colspan="7"><hr /></th>
		</tr>
		
	</thead>
	
	<tfoot>
	
		<tr>
			<td colspan="7"><hr /></td>
		</tr>
		
		<tr class="item_total">
			<td colspan="3"></td>
			<td colspan="4">
				<span style="font-weight:bold">Summe aller Artikel</span>
				<span class="total">
					{if $order->group_show_tax == '1'}
					<span>
						{if $footer->item_total_with_tax}
							{$footer->item_total_with_tax|number_format:"2":".":""}
						{else}
							0.00
						{/if}
					</span>
					{else}
					<span>
						{if $footer->item_total}
							{$footer->item_total|number_format:"2":".":""}
						{else}
							0.00
						{/if}
					</span>
					{/if}
					&euro;
				</span>
			</td>
		</tr>
				
		<tr class="payment_method">
			<td colspan="3"></td>
			<td colspan="4">
				Zahlungsgeb&uuml;hren
				<span class="total">
					{if $order->group_show_tax == '1'}
					<span>
						{if $footer->payment_method_charges}
							{$footer->payment_method_charges|number_format:"2":".":""}
						{else}
							0.00
						{/if}
					</span>
					{else}
						{if $footer->payment_method_charges}
							{(($footer->payment_method_charges / 119.0) * 100.0)|number_format:"2":".":""}
						{else}
							0.00
						{/if}
					{/if}
					
					&euro;
				</span>
			</td>
		</tr>
		
		<tr class="shipping">
			<td colspan="3">
			<span id="without_shipping_charges" style="display:inline-block;">
				<input style="display:inline;" type="checkbox" name="without_shipping_charges" value="yes" {if $order->without_shipping_charges}checked="checked"{/if} />
				<label style="display:inline;" for="without_shipping_charges">Versandkostenfrei</label>
			</span>
			</td>
			<td colspan="2">
				Versandkosten
			</td>
			<td>
				{if $order->group_show_tax == '1'}
					<input id="manual_shipping_charges" type="text" name="manual_shipping_charges" value="{$footer->shipping_charges} " style="width:56px;display:inline;"> &euro;
				{else}
					<input id="manual_shipping_charges" type="text" name="manual_shipping_charges" value="{(($footer->shipping_charges / 119.0) * 100.0)}" style="width:56px;display:inline;"> &euro;
				{/if}
			</td>
			<td>
				<span class="total">
					<span>
						{if $order->group_show_tax == '1'}
							{if $footer->shipping_charges}
								{$footer->shipping_charges|number_format:"2":".":""}
							{else}
								0.00
							{/if}
						{else}
							{if $footer->shipping_charges}
								{(($footer->shipping_charges / 119.0) * 100.0)|number_format:"2":".":""}
							{else}
								0.00
							{/if}
						{/if}
					</span>
					
					&euro;
				</span>
			</td>
		</tr>
				
		<tr class="tax">
			<td colspan="3"></td>
			{if order_items}
				{if $order->group_show_tax == '1'}
				<td colspan="4" id="tax_target">
					{foreach $footer->taxes as $key => $value}
						<div class="{$key} with_tax">darin enthaltene Mwst. {$key}% <span class="total"><span>{$value|number_format:"2":".":""}</span> &euro;</span></div>
					{/foreach}
				</td>
				{else}
					<td colspan="4" id="tax_target">
						{if $order->is_eu_order == 1}
							<div>Bruttosumme<span class="total"><span>{($footer->item_total + (($footer->payment_method_charges / 119.0) * 100.0) + (($footer->shipping_charges / 119.0) * 100.0))|number_format:"2":".":""}</span> &euro;</span></div>
						{else}
							{foreach $footer->taxes as $key => $value}
								<div class="{$key} without_tax">zzgl. {$key}% Mwst. <span class="total"><span>{$value|number_format:"2":".":""}</span> &euro;</span></div>
							{/foreach}
						{/if}
					</td>
				{/if}
			{else}
			<td colspan="4" id="tax_target">
			</td>
			{/if}
		</tr>
		
		{if $footer->gift_certificate_id}
			<tr class="order_total">
				<td colspan="3"></td>
				<td colspan="4">
					<span style="font-weight:bold;">Zwischen Betrag</span>
					<span class="total">
						<span>
							{if $order->group_show_tax != '1' && $order->is_eu_order == 1}
								{($footer->item_total + (($footer->payment_method_charges / 119.0) * 100.0) + (($footer->shipping_charges / 119.0) * 100.0))|number_format:"2":".":""}
							{else}
								{$footer->order_total_with_tax|number_format:"2":".":""}
							{/if}
						</span>
						
						&euro;
					</span>
				</td>
			</tr>
		
			<tr class="gift_certificate">
				<td colspan="3">
					<input type="hidden" id="giftCertificateId" name="giftCertificate[gift_certificate_id]" value="{$footer->gift_certificate_id}" />
					<input type="hidden" id="giftCertificateCode" name="giftCertificate[gift_certificate_code]" value="{$footer->gift_certificate_code}" />
					<input type="hidden" id="giftCertificateTotal" name="giftCertificate[gift_certificate_total]" value="{$footer->gift_certificate_total}" />
					<input type="hidden" id="giftCertificateType" value="{$footer->gift_certificate_type}" />
					<input type="hidden" id="giftCertificateAmount" value="{$footer->gift_certificate_amount}" />
					<input type="hidden" id="giftCertificateMinOrder" value="{$footer->gift_certificate_min_order}" />
				</td>
				<td colspan="4">
					abzgl. Gutschein {$footer->gift_certificate_code}
					<span class="total">
						<span>
							- {$footer->gift_certificate_total|number_format:"2":".":""}
						</span>
						
						&euro;
					</span>
				</td>
			</tr>
			
			<tr class="order_total_after_gift">
				<td colspan="3"></td>
				<td colspan="4">
					<span style="font-weight:bold;">F&auml;lliger Betrag</span>
					<span class="total">
						<span>
							{if $order->group_show_tax != '1' && $order->is_eu_order == 1}
								{(($footer->item_total + (($footer->payment_method_charges / 119.0) * 100.0) + (($footer->shipping_charges / 119.0) * 100.0)) - $footer->gift_certificate_total)|number_format:"2":".":""}
							{else}
								{($footer->order_total_with_tax - $footer->gift_certificate_total)|number_format:"2":".":""}
							{/if}
						</span>
						
						&euro;
					</span>
				</td>
			</tr>
		{else}
			<tr class="order_total">
				<td colspan="3"></td>
				<td colspan="4">
					<span style="font-weight:bold;">F&auml;lliger Betrag</span>
					<span class="total">
						<span>
							{if $order->group_show_tax != '1' && $order->is_eu_order == 1}
								{($footer->item_total + (($footer->payment_method_charges / 119.0) * 100.0) + (($footer->shipping_charges / 119.0) * 100.0))|number_format:"2":".":""}
							{else}
								{$footer->order_total_with_tax|number_format:"2":".":""}
							{/if}
						</span>
						
						&euro;
					</span>
				</td>
			</tr>
		{/if}
		
	</tfoot>
	
	{if $order_items}
		{foreach from=$order_items item=item}
		<tbody class="table_order_items">
		
			<tr>
			
				<td class="buttons">
					<input type="hidden" name="order_item[stamp][]" value="{$item->stamp}" />
					<input value="{$item->user_data}" name="order_item[user_data][]" type="hidden" />
					<input value="{$item->parent_item_id}" name="order_item[parent_item_id][]" type="hidden" />
					
					<a class="button drop_box_button {if $item->item_status == '1' or $item->item_status == '2'}up{else}down{/if}" title="Artikelstatus setzen"></a>
					<a class="button delete_button delete" title="Artikel l&ouml;schen"></a>
					<input type="hidden" class="is_shippable" value="{$item->shippable}" />
					{if $item->shippable == '0'}
						<img class="shipping_status" src="themes/admin/media/images/red_notice.png" title="nicht lieferbar" />
					{elseif $item->shippable == '1'}
						<img class="shipping_status" src="themes/admin/media/images/green_notice.png" title="lieferbar" />
					{elseif $item->shippable == '2'}
						<img class="shipping_status" src="themes/admin/media/images/orange_notice.png" title="lieferbar ab {$item->available_from} bis {$item->available_till}" />
					{elseif $item->shippable == '3'}
						<img class="shipping_status" src="themes/admin/media/images/orange_notice.png" title="lieferzeit unbekannt" />
					{/if}
				</td>
				
				<td class="pos">
					{$item@index + 1}
				</td>
				
				<td class="quantity">
					<input class="item_id" type="hidden" name="order_item[item_id][]" value="{$item->item_id}" />
					<input class="amount_old" type="hidden" name="order_item[amount_old][]" value="{$item->amount}" />
					<input class="amount" type="text" name="order_item[amount][]" value="{$item->amount}" {if $item->item_status == '1'}readonly="readonly"{/if}/>
				</td>
				
				<td class="item">
					<a href="./index.php?admin_modul=admin_item_editor&action=edit&id={$item->item_id}" target="_blank">{$item->item_name}</a>
					<div>
					Art-Nr.: {$item->item_number}
					</div>
				</td>
				
				<td class="tax_rate">
					<input type="hidden" class="taxes" name="order_item[taxes][]" value="{$item->taxes}" />
					<span>{$item->tax_rate}</span> %
				</td>
				
				<td class="price">
					<input type="text" name="order_item[price][]" class="item_price_edit" value="{$item->shown_amount|number_format:"2":".":""}" /> &euro;
				</td>
				
				<td class="total">
					<span>{$item->shown_total|number_format:"2":".":""}</span> &euro;
				</td>
			
			</tr>
			
			<tr class="hidable" >
			
				<td colspan="3"></td>
				
				<td>{if $item->variant1}{if $item->vn1}{$item->vn1}: {else}Attr.: {/if}{$item->variant1}{else}-{/if}</td>
				
				<td colspan="2">{if $item->variant2}{if $item->vn2}{$item->vn2}: {else}Attr.: {/if}{$item->variant2}{else}-{/if}</td>
				
				<td>
					<input type="hidden" name="order_item[variant1][]" value="{$item->variant1}" class="order_item_variant_1" />
					<input type="hidden" name="order_item[variant2][]" value="{$item->variant2}" class="order_item_variant_2" />
				</td>
			
			</tr>
			
			<tr class="hidable" {if $item->item_status eq '0'}style="display:none;"{/if}>
			
				<td colspan="2">
					<label>Artikel Status</label>
					<select class="item_status" name="order_item[item_status][]">
						<option value="0">-</option>
						<option value="1" {if $item->item_status == '1'}selected="selected"{/if}>nicht lieferbar</option>
						<option value="2" {if $item->item_status == '2'}selected="selected"{/if}>nachliefern</option>
						<option value="3" {if $item->item_status == '3'}selected="selected"{/if}>info</option>
					</select>
				</td>
				
				<td>
					<label>St.</label>
					<select class="backorder_quantity" name="order_item[backorder_quantity][]" {if $item->item_status != '2'}readonly="readonly"{/if} >
					{$num=0}
					{while $num <= $item->amount}
						<option value="{$num}" {if $num == $item->backorder_quantity}selected="selected"{/if}>{$num}</option>
						{$num++}
					{/while}
					</select>
				</td>
				
				<td colspan="2">
					<label>Kommentar</label>
					<input type="text" name="order_item[item_status_text][]" value="{$item->item_status_text}" />
				</td>
				
				<td>
					<label>Datum</label>
					<input class="delivery_date" type="text" name="order_item[delivery_date][]" value="{$item->delivery_date}" {if $item->item_status != '2'}readonly="readonly"{/if} />
				</td>
				
				<td class="inventory">
					<label>Lager</label>
					<span>{if $item->inventory}{$item->inventory}{else}0{/if}</span>
				</td>
			
			</tr>

			{if $item->children}
				{foreach $item->children as $child}
					<tr class="combination_item">
						<td colspan="7">
							<div style="margin-left:159px;width:320px;clear:both;float:left;">
								<input class="child_quantity" value="{$child->amount}" name="order_item[amount][]" type="hidden" />
								<input value="{$child->item_id}" name="order_item[item_id][]" type="hidden" />
								<input value="{$child->variant1}" name="order_item[variant1][]" type="hidden" />
								<input value="{$child->variant2}" name="order_item[variant2][]" type="hidden" />
								<input value="{$child->taxes}" name="order_item[taxes][]" type="hidden" />
								<input class="child_price" value="{$child->shown_amount}" name="order_item[price][]" type="hidden" />
								<input value="{$child->item_status}" name="order_item[item_status][]" type="hidden" />
								<input value="{$child->item_status_text}" name="order_item[item_status_text][]" type="hidden" />
								<input value="{$child->delivery_date}" name="order_item[delivery_date][]" type="hidden" />
								<input value="{$child->backorder_quantity}" name="order_item[backorder_quantity][]" type="hidden" />
								<input value="{$child->user_data}" name="order_item[user_data][]" type="hidden" />
								<input value="{$child->parent_item_id}" name="order_item[parent_item_id][]" type="hidden" />
								<input value="{$child->stamp}" name="order_item[stamp][]" type="hidden" />
								
								{$child->item_name}
								
								{if $child->variant1 != ''}
									{$child->variant1}
								{/if}
								
								{if $child->variant2 != ''}
									{$child->variant2}
								{/if}
								
								{if $child->user_data != ''}
									{$child->user_data}
								{/if}
								
								{$child->item_number}
							</div>
							<div style="float:right;width:77px;text-align:right;">
								<span class="child_total">{$child->shown_total|number_format:"2":".":""}</span> &euro;
							</div>
						</td>
					</tr>
				{/foreach}
			{/if}

		</tbody>
		{/foreach}
	{/if}

</table>