{title}Quotes Archive{/title}
{add_bread_crumb}Archive{/add_bread_crumb}

{wrap_columns}
  {wrap_content_column}
  	<div class="pagination_container top">
      {if $pagination && $pagination->getLastPage() > 1}
        {pagination pager=$pagination}{assemble route=quotes_archive page='-PAGE-'}{/pagination}
      {/if}
    </div>

    {if is_foreachable($archived_quotes)}
      <div id="quotes">
        <table class="quotes common">
          <tr>
          	<th class="icon"></th>
          	<th class="date">{lang}Closed On{/lang}</th>
          	<th class="name">{lang}Name{/lang}</th>
            <th class="client">{lang}Client{/lang}</th>
            <th class="total">{lang}Total{/lang}</th>
            <th class="options"></th>
          </tr>
        {foreach from=$archived_quotes item=archived_quote}
          <tr class="{cycle values='odd,even'} {if $archived_quote->isWon()}won{elseif $archived_quote->isLost()}lost{/if}">
          	<td class="icon">{if $archived_quote->isWon()}<img src="{image_url name="layout/bits/indicator-ok.png" module=$smary.const.ENVIRONMENT_FRAMEWORK}" alt="ok" />{elseif $archived_quote->isLost()}<img src="{image_url name='icons/16x16/important.png' module=$smarty.const.ENVIRONMENT_FRAMEWORK}" alt="" />{/if}</td>
          	<td class="date">{$archived_quote->getClosedOn()|date}</td>
          	<td class="name"><a href="{$archived_quote->getViewUrl()}">{$archived_quote->getName()}</a></td>
            <td class="client">{company_link company=$archived_quote->getCompany()}</td>
            <td class="total">{$archived_quote->getTaxedTotal()|money} {$archived_quote->getCurrencyCode()}</td>
            <td class="options">{link href=$archived_quote->getViewUrl() title='View Quote Details'}<img src="{image_url name="icons/12x12/preview.png" module=$smarty.const.ENVIRONMENT_FRAMEWORK}" alt="" />{/link}</td>
          </tr>
        {/foreach}
        </table>
      </div>
      {if ($pagination->getLastPage() > 1) && !$pagination->isLast()}
        <p class="next_page"><a href="{assemble route=quotes_archive page=$pagination->getNextPage()}">Next Page</a></p>
      {/if}
    {else}
      <p class="empty_page"><span class="inner">{lang}There are no archived quotes in the database{/lang}</span></p>
    {/if}
  {/wrap_content_column}
  
  {wrap_sidebar_column}
    {include file=get_view_path('tabs', 'quotes', 'invoicing')}
  {/wrap_sidebar_column}
  
{/wrap_columns}