> For the complete documentation index, see [llms.txt](https://templates.keycrm.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://templates.keycrm.app/ua/sklad.md).

# Для складських операцій

#### Інструкції:

* [Як використовувати шаблони з бібліотеки та створювати власні шаблони документів](https://help.keycrm.app/uk/products-and-warehouse-management/iak-stvoriti-shablon-ta-drukuvati-dokumienti);
* [Довідник доступних тегів, функцій та фільтрів Twig](https://help.keycrm.app/uk/process-automation-api-and-more/dovidnik-dostupnikh-funktsii-ta-fil-triv-twig);
* [Приклади рішень та відповіді на поширені запитання](https://help.keycrm.app/uk/products-and-warehouse-management/pitannia-vidpovidi-faq-po-stvorienniu-dokumientiv-po-sklads-kim-opieratsiiam).

### 1. Оприбуткування

{% tabs %}
{% tab title="Зовнішній вигляд" %}
![](/files/ok5vkRTNNls1lNzMMKr0)
{% endtab %}

{% tab title="Код шаблону" %}
**Тип шаблону:** Складські операції

```
<!doctype html>
<html lang="uk">
<head>
    <meta charset="UTF-8">
    <title>Оприбуткування товарів</title>
</head>
<body>

<div class="container">

    <!-- Заголовок -->
    <h2 class="text-center">АКТ ОПРИБУТКУВАННЯ ТОВАРІВ №: {{ model.id }}</h2>

    <br>

    <!-- Демо реквізити компанії -->
    <table class="width100">
        <tr>
            <td valign="top" class="label" style="width:50%">
                <span style="background-color: yellow">Постачальник: Ваша компанія</span><br />
                <span style="background-color: yellow">ФОП / ТОВ</span><br />
                <span style="background-color: yellow">м. Київ, вул. Прикладна, 1</span><br />
                <span style="background-color: yellow">тел.: (000)000-00-00</span><br />
            </td>

            <td valign="top">
                <strong>Дата:</strong> {{ model.created_at|date("d.m.Y H:i") }}<br>
                <strong>Тип операції:</strong> {{ model.event }}<br>
                <strong>Менеджер:</strong> {{ model.manager }}<br>
                <strong>Склад:</strong> {{ model.destination }}
            </td>
        </tr>
    </table>

    {% if model.comment %}
        <br>
        <strong>Коментар:</strong> {{ model.comment }}
    {% endif %}

    <br><br>

    <!-- Таблиця товарів -->
    <table class="width100 border">
        <thead>
        <tr>
            <th>№</th>
            <th>Зображення</th>
            <th>Артикул</th>
            <th>Назва товару</th>
            <th>Ціна закупівлі</th>
            <th>Кількість</th>
            <th>Сума закупівлі</th>
        </tr>
        </thead>
        <tbody>

        {% set total = 0 %}
        {% set total_qty = 0 %}
        {% set currency = model.inventories[0].currency_code ?? 'UAH' %}

        {% for key, inventory in model.inventories %}
            {% set row_sum = inventory.quantity * inventory.price %}
            {% set total = total + row_sum %}
            {% set total_qty = total_qty + inventory.quantity %}

            <tr>
                <td class="text-center">{{ key + 1 }}</td>
                <td class="text-center"><img src="{{ inventory.offer_picture }}" style="width: 60px;"></td>
                <td class="text-center">{{ inventory.offer_sku }}</td>
                <td class="text-center">{{ inventory.product_name }}</td>
                <td class="text-center">
                    {{ inventory.price|format_currency(currency, locale='uk') }}
                </td>
                <td class="text-center">{{ inventory.quantity }}</td>
                <td class="text-center">
                    {{ row_sum|format_currency(currency, locale='uk') }}
                </td>
            </tr>
        {% endfor %}

        </tbody>

        <!-- Підсумки -->
<tfoot>
<tr>
    <td colspan="5" class="text-right"><strong>Разом:</strong></td>
    <td class="text-center"><strong>{{ total_qty }} {{ model.inventories[0].product_unit_type ?? '' }}</strong></td>
    <td class="text-center">
        <strong>{{ total|format_currency(currency, locale='uk') }}</strong>
    </td>
</tr>
</tfoot>
    </table>

    <br><br>

<!-- Додатковий підсумок -->
   <p>
    <strong>Всього позицій:</strong> {{ model.inventories|length }} <br>
    
    <strong>Загальна кількість:</strong> 
    {{ total_qty }} 
    {{ model.inventories[0].product_unit_type ?? '' }} <br>
    
    <strong>Загальна сума закупівлі:</strong> 
    {{ total|format_currency(currency, locale='uk') }}
</p>

    <br><br>

    <!-- Підписи -->
    <table class="width100">
        <tr>
            <td>Прийняв: _______________________</td>
            <td class="text-right">Підпис: _______________________</td>
        </tr>
    </table>

</div>

</body>

<style>
    body {
        font-family: sans-serif;
        font-size: 14px;
    }

    .container {
        width: 100%;
    }

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

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

    .label {
        font-weight: bold;
    }

    table {
        border-collapse: collapse;
        width: 100%;
    }

    th, td {
        border: 1px solid #000;
        padding: 6px;
    }

    th {
        background: #eee;
    }

    .border {
        border: 2px solid #000;
    }
</style>

</html>

```

{% endtab %}
{% endtabs %}

### 2. Переміщення

{% tabs %}
{% tab title="Зовнішній вигляд" %}
![](/files/mlJiongXGjtZiDcEr2Hx)
{% endtab %}

{% tab title="Код шаблону" %}
**Тип шаблону:** Складські операції

{% code fullWidth="true" %}

```
<!doctype html>
<html lang="uk">
<head>
    <meta charset="UTF-8">
    <title>Переміщення товарів</title>
</head>
<body>

<div class="container">

    <!-- Заголовок -->
    <h2 class="text-center">
        НАКЛАДНА ПЕРЕМІЩЕННЯ №: {{ model.id }}
    </h2>

    <br>

    <!-- Демо реквізити -->
    <table class="width100">
        <tr>
            <td valign="top" class="label" style="width:50%">
                <span style="background-color: yellow">Ваша компанія</span><br />
                <span style="background-color: yellow">ФОП / ТОВ</span><br />
                <span style="background-color: yellow">м. Київ, вул. Прикладна, 1</span><br />
                <span style="background-color: yellow">тел.: (000)000-00-00</span><br />
            </td>

            <td valign="top">
                <strong>Дата:</strong> {{ model.created_at|date("d.m.Y H:i") }}<br>
                <strong>Менеджер:</strong> {{ model.manager }}<br>
                <strong>Тип:</strong> {{ model.event }}
            </td>
        </tr>
    </table>

    <br>

    <!-- Склади -->
    <table class="width100 border">
        <tr>
            <td>
                <strong>Склад-відправник:</strong><br>
                {{ model.target }}
            </td>
            <td>
                <strong>Склад-отримувач:</strong><br>
                {{ model.destination }}
            </td>
        </tr>
    </table>

    {% if model.comment %}
        <br>
        <strong>Коментар:</strong> {{ model.comment }}
    {% endif %}

    <br><br>

    <!-- Таблиця товарів -->
    <table class="width100 border">
        <thead>
        <tr>
            <th>№</th>
            <th>Зображення</th>
            <th>Артикул</th>
            <th>Назва товару</th>
            <th>Од.</th>
            <th>Кількість (відправлено)</th>
            <th>Кількість (отримано)</th>
            <th>Ціна</th>
            <th>Сума</th>
        </tr>
        </thead>
        <tbody>

        {% set total = 0 %}
        {% set total_qty = 0 %}
        {% set currency = model.inventories[0].currency_code ?? 'UAH' %}

        {% for key, inventory in model.inventories %}
            {% set row_sum = inventory.quantity * inventory.price %}
            {% set total = total + row_sum %}
            {% set total_qty = total_qty + inventory.quantity %}

            <tr>
                <td class="text-center">{{ key + 1 }}</td>
                <td class="text-center">
                    <img src="{{ inventory.offer_picture }}" style="width: 50px;">
                </td>
                <td class="text-center">{{ inventory.offer_sku }}</td>
                <td>{{ inventory.product_name }}</td>
                <td class="text-center">{{ inventory.product_unit_type }}</td>

                <!-- відправлено -->
                <td class="text-center">
                    {{ inventory.quantity }}
                </td>

                <!-- отримано (порожнє для заповнення) -->
                <td class="text-center">
                    __________
                </td>

                <td class="text-right">
                    {{ inventory.price|format_currency(currency, locale='uk') }}
                </td>

                <td class="text-right">
                    {{ row_sum|format_currency(currency, locale='uk') }}
                </td>
            </tr>
        {% endfor %}

        </tbody>

        <!-- Підсумки -->
        <tfoot>
        <tr>
            <td colspan="5" class="text-right"><strong>Разом:</strong></td>
            <td class="text-center">
                <strong>{{ total_qty }}</strong>
            </td>
            <td></td>
            <td></td>
            <td class="text-right">
                <strong>{{ total|format_currency(currency, locale='uk') }}</strong>
            </td>
        </tr>
        </tfoot>
    </table>

    <br><br>

    <!-- Додатковий підсумок -->
    <p>
        <strong>Всього позицій:</strong> {{ model.inventories|length }} <br>

        <strong>Відправлено:</strong>
        {{ total_qty }} {{ model.inventories[0].product_unit_type ?? '' }} <br>

        <strong>Сума товарів:</strong>
        {{ total|format_currency(currency, locale='uk') }}
    </p>

    <br><br>

    <!-- Підписи -->
    <table class="width100">
        <tr>
            <td>
                Відвантажив (склад-відправник): <br><br>
                _______________________
            </td>

            <td>
                Прийняв (склад-отримувач): <br><br>
                _______________________
            </td>
        </tr>
    </table>

</div>

</body>

<style>
    body {
        font-family: sans-serif;
        font-size: 14px;
    }

    .container {
        width: 100%;
    }

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

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

    .label {
        font-weight: bold;
    }

    table {
        border-collapse: collapse;
        width: 100%;
    }

    th, td {
        border: 1px solid #000;
        padding: 6px;
    }

    th {
        background: #eee;
    }

    .border {
        border: 2px solid #000;
    }
</style>

</html>

```

{% endcode %}
{% endtab %}
{% endtabs %}

### 3. Інвентаризація

{% tabs %}
{% tab title="Зовнішній вигляд" %}
![](/files/VTvJ5K89wVCOlcGy3zCw)
{% endtab %}

{% tab title="Код шаблону" %}
**Тип шаблону:** Складські операції

```
<!doctype html>
<html lang="uk">
<head>
    <meta charset="UTF-8">
    <title>Інвентаризація</title>
</head>
<body>

<div class="container">

    <!-- Заголовок -->
    <h2 class="text-center">
        АКТ ІНВЕНТАРИЗАЦІЇ №: {{ model.id }}
    </h2>

    <br>

    <!-- Демо реквізити -->
    <table class="width100">
        <tr>
            <td valign="top" class="label" style="width:50%">
                <span style="background-color: yellow">Ваша компанія</span><br />
                <span style="background-color: yellow">ФОП / ТОВ</span><br />
                <span style="background-color: yellow">м. Київ, вул. Прикладна, 1</span><br />
                <span style="background-color: yellow">тел.: (000)000-00-00</span><br />
            </td>

            <td valign="top">
                <strong>Дата:</strong> {{ model.created_at|date("d.m.Y H:i") }}<br>
                <strong>Менеджер:</strong> {{ model.manager }}<br>
                <strong>Склад:</strong> {{ model.destination }}<br>
                <strong>Тип:</strong> {{ model.event }}
            </td>
        </tr>
    </table>

    {% if model.comment %}
        <br>
        <strong>Коментар:</strong> {{ model.comment }}
    {% endif %}

    <br><br>

    <!-- Таблиця -->
    <table class="width100 border">
        <thead>
        <tr>
            <th>№</th>
            <th>Зображення</th>
            <th>Артикул</th>
            <th>Назва товару</th>
            <th>Од.</th>
            <th>Було в системі</th>
            <th>Фактично</th>
            <th>Різниця</th>
        </tr>
        </thead>
        <tbody>

       {% set total_system = 0 %}
{% set total_fact = 0 %}
{% set total_diff = 0 %}

{% for key, inventory in model.inventories %}

    {% set system_qty = inventory.quantity_before ? inventory.quantity_before : 0 %}

    {# quantity = це різниця #}
    {% set diff = inventory.quantity ? inventory.quantity : 0 %}

    {# фактичний залишок = було + різниця #}
    {% set fact_qty = system_qty + diff %}

    {% set total_system = total_system + system_qty %}
    {% set total_fact = total_fact + fact_qty %}
    {% set total_diff = total_diff + diff %}

    <tr>
        <td class="text-center">{{ key + 1 }}</td>

        <td class="text-center">
            <img src="{{ inventory.offer_picture }}" style="width: 50px;">
        </td>

        <td class="text-center">{{ inventory.offer_sku }}</td>

        <td>
            {{ inventory.product_name }}
        </td>

        <td class="text-center">{{ inventory.product_unit_type }}</td>

        <!-- було -->
        <td class="text-center">
            {{ system_qty }}
        </td>

        <!-- фактично -->
        <td class="text-center">
            {{ fact_qty }}
        </td>

        <!-- різниця -->
        <td class="text-center">
            {% if diff > 0 %}
                +{{ diff }}
            {% else %}
                {{ diff }}
            {% endif %}
        </td>
    </tr>

{% endfor %}

        </tbody>

        <!-- Підсумки -->
        <tfoot>
        <tr>
            <td colspan="5" class="text-right"><strong>Разом:</strong></td>

            <td class="text-center">
                <strong>{{ total_system }}</strong>
            </td>

            <td class="text-center">
                <strong>{{ total_fact }}</strong>
            </td>

            <td class="text-center">
                <strong>
                    {% if total_diff > 0 %}
                        +{{ total_diff }}
                    {% else %}
                        {{ total_diff }}
                    {% endif %}
                </strong>
            </td>
        </tr>
        </tfoot>
    </table>

    <br><br>

    <!-- Додатковий підсумок -->
    <p>
        <strong>Всього позицій:</strong> {{ model.inventories|length }} <br>

        <strong>Було в системі:</strong>
        {{ total_system }} {{ model.inventories[0].product_unit_type ?? '' }} <br>

        <strong>Фактично:</strong>
        {{ total_fact }} {{ model.inventories[0].product_unit_type ?? '' }} <br>

        <strong>Різниця:</strong>
        {% if total_diff > 0 %}
            +{{ total_diff }}
        {% else %}
            {{ total_diff }}
        {% endif %}
    </p>

    <br><br>

    <!-- Підписи -->
    <table class="width100">
        <tr>
            <td>
                Провів інвентаризацію: <br><br>
                _______________________
            </td>

            <td>
                Перевірив: <br><br>
                _______________________
            </td>
        </tr>
    </table>

</div>

</body>

<style>
    body {
        font-family: sans-serif;
        font-size: 14px;
    }

    .container {
        width: 100%;
    }

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

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

    .label {
        font-weight: bold;
    }

    table {
        border-collapse: collapse;
        width: 100%;
    }

    th, td {
        border: 1px solid #000;
        padding: 6px;
    }

    th {
        background: #eee;
    }

    .border {
        border: 2px solid #000;
    }
</style>

</html>
     
    


```

{% endtab %}
{% endtabs %}
