{% extends 'datatable.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% import "macros/datatables.html.twig" as tables %} {% import "invoice/actions.html.twig" as actions %} {% block datatable_row %} {{ widgets.user_avatar(entry.user) }} {{ entry.createdAt|date_short }} {{ widgets.label_user(entry.user) }} {{ widgets.label_customer(entry.customer) }} {{ entry.comment }} {% for field in metaColumns %} {{ tables.datatable_meta_column(entry, field) }} {% endfor %} {{ widgets.label(entry.invoiceNumber, 'default') }} {{ _self.invoice_due_date(entry) }} {% if entry.paymentDate and entry.paid %} {{ widgets.label(entry.paymentDate|date_short, 'primary') }} {% endif %} {{ _self.invoice_status(entry) }} {{ entry.subtotal|money(entry.currency) }} {{ entry.tax|money(entry.currency) }} {{ entry.total|money(entry.currency) }} {{ actions.invoice(entry, 'index') }} {% endblock %} {% block javascripts %} {{ parent() }} {% if download is not null %} {% endif %} {% endblock %} {% macro invoice_status(invoice) %} {% from "macros/widgets.html.twig" import label %} {% set overdue = invoice.overdue %} {% if invoice.new and overdue %} {{ label('status.new'|trans, 'danger') }} {% elseif invoice.new %} {{ label('status.new'|trans, 'primary') }} {% elseif invoice.pending and overdue %} {{ label('status.pending'|trans, 'danger') }} {% elseif invoice.pending %} {{ label('status.pending'|trans, 'warning') }} {% elseif invoice.paid %} {{ label('status.paid'|trans, 'success') }} {% elseif invoice.canceled %} {{ label('status.canceled'|trans, 'gray') }} {% endif %} {% endmacro %} {% macro invoice_due_date(invoice) %} {% from "macros/widgets.html.twig" import label %} {% if invoice.canceled %} {{ label('status.canceled'|trans, 'gray') }} {% elseif invoice.overdue and not invoice.paid %} {{ label(invoice.dueDate|date_short, 'danger') }} {% else %} {{ label(invoice.dueDate|date_short, 'primary') }} {% endif %} {% endmacro %}