# Для заказов

#### Инструкции:

* [Как использовать шаблоны из библиотеки и создавать свои шаблоны документов](https://help.keycrm.app/ru/order-management/kak-sozdat-novyi-shablon-dokumienta-dlia-piechati-dlia-administratorov);
* [Справочник доступных тегов, функций и фильтров Twig](https://help.keycrm.app/ru/keycrm-api/spravochnik-dostupnykh-tieghov-funktsii-i-fil-trov-twig);
* [Примеры решений и ответы на частые вопросы](https://help.keycrm.app/ru/order-management/ch-avo-po-sozdaniiu-dokumientov-2).

### 1. Товарный чек

{% tabs %}
{% tab title="Внешний вид" %}
![](/files/rh5K0XZTRN71lNdGZbzL)
{% endtab %}

{% tab title="Код шаблона" %}
**Тип шаблона:** Заказы

```
<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Invoice</title>
</head>
<body>

<div class="container">

  <table class="width100">
    <tbody>
    <tr>
      <td class="logo-wrapper" valign="top">
          <img src="https://blog.keycrm.app/keycrm/images/keycrm-logo-blue-on-white.png" style="width: 200px;" alt="">
      </td>
      <td valign="top">
        <span style="background-color: yellow">г.Киев ул. Хрещатик, 1</span><br />
        <span style="background-color: yellow">test@ukr.net</span><br />
      </td>
      <td valign="top">
        <span style="background-color: yellow">тел.: +38(050)000-00-00</span><br />
        <span style="background-color: yellow">тел.: +38(050)000-00-00</span><br />
        <span style="background-color: yellow">тел.: +38(050)000-00-00</span><br />
      </td>
    </tr>
    </tbody>
  </table>
  
  <br /><br /><br />

  <table class="width100">
    <tbody>
    <tr>
      <td valign="top" class="label" style="width:50%">
          <span style="background-color: yellow">Поставщик: Company Name</span><br />
          <span style="background-color: yellow">ФОП Тест А.А.</span><br />
          <span style="background-color: yellow">г.Киев ул. Хрещатик, 1</span><br />
          <span style="background-color: yellow">тел.: +38(050)000-00-00</span><br />
      </td>
      <td valign="top" class="label">
          Получатель: {{ model.client_name }}<br />
          тел.: {{ model.client_phone }}<br />
          {% if model.client_email %}
            email: {{ model.client_email }}
          {% endif %}
      </td>
    </tr>
    </tbody>
  </table>
  <br />

  <p class="big-text text-center" style="margin-bottom: 10px">
    {% set mnths = ['','января','февраля','марта','апреля','мая','июня','июля','августа','сентября','октября','ноября','декабря'] %}
    
    Товарный чек №{{ model.id }} от {{ model.created_at|date("j") }} {{ mnths[model.created_at|date("n")] }} {{ model.created_at|date("Y") }} г.
  </p>

  <table class="table-products width100 border">
    <tbody>
        
    <tr>
      <th class="text-center">№</th>
      <th>Код товара</th>
      <th class="name-col">Название товара</th>
      <th>Ед.</th>
      <th>Количество</th>
      <th>Цена</th>
      <th>Сумма</th>
    </tr>
    
    {% for key, product in model.products %}
    <tr>
      <td class="text-center">{{key + 1}}</td>
      <td class="text-center">{{ product.product_sku }}</td>
      <td style="width:50%">{{ product.product_name }}</td>
      <td class="text-center">шт</td>
      <td class="text-center">{{ product.product_quantity }}</td>
      <td class="text-center">{{ product.price_sold|format_currency('UAH', locale='uk') }}</td>
      <td class="text-right">{{ (product.product_quantity * product.price_sold)|format_currency('UAH', locale='uk') }}</td>
    </tr>
    {% endfor %}
    
  </table>
  
  <table class="width100">
    <tr>
      <td align="right">
          <table class="table-sum">
            
            {% if model.discount_amount or model.shipping_price  %}
            <tr>
              <td>Всего за товары:</td>
              <td class="text-right">{{ model.total_price|format_currency('UAH', locale='uk') }}</td>
            </tr>
            {% endif %}
            
            {% if model.discount_amount %}
            <tr>
              <td>Скидка:</td>
              <td class="text-right">{{ model.discount_amount|format_currency('UAH', locale='uk') }}</td>
            </tr>
            {% endif %}
            
            {% if model.shipping_price %}
            <tr>
              <td>Доставка:</td>
              <td class="text-right">{{ model.shipping_price|format_currency('UAH', locale='uk') }}</td>
            </tr>
            {% endif %}
            
            <tr>
              <td>Сумма:</td>
              <td class="text-right">{{ model.grand_total|format_currency('UAH', locale='uk') }}</td>
            </tr>
            </tbody>
          </table>
      </td>
    </tr>
  </table>
 
  <br /><br />
  <table class="table-sum width100">
    <tr>
      <td colspan="2">
          Всего наименований {{ model.products|length }}, на сумму  {{ model.grand_total|format_currency('UAH', locale='uk') }}
      </td>
      <td></td>
    </tr>
    <tr>
      <td>Дата: <span class="label underline">{{ model.created_at|date("j") }} {{ mnths[model.created_at|date("n")] }} {{ model.created_at|date("Y") }} г.</span>    </td>
      <td>Подпись поставщика: &nbsp;&nbsp;&nbsp; ____________________</td>
      <td></td>
    </tr>
  </table>
</div>

</body>
<style>
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html, body {
    height: 100%;
  }
  body {
    font-size: 16px;
    line-height: 1.3;
    min-width: 320px;
    font-family: sans-serif;
    overflow-x: hidden;
  }

  .container {
    margin-right: auto;
    margin-left: auto;
  }

  .text-center {
    text-align: center;
  }

  .text-right {
    text-align: right;
  }

  .label {
    font-weight: bold;
  }
  
  .underline {
      text-decoration: underline;
      font-style: italic;
  }

  .big-text {
    font-size: 18px;
  }
  
  .width100 {
      width: 100%;
  }

  table {
    border-collapse:collapse;
    border-spacing:0;
    height: auto;
  }

  table td {
    padding-right: 5px;
    padding-left: 5px;
    border: none;
  }

  table th {
    background: #d4d4d4;
  }

  table.border td,
  table.border th {
    border: 1px solid black;
  }
  
  table.table-products {
      border: solid 2px black;
  }

  table.table-products th {
    padding: 20px 5px;
  }
  table.table-products td {
    padding: 5px;
  }
  
  table.table-sum {
      margin-top: 7px;
  }
  
  table.table-sum td {
    padding: 3px 5px 3px 15px;
  }

</style>
</html>
```

{% endtab %}
{% endtabs %}

### 2. Расходная накладная

{% tabs %}
{% tab title="Внешний вид" %}
![](/files/rUdDaHQM0JJ27jhmijoo)
{% endtab %}

{% tab title="Код шаблона" %}
**Тип шаблона:** Заказы

```
<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Invoice</title>
</head>
<body>

<div class="container">
    
  <table style="padding-bottom: 10px; border-bottom: solid 3px black; margin-bottom: 10px;">
    <tbody>
    <tr>
      <td>
          <img src="https://blog.keycrm.app/keycrm/images/keycrm-logo-blue-on-white.png" style="height: 40px" alt="">
      </td>
      <td style="font-size: 20px; font-weight: bold; width: 90%">
        {% set mnths = ['','января','февраля','марта','апреля','мая','июня','июля','августа','сентября','октября','ноября','декабря'] %}
    
        Расходная накладная № {{ model.id }} от {{ model.created_at|date("j") }} {{ mnths[model.created_at|date("n")] }} {{ model.created_at|date("Y") }} г.
      </td>
    </tr>
    </tbody>
  </table>
  
  <table>
    <tbody>
    <tr>
      <td valign="top">
          <span style="text-decoration: underline">Поставщик:</span>
      </td>
      <td valign="top" style="padding-bottom: 7px;">
        <strong style="background-color: yellow">ОБЩЕСТВО С ОГРАНИЧЕННОЙ ОТВЕТСТВЕННОСТЬЮ "ТОРГОВЫЙ ДОМ "АЗАРИС"</strong>
        <div style="padding-left: 15px; font-size: 90%;">
        <span style="background-color: yellow">р/с 111111111111111, в банке ПАО "BANK", БИК 1111111</span><br />
        <span style="background-color: yellow">г.Киев ул. Хрещатик, 1, тел.: +38(050)000-00-00,</span><br />
        <span style="background-color: yellow">КПП 1111111, ІПН 111111111111, № свид. 2222222222,</span><br />
        <span style="background-color: yellow">Является плательщиком налога на прибыль на общих основаниях</span>
      </td>
    </tr>
    <tr>
      <td valign="top">
          <span style="text-decoration: underline">Покупатель:</span>
      </td>
      <td valign="top" style="padding-bottom: 7px;">
        <strong>{{ model.client_name }}</strong>
        <div style="padding-left: 15px; font-size: 90%;">
          {% if model.shipping_address %}
            {{ model.shipping_address }},<br />
          {% endif %}
          {% if model.client_phone %}
            {{ model.client_phone }},
          {% endif %}
          {% if model.client_email %}
            {{ model.client_email }}
          {% endif %}
        </div>
      </td>
    </tr>
    <tr>
      <td valign="top">
          <span style="text-decoration: underline">Договор:</span>
      </td>
      <td valign="top" style="padding-bottom: 7px;">
        <span>Основной договор</span>
      </td>
    </tr>
    <tr>
      <td valign="top">
          <span style="text-decoration: underline">Условия поставки:</span>
      </td>
      <td valign="top" style="padding-bottom: 7px;">
        {{ model.shipping_type }}
      </td>
    </tr>
    </tbody>
  </table>

  <br />

  <table class="table-products width100 border">
    <tbody>
        
    <tr>
      <th class="text-center">№</th>
      <th>Артикул</th>
      <th class="name-col">Название товара</th>
      <th>Ед.</th>
      <th>Количество</th>
      <th>Цена</th>
      <th>Сумма</th>
    </tr>
    
    {% for key, product in model.products %}
    <tr>
      <td class="text-center">{{key + 1}}</td>
      <td class="text-center">{{ product.product_sku }}</td>
      <td style="width:50%">{{ product.product_name }}</td>
      <td class="text-center">шт</td>
      <td class="text-center">{{ product.product_quantity }}</td>
      <td class="text-center">{{ product.price_sold|format_currency('UAH', locale='uk') }}</td>
      <td class="text-right">{{ (product.product_quantity * product.price_sold)|format_currency('UAH', locale='uk') }}</td>
    </tr>
    {% endfor %}
    
  </table>
  
  <table class="width100">
    <tr>
      <td align="right">
          <table class="table-sum">
            {% if model.discount_amount or model.shipping_price  %}
            <tr>
              <td>Всего за товары:</td>
              <td class="text-right">{{ model.total_price|format_currency('UAH', locale='uk') }}</td>
            </tr>
            {% endif %}
            
            {% if model.discount_amount %}
            <tr>
              <td>Скидка:</td>
              <td class="text-right">{{ model.discount_amount|format_currency('UAH', locale='uk') }}</td>
            </tr>
            {% endif %}
            
            {% if model.shipping_price %}
            <tr>
              <td>Доставка:</td>
              <td class="text-right">{{ model.shipping_price|format_currency('UAH', locale='uk') }}</td>
            </tr>
            {% endif %}
            
            <tr>
              <td>Итого:</td>
              <td class="text-right">{{ model.grand_total|format_currency('UAH', locale='uk') }}</td>
            </tr>
            </tbody>
          </table>
      </td>
    </tr>
  </table>
  
  <br />
  
  <table>
    <tr>
      <td>
          <strong>Всего наименований {{ model.products|length }}, на сумму  {{ model.grand_total|format_currency('UAH', locale='uk') }}</strong>
      </td>
    </tr>
  </table>
  
  <br />
  
  <table>
    <tr>
      <td>
          Место складирования:
      </td>
      <td>
          <span style="background-color: yellow">г.Киев ул. Хрещатик, 1</span>
      </td>
    </tr>
  </table>
  
  <br />
  
  <table class="width100" style="border-top: solid 3px black;">
    <tr>
      <td valign="top" style="padding-top: 15px; padding-right: 30px;" width="50%">
          <div style="padding-bottom: 35px; margin-bottom: 15px; border-bottom: solid 2px black;">
              <strong>От поставщика*</strong>
          </div>
          <span style="font-size: 90%;">* Ответственный за осуществление хозяйственной операции и правильность ее оформления</span>
      </td>
      <td valign="top" style="padding-top: 15px; padding-right: 30px;">
          <div style="padding-bottom: 35px; margin-bottom: 15px; border-bottom: solid 2px black;">
              <strong>Получил(а)</strong>
          </div>
          <span style="font-size: 90%;">По доверенности &nbsp;&nbsp;&nbsp;&nbsp; № &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; от </span>
      </td>
    </tr>
  </table>
</div>

</body>
<style>
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html, body {
    height: 100%;
  }
  body {
    font-size: 16px;
    line-height: 1.3;
    min-width: 320px;
    font-family: sans-serif;
    overflow-x: hidden;
  }

  .container {
    margin-right: auto;
    margin-left: auto;
  }

  .text-center {
    text-align: center;
  }

  .text-right {
    text-align: right;
  }

  .label {
    font-weight: bold;
  }
  
  .underline {
      text-decoration: underline;
      font-style: italic;
  }

  .big-text {
    font-size: 18px;
  }
  
  .width100 {
      width: 100%;
  }

  table {
    border-collapse:collapse;
    border-spacing:0;
    height: auto;
  }

  table td {
    padding-right: 5px;
    padding-left: 5px;
    border: none;
  }

  table th {
    background: #d4d4d4;
  }

  table.border td,
  table.border th {
    border: 1px solid black;
  }
  
  table.table-products {
      border: solid 2px black;
  }

  table.table-products th {
    padding: 15px 5px;
  }
  table.table-products td {
    padding: 5px;
  }
  
  table.table-sum {
      margin-top: 7px;
  }
  
  table.table-sum td {
    padding: 3px 5px 3px 15px;
  }

</style>
</html>
```

{% endtab %}
{% endtabs %}

### 3. Proforma Invoice для отправки зарубеж (таможенный инвойс)

{% tabs %}
{% tab title="Внешний вид" %}
![](/files/sQkoFWOTzJVP6Lf72ERN)
{% endtab %}

{% tab title="Код шаблона" %}
**Тип шаблона:** Доставка

```
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="author" content="KeyCRM">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
</head>
<body>
<div class="bold text-center">PROFORMA INVOICE</div>
<div>
    <div class="margin"></div>
    <table class="head-table mt-10 mb-10">
        <tbody>
        <tr>
            <td>DATE (дата)</td>
            <td class="text-center">{{ "now"|date("m/d/Y") }} / {{ "now"|date("d/m/Y") }}</td>
        </tr>
        <tr>
            <td>TRK.NO. (номер накладной UPS)</td>
            <td class="text-center">{{ model.tracking_code }}</td>
        </tr>
        </tbody>
    </table>
</div>
<div class="clean-float"><span class="bold">SHIPPER</span> (грузоотправитель)</div>
<table class="second-table">
    <tbody>
    <tr>
        <td>Company name (название компании)</td>
        <td>
            Individual entrepreneur <span style="background-color: yellow">FIRST_NAME LAST_NAME</span>/
            ИП <span style="background-color: yellow">ФАМИЛИЯ ИМЯ ОТЧЕСТВО</span>
        </td>
    </tr>
    <tr>
        <td>TAX ID (ИНН)</td>
        <td><span style="background-color: yellow">< ИНН ></span></td>
    </tr>
    <tr>
        <td>Contact person (контактное лицо)</td>
        <td>
            <span style="background-color: yellow">FIRST_NAME LAST_NAME</span>/
            <span style="background-color: yellow">ФАМИЛИЯ ИМЯ ОТЧЕСТВО</span>
        </td>
    </tr>
    <tr>
        <td>Address (адрес)</td>
        <td>
            <span style="background-color: yellow">Kiev st. Khreshchatyk, 1/г.Киев ул. Хрещатик, 1</span>
        </td>
    </tr>
    <tr>
        <td>City (город)</td>
        <td><span style="background-color: yellow">Kyiv/Киев</span></td>
    </tr>
    <tr>
        <td>Postal code (почтовый индекс)</td>
        <td>{{ shipment.address.postal_code }}</td>
    </tr>
    <tr>
        <td>Country (страна)</td>
        <td style="background-color: yellow">Ukraine/Украина</td>
    </tr>
    <tr>
        <td>Phone/fax nr. (телефон/факс)</td>
        <td>{{ shipment.address.phone }}</td>
    </tr>
    </tbody>
</table>
<div class="mt-10"><span class="bold">SHIP TO</span> (грузополучатель)</div>
<table class="second-table">
    <tbody>
    <tr>
        <td>Company name (название компании)</td>
        <td>{{ shipment.name }}</td>
    </tr>
    <tr>
        <td>Contact person (контактное лицо)</td>
        <td>{{ shipment.name }}</td>
    </tr>
    <tr>
        <td>Address (адрес)</td>
        <td>{{ model.shipping_receive_point }}</td>
    </tr>
    <tr>
        <td>City (город)</td>
        <td>{{ model.shipping_address_city }}</td>
    </tr>
    <tr>
        <td>Postal code (почтовый индекс)</td>
        <td>{{ model.shipping_address_zip }}</td>
    </tr>
    <tr>
        <td>Country (страна)</td>
        <td>{{ model.shipping_address_country }}</td>
    </tr>
    <tr>
        <td>Phone/fax nr. (телефон/факс)</td>
        <td>{{ shipment.phone }}</td>
    </tr>
    </tbody>
</table>

<table class="goods-table mt-10">
    <tbody>
    <tr class="text-center">
        <td>
            <div class="bold">No. Units</div>
            <div>Кол-во</div>
        </td>
        <td>
            <div class="bold">Complete description of goods</div>
            <div>Наименование груза</div>
        </td>
        <td>
            <div class="bold">Harmonized tariff code</div>
            <div>Код по ТНВЭД</div>
        </td>
        <td>
            <div class="bold">Country of origin</div>
            <div>Страна происхождения</div>
        </td>
        <td>
            <div class="bold">Unit Value</div>
            <div>Цена за единицу</div>
        </td>
        <td>
            <div class="bold">Total Value</div>
            <div>Общая стоимость</div>
        </td>
    </tr>
    {% for item in shipment.items %}
    <tr>
        <td class="text-center">{{ item.quantity }}</td>
        <td>{{ item.description_eng|slice(0, 35) }} / {{ item.description_local|slice(0, 35) }}</td>
        <td>{{ item.hs_code }}</td>
        <td>Ukraine/Украина</td>
        <td class="text-center">{{ item.price }} {{ shipment.currency }}</td>
        <td class="text-center">{{ item.price * item.quantity }} {{ shipment.currency }}</td>
    </tr>
    {% endfor %}
    <tr>
        <td colspan="5">TOTAL VALUE</td>
        <td class="text-center">
            {{ shipment.items|reduce((carry, item) => carry + (item.price * item.quantity), 0)|round(2) }}
            {{ shipment.currency }}
        </td>
    </tr>
    </tbody>
</table>

<div style="padding: 0 40px;">
    <table class="second-table no-border">
        <tbody>
        <tr>
            <td class="nowrap">
                <span class="bold mr-10">Total weight, kg</span>
                <span>(Общий вес)</span>
            </td>
            <td class="full-width border-bottom">
                {{ shipment.weight }}
            </td>
        </tr>
    </table>
    <table class="second-table no-border">
        <tr>
            <td class="nowrap">
                <span class="bold mr-10">Number of packages</span>
                <span>(Количество  пакетов)</span>
            </td>
            <td class="full-width border-bottom">
                1
            </td>
        </tr>
    </table>
    <table class="second-table no-border">
        <tr>
            <td class="nowrap">
                <span class="bold mr-10">Reason for export</span>
                <span>(Цель экспорта)</span>
            </td>
            <td class="full-width border-bottom">
                <span style="background-color: yellow">SALE / ПРОДАЖА</span>
            </td>
        </tr>
        </tbody>
    </table>
    
    <p class="mt-10">I declare that the above information is true and correct to the best of my knowledge.</p>
</div>

<div class="middle">
    <div>SIGNATURE</div>
    <div>COMPANY STAMP</div>
</div>
</body>
<style>
    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    body {
        font-family: 'Times New Roman', Verdana, Arial, sans-serif;
        font-size: 14px;
        padding: 0;
        margin: 0;
    }
    
    img {
        border-style: none;
    }

    .italic {
        font-style: italic;
    }

    .bold {
        font-weight: 600;
    }

    .text-center {
        text-align: center;
    }

    .space-text span{
        margin-right: 10px;
    }

    .border-bottom {
        border-bottom: 1px solid black !important;
    }

    .clean-float {
        clear: right;
    }

    .mt-10 {
        margin-top: 10px;
    }

    .mb-10 {
        margin-bottom: 10px;
    }

    .mr-10 {
        margin-right: 10px;
    }

    .middle {
        margin-top: 50px;
        margin-left: 50%;
    }
    
    .nowrap {
        white-space: nowrap;
    }

    .second-table.no-border td{
        border: none;
    }

    .margin {
        display: inline-block;
        width: 28%;
    }

    /*head-table*/
    .head-table {
        display: inline-table;
        width: 70%;
        border-collapse: collapse;
    }

    .head-table td {
        height: 18px;
        padding: 0 5px;
        border: solid 1px black;
        line-height: 1;
    }

    .head-table td:first-child {
        width: 60%;
    }

    .head-table td:last-child {
        width: 40%;
    }

    /*second-table*/
    .second-table {
        width: 100%;
        border-collapse: collapse;
    }

    .second-table .slim-row td {
        height: 10px;
    }

    .second-table td, .goods-table td {
        height: 18px;
        padding-right: 5px;
        border: solid 1px black;
        padding-left: 5px;
    }
    
    .second-table td:first-child {
        width: 40%;
    }

    .second-table td:last-child {
        width: 60%;
    }

    .second-table td.nowrap {
        padding-right: 20px;
        width: auto;
    }

    .second-table td.full-width {
        padding-left: 20px;
        width: 90%;
    }

    /*goods-table*/
    .goods-table {
        width: 100%;
        border: solid 1px black;
        border-collapse: collapse;
        margin-bottom: 20px;
    }

    .goods-table td:nth-child(1) {
        width: 6%;
    }

    .goods-table td:nth-child(2) {
        width: 42%;
    }

    .goods-table td:nth-child(3) {
        width: 13%;
    }

    .goods-table td:nth-child(4) {
        width: 13%;
    }

    .goods-table td:nth-child(5) {
        width: 13%;
    }

    .goods-table td:nth-child(6) {
        width: 13%;
    }

    .goods-table td {
        padding: 5px;
    }
</style>
</html>
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://templates.keycrm.app/ru/zakaz.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
