<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>

<div class="panel panel_invoice">

  <div class="pnl_formsarea">
    <fieldset class="inlineLabels"><legend>Address</legend>
      <div class="ctrlHolder">
      	<label for="invoice_type">{tmpl_var name='invoice_type_txt'}</label>
        <select name="invoice_type" id="invoice_type" class="selectInput" disabled="disabled">
					{tmpl_var name='invoice_type'}
		</select>
      </div>
	  <div class="ctrlHolder">
      	<label for="invoice_company_id">{tmpl_var name='invoice_company_id_txt'}</label>
        <select name="invoice_company_id" id="invoice_company_id" class="selectInput">
					{tmpl_var name='invoice_company_id'}
				</select>
      </div>
	  <div class="ctrlHolder">
      	<label for="client_id">{tmpl_var name='client_id_txt'}</label>
        <select name="client_id" id="client_id" class="selectInput" onChange="submitForm('pageForm','billing/invoice_edit.php?action=loadtemplate');">
					{tmpl_var name='client_id'}
		</select>
      </div>
      <div class="ctrlHolder">
      	<label for="invoice_number">{tmpl_var name='invoice_number_txt'}</label>
        <input name="invoice_number" id="invoice_number" value="{tmpl_var name='invoice_number'}" size="15" maxlength="255" type="hidden" class="textInput" /> {tmpl_var name='invoice_number'}
			</div>
      <div class="ctrlHolder">
      	<label for="invoice_date">{tmpl_var name='invoice_date_txt'}</label>
        <input name="invoice_date" id="invoice_date" value="{tmpl_var name='invoice_date'}" size="15" maxlength="15" type="text" class="textInput formLengthDate" />
			</div>
      <div class="ctrlHolder">
      	<label for="company_name">{tmpl_var name='company_name_txt'}</label>
        <input name="company_name" id="company_name" value="{tmpl_var name='company_name'}" size="30" maxlength="255" type="text" class="textInput" />
			</div>
      <div class="ctrlHolder">
      	<label for="contact_name">{tmpl_var name='contact_name_txt'}</label>
        <input name="contact_name" id="contact_name" value="{tmpl_var name='contact_name'}" size="30" maxlength="255" type="text" class="textInput" />
			</div>
      <div class="ctrlHolder">
      	<label for="street">{tmpl_var name='street_txt'}</label>
        <input name="street" id="street" value="{tmpl_var name='street'}" size="30" maxlength="255" type="text" class="textInput" />
			</div>
      <div class="ctrlHolder">
      	<label for="zip">{tmpl_var name='zip_txt'}</label>
        <input name="zip" id="zip" value="{tmpl_var name='zip'}" size="10" maxlength="255" type="text" class="textInput" />
			</div>
      <div class="ctrlHolder">
      	<label for="city">{tmpl_var name='city_txt'}</label>
        <input name="city" id="city" value="{tmpl_var name='city'}" size="30" maxlength="255" type="text" class="textInput" />
			</div>
      <div class="ctrlHolder">
      	<label for="state">{tmpl_var name='state_txt'}</label>
        <input name="state" id="state" value="{tmpl_var name='state'}" size="30" maxlength="255" type="text" class="textInput" />
			</div>
      <div class="ctrlHolder">
      	<label for="country">{tmpl_var name='country_txt'}</label>
        <select name="country" id="country" class="selectInput withicons">
					{tmpl_var name='country'}
				</select>
      </div>
      <div class="ctrlHolder">
      	<label for="email">{tmpl_var name='email_txt'}</label>
        <input name="email" id="email" value="{tmpl_var name='email'}" size="30" maxlength="255" type="text" class="textInput" />
			</div>
	  <div class="ctrlHolder">
      	<label for="email">{tmpl_var name='vat_id_txt'}</label>
        <input name="vat_id" id="vat_id" value="{tmpl_var name='vat_id'}" size="30" maxlength="255" type="text" class="textInput" />
			</div>
      <div class="ctrlHolder">
      	<label for="payment_terms">{tmpl_var name='payment_terms_txt'}</label>
        <select name="payment_terms" id="payment_terms" class="selectInput">
					{tmpl_var name='payment_terms'}
				</select>
      </div>
	  <div class="ctrlHolder">
      	<label for="payment_gateway">{tmpl_var name='payment_gateway_txt'}</label>
        <select name="payment_gateway" id="payment_gateway" class="selectInput">
					{tmpl_var name='payment_gateway'}
				</select>
      </div>
      <div class="ctrlHolder">
				<p class="label">{tmpl_var name='status_printed_txt'}</p>
					<div class="multiField">
						{tmpl_var name='status_printed'}
					</div>
			</div>
      <div class="ctrlHolder">
				<p class="label">{tmpl_var name='status_sent_txt'}</p>
					<div class="multiField">
						{tmpl_var name='status_sent'}
					</div>
			</div>
      <div class="ctrlHolder">
				<p class="label">{tmpl_var name='status_paid_txt'}</p>
					<div class="multiField">
						{tmpl_var name='status_paid'}
					</div>
			</div>
		<tmpl_if name='list' op='==' value=''>
      <div class="ctrlHolder">
				<p class="label">{tmpl_var name='status_reminded_txt'}</p>
					<div class="multiField">
						{tmpl_var name='status_reminded'}
					</div>
			</div>
		<div class="ctrlHolder">
				<p class="label">{tmpl_var name='status_refunded_txt'}</p>
					<div class="multiField">
						{tmpl_var name='status_refunded'}
					</div>
			</div>
		</tmpl_if>
	  <div class="ctrlHolder">
      	<label for="payment_date">{tmpl_var name='payment_date_txt'}</label>
        <input name="payment_date" id="payment_date" value="{tmpl_var name='payment_date'}" size="15" maxlength="15" type="text" class="textInput formLengthDate" />
	  </div>
      <div class="ctrlHolder">
      	<label for="invoice_amount">{tmpl_var name='invoice_amount_txt'}</label>
        <input name="invoice_amount" id="invoice_amount" value="{tmpl_var name='invoice_amount'}" size="15" maxlength="255" type="hidden" class="textInput" /> {tmpl_var name='invoice_amount'} {tmpl_var name='currency_txt'}
			</div>
      <div class="ctrlHolder">
      	<label for="notes">{tmpl_var name='notes_txt'} <div class="ttip" title="{tmpl_var name='notes_ttip_txt'}"></div></label>
        <textarea name="notes" id="notes" rows='10' cols='30'>{tmpl_var name='notes'}</textarea>
      </div>
	  <div class="ctrlHolder">
      	<label for="annotation">{tmpl_var name='annotation_txt'} <div class="ttip" title="{tmpl_var name='annotation_ttip_txt'}"></div></label>
        <textarea name="annotation" id="annotation" rows='10' cols='30'>{tmpl_var name='annotation'}</textarea>
      </div>
    </fieldset>

    <input type="hidden" name="id" value="{tmpl_var name='id'}">
	<input type="hidden" name="list" value="{tmpl_var name='list'}">

    <div class="buttonHolder buttons">
      <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','billing/invoice_edit.php');"><span>{tmpl_var name='btn_save_draft_txt'}</span></button>
	  <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','billing/invoice_edit.php?action=finalize_invoice');"><span>{tmpl_var name='btn_save_finalize_txt'}</span></button>
	  <button class="positive iconstxt icoAdd" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="javascript:changeTab('invoice_items','billing/invoice_edit.php')"><span>{tmpl_var name='btn_add_items_txt'}</span></button>
      <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('{tmpl_var name="cancel_url"}');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
    </div>
  </div>
  
</div>
<script language="JavaScript" type="text/javascript">
		var invoice_type = jQuery('#invoice_type').val();
		jQuery('#invoice_type').attr({name: 'invoice_type_disabled', id: 'invoice_type_disabled'});
		jQuery('#invoice_type_disabled').after('<input type="hidden" name="invoice_type" value="'+invoice_type+'">');
			
</script>
<script language="JavaScript" type="text/javascript">
		jQuery( "#invoice_date" ).datepicker({ dateFormat: '<tmpl_var name="date_format">', changeMonth: true, changeYear: true, yearRange: '-100:+100', dayNamesMin: ['<tmpl_var name="daynamesmin_su">','<tmpl_var name="daynamesmin_mo">','<tmpl_var name="daynamesmin_tu">','<tmpl_var name="daynamesmin_we">','<tmpl_var name="daynamesmin_th">','<tmpl_var name="daynamesmin_fr">','<tmpl_var name="daynamesmin_sa">'], dayNames: ['<tmpl_var name="daynames_sunday">','<tmpl_var name="daynames_monday">','<tmpl_var name="daynames_tuesday">','<tmpl_var name="daynames_wednesday">','<tmpl_var name="daynames_thursday">','<tmpl_var name="daynames_friday">','<tmpl_var name="daynames_saturday">'], monthNamesShort: ['<tmpl_var name="monthnamesshort_jan">','<tmpl_var name="monthnamesshort_feb">','<tmpl_var name="monthnamesshort_mar">','<tmpl_var name="monthnamesshort_apr">','<tmpl_var name="monthnamesshort_may">','<tmpl_var name="monthnamesshort_jun">','<tmpl_var name="monthnamesshort_jul">','<tmpl_var name="monthnamesshort_aug">','<tmpl_var name="monthnamesshort_sep">','<tmpl_var name="monthnamesshort_oct">','<tmpl_var name="monthnamesshort_nov">','<tmpl_var name="monthnamesshort_dec">'], nextText: '<tmpl_var name="datepicker_nextText">', prevText: '<tmpl_var name="datepicker_prevText">', firstDay: 1 });
		jQuery( "#payment_date" ).datepicker({ dateFormat: '<tmpl_var name="date_format">', changeMonth: true, changeYear: true, yearRange: '-100:+100', dayNamesMin: ['<tmpl_var name="daynamesmin_su">','<tmpl_var name="daynamesmin_mo">','<tmpl_var name="daynamesmin_tu">','<tmpl_var name="daynamesmin_we">','<tmpl_var name="daynamesmin_th">','<tmpl_var name="daynamesmin_fr">','<tmpl_var name="daynamesmin_sa">'], dayNames: ['<tmpl_var name="daynames_sunday">','<tmpl_var name="daynames_monday">','<tmpl_var name="daynames_tuesday">','<tmpl_var name="daynames_wednesday">','<tmpl_var name="daynames_thursday">','<tmpl_var name="daynames_friday">','<tmpl_var name="daynames_saturday">'], monthNamesShort: ['<tmpl_var name="monthnamesshort_jan">','<tmpl_var name="monthnamesshort_feb">','<tmpl_var name="monthnamesshort_mar">','<tmpl_var name="monthnamesshort_apr">','<tmpl_var name="monthnamesshort_may">','<tmpl_var name="monthnamesshort_jun">','<tmpl_var name="monthnamesshort_jul">','<tmpl_var name="monthnamesshort_aug">','<tmpl_var name="monthnamesshort_sep">','<tmpl_var name="monthnamesshort_oct">','<tmpl_var name="monthnamesshort_nov">','<tmpl_var name="monthnamesshort_dec">'], nextText: '<tmpl_var name="datepicker_nextText">', prevText: '<tmpl_var name="datepicker_prevText">', firstDay: 1 });
</script>