{foreach $contents as $posuid => $item} {if $invoice.netflag} {if $item.vdiscount != 0} {$valuenetto = $item.valuenetto + $item.vdiscount} {elseif $item.pdiscount != 0} {$valuenetto = (100 * $item.valuenetto ) / (100 - $item.pdiscount)} {else} {$valuenetto = $item.valuenetto} {/if} {$valuenetto = round($valuenetto, 3)} {$valuebrutto = round($valuenetto * ($taxeslist[$item.taxid].value / 100 + 1), 3)} {else} {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, 3)} {$valuenetto = round($valuebrutto / ($taxeslist[$item.taxid].value / 100 + 1), 3)} {/if} {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("Type")}
{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|escape|nl2br} {if !empty($item.tariffid) && !empty($item.tariff.price_variants)} {capture assign="price_variants_hint"}
{trans("Price variants")}
{trans('Gross price')}
{trans('Net price')}
{trans('Quantity threshold')}
{foreach $item.tariff.price_variants as $price_variant}
{moneyf($price_variant.gross_price, $tariff.currency, 3)}
{moneyf($price_variant.net_price, $tariff.currency, 3)}
{$price_variant.quantity_threshold}
{/foreach}
{/capture} {hint text=$price_variants_hint method="rollover" icon="options"} {/if} {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} {strip} {if isset($_SERVICETYPES[$item.servicetype])} {$_SERVICETYPES[$item.servicetype]} {else} {trans("— none —")} {/if} {/strip} {strip} {if $item.taxcategory} ({sprintf('%02d', $item.taxcategory)}) {$_TAX_CATEGORIES[$item.taxcategory].label} {else} {trans("— none —")} {/if} {/strip}
{$item.prodid} {if isset($item.count_custom_contents)} {$item.count_custom_contents} {/if} {strip} {$item.count}
{$item.jm} {/strip}
{strip} {if $item.pdiscount != 0} {$item.pdiscount|string_format:"%01.2f %%"} {else} {if $item.vdiscount != 0} {$item.vdiscount|string_format:"%01.3f"} {/if} {/if} {/strip} {$item.valuenetto|string_format:"%01.3f"} {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}
{foreach $taxeslist as $tax} {/foreach} {$item.tax} {$item.valuebrutto|string_format:"%01.3f"} {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`-other-selection"} {/block}
{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}
{foreach $taxeslist as $tax} {/foreach}
{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}