<!-- content_cash_desk/address_invoice.tpl -->
<div class="full_box"> 
	<div class="title_wrapper">
		<div class="title"><h2>Rechnungsanschrift</h2></div>
		<div class="clear"></div>
	</div>
	<div class="box_content">
		<div id="billing_address_container" class="box_padder">
			{if !isset($guest_order) || $guest_order != 1}
			<select class="formatted" id="billing_address_select" name="billing[address]" size="1">
				<option value="">Rechnungsanschrift w&auml;hlen</option>
				<option value="" style="font-weight:bold;color:#990000;">Neue Adresse anlegen</option>
				{foreach from=$addresses key=address_id item=address}
					<option value="{$address_id}" {if (!(isset($personal_data.billing.address) && $personal_data.billing.address) && $customer->default_address == $address_id) || (isset($personal_data.billing.address) && $personal_data.billing.address == $address_id)}selected="selected"{/if}>
					{*{$address->firstname} {$address->surname}, {if $address->company}{$address->company}, {/if}{$address->city}*}
					{if $address->honorific == 0}
						Herr {$address->firstname} {$address->surname}
					{else if $address->honorific == 1}
						Frau {$address->firstname} {$address->surname}
					{else}
						Firma {$address->company}
					{/if}
					,{$address->street} {$address->house_number}, {$address->zip_code} {$address->city},
					{foreach from=$countries item=country}
						{if $country->id == $address->country}
							{$country->name}
						{/if}
					{/foreach}
				</option>
				{/foreach}
			</select>
			<br /><br />
			{else}
				<input id="input_billing_address" type="hidden" name="billing[billing_address]" value="{if isset($personal_data.billing.billing_address) && $personal_data.billing.billing_address}{$personal_data.billing.billing_address}{else}{$customer->default_address}{/if}" />
			{/if}
			<div class="consists_of_3">
				<div style="width:213px;float:left;">
					<label class="obligatory">Anrede <span>*</span></label>
					<select id="billing_honorific" class="formatted obligatory" name="billing[honorific]" title="">
						<option value="">Bitte w&auml;hlen...</option>
						<option value="0" {if isset($personal_data.billing.honorific) && $personal_data.billing.honorific == 0 && $personal_data.billing.honorific != ''}selected{/if}>Herr</option>
						<option value="1" {if isset($personal_data.billing.honorific) && $personal_data.billing.honorific == 1}selected{/if}>Frau</option>
						<option value="2" {if isset($personal_data.billing.honorific) && $personal_data.billing.honorific == 2}selected{/if}>Firma</option>
					</select>
				</div>
				<div style="width:213px;margin-left:20px;float:left;">
					<label class="address_person">Vorname <span>*</span></label>
					<input type="text" id="billing_firstname" class="formatted obligatory" name="billing[firstname]" value="{if isset($personal_data.billing.firstname) && $personal_data.billing.firstname}{$personal_data.billing.firstname}{/if}" title="Vorname" />
				</div>

				<div style="width:213px;margin-left:20px;float:left;">
					<label class="address_person">Nachname <span>*</span></label>
					<input type="text" id="billing_surname" class="formatted obligatory" name="billing[surname]" value="{if isset($personal_data.billing.surname) && $personal_data.billing.surname}{$personal_data.billing.surname}{/if}" title="Nachname" />
				</div>
				<br style="clear:left;" />
			</div>
			<br />

			<div class="consists_of_1">
				<div style="width:680px;float:left;">
					<label class="address_company">Firma <span>*</span></label>
					<input type="text" id="billing_company" class="formatted" name="billing[company]" value="{if isset($personal_data.billing.company) && $personal_data.billing.company}{$personal_data.billing.company}{/if}" title="Firma" />
				</div>
				<br style="clear:left;" />
			</div>
			<br />

			<div class="consists_of_2 split_2_1">
				<div style="width:446px;float:left;">
					<label class="obligatory">Stra&szlig;e <span>*</span></label>
					<input type="text" id="billing_street" class="formatted obligatory" name="billing[street]" value="{if isset($personal_data.billing.street) && $personal_data.billing.street}{$personal_data.billing.street}{/if}" title="Straße" />
				</div>

				<div style="width:213px;margin-left:20px;float:left;">
					<label class="obligatory">Hausnummer <span>*</span></label>
					<input type="text" id="billing_house_number" class="formatted obligatory" name="billing[house_number]" value="{if isset($personal_data.billing.house_number) && $personal_data.billing.house_number}{$personal_data.billing.house_number}{/if}" title="Hausnummer" />
				</div>
				<br style="clear:left;" />
			</div>
			<br />

			<div class="consists_of_3">
				<div style="width:213px;float:left;">
					<label class="obligatory">PLZ <span>*</span></label>
					<input type="text" id="billing_zip_code" class="formatted obligatory" name="billing[zip_code]" value="{if isset($personal_data.billing.zip_code) && $personal_data.billing.zip_code}{$personal_data.billing.zip_code}{/if}" title="PLZ" />
				</div>

				<div style="width:213px;margin-left:20px;float:left;">
					<label class="obligatory">Ort <span>*</span></label>
					<input type="text" id="billing_city" class="formatted obligatory" name="billing[city]" value="{if isset($personal_data.billing.city) && $personal_data.billing.city}{$personal_data.billing.city}{/if}" title="Ort" />
				</div>

				<div style="width:213px;margin-left:20px;float:left;">
					<label class="obligatory">Land <span>*</span></label>
					<select id="bill_country" class="formatted obligatory" name="billing[country]" title="">
						<option value="">Land</option>
						{foreach from=$countries item=country}
							<option value="{$country->id}" {if isset($billing_address['country']) && $billing_address['country'] == $country->id}selected{/if}>{$country->name}</option>
						{/foreach}
					</select>
				</div>
				<br style="clear:left;" />
			</div>
			<br />

			{if isset($guest_order) && $guest_order == 1}
			<div class="consists_of_3">
				<div style="width:213px;float:left;">
					<label class="obligatory">E-Mail <span>*</span></label>
					<input id="guest_order_email" type="text" class="formatted obligatory" name="billing[email]" value="{if isset($personal_data.billing.email) && $personal_data.billing.email}{$personal_data.billing.email}{/if}" title="email" />
				</div>

				<div style="width:213px;margin-left:20px;float:left;">
					<label>Telefon <span>*</span></label>
					<input type="text" id="guest_order_phone" class="formatted" name="billing[phone]" value="{if isset($personal_data.billing.phone) && $personal_data.billing.phone}{$personal_data.billing.phone}{/if}" title="phone" />
				</div>
				<br style="clear:left;" />
			</div>
			{/if}

			{if !isset($guest_order) || $guest_order != 1}
			<div class="consists_of_2 split_2_1">
				<div id="billing_save_message" style="float:left;font-weight:bold;"></div>
				<div style="float:right;">
					<input id="cashdesk_button_save_billing" type="button" class="button" value="&gt;&gt; Daten speichern" />
				</div>

				<br style="clear:both;" />
			</div>
			{/if}

			{if (!isset($guest_order) || $guest_order != 1) && $customer->email == ''}
				<br><br><br><br><br>
				<div class="full_box"> 
					<div class="title_wrapper">
						<div class="title"><h2>E-Mail Adresse für die Bestellbenachrichtigungen</h2></div>
						<div class="clear"></div>
					</div>
					<div class="box_content">
						<div class="consists_of_3">
							<div style="width:500px;float:left;">
								<input id="customer_order_email" type="text" class="formatted obligatory" name="billing[email]" value="{if isset($personal_data.billing.email) && $personal_data.billing.email}{$personal_data.billing.email}{/if}" title="email" style="width:500px;"  />
							</div>
							<br style="clear:left;" />
						</div>
					</div>
				</div>
                        
			{/if}

		</div>
	</div>
</div>
