{# views/product/details.twig #} {% extends 'layouts/base.twig' %} {% block title %}{{ translations.product_details }}{% endblock %} {% block page_heading %}

{{ translations.product }}

{% if errors is not empty %}
{% endif %} {% endblock %} {% block content %}

{{ translations.overview }}

{{ translations.name }} {{ product_data.getName() }}
{{ translations.category }} {{ product_data.getCategoryName() }}
{{ translations.tax_value_perc }} {{ product_data.getTaxValPerc() }}
{{ translations.single_weight }} {{ product_data.getSingleWeight() }}
{{ translations.storage_type }} {{ product_data.getStorageName() }}
{{ translations.positioning_type }} {{ product_data.getPositioningName() }}
{{ translations.available_to_sale }} {% if product_data.getIsActive() == 1 %} {% else %} {% endif %}
{{ translations.is_vegetarian }} {% if product_data.getIsVegetarian() == 1 %} {% else %} {% endif %}
{{ translations.is_divisible }} {% if product_data.getIsDivisible() == 1 %} {% else %} {% endif %}
{{ translations.require_prepare_before_sale }} {% if product_data.getIsPreparedBeforeSales() == 1 %} {% else %} {% endif %}
{{ translations.suggested_sale_price }} {{ product_data.getSuggestedSalePrice() }} {{ currency_symbol }}
{{ translations.sale_price }} {{ product_data.getPortionPrice() }} {{ currency_symbol }}
{{ translations.quantity_per_label }} {{ product_data.getQuantityPerLabel() }}
{{ translations.shelf_life }} {{ product_data.getShelfLifeHours() ~ "h" }} {{ "(" ~ product_data.getShelfLifeMinutes() ~ " min)" }}

{{ translations.required_competences }}

{% if product_data.getRequiredCompetences() is empty %}
{{ translations.no_assigned_competences }}
{% else %}
{% for competence in product_data.getRequiredCompetences() %} {{ competence.getName() }} {% endfor %}
{% endif %}

{{ translations.recipe_calculation }}

{% if recipe_calculation is null %}

{{ translations.no_recipe }}

{% else %} {% set total_ingredient_cost = 0 %} {% set total_allergens = [] %} {% if recipe_calculation is not empty %} {% for item in recipe_calculation.getElements() %} {% set class = (item.getType() == "ingredient") ? "bg-light-warning" : "bg-light-info" %} {% set allergens = item.getAllergens() %} {% if allergens is not null and allergens is not empty %} {% set total_allergens = total_allergens|merge(allergens) %} {% endif %} {% endfor %} {% endif %}
{{ translations.ingredient }} {{ translations.quantity }} {{ translations.approximate_cost_price_net }} {{ translations.allergens }}
{{ item.getName() }} {{ item.getRecipeQuantity() }} {{ item.getUnitName() }} {{ item.getCalculatedReqPriceNet()|number_format(3, '.') }} {{ currency_symbol }} {{ item.getAllergens() ? item.getAllergens()|join(", ") : "" }}
{{ translations.total }}: {{ recipe_calculation.getCostNet() }} {{ currency_symbol }} {{ total_allergens|array_unique|join(", ") }}
{% endif %}

{{ translations.package_calculation }}

{% if pack_calculation is not defined or pack_calculation is null %}

{{ translations.no_package }}

{% else %} {% if pack_calculation is not empty %} {% for item in pack_calculation.getMaterials() %} {% endfor %} {% endif %}
{{ translations.material }} {{ translations.quantity }} {{ translations.approximate_cost_price_net }}
{{ item.getName() }} {{ item.getQuantity() }} {{ item.getUnitName() }} {{ item.getBaseUnitPriceNet() ~ " " ~ currency_symbol }}
{{ translations.total }}: {{ pack_calculation.getCostNet() ~ " " ~ currency_symbol }}
{% endif %}
{% if recipe_calculation is null %}
{{ translations.no_recipe }}
{% else %}
{% set fc_ratio = (product_data.getPortionPrice() == 0) ? 0 : (((recipe_calculation.getCostNet() ?? 0) / product_data.getPortionPrice()) * 100) %}
{{ translations.fc_ratio }}
{{ fc_ratio|number_format(2, '.') }} %
{% endif %}
{% if pack_calculation is not defined or pack_calculation is null %}
{{ translations.no_package }}
{% else %}
{% set pack_ratio = (product_data.getPortionPrice() == 0) ? 0 : ((pack_calculation.getCostNet() / product_data.getPortionPrice()) * 100) %}
{{ translations.pack_ratio }}
{{ pack_ratio|number_format(2, '.') }} %
{% endif %}
{{ translations.main_photo }}
{% if recipe_calculation is null %}
{{ translations.no_recipe }}
{% else %}
{% if recipe_data.getMainPhotoPath() != "" %} {% else %}
{{ translations.miss }}
{% endif %}
{% endif %}
{{ translations.additional_photo }}
{% if recipe_calculation is null %}
{{ translations.no_recipe }}
{% else %}
{% if recipe_data.getPhoto1Path() != "" %} {% else %}
{{ translations.miss }}
{% endif %}
{% endif %}
{{ translations.additional_photo }}
{% if recipe_calculation is null %}
{{ translations.no_recipe }}
{% else %}
{% if recipe_data.getPhoto2Path() != "" %} {% else %}
{{ translations.miss }}
{% endif %}
{% endif %}
{{ translations.additional_photo }}
{% if recipe_calculation is null %}
{{ translations.no_recipe }}
{% else %}
{% if recipe_data.getPhoto3Path() != "" %} {% else %}
{{ translations.miss }}
{% endif %}
{% endif %}
{% endblock %} {% block scripts %} {% endblock %}