{if $iframe} {$_locale_string = substr($wa->locale(), 0, 2)} {$wa->appName()} — {$wa->accountName()} {* CSS *} {$wa->css()} {wa_js} {$wa_url}wa-content/js/jquery/jquery-3.6.0.min.js {$wa_app_static_url}js/jquery/jquery-ui.min.js {$wa_url}wa-content/js/jquery-plugins/jquery.store.js {$wa_url}wa-content/js/redactor/2/redactor.min.js {$wa_url}wa-content/js/jquery-wa/wa.js {/wa_js} {if $_locale_string != 'en'} {/if} {wa_js} {$wa_app_static_url}js/crm.js {$wa_app_static_url}js/invoice.js {$wa_app_static_url}js/contact.add.js {/wa_js} {* CRM CORE *} {$wa->js()} {/if} {$_title = '[`Invoice`]'} {$_contact_id = ""} {$_contact_name = ""} {$_company_name = ""} {if !empty($contact)} {$_exists = $contact->exists()} {$_userpic = $contact->getPhoto(32)} {$_contact_id = $contact.id} {$_contact_name = $contact->getName()} {$_company_name = $contact->get('company')} {/if} {$_is_admin = $wa->user()->isAdmin($wa->app())} {$_can_use_shop = ( !empty($shop_supported) && !empty($has_shop_rights) )} {$company = reset($companies)} {if !empty($invoice.company_id) && !empty($companies[$invoice.company_id])} {$company = $companies[$invoice.company_id]} {/if} {$_locale_string = substr($wa->locale(), 0, 2)} {$_is_ru_locale = false} {if $_locale_string == "ru"}{$_is_ru_locale = true}{/if} {$hidden_input_style = "visibility: hidden;width: 0;min-width: 0;border: 0;padding: 0;"}

{if $iframe} {else} {/if} [`Invoice`] [`#`] [`issued on`]

[`Expires in`]
{$not_empty_date = !empty($invoice.due_days) || !empty($invoice.due_date)}
[`days`]
[`clear`]
[`Billed To`]
{strip}
{if !empty($contact)}{$_contact_name|escape}{/if} {if !empty($contact) && $_company_name}{$_company_name|escape}{/if}
{/strip} {if !empty($contact.id)}[`Change`]{else}[`Set contact`]{/if}
{if $deal}
[`Deal`]
{$_funnel_color = 'lightgray'} {if !empty($funnel) && !empty($funnel.color)}{$_funnel_color = $funnel.color}{/if} {if $deal.status_id == crmDealModel::STATUS_WON} {elseif $deal.status_id == crmDealModel::STATUS_LOST} {elseif empty($funnel.icon)} {else} {/if} {$deal.name|escape} {* 83.6957 *} {* *} {* [`link to another deal`]*} {* *} {* *} {* [`Detach from deal`]*} {* *} {* {elseif !empty($clean_data.deal)}*} {* *} {* *} {* [`Associate with a deal`]*} {* *}
{/if}
[`Payment recipient`]
{if $companies} {else} [`To add invoices, set up at least one company.`] {/if} {if !empty($_is_admin)} [`Company settings`] {/if}
[`Currency`]
{function tableRow} {if !empty($_index)}{$_index}{else}1{/if} {* NAME AUTOCOMPLETE *}
    {* TAX DROPDOWN *} {$_is_changed = false} {if !empty($_item.tax_percent) && !empty($_item.tax_type)} {if $_item.tax_percent != $invoice.tax_percent || $_item.tax_type != $invoice.tax_type} {$_is_changed = true} {/if} {/if}
    {if $company} {/if}
      {$_price = ""} {if !empty($_item.price)} {$_price = floatval($_item.price)} {$_price = sprintf('%0.2f', $_price)} {if $_is_ru_locale}{$_price = str_replace(".", ",", $_price)}{/if} {/if} 0,00 {/function} {capture assign="_row_template_html"}{tableRow}{/capture}
      {$_index = 1} {if !empty($invoice.items)} {foreach $invoice.items as $_item} {tableRow _item=$_item _index=$_index} {$_index = $_index + 1} {/foreach} {/if} {tableRow _item=[] _index=$_index}
      [`#`] [`Product or service`] [`Qty`] [`Tax`] [`Price`] [`Amount`]
      [`Subtotal`] 0,00
      0,00
      [`Total`] 0,00
      {if empty($invoice.id)} [`Cancel`] {else} [`Cancel`] {/if}
      {capture assign="_confirm_dialog_template"}

      [`Recalculate prices`]

      [`You have changed the invoice currency.`]
      [`Recalculate the prices of items at the appropriate rate?`]

      {/capture}
      {if $iframe} {/if}