<!-- template content_order_editor/items.tpl -->

{if $orderitems}
	<table class="content_item_view">
		<thead>
			<tr>
				<th style="text-align:center;">Pos.</th>
				<th style="text-align:left;">Art-Nr./Beschreibung</th>
				<th style="text-align:right;">St&uuml;ckpreis</th>
				<th style="text-align:center;">St.</th>
				<th style="text-align:right;">Gesamtpreis</th>
			</tr>

			<tr>
				<th colspan="5">
					<hr />
				</th>
			</tr>
		</thead>

		<tbody>
			{foreach from=$orderitems item=item}
				<tr {if $item@last}class="last"{/if}>
					<td style="text-align:center;">
						{$item@index + 1}
					</td>

					<td style="text-align:left;">
						{$item->item_name}
						<div>Art-Nr.: {$item->item_number}</div>
					</td>

					<td style="text-align:right;">
						<span>
							{if $customer->show_tax}
								{$item->price_with_tax|number_format:2:",":"."} &euro;
								<div>inkl. {$item->tax_rate|number_format:2:",":"."}% MwSt.</div>
							{else}
								{$item->price|number_format:2:",":"."} &euro;
							{/if}
						</span>
					</td>

					<td style="text-align:center;">
						{$item->amount|number_format:2:",":"."}
					</td>

					<td style="text-align:right;">
						{$item->shown_total|number_format:2:",":"."} &euro;
					</td>
				</tr>
			{/foreach}
		</tbody>
		<tfoot>
			<tr>
				<td colspan="5">
					<hr />
				</td>
			</tr>

			<tr class="item_total">
				<td colspan="2"></td>

				<td colspan="2" style="font-weight:bold;"><span style="padding-left:20px;">Summe aller Artikel</span></td>

				<td class="total" style="text-align:right;">
					{if $customer->show_tax}
						{$footer->item_total_with_tax|number_format:2:",":"."} 
					{else}
						{$footer->item_total|number_format:2:",":"."} 
					{/if}
					&euro;
				</td>
			</tr>
			
			{if $footer->taxes|is_array}
				{foreach $footer->taxes as $rate => $tax}
					<tr class="tax">
						<td colspan="2"></td>

						<td colspan="2" class="greyed">
							<span style="padding-left:20px;">
								{if $customer->show_tax}inkl.{else}zzgl.{/if}
								{$rate|number_format:2:",":"."} MwSt.
							</span>
						</td>

						<td class="total" style="text-align:right;">{$tax|number_format:2:",":"."} &euro;</td>
					</tr>
				{/foreach}
			{/if}

			{if $footer->shipping > 0}
				<tr class="shipping">
					<td colspan="2"></td>

					<td colspan="2"><span style="padding-left:20px;">Versandkosten</span></td>

					<td class="total" style="font-weight:normal;text-align:right;">{$footer->shipping|number_format:2:",":"."} &euro;</td>
				</tr>
			{/if}
			
			{if $footer->payment_method > 0}
				<tr class="payment_method">
					<td colspan="2"></td>

					<td colspan="2"><span style="padding-left:20px;">Zahlungsgeb&uuml;hren</span></td>

					<td class="total" style="font-weight:normal;text-align:right;"">{$footer->payment_method|number_format:2:",":"."} &euro;</td>
				</tr>
			{/if}

			<tr class="order_total">
				<td colspan="2"></td>

				<td colspan="2" style="font-weight:bold;"><span style="padding-left:20px;">F&auml;lliger Betrag</span></td>

				<td class="total" style="text-align:right;">{$footer->order_total_with_tax|number_format:2:",":"."} &euro;</td>
			</tr>
		</tfoot>
	</table>
{/if}
