You are here

commerce-invoice--admin.html.twig in Commerce Invoice 8.2

Invoice template used on the admin invoice page.

Available variables:

  • attributes: HTML attributes for the wrapper.
  • invoice: The rendered invoice fields. Use 'invoice' to print them all, or print a subset such as 'invoice.invoice_number'. Use the following code to exclude the printing of a given field:

  {{ invoice|without('invoice_number') }}
  
  • invoice_entity: The invoice entity.

File

templates/commerce-invoice--admin.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Invoice template used on the admin invoice page.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes for the wrapper.
  8. * - invoice: The rendered invoice fields.
  9. * Use 'invoice' to print them all, or print a subset such as
  10. * 'invoice.invoice_number'. Use the following code to exclude the
  11. * printing of a given field:
  12. * @code
  13. * {{ invoice|without('invoice_number') }}
  14. * @endcode
  15. * - invoice_entity: The invoice entity.
  16. *
  17. * @ingroup themeable
  18. */
  19. #}
  20. {{ attach_library('commerce_order/form') }}
  21. {% set invoice_state = invoice_entity.getState.getLabel %}
  22. <div class="layout-order-form clearfix">
  23. <div class="layout-region layout-region-order-main">
  24. {{ invoice.invoice_items }}
  25. {{ invoice.total_price }}
  26. {% if invoice.activity %}
  27. <h2>{% trans %}Activity{% endtrans %}</h2>
  28. {{ invoice.activity }}
  29. {% endif %}
  30. </div>
  31. <div class="layout-region layout-region-order-secondary">
  32. <div class="entity-meta">
  33. <div class="entity-meta__header">
  34. <h3 class="entity-meta__title">
  35. {{ invoice_state }}
  36. </h3>
  37. {% for key in ['invoice_date', 'due_date'] %}
  38. {% if invoice[key] %}
  39. <div class="form-item">
  40. {{ invoice[key] }}
  41. </div>
  42. {% endif %}
  43. {% endfor %}
  44. </div>
  45. <details open class="seven-details">
  46. <summary role="button" class="seven-details__summary">
  47. {{ 'Customer Information'|t }}
  48. </summary>
  49. <div class="details-wrapper seven-details__wrapper">
  50. {% for key in ['uid', 'mail'] %}
  51. {% if invoice[key] %}
  52. <div class="form-item">
  53. {{ invoice[key] }}
  54. </div>
  55. {% endif %}
  56. {% endfor %}
  57. </div>
  58. </details>
  59. {% if invoice.billing_information %}
  60. <details open class="seven-details">
  61. <summary role="button" class="seven-details__summary">
  62. {{ 'Billing information'|t }}
  63. </summary>
  64. <div class="details-wrapper seven-details__wrapper">
  65. {{ invoice.billing_information }}
  66. </div>
  67. </details>
  68. {% endif %}
  69. {# If the invoice has possible transitions, render the field for transition buttons. #}
  70. {% if invoice_entity.getState.getTransitions is not empty %}
  71. <div class="entity-meta__header">
  72. {{ invoice.state }}
  73. </div>
  74. {% endif %}
  75. </div>
  76. </div>
  77. </div>