{% block oro_pricing_product_price_widget %} {% apply spaceless %}
{{ form_label(form.priceList) }}
{{ form_widget(form.priceList, { 'attr': {'class': 'priceList'} }) }}
{{ form_errors(form.priceList) }}
{{ form_label(form.quantity) }}
{{ form_widget(form.quantity, { 'attr': {'class': 'quantity'} }) }}
{{ form_errors(form.quantity) }}
{{ form_widget(form.unit, { 'attr': {'class': 'unit'} }) }}
{{ form_errors(form.unit) }}
{{ form_label(form.price.value) }}
{{ form_widget(form.price.value, { 'attr': {'class': 'price-value'} }) }}
{{ form_errors(form.price.value) }}
{{ form_widget(form.price.currency, { 'attr': {'class': 'price-currency'} }) }}
{{ form_errors(form.price.currency) }}
{% endapply %} {% endblock %} {% block oro_pricing_product_price_collection_widget %}
{% set attr = attr|merge({'class': (attr.class is defined ? attr.class ~ ' ' : '') ~ 'oro-options-collection' }) %} {{ block('oro_collection_widget') }}
{% endblock %} {% block oro_pricing_price_list_collection_row %} {% if render_as_widget %}
{{ block('oro_pricing_price_list_collection_widget') }}
{% else %} {{ block('form_row') }} {% endif %} {% endblock %} {% block oro_pricing_price_list_collection_widget %} {% import '@OroUI/macros.html.twig' as UI %} {{ UI.sortable_list_view(form, attr, { collection_class: 'pricing-price-list', add_btn_label: 'oro.pricing.add_price_list'|trans, column_label: 'oro.pricing.pricelist.entity_label'|trans, column_options_label: 'oro.pricing.pricelist.options.label'|trans, show_form_when_empty: show_form_when_empty, data_page_component_module: "oropricing/js/app/components/price-lists-errors-handler" }) }} {% endblock %} {% macro oro_pricing_price_list_collection_prototype(widget) %} {% if 'collection' in widget.vars.block_prefixes %} {% set form = widget.vars.prototype %} {% set name = widget.vars.full_name ~ '[' ~ widget.vars.prototype.vars.name ~ ']' %} {% else %} {% set form = widget %} {% set name = widget.vars.full_name %} {% endif %} {{ form_widget(form) }} {% endmacro %} {% block oro_pricing_price_list_select_with_priority_widget %} {% apply spaceless %} {{ form_widget(form.priceList) }} {{ form_errors(form.priceList) }} {% if form.mergeAllowed is defined %} {{ form_widget(form.mergeAllowed, { 'attr': {'class': 'merge-allowed-checkbox'} }) }} {{ 'oro.pricing.pricelist.merge_allowed.label'|trans }} {{ form_errors(form.mergeAllowed) }} {% endif %} {{ form_widget(form._position) }} {% endapply %} {% endblock %} {# --------------------------- Product Price Attributes ------------------------------------------------------ #} {% block oro_pricing_product_attribute_price_collection_widget %} {% set attr = attr|merge({'class': (attr.class is defined ? attr.class ~ ' ' : '') ~ 'oro-item-collection grid-container price-list-grid-form' }) %} {% set id = id ~ '_collection' %}
{% for currency in form.vars.currencies %} {% endfor %} {% if form.children|length %} {% for unit, unitLabel in form.vars.units %} {% set childrenByCurrency = [] %} {% for child in form.children %} {% if child.vars.value.unit.code == unit %} {% set childrenByCurrency = childrenByCurrency|merge({(child.vars.value.price.currency): child}) %} {% endif %} {% endfor %} {% for currency in form.vars.currencies %} {% endfor %} {% endfor %} {% endif %}
{{ 'oro.pricing.priceAttribute.unit.label'|trans }}{{ currency }}
{{ unitLabel|trans }} {{ form_widget(attribute(childrenByCurrency, currency).price, { 'attr': {'class': 'price-value'} }) }} {{ form_errors(attribute(childrenByCurrency, currency).price) }}
{% endblock %} {# --------------------------- Price Rules ------------------------------------------------------ #} {% macro oro_pricing_price_rule_widget_prototype(widget) %} {% apply spaceless %} {% if 'collection' in widget.vars.block_prefixes %} {% set form = widget.vars.prototype %} {% set name = widget.vars.full_name ~ '[' ~ widget.vars.prototype.vars.name ~ ']' %} {% else %} {% set form = widget %} {% set name = widget.vars.full_name %} {% endif %} {% set quantity = { fieldType: '.price-rule-item-quantity-type-field', expressionType: '.price-rule-item-quantity-type-expression' } %} {% set productUnit = { fieldType: '.price-rule-item-product-unit-type-field', expressionType: '.price-rule-item-product-unit-type-expression' } %} {% set currency = { fieldType: '.price-rule-item-currency-type-field', expressionType: '.price-rule-item-currency-type-expression' } %}
{{ form_widget(form.quantityExpression) }}
{{ 'oro.pricing.pricerule.in_separator'|trans }}
{{ form_errors(form.quantity) }}
{{ form_errors(form.quantityExpression) }}
{{ form_errors(form.productUnit) }}
{{ form_errors(form.productUnitExpression) }}
{{ form_errors(form.currency) }}
{{ form_errors(form.currencyExpression) }}
{{ form_row(form.rule) }} {{ form_row(form.ruleCondition) }}
{{ form_row(form.priority) }}
{% endapply %} {% endmacro %} {% block _oro_pricing_price_list_priceRules_widget %} {% import _self as fields %} {% apply spaceless %} {% if prototype is defined %} {% set prototype_html = fields.oro_pricing_price_rule_widget_prototype(form) %} {% endif %} {% set attr = attr|merge({'class': (attr.class is defined ? attr.class ~ ' ' : '') ~ 'oro-item-collection collection-fields-list' }) %} {% set id = id ~ '_collection' %}
{% set prototype_name = form.vars.prototype_name %}
{% if form.children|length %} {% for child in form.children %} {{ fields.oro_pricing_price_rule_widget_prototype(child) }} {% endfor %} {% endif %}
{{ 'oro.pricing.form.add_rule.label'|trans }}
{% if handle_primary and (prototype is not defined or prototype.primary is defined) %} {{ fields.oro_collection_validate_primary_js(_context) }} {% endif %} {% endapply %} {% endblock %}