{$_title = '[`Invoice`]'} {$_contact_id = ""} {$_contact_name = ""} {if !empty($contact)} {$_contact_id = $contact.id} {$_contact_name = $contact->getName()} {/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;"}

[`Invoice`] [`#`] [`issued on`]

[`Expires in`]
 [`days`]
[`clear due date`]
[`Company`]
{if $companies} {else} [`To add invoices, set up at least one company.`] {/if} {if !empty($_is_admin)} [`Company settings`] {/if}
[`Client`]
{strip} {if !empty($contact)}{$_contact_name|escape}{/if} {/strip} {if !empty($contact)}[`change client`]{else}[`Set client`]{/if}
{if $deal}
[`Deal`]
{if $deal} {$deal.name|escape} {* 83.6957 *} {* [`link to another deal`]*} {* *} {* {elseif !empty($clean_data.deal)}*} {* {include file="templates/actions-legacy/message/MessageConversation.dealSelector.inc.html"*} {* deal = $clean_data.deal|default:[]*} {* funnels = $clean_data.funnels|default:[]*} {* stages = $clean_data.stages|default:[]*} {* show_save_button = true*} {* inline}*} {/if}
{/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
      {capture assign="_confirm_dialog_template"}

      [`Recalculate prices`]

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

      {/capture}