[`Created at`]
{$invoice.create_datetime|wa_datetime}
{if !empty($invoice.due_date)}
[`Valid through`]
{$invoice.due_date|wa_date}
{if !crmInvoice::isCliOk()}
{include file="templates/actions-legacy/settings/SettingsCronInvoicesArchive.inc.html" inline}
{/if}
{/if}
[`State`]
{$_state = crmInvoice::getState($invoice.state_id)}
{$_state.name|escape|default:$invoice.state_id}
{if !empty($invoice.creator_contact)}
{$_contact = $invoice.creator_contact}
{$_exists = $_contact->exists()}
{$_userpic = $_contact->getPhoto(32)}
{$_contact_name = $wa->crm->contactName($_contact.name)}
[`Created by`]
{if !empty($_userpic)}
{if $_exists}
{else}

{/if}
{/if}
{/if}
{if $show_url}
{/if}
[`Company`]
{ifempty($invoice.company.name, $invoice.company_id)|escape}
[`Client`]
{$_exists = $contact->exists()}
{$_userpic = $contact->getPhoto(32)}
{$_contact_name = $wa->crm->contactName($contact.name)}
{if !empty($_userpic)}
{if $_exists}
{else}

{/if}
{/if}
{if $deal}
{elseif $deal_access_denied}
[`Deal not shown due to access rights restrictions.`]
{/if}
[`Amount`]
{$invoice.amount|wa_format_amount_currency:$invoice.currency_id}
{if $invoice.state_id == 'PAID'}
[`Payment date`]
{$invoice.payment_datetime|wa_date}
{/if}
{if $transactions}
[`Payment transactions`]
{foreach $transactions as $_t}
{$_classes = ["c-transaction"]}
{if $_t.state === "DECLINED"}
{$_classes[] = "is-declined"}
{elseif ($_t.state) === "CAPTURED"}
{$_classes[] = "is-captured"}
{elseif ($_t.state) === "CANCELED"}
{$_classes[] = "is-canceled"}
{elseif ($_t.state) === "REFUNDED"}
{$_classes[] = "is-refunded"}
{elseif ($_t.state) === "AUTH"}
{$_classes[] = "is-auth"}
{/if}
| {$_t.create_datetime|wa_datetime} |
{ifempty($plugins[$_t.plugin].name, $_t.plugin)|escape} |
{$_t.amount|wa_format_amount_currency:$_t.currency_id} |
{$_t.view_data|escape} |
{$_t.state|escape} |
{/foreach}
{/if}
{* @event backend_invoice.%plugin_id%.info_section *}
{if !empty($backend_invoice)}{foreach $backend_invoice as $_}{ifset($_.info_section)}{/foreach}{/if}
{include file="../frontend/FrontendInvoice.html" is_include=true inline}