{% extends 'OroUIBundle:actions:update.html.twig' %} {% import 'OroUIBundle::macros.html.twig' as UI %} {% oro_title_set({params : { '%identifier%': entity.invoiceNumber|default('N/A'|trans), '%entityName%': 'oro.invoice.entity_label'|trans } }) %} {% set formAction = entity.id ? path('oro_invoice_update', { 'id': entity.id }) : path('oro_invoice_create') %} {% form_theme form with ['OroInvoiceBundle:Form:fields.html.twig'] %} {% block navButtons %} {{ parent() }} {{ UI.cancelButton(path('oro_invoice_index')) }} {% set html = UI.saveAndCloseButton() %} {% if entity.id or resource_granted('oro_invoice_update') %} {% set html = html ~ UI.saveAndStayButton() %} {% endif %} {{ UI.dropdownSaveButton({'html': html}) }} {% endblock navButtons %} {% block pageHeader %} {% if entity.id %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('oro_invoice_index'), 'indexLabel': 'oro.invoice.entity_plural_label'|trans, 'entityTitle': entity.invoiceNumber|default('N/A'|trans) } %} {{ parent() }} {% else %} {% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.invoice.entity_label'|trans}) %} {% include 'OroUIBundle::page_title_block.html.twig' with { title: title } %} {% endif %} {% endblock pageHeader %} {% block content_data %} {% set id = 'invoice-edit' %} {% set totals %} {% include 'OroPricingBundle:Totals:totals.html.twig' with { options: { route: 'oro_pricing_recalculate_entity_totals', selectors: { template: '#totals-template', form: '#' ~ form.vars.id }, events: [ 'line-items-totals:update', 'update:account', 'update:currency' ], entityClassName: 'Oro\\Bundle\\InvoiceBundle\\Entity\\Invoice', entityId: form.vars.value.id, data: totals } } only %} {% endset %} {% set lineItems %}
{{ form_widget(form.lineItems) }} {{ form_errors(form.lineItems) }}
{% endset %} {% set mainFormFields %}
{{ form_row(form.account) }} {{ form_row(form.accountUser) }}
{{ form_row(form.invoiceDate) }} {{ form_row(form.paymentDueDate) }} {{ form_row(form.poNumber) }} {{ form_row(form.currency) }}
{% endset %} {% set dataBlocks = [ { 'title': 'oro.invoice.sections.general'|trans, 'class': 'active', 'subblocks': [{ 'data': [mainFormFields] }] }, { 'title': 'oro.invoice.sections.invoice_line_items'|trans, 'subblocks': [{ 'title': '', 'data': [ lineItems ] }] } ] %} {% set dataBlocks = dataBlocks|merge([{ 'title': 'oro.invoice.sections.totals'|trans, 'class': 'active', 'subblocks': [{ 'data': [totals] }] }]) %} {% set additionalData = [ form_row(form.poNumber), ] %} {% set data = { 'formErrors': form_errors(form), 'dataBlocks': dataBlocks }%} {{ parent() }} {% endblock content_data %}