<!-- BEGIN {$smarty.template} -->

{literal}
<script type="text/javascript">

function confirm_delete(quot_id)
{
if (window.confirm('{/literal}{t}Are you sure you want to delete this quotation?{/t} {$quotInfo.quot_number}/{$quotInfo.quot_date}  ({$quotInfo.quot_endsum|phpaga_formatamount} {$quotInfo.curr_name}){literal}')) {
location.href = 'quotation.php?id='+quot_id+'&action={/literal}{$smarty.const.ACTION_DELETE}{literal}';
}

}
</script>
{/literal}

{include file="quotation_print.tpl.html"}

<div id="quottoinv">

  <form action="add_bill.php" method="get">
    <input type="hidden" name="id" value="{$quotInfo.quot_id}">
    <input type="hidden" name="action" value="{$smarty.const.ACTION_FROMQUOTATION}">


    <label for="getquotnum">{t}Use the quotation number as invoice number?{/t}</label>
    <input type="checkbox" name="getquotnum" id="getquotnum" value="1">
    <input type="submit" value="{t}Create invoice{/t}">
    <input type="button" value="{t}Cancel{/t}" onclick="hideElement('quottoinv')">

  </form>


</div>

<table class="stdtable" cellspacing="0">

  <caption><em>{t}Quotation{/t} {$quotInfo.quot_number|wash}/{$quotInfo.quot_date|wash}</em>
    {if $perm_quotations}
    [ <a class="ptr" onclick="confirm_delete({$quotInfo.quot_id});">{t}Delete{/t}</a> |
    <a href="add_quotation.php?id={$quotInfo.quot_id}&amp;action={$smarty.const.ACTION_CLONE}">{t}Clone{/t}</a> |
    <a onclick="showElement('quottoinv'); return false;" href="add_bill.php?id={$quotInfo.quot_id}&amp;action={$smarty.const.ACTION_FROMQUOTATION}">{t}Create invoice{/t}</a> |
    <a href="add_project.php?id={$quotInfo.quot_id}&amp;action={$smarty.const.ACTION_FROMQUOTATION}">{t}Create project{/t}</a> |
    {/if}
    <a class="ptr" onclick="showElement('printbill');">{t}Export PDF{/t}</a> ]
  </caption>

  <tr>
    <td class="label">{t}Quotation nr.{/t}: </td>
    <td class="data"> {$quotInfo.quot_number|wash} </td>
    <td class="label"> {t}Quotation date{/t}: </td>
    <td class="data"> {$quotInfo.quot_date|wash|date_format:$smarty.const.PHPAGA_DATEFORMAT_SHORT} </td>
  </tr>
  <tr>
    <td class="label"> {t}Quotation type{/t}: </td>
    <td class="data"> {$quotInfo.bmt_description|wash} </td>
    <td class="label"> {t}Term of payment{/t}: </td>
    <td class="data"> {$quotInfo.quot_payterm|wash|default:"&nbsp;"} </td>
  </tr>
  <tr>
    <td class="label">{t}Company{/t}: </td>
    <td colspan="3" class="data">{$quotInfo.cpn_name|wash}</td>
  </tr>
  <tr>
    <td class="label"> {t}Contact person{/t}: </td>
    <td class="data" colspan="3"> {$quotInfo.quot_person_recipient|wash|default:"&nbsp;"} </td>
  </tr>
  <tr>
    <td class="label last">{t}Details{/t}: </td>
    <td colspan="3">
      <table class="billdetailstable" cellspacing="0">
	{section name=details loop=$quotInfo.quot_details}
	<tr>
	  {if $quotInfo.quot_details[details].text eq ""}
	  <td class="btext">&nbsp;</td>
	  {else}
	  <td class="bdesc"> {$quotInfo.quot_details[details].text|wash} </td>
	  {/if}
	  {if $quotInfo.quot_details[details].amount eq ""}
	  <td class="bamount">&nbsp;</td>
	  {else}
	  <td class="bnumber"> {$quotInfo.quot_details[details].amount} </td>
	  {/if}
	</tr>
	{/section}
      </table>
    </td>
  </tr>
</table>

<table class="stdtable" cellspacing="0">
  <caption><em><em>{t}Line items{/t}</em></caption>
  <tr>
    <th> {t}Product code{/t} </th>
    <th> {t}Description{/t} </th>
    <th class="time"> {t}Qty./Hours{/t} </th>
    <th class="number"> {t}Net price{/t} </th>
  </tr>
  {section name=lit loop=$quotInfo.lineitems}
  <tr class="{cycle values="odd,even"}">
    <td> {$quotInfo.lineitems[lit].lit_prodcode|default:"&nbsp;"} </td>
    <td class="datawrap"> {$quotInfo.lineitems[lit].lit_desc|wash|nl2br|default:"&nbsp;"} </td>
    <td class="time"> {$quotInfo.lineitems[lit].lit_qty|wash|default:"&nbsp;"} </td>
    <td class="number lr"> {$quotInfo.lineitems[lit].lit_netprice|wash|phpaga_formatamount|default:"&nbsp;"} </td>
  </tr>
  {/section}
</table>

<!-- END {$smarty.template} -->
