{trans("Draw-up date:")} {$note.cdate|date_format:"%Y/%m/%d"}{if $note.division_cplace != ""}, {$note.division_cplace}{/if}
{trans("Deadline:")} {$note.pdate|date_format:"%Y/%m/%d"}
{trans("Expositor:")} {if $note.user}{$note.user}{else}{$note.division_author}{/if}

{number number=$note.number template=$note.template time=$note.cdate assign=number} {t a=$number}Debit Note No. $a{/t} {if $note.dontpublish}
{trans("NO ACCOUNTANT DOCUMENT")} {/if}


{trans("Note drawer:")}

{if !ConfigHelper::checkConfig('invoices.show_only_alternative_accounts') || empty($note.bankccounts)} {$accounts = array(bankaccount($note.customerid, $note.account))} {else} {$accounts = array()} {/if} {if ConfigHelper::checkConfig('invoices.show_all_accounts') || ConfigHelper::checkConfig('invoices.show_only_alternative_accounts')} {$accounts = array_merge($accounts, $note.bankaccounts)} {/if} {foreach $accounts as $accountidx => $account} {$accounts[$accountidx] = format_bankaccount($account)} {/foreach} {textformat assign="account_text" wrap=5000} {if $use_alert_color}{/if}{implode('
', $accounts)}{if $use_alert_color}
{/if} {/textformat} {$tmp = $note.division_header} {$tmp = str_replace("\n", '
', $tmp)} {$tmp = str_replace('%bankaccount', $account_text, $tmp)} {$tmp = str_replace('%bankname', $note.div_bank, $tmp)} {if ConfigHelper::checkValue(ConfigHelper::getConfig('invoices.customer_bankaccount', true))} {textformat assign="tmp" wrap=5000} {$tmp}
{trans('Bank account:')}
{$account_text} {/textformat} {/if} {$tmp}
{trans("Note recipient:")}

{$note.name}
{$note.address}
{$note.zip} {$note.city} {if $note.ten}
{t a=$note.ten}TEN $a{/t} {elseif $note.ssn}
{t a=$note.ssn}SSN $a{/t} {/if} {if (ConfigHelper::checkValue(ConfigHelper::getConfig('invoices.customer_credentials', true)))} {if $note.customerpin}
{trans("Customer ID:")} {$note.customerid|string_format:"%04d"}
PIN: {$note.customerpin|string_format:"%04d"}

{/if} {/if}

{cycle values="grey,white" print=false name=cycle2} {counter start=0 print=false} {foreach from=$note.content item=item} {/foreach}
{trans("No.")} {trans("Title:")} {trans("Value:")}
{counter}. {$item.description} {$item.value|string_format:"%01.2f"}

{trans("Total:")}

{$note.value|string_format:"%01.2f"}

{trans("To pay:")} {moneyf($note.value, $note.currency)}
{trans("In words:")} {moneyf_in_words($note.value, $note.currency)}
 
{$note.division_footer}
{* customer's balance: {$note.customerbalancelist.balance} *} {if $note.customerbalancelist.list} {if $note.customerbalancelistlimit >= $note.customerbalancelist.total} {assign var="startloop" value="0"} {else} {math assign="startloop" equation="x-y" x=$note.customerbalancelist.total y=$note.customerbalancelistlimit} {/if} {section name=balancelist loop=$note.customerbalancelist.list start=$startloop max=$note.customerbalancelistlimit} {* section name=balancelist loop=$note.customerbalancelist.list start=$note.customerbalancelistlimit step=-1 *} {$item=$note.customerbalancelist.list[balancelist]} {/section}
{trans("Date:")} {trans("Value:")} {trans("Tax:")} » {trans("After:")} {trans("Description:")}
{$item.date} {if $item.value > 0}+{/if}{moneyf($item.value, $item.currency)} {$item.tax} » {if $item.after < 0}{/if} {moneyf($item.after)} {if $item.after < 0}{/if} {$item.comment}
{/if}