{$_title = '[`Invoice`]'} {$invoice.contact = $contact}

[`Invoice`] [`#`]{$invoice.number|escape} [`issued on`] {$invoice.invoice_date|wa_date} {* @event backend_invoice.%plugin_id%.title_suffix *} {if !empty($backend_invoice)}{foreach $backend_invoice as $_}{ifset($_.title_suffix)}{/foreach}{/if}

[`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 $_exists} {$_contact_name} {else} {$_contact_name} {/if}
{/if} {if $show_url}
[`Public link`]
{if !empty($public_url)} {$public_url} {else} [`A CRM settlement is required to publish invoices.`] [`Use Site app to add a settlement for CRM.`] {/if}
{/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 $_exists} {$_contact_name} {else} {$_contact_name} {/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} {/foreach}
{$_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}
{/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}