{if $error}
{$LANG.invoiceserror}
{else}
{if $logo}

{else}

{$companyname}

{/if}
{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 $smarty.get.paymentsuccess} {elseif $smarty.get.pendingreview} {elseif $smarty.get.paymentfailed}

{$LANG.invoicepaymentfailedconfirmation}

{elseif $offlinepaid}

{$LANG.invoiceofflinepaid}

{/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 from=$invoiceitems item=item} {/foreach} {if $taxrate} {/if} {if $taxrate2} {/if}
{$LANG.invoicesdescription} {$LANG.invoicesamount}
{$item.description}{if $item.taxed eq "true"} *{/if} {$item.amount}
{$LANG.invoicessubtotal}: {$subtotal}
{$taxrate}% {$taxname}: {$tax}
{$taxrate2}% {$taxname2}: {$tax2}
{$LANG.invoicescredit}: {$credit}
{$LANG.invoicestotal}: {$total}
{if $taxrate}

* {$LANG.invoicestaxindicator}

{/if}
{$LANG.invoicestransactions}
{foreach from=$transactions item=transaction} {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}