{if $customer}
{trans("Customer:")} {$customer.customername}  »  {if $customer.postoffice && $customer.postoffice != $customer.city && $customer.street}{$customer.city}, {/if} {$customer.address}, {$customer.zip} {if $customer.postoffice}{$customer.postoffice}{else}{$customer.city}{/if}  »  {if $customer.balance < 0}{/if}{$customer.balance|money_format}{if $customer.balance < 0}{/if}
{/if}
{foreach $contents as $posuid => $item} {if $item.vdiscount != 0} {$valuebrutto = $item.valuebrutto + $item.vdiscount} {elseif $item.pdiscount != 0} {$valuebrutto = (100 * $item.valuebrutto ) / (100 - $item.pdiscount)} {else} {$valuebrutto = $item.valuebrutto} {/if} {$valuebrutto = round($valuebrutto, 2)} {$valuenetto = round(($valuebrutto * 100) / (100 + $taxeslist[$item.taxid].value), 2)} {if isset($error.posuid)} {$row = $itemdata} {else} {$row = $item} {/if} {foreachelse} {/foreach} {if $contents} {else} {/if} {block name="`$layout.module`-additem"} {if !$invoice.closed} {/if} {/block}
{trans("No.")} {trans("Name of product, commodity or service:")} {trans("Tax category:")} {trans("Product ID:")} {trans("Amount:")}
{trans("Unit:")}
{trans("Discount:")} {trans("Net Price:")}
{trans("Net Value:")}
{trans("Tax:")} {trans("Gross Price:")}
{trans("Gross Value:")}
 
{counter}. {$item.name} {if isset($item.name_custom_contents)} {$item.name_custom_contents} {/if} {tax_category_selection class="invoice-contents-field-edit" elementname="invoice-contents["|cat:$posuid|cat:"][taxcategory]" selected=$row.taxcategory visible=false tip="Select tax category" data_old_value=$item.taxcategory} {if $item.taxcategory} ({sprintf('%02d', $item.taxcategory)}) {$_TAX_CATEGORIES[$item.taxcategory].label} {else} {trans("- none -")} {/if} {$item.prodid} {if isset($item.count_custom_contents)} {$item.count_custom_contents} {/if} {$item.count|string_format:"%.3f"}
{$item.jm}
{if $item.pdiscount != 0}{$item.pdiscount|string_format:"%01.2f %%"}{else}{if $item.vdiscount != 0}{$item.vdiscount|string_format:"%01.2f"}{/if}{/if} {$item.valuenetto|string_format:"%01.2f"} {if isset($item.valuenetto_custom_contents)} {$item.valuenetto_custom_contents} {/if}
{$item.s_valuenetto|string_format:"%01.2f"}
{if isset($item.s_valuenetto_custom_contents)} {$item.s_valuenetto_custom_contents} {/if}
{$item.tax} {$item.valuebrutto|string_format:"%01.2f"} {if isset($item.valuebrutto_custom_contents)} {$item.valuebrutto_custom_contents} {/if}
{$item.s_valuebrutto|string_format:"%01.2f"}
{if isset($item.s_valuebrutto_custom_contents)} {$item.s_valuebrutto_custom_contents} {/if}
{if !$invoice.closed} {button type="link" icon="edit" tip="Edit this item" onclick="editItem({$posuid});" class="invoice-contents-field-value"} {button type="link" icon="save" tip="Save this item" onclick="saveItem({$posuid});" class="invoice-contents-field-edit" visible=false} {button type="link" icon="cancel" tip="Cancel changes" onclick="cancelEditItem({$posuid});" class="invoice-contents-field-edit" visible=false} {button type="link" icon="delete" tip="Remove this item from list" onclick="delItem({$posuid});"} {/if}

{trans("Invoice have no items. Use form below for items addition.")}

{trans("Total:")} {sum array=$contents column=s_valuenetto string_format="%01.2f"}   {sum assign="s_valuebrutto" array=$contents column=s_valuebrutto} {$s_valuebrutto|string_format:"%01.2f"}  
{counter}. {block name="`$layout.module`-tariff-selection"}
{/block}
{if isset($itemdata) && !isset($error.posuid)} {$taxcategory = $itemdata.taxcategory} {else} {$taxcategory = 0} {/if} {tax_category_selection elementname="taxcategory" tip="Select tax category" selected=$taxcategory}
{button type="link" icon="save" tip="Add item" onclick="addItem();"}
{if $layout.module == 'invoicenew'} {/if} {button icon="cancel" label="Cancel" href="?m=invoicelist{if $invoice.proforma}&proforma=1{/if}"} {button icon="delete" label="Clear Contents" href="?m={$layout.module}&action=init{if $layout.module == 'invoiceedit'}&id={$invoice.id}{/if}"} {if !$customer} {button icon="save" label="Save" class="customer-alert"} {button icon="print" label="Save & Print" class="customer-alert"} {elseif !$contents} {button icon="save" label="Save" class="invoice-alert"} {button icon="print" label="Save & Print" class="invoice-alert"} {else} {button icon="save" label="Save" onclick="saveInvoice();"} {button icon="print" label="Save & Print" onclick="printInvoice();"} {/if}