<div class="content2 all_opent_ticket">
  <h1>{{@page_data.title}}</h1>
  <include href="pagination.htm" />

  <repeat group="{{@receipts}}" value="{{@receipt}}">
  <div class="open_ticket">
    <div class="ticket_body">
      <table width="100%">
        <tr>
          <td width="68"></td>
          <td width="68"></td>
          <td width="48"></td>
          <td width="90"></td>
        </tr>
        <tr>
          <td>
            <big><b>{{@base_settings['cafe_mode']==1?@receipt.order_number:@receipt.id}}</b></big>
          </td>
          <td colspan="3">
            {{number_format(@receipt.lines_sum, 2, '.', '')}}
          </td>
        </tr>
        <tr>
          <td colspan="4">
            {{@receipt.short_name}}
          </td>
        </tr>
        <check if="{{@base_settings['multikassa']==1}}">
        <tr>
          <td>
            <b>Касса</b>
          </td>
          <td colspan="3">
            {{@receipt.rm}}
          </td>
        </tr>
        </check>
        <check if="{{@base_settings['cafe_mode']==1}}">
        <tr>
          <td>
            <b>Зал</b>
          </td>
          <td colspan="3">
            {{@receipt.room_title}}
          </td>
        </tr>
        <tr>
          <td>
            <b>Стол</b>
          </td>
          <td colspan="3">
            {{@receipt.table_title}}
          </td>
        </tr>
        </check>
        <check if="{{@receipt.partner_name}}">
        <tr>
          <td colspan="4">
            <b>Клиент</b>:
            {{@receipt.partner_name}}
          </td>
        </tr>
        </check>
        <check if="{{@receipt.description}}">
          <tr>
            <td colspan="4">
            <small>{{@receipt.description}}</small>
            </td>
          </tr>
        </check>
        <repeat group="{{@receipt.lines}}" value="{{@l}}">
        <tr>
          <td colspan="2">
            {{@l.product_title}}
          </td>
          <td align="right">
            {{numberformat(@l.count, 3, '.', '')}}X
          </td>
          <td align="right">
            {~@l.discount=@receipt.discount~}
            {~if(@l.loyalty) @l.discount=0~}
            {~@price=@l.price+(@l.price*(@l.vat/100))*max(0, @l.vat_type)~}
            {~@price=round(@price, 2)~}
            {~@d_sum=@price*(@l.discount/100)~}
            {~@price-=@d_sum~}
            {{number_format(@price, 2, '.', '')}}
            &equiv;
            {~@total=@price*@l.count~}
            {{number_format(@total, 2, '.', '')}}
          </td>
        </tr>
        </repeat>
      </table>
      <check if="{{@receipt.user_id!=@authorization_user.id || (@base_settings['cafe_mode']==1 &&  @receipt.table_id==0) || (@base_settings['cafe_mode']==0 &&  @receipt.table_id!=0) || @receipt.ip}}">
        <true>
      <input type="button" class="show_window" href="/messages/continue?uri={{urlencode("/receipts/intercept?id=".@receipt.id.(@receipt.ip?'-'.@receipt.ip:''))}}" value="Перехват">
        </true>
        <false>
      <input type="button" class="send_ajax" href="/receipts/switch?id={{@receipt.id}}" value="Выбрать">
        </false>
      </check>
    </div>
  </div>
  </repeat>
</div>
