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

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

{% tabs %}
{% tab title="Зовнішній вигляд" %}
![](https://3026330704-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXpkXXVQNdriuGMnogYNZ%2Fuploads%2F3Je5TsaRvHICnrTj7HN3%2FScreenshot_11.png?alt=media\&token=3daf96f3-7436-454e-ba27-cbba47d01262)
{% 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="Зовнішній вигляд" %}
![](https://3026330704-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXpkXXVQNdriuGMnogYNZ%2Fuploads%2FebQd2z4JCeREWcKYOp15%2F%D0%BF%D0%B5%D1%80%D0%B5%D0%BC%D1%96%D1%89%D0%B5%D0%BD%D0%BD%D1%8F.png?alt=media\&token=cb8a8ff8-8f43-48cb-990e-4d482df001ac)
{% 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="Зовнішній вигляд" %}
![](https://3026330704-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXpkXXVQNdriuGMnogYNZ%2Fuploads%2F4f6o8oD7XgGn3xBFf4jy%2F%D1%96%D0%BD%D0%B2%D0%B5%D0%BD%D1%82%D0%B0%D1%80%D0%B8%D0%B7%D0%B0%D1%86%D1%96%D1%8F.png?alt=media\&token=0a16479a-20f3-4477-a7a1-bee788fb3bc3)
{% 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 %}


---

# 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/ua/sklad.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.
