{if $error}

{$LANG.invoiceserror}

{else}
{if $status eq "Unpaid"} {$LANG.invoicesunpaid}
{if $allowchangegateway}
{$gatewaydropdown}
{else} {$paymentmethod}
{/if} {$paymentbutton} {elseif $status eq "Paid"}
{$paymentmethod}
({$datepaid}) {elseif $status eq "Refunded"} {$LANG.invoicesrefunded} {elseif $status eq "Cancelled"} {$LANG.invoicescancelled} {elseif $status eq "Collections"} {$LANG.invoicescollections} {/if}
{if $logo}

{else}

{$companyname}

{/if}
{if $smarty.get.paymentsuccess} {elseif $smarty.get.pendingreview} {elseif $smarty.get.paymentfailed}

{$LANG.invoicepaymentfailedconfirmation}

{elseif $offlinepaid}

{$LANG.invoiceofflinepaid}

{else}
{/if} {if $manualapplycredit}
{$LANG.invoiceaddcreditdesc1} {$totalcredit}. {$LANG.invoiceaddcreditdesc2}
{$LANG.invoiceaddcreditamount}:

{/if}
{$LANG.invoicesinvoicedto}
{if $clientsdetails.companyname}{$clientsdetails.companyname}
{/if} {$clientsdetails.firstname} {$clientsdetails.lastname}
{$clientsdetails.address1}, {$clientsdetails.address2}
{$clientsdetails.city}, {$clientsdetails.state}, {$clientsdetails.postcode}
{$clientsdetails.country} {if $customfields}

{foreach from=$customfields item=customfield} {$customfield.fieldname}: {$customfield.value}
{/foreach} {/if}
{$LANG.invoicespayto}
{$payto}

{* This code should be uncommented for EU companies using the sequential invoice numbering so that when unpaid it is shown as a proforma invoice {if $status eq "Paid"}*}{$LANG.invoicenumber}{*{else}{$LANG.proformainvoicenumber}{/if}*}{$invoicenum}
{$LANG.invoicesdatecreated}: {$datecreated}
{$LANG.invoicesdatedue}: {$datedue}

{foreach key=num item=invoiceitem from=$invoiceitems} {/foreach} {if $taxrate}{/if} {if $taxrate2}{/if}
{$LANG.invoicesdescription}{$LANG.invoicesamount}
{$invoiceitem.description}{if $invoiceitem.taxed eq "true"} *{/if}{$invoiceitem.amount}
{$LANG.invoicessubtotal}: 
{$subtotal}
{$taxrate}% {$taxname}: 
{$tax}
{$taxrate2}% {$taxname2}: 
{$tax2}
{$LANG.invoicescredit}: 
{$credit}
{$LANG.invoicestotal}: 
{$total}
{if $taxrate}

* {$LANG.invoicestaxindicator}

{/if}

{$LANG.invoicestransactions}

{foreach key=num item=transaction from=$transactions} {foreachelse} {/foreach}
{$LANG.invoicestransdate}{$LANG.invoicestransgateway}{$LANG.invoicestransid}{$LANG.invoicestransamount}
{$transaction.date}{$transaction.gateway}{$transaction.transid}{$transaction.amount}
{$LANG.invoicestransnonefound}
{$LANG.invoicesbalance}: 
{$balance}
{if $notes}

{$LANG.invoicesnotes}: {$notes}

{/if}




{/if}

{$LANG.invoicesbacktoclientarea} | {$LANG.invoicesdownload} | {$LANG.closewindow}