{% extends 'base.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% block main %} {% set can_edit = is_granted('edit', customer) %} {% embed '@theme/embeds/card.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% block box_attributes %}id="customer_details_box"{% endblock %} {% block box_title %} {{ widgets.label_customer(customer) }} {% if customer.company is not empty %} – {{ customer.company }}{% endif %} {% endblock %} {% block box_tools %} {% if can_edit %} {{ widgets.card_tool_button('edit', {'class': 'modal-ajax-form open-edit', 'title': 'action.edit', 'url': path('admin_customer_edit', {'id': customer.id})}) }} {% endif %} {% endblock %} {% block box_body_class %}p-0{% endblock %} {% block box_body %} {% if customer.comment is not empty %}
{{ customer.comment|comment2html(true) }}
{% endif %} {% if not customer.visible %} {% endif %} {% if not customer.billable %} {% endif %} {% if customer.address is not empty %} {% endif %} {% if customer.country is not empty %} {% endif %} {% if customer.contact is not empty %} {% endif %} {% if customer.phone is not empty %} {% endif %} {% if customer.mobile is not empty %} {% endif %} {% if customer.email is not empty %} {% endif %} {% if customer.homepage is not empty %} {% endif %} {% if customer.fax is not empty %} {% endif %} {% if customer.timezone is not empty %} {% endif %} {% if customer.currency is not empty %} {% endif %} {% if is_granted('details', customer) %} {% if customer.number is not empty %} {% endif %} {% if customer.vatId is not empty %} {% endif %} {% endif %} {% for metaField in customer.visibleMetaFields|sort((a, b) => a.order <=> b.order) %} {% endfor %}
{{ 'visible'|trans }} {{ widgets.label_boolean(customer.visible) }}
{{ 'billable'|trans }} {{ widgets.label_boolean(customer.billable) }}
{{ 'address'|trans }} {{ customer.address|nl2br }}
{{ 'country'|trans }} {{ customer.country|country_name }}
{{ 'contact'|trans }} {{ customer.contact }}
{{ 'phone'|trans }} {{ customer.phone }}
{{ 'mobile'|trans }} {{ customer.mobile }}
{{ 'email'|trans }} {{ customer.email }}
{{ 'homepage'|trans }} {{ customer.homepage|replace({'https://': '', 'http://': ''}) }}
{{ 'fax'|trans }} {{ customer.fax }}
{{ 'timezone'|trans }} {{ customer_now|date_time }} ({{ customer.timezone }})
{{ 'currency'|trans }} {{ customer.currency }}
{{ 'number'|trans }} {{ customer.number }}
{{ 'vat_id'|trans }} {{ customer.vatId }}
{{ metaField.label|trans }} {{ widgets.form_type_value(metaField.type, metaField.value, customer) }}
{% endblock %} {% endembed %} {{ render(controller('App\\Controller\\CustomerController::projectsAction', {'customer': customer.id, 'page': 1})) }} {% if can_edit %} {{ include('embeds/rates-table.html.twig', {'id': 'customer_rates_box', 'entity': customer, 'create_url': path('admin_customer_rate_add', {'id': customer.id}), 'delete_route': 'delete_customer_rate', 'currency': customer.currency, 'edit_route': 'admin_customer_rate_edit'}) }} {% endif %} {% if stats is not null %} {{ include('embeds/budgets.html.twig', {'entity': customer, 'stats': stats, 'currency': customer.currency}) }} {% endif %} {% for controller in boxes %} {{ render(controller(controller, {'customer': customer, 'page': 1})) }} {% endfor %} {% if teams is not null %} {% set options = {'teams': teams, 'team': team} %} {% if is_granted('permissions', customer) %} {% set options = options|merge({'route_create': path('customer_team_create', {'id': customer.id}), 'route_edit': path('admin_customer_permissions', {'id': customer.id})}) %} {% endif %} {{ include('embeds/teams.html.twig', options) }} {% endif %} {% if comments is not null %} {% set options = {'form': commentForm, 'comments': comments} %} {% if can_edit %} {% set options = options|merge({'route_pin': 'customer_comment_pin', 'route_delete': 'customer_comment_delete', 'csrf_delete': 'customer.delete_comment', 'csrf_pin': 'customer.pin_comment'}) %} {% endif %} {{ include('embeds/comments.html.twig', options) }} {% endif %} {% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}