{if $invalidInvoiceIdRequested} {include file="$template/includes/panel.tpl" type="danger" headerTitle="{lang key='error'}" bodyContent="{lang key='invoiceserror'}" bodyTextCenter=true} {else}
{if $logo}

{else}

{$companyname}

{/if}

{$pagetitle}

{if $status eq "Draft"} {lang key='invoicesdraft'} {elseif $status eq "Unpaid"} {lang key='invoicesunpaid'} {elseif $status eq "Paid"} {elseif $status eq "Refunded"} {lang key='invoicesrefunded'} {elseif $status eq "Cancelled"} {lang key='invoicescancelled'} {elseif $status eq "Collections"} {lang key='invoicescollections'} {elseif $status eq "Payment Pending"} {/if}
{if $status eq "Unpaid" || $status eq "Draft"}
{lang key='invoicesdatedue'}: {$datedue}
{$paymentbutton}
{/if}

{if $paymentSuccessAwaitingNotification} {include file="$template/includes/panel.tpl" type="success" headerTitle="{lang key='success'}" bodyContent="{lang key='invoicePaymentSuccessAwaitingNotify'}" bodyTextCenter=true} {elseif $paymentSuccess} {include file="$template/includes/panel.tpl" type="success" headerTitle="{lang key='success'}" bodyContent="{lang key='invoicepaymentsuccessconfirmation'}" bodyTextCenter=true} {elseif $paymentInititated} {include file="$template/includes/panel.tpl" type="info" headerTitle="{lang key='success'}" bodyContent="{lang key='invoicePaymentInitiated'}" bodyTextCenter=true} {elseif $pendingReview} {include file="$template/includes/panel.tpl" type="info" headerTitle="{lang key='success'}" bodyContent="{lang key='invoicepaymentpendingreview'}" bodyTextCenter=true} {elseif $paymentFailed} {include file="$template/includes/panel.tpl" type="danger" headerTitle="{lang key='error'}" bodyContent="{lang key='invoicepaymentfailedconfirmation'}" bodyTextCenter=true} {elseif $offlineReview} {include file="$template/includes/panel.tpl" type="info" headerTitle="{lang key='success'}" bodyContent="{lang key='invoiceofflinepaid'}" bodyTextCenter=true} {/if}
{lang key='invoicespayto'}
{$payto} {if $taxCode}
{$taxIdLabel}: {$taxCode}{/if}
{lang key='invoicesinvoicedto'}
{if $clientsdetails.companyname}{$clientsdetails.companyname}
{/if} {$clientsdetails.firstname} {$clientsdetails.lastname}
{$clientsdetails.address1}, {$clientsdetails.address2}
{$clientsdetails.city}, {$clientsdetails.state}, {$clientsdetails.postcode}
{$clientsdetails.country} {if $clientsdetails.tax_id}
{$taxIdLabel}: {$clientsdetails.tax_id} {/if} {if $customfields}

{foreach $customfields as $customfield} {$customfield.fieldname}: {$customfield.value}
{/foreach} {/if}
{lang key='paymentmethod'}
{if $status eq "Unpaid" && $allowchangegateway}
{$tokenInput}
{else} {$paymentmethod}{if $paymethoddisplayname} ({$paymethoddisplayname}){/if} {/if}


{lang key='invoicesdatecreated'}
{$date}


{if $manualapplycredit}

{lang key='invoiceaddcreditapply'}

{lang key='invoiceaddcreditdesc1'} {$totalcredit}. {lang key='invoiceaddcreditdesc2'}. {lang key='invoiceaddcreditamount'}:
{/if} {if $notes} {include file="$template/includes/panel.tpl" type="info" headerTitle="{lang key='invoicesnotes'}" bodyContent=$notes} {/if}

{lang key='invoicelineitems'}

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

* {lang key='invoicestaxindicator'}

{/if}
{foreach $transactions as $transaction} {foreachelse} {/foreach}
{lang key='invoicestransdate'} {lang key='invoicestransgateway'} {lang key='invoicestransid'} {lang key='invoicestransamount'}
{$transaction.date} {$transaction.gateway} {$transaction.transid} {$transaction.amount}
{lang key='invoicestransnonefound'}
{lang key='invoicesbalance'} {$balance}
{lang key='print'} {lang key='invoicesdownload'}
{/if}

{lang key='invoicesbacktoclientarea'}