User authentication is temporarily unavailable. If this situation persists, please inform your Wiki Admin.

Template - No Labels

This is modified to remove the labels and rearrange the Invoice Summary, add a PAID stamp which displays only when the $invoice.owing amount equals zero, plus add a PayPal button (passes $customer.name,$invoice.id and $invoice.total to PayPal)which works in both print preview and PDF but only when $invoice.owing amount is NOT equal to zero.

Version tested against

20080629 stable

Developed by

seesaw

Chris Straughton

To Edit

Search for these items and replace with your details.

Your Name (this is the name your cheques are made payable to) *optional

[email protected]%2ecom (this is the email address that paypal link will send payment to)

File Edit

style.css (edit this file and add the following code (edit the path-to-paid.gif)

.rec {
background-image: url("path-to-paid.gif");
background-repeat: no-repeat;
background-position: 55% 10%;
}

paid.gif (save this image to your server in the path detailed above)

Template

<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="{$css}">
<title>{$customer.name} - {$preference.pref_inv_wording} {$LANG.number_short}{$invoice.index_id}</title>
</head> {php}
global $customer;
{/php}

       {if $invoice.owing == 0.00 }
<body class="rec">


        {else}
<body>
        {/if}
<br>
<div id="container">
	<div id="header">
	</div>

	<table width="100%" align="center">
		<tr>
			<th align="left"><span><h1>{$preference.pref_inv_heading}</h1></span></th><td colspan="5"><img src="{$logo}" 

border="0" hspace="0" align="right"></td>
			
		</tr>
		</table>
	
	

<!-- Biller section - start -->
   
<table class="right">         
		
        
       	
<tr >
<td class='tbl1-right' align='right' >{$biller.street_address}</td>
</tr>   
			
					
<tr >
<td class='tbl1-right' align='right' >{$biller.street_address2}</td>
</tr>  
<tr >
<td class='tbl1-right' align='right'>	{$biller.city}		
        	</td>
</tr>	<tr>
								
<td class='tbl1-right' align='right' >{$biller.zip_code}</td>
		</tr>
<tr><td class='tbl1-right' align='right' >{$biller.phone}</td></tr>
<tr><td class='tbl1-right' align='right' ><a href="mailto:{$biller.email}">{$biller.email}</a></td></tr>
<tr><td class='tbl1-right' align='right' >{$biller.custom_field1}</td></tr>     	 	
</table>
<!-- Biller section - end -->


<br>
<!-- Customer section - start -->	<table class="left">

    
	<tr>
			<td class="tbl1-left tbl1-top tbl1-bottom col11" ><b></b></td>
			<td class="tbl1-top tbl1-bottom col11 tbl1-right" colspan="3"><b>{$customer.name}</b></td>
	</tr>

        {if $customer.attention != null }
    <tr>
            <td class='tbl1-left'></td>
			<td align=left class='tbl1-right' colspan="3" >{$customer.attention}</td>
                </tr>
       {/if}
        {if $customer.street_address != null }
    <tr >
            <td class='tbl1-left'></td>
			<td class='tbl1-right' align=left colspan="3">{$customer.street_address}</td>
    </tr>   
        {/if}
        {if $customer.street_address2 != null}
                {if $customer.street_address == null}
    <tr>
            <td class='tbl1-left'></td>
			<td class='tbl1-right' align=left colspan="3">{$customer.street_address2}</td>
    </tr>   
                {/if}
                {if $customer.street_address != null}
    <tr>
			<td class='tbl1-left'></td>
			<td class='tbl1-right' align=left colspan="3">{$customer.street_address2}</td>
    </tr>   
                {/if}
        {/if}
		
		{merge_address field1=$customer.city field2=$customer.state field3=$customer.zip_code street1=$customer.street_address 

street2=$customer.street_addtess2 class1="tbl1-left" class2="tbl1-right" colspan="3"}

         {if $customer.country != null}
    <tr>
            <td class='tbl1-left'></td>
			<td class='tbl1-right' colspan="3">{$customer.country}</td>
    </tr>
        {/if}

{if $customer.phone != null}
    <tr>
            <td class='tbl1-left'></td>
			<td class='tbl1-right' colspan="3">{$customer.phone}</td>

    </tr>
        {/if}

{if $customer.mobile_phone != null}
    <tr>
            <td class='tbl1-left'></td>
			<td class='tbl1-right' colspan="3">{$customer.mobile_phone}</td>
    </tr>
        {/if}

{if $customer.email != null}
    <tr>
            <td class='tbl1-left'></td>
			<td class='tbl1-right' colspan="3"><a href="mailto:{$customer.email}">{$customer.email}</a></td>
    </tr>
        {/if}

	

	{print_if_not_null label=$customFieldLabels.customer_cf1 field=$customer.custom_field1 class1='tbl1-left' class2='tbl1-right' 

colspan="3"}
	{print_if_not_null label=$customFieldLabels.customer_cf2 field=$customer.custom_field2 class1='tbl1-left' class2='tbl1-right' 

colspan="3"}
	{print_if_not_null label=$customFieldLabels.customer_cf3 field=$customer.custom_field3 class1='tbl1-left' class2='tbl1-right' 

colspan="3"}
	{print_if_not_null label=$customFieldLabels.customer_cf4 field=$customer.custom_field4 class1='tbl1-left' class2='tbl1-right' 

colspan="3"}

		<tr>
			<td class="tbl1-top" colspan="4"></td>
		</tr>
	</table>

	<br><!-- Customer section - end -->

<br>
<!-- Summary - start -->	
<table width=100% >		
<tr>
<td align="center" colspan=5 class="col11 tbl1"><b>{$preference.pref_inv_wording} {$LANG.summary}</b></td>
</tr>
<tr class="col1">
<td width=20% align="center"><b>{$preference.pref_inv_wording} {$LANG.number_short}</b></td>
<td width=20% align="center"><b>{$preference.pref_inv_wording} {$LANG.date}</b></td>
		
<!-- Show the Invoice Custom Fields if valid -->
		
{ if $invoice.custom_field1 != null}
						<td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf1}</td>
				<td class="tbl1-left">{$invoice.custom_field1}</td>
				{/if}
		{ if $invoice.custom_field2 != null}
						<td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf2}</td>
				<td class="tbl1-left">{$invoice.custom_field2}</td>
				{/if}
		{ if $invoice.custom_field3 != null}
						<td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf3}</td>
				<td class="tbl1-left">{$invoice.custom_field3}</td>
				{/if}
		{ if $invoice.custom_field4 != null}
						<td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf4}</td>
				<td class="tbl1-left">{$invoice.custom_field4}</td>{/if}

<td width=20% align="center"><b>{$LANG.total}</b></td>
<td width=20% align="center"><b>{$LANG.paid}</b></td>
<td width=20% align="center"><b>{$LANG.owing}</b></td>
</tr>

<tr class="col11">
<td width=20% align="center">{$invoice.index_id}</td>
<td width=20% align="center">{$invoice.date}</td>

<!-- Show the Invoice Custom Fields if valid -->
		{ if $invoice.custom_field1 != null}
			<td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf1}:</td>		<td 

class="tbl1-left">{$invoice.custom_field1}</td>			{/if}	{ if $invoice.custom_field2 != null}
						<td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf2}</td>				

<td class="tbl1-left">{$invoice.custom_field2}</td>
				{/if}	{ if $invoice.custom_field3 != null}
						<td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf3}</td>				

<td class="tbl1-left">{$invoice.custom_field3}</td>
				{/if}		{ if $invoice.custom_field4 != null}
						<td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf4}</td>				

<td class="tbl1-left">{$invoice.custom_field4}</td>				{/if}

<td width=20% align="center">{$preference.pref_currency_sign}{$invoice.total|number_format:2}</td>
<td width=20% align="center">{$preference.pref_currency_sign}{$invoice.paid|number_format:2}</td>
<td width=20% align="center">{$preference.pref_currency_sign}{$invoice.owing|number_format:2}</td>
</tr>
</table>

<!-- Summary - end -->
<br>

<!-- Invoice items - start -->	<table class="left" width="100%">
		<tr>
			<td colspan="6"><br /></td>
		</tr>

	{if $invoice.type_id == 2 }
					<tr class="col1">
				<td class="tbl1 "><b>{$LANG.quantity_short}</b></td>
				<td class="tbl1 "><b>{$LANG.description}</b></td>
				<td class="tbl1 "><b>{$LANG.unit_price}</b></td>
				<td class="tbl1 "><b>{$LANG.gross_total}</b></td>
				<td class="tbl1 "><b>{$LANG.tax}</b></td>
				<td class="tbl1 " align="right"><b>{$LANG.total_uppercase}</b></td>
			</tr>
			
				{foreach from=$invoiceItems item=invoiceItem}

			<tr class="tbl1" >
				<td class="tbl1">{$invoiceItem.quantity|number_format:2}</td>
				<td class="tbl1">{$invoiceItem.product.description}</td>
				<td class="tbl1">{$preference.pref_currency_sign}{$invoiceItem.unit_price|number_format:2}</td>
				<td class="tbl1">{$preference.pref_currency_sign}{$invoiceItem.gross_total|number_format:2}</td>
				<td class="tbl1">{$preference.pref_currency_sign}{$invoiceItem.tax_amount|number_format:2}</td>
				<td class="tbl1" align="right">{$preference.pref_currency_sign}{$invoiceItem.total|number_format:2}</td>
			</tr>
            <tr>
                <td class="tbl1-left"></td>
				<td class="tbl1-right" colspan="5">
					<table width="100%">
						<tr>

					{inv_itemised_cf label=$customFieldLabels.product_cf1 field=$invoiceItem.product.custom_field1}
					{do_tr number=1 class="blank-class"}
					{inv_itemised_cf label=$customFieldLabels.product_cf2 field=$invoiceItem.product.custom_field2}
					{do_tr number=2 class="blank-class"}
					{inv_itemised_cf label=$customFieldLabels.product_cf3 field=$invoiceItem.product.custom_field3}
					{do_tr number=3 class="blank-class"}
					{inv_itemised_cf label=$customFieldLabels.product_cf4 field=$invoiceItem.product.custom_field4}
					{do_tr number=4 class="blank-class"}
 
						</tr>
					</table>
                </td>
            </tr>
             	{/foreach}
	{/if}

	{if $invoice.type_id == 3 }
			<tr class="tbl1 col1">
				<td class="tbl1"><b>{$LANG.quantity_short}</b></td>
				<td class="tbl1"><b>{$LANG.item}</b></td>
				<td class="tbl1"><b>{$LANG.unit_price}</b></td>
				<td class="tbl1"><b>{$LANG.gross_total}</b></td>
				<td class="tbl1"><b>{$LANG.tax}</b></td>
				<td align="right" class="tbl1"><b>{$LANG.total_uppercase}</b></td>
			</tr>
		
			{foreach from=$invoiceItems item=invoiceItem}
	
			<tr class="tbl1-left tbl1-right">
				<td class="tbl1-left" >{$invoiceItem.quantity|number_format:2}</td>
				<td>{$invoiceItem.product.description}</td>
				<td class="tbl1-right" colspan="4"></td>
			</tr>
			
            <tr>       
                <td class="tbl1-left"></td>
				<td class="tbl1-right" colspan="5">
                    <table width="100%">
                        <tr>

					{inv_itemised_cf label=$customFieldLabels.product_cf1 field=$invoiceItem.product.custom_field1}
					{do_tr number=1 class="blank-class"}
					{inv_itemised_cf label=$customFieldLabels.product_cf2 field=$invoiceItem.product.custom_field2}
					{do_tr number=2 class="blank-class"}
					{inv_itemised_cf label=$customFieldLabels.product_cf3 field=$invoiceItem.product.custom_field3}
					{do_tr number=3 class="blank-class"}
					{inv_itemised_cf label=$customFieldLabels.product_cf4 field=$invoiceItem.product.custom_field4}
					{do_tr number=4 class="blank-class"}

                        </tr>
                    </table>
                </td>
            </tr>
	
			<tr class="tbl1-left tbl1-right">
				<td class="tbl1-left"></td>
				<td class="tbl1-right" colspan="5"><font size=1>{$invoiceItem.description}</font></td>
			</tr>
			<tr class="tbl1-left tbl1-right tbl1-bottom">
				<td class="tbl1-left tbl1-bottom" ></td>
				<td class="tbl1-bottom"></td>
				<td class="tbl1-bottom">{$preference.pref_currency_sign}{$invoiceItem.unit_price|number_format:2}</td>
				<td class="tbl1-bottom">{$preference.pref_currency_sign}{$invoiceItem.gross_total|number_format:2}</td>
				<td class="tbl1-bottom ">{$preference.pref_currency_sign}{$invoiceItem.tax_amount|number_format:2}</td>
				<td align="right" class="tbl1-right 

tbl1-bottom">{$preference.pref_currency_sign}{$invoiceItem.total|number_format:2}</td>
			</tr>
			{/foreach}
	{/if}
	
	{if $invoice.type_id == 1 }
		    <table class="left" width="100%">

                <tr class="tbl1 col1" >
                    <td class="tbl1 col11 tbl1-right" colspan="6"><b>{$LANG.description}</b></td>
                </tr>
                
          {foreach from=$invoiceItems item= invoiceItem}

			    <tr class="tbl1-left tbl1-right">
                    <td class="tbl1-left tbl1-right" colspan="6">{$invoiceItem.description}</td>
                </tr>
                <tr class="tbl1-left tbl1-right">
                    <td colspan="6" class="tbl1-left tbl1-right"><br></td>
                </tr>

		{/foreach}
	{/if}

{if ($invoice.type_id == 2 && $invoice.note != "") || ($invoice.type_id == 3 && $invoice.note != "" )  }

		<tr>
			<td class="tbl1-left tbl1-right" colspan="6"><br></td>
		</tr>
		<tr>
			<td class="tbl1-left tbl1-right" colspan="6" align="left"><b>{$LANG.notes}:</b></td>
		</tr>
		<tr>
			<td class="tbl1-left tbl1-right" colspan="6">{$invoice.note}</td>
		</tr>

{/if}

	<tr class="tbl1-left tbl1-right">
		<td class="tbl1-left tbl1-right" colspan="6" ><br></td>
	</tr>
	
	<tr>
		<td class="tbl1-left" colspan="2"></td>
		<td align="right" colspan="3">{$LANG.gross_total}</td>
{php}   global $invoice; $this->assign('invoice_gross_total', $invoice[total] - $invoice[total_tax]); {/php}
{if $invoice.type_id == 1} <!-- Only Type 1 is a single entry - hence last row gross is valid as gross_total - see Invoice 2 in sample 

data-->
		<td align="right" class="tbl1-right">{$preference.pref_currency_sign}{$invoiceItems.0.gross_total|number_format:2}</td>
{else}
		<td align="right" class="tbl1-right">{$preference.pref_currency_sign}{$invoice_gross_total|number_format:2}</td>
{/if}
	</tr>	
	<tr class="tbl1-left tbl1-right">
		<td class="tbl1-left" colspan="2"></td>
		<td align="right" colspan="3">{$LANG.tax_total}</td>
		<td align="right" class="tbl1-right" >{$preference.pref_currency_sign}{$invoice.total_tax|number_format:2}</td>
	</tr>
	<tr class="tbl1-left tbl1-right">
		<td class="tbl1-left tbl1-right" colspan="6" ><br></td>
	</tr>
	<tr class="tbl1-left tbl1-right tbl1-bottom">
		<td class="tbl1-left tbl1-bottom" colspan="2"></td>
		<td class="tbl1-bottom" align="right" colspan="3"><b>{$preference.pref_inv_wording} {$LANG.amount}</b></td>
		<td  class="tbl1-bottom tbl1-right" 

align="right"><u>{$preference.pref_currency_sign}{$invoice.total|number_format:2}</u></td>
	</tr>
	<tr>
		<td colspan="6"><br /><br /></td>
	</tr>
	
	
<!-- invoice items section - end -->

<!-- invoice details section - start -->

	<tr>
		<td class="tbl1-left tbl1-right" colspan="6"><i>{$preference.pref_inv_detail_line}</i></td>
	</tr>
	<tr>
		<td class="tbl1-left tbl1-right" colspan="6">{$preference.pref_inv_payment_method}</td>
	</tr>
	<tr>
		<td class="tbl1-left tbl1-right" colspan="6">{$preference.pref_inv_payment_line1_name} 

{$preference.pref_inv_payment_line1_value}</td>
	</tr>
	<tr>
		<td class="tbl1-left tbl1-bottom tbl1-right" colspan="6">{$preference.pref_inv_payment_line2_name} 

{$preference.pref_inv_payment_line2_value}</td>
	</tr>
	<tr>
		<td><br></td>
	</tr>{if $invoice.owing == 0.00 }<tr align=center><td colspan=6>--- paid with thanks ---<br><br></td>{else}<tr><td colspan=6><div 

align="center" style="font-family: arial; font-size: 11pt; color: blue">Please make cheques payable to</td></tr><tr><td colspan=6><div 

align="center" style="font-family: arial; font-size: 12pt; color: red"><b>Your Name</b><br><br></td></tr><tr><td width=100% 

colspan=6><div align="center" style="font-family: arial; font-size: 11pt; color: blue">Secure Online Payment via PayPal

<br>
{php} print '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&[email protected]%2ecom&item_name='.$customer[name].' - 

Invoice No: ' . 

$invoice[id].'&amount='.$invoice[total].'&no_shipping=0&no_note=1&currency_code=GBP&lc=GB&bn=PP%2dBuyNowBF&charset=UTF%2d8" 

target="_blank"><img src="https://www.paypal.com/en_GB/i/btn/btn_paynow_LG.gif" border=0></a>'; {/php}
</div><br><br>


</td></tr>{/if} 


	<tr>
		<td colspan="6"><div style="font-size:8pt;" align="center">{$biller.footer}</div></td>
	</tr>

	<!-- invoice details section - end -->

</table>

<div id="footer"></div>

</div>

</body>
</html>

Preview

Discussion

Richard Brooks, 2009/02/14 07:32

I was wanting to be able to use this template, but not have to manually code the Pay Checks to and PayPal address.

Your Code :-

align=“center” style=“font-family: arial; font-size: 11pt; color: blue”>Please make cheques payable to</td></tr><tr><td colspan=6><div

align=“center” style=“font-family: arial; font-size: 12pt; color: red”><b>Your Name</b><br><br></td></tr><tr><td width=100%

colspan=6><div align=“center” style=“font-family: arial; font-size: 11pt; color: blue”>Secure Online Payment via PayPal

<br> {php} print '<a href=“https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&[email protected]%2ecom&item_name='.$customer[name].' -

Invoice No: ' .

$invoice[id].'&amount='.$invoice[total].'&no_shipping=0&no_note=1&currency_code=GBP&lc=GB&bn=PP%2dBuyNowBF&charset=UTF%2d8”

target=“_blank”><img src=“https://www.paypal.com/en_GB/i/btn/btn_paynow_LG.gif” border=0></a>'; {/php}

My Changes :- align=“center” style=“font-family: arial; font-size: 11pt; color: blue”>Please make cheques payable to</td></tr><tr><td colspan=6><div

align=“center” style=“font-family: arial; font-size: 12pt; color: red”><b>{$biller.name}</b><br><br></td></tr><tr><td width=100%

colspan=6><div align=“center” style=“font-family: arial; font-size: 11pt; color: blue”>Secure Online Payment via PayPal

<br> <a href=“https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business={$biller.email}&item_name={$customer.name} - Invoice No: {$invoice.id}&amount={$invoice.total}&no_shipping=0&no_note=1&currency_code=AUD&lc=AU&bn=PP%2dBuyNowBF&charset=UTF%2d8” target=“_blank”><img src=“https://www.paypal.com/en_GB/i/btn/btn_paynow_LG.gif” border=0></a>

I bascially removed the {php}{/php} tags and the print function.

Now the template automatically gets the Biller Name and Email address into the correct place :)

Neil Marshall, 2009/12/30 22:58

Would it Be possible to Upload your Full Template Code Richard

Michael Bogle, 2011/12/27 06:07

I had a had time with this as well so im posting my full code for you. I think the issue with my case was copying and pasting from the browser and it's double quotes were an issue. Once I replaced them with the quotes when typed from MY keyboard this code actually WORKS! Also there is no tick mark (') issue aka %27 in front of the amount that I had with some other code segments that I used. You really only need the portion at the bottom. I hope this doesn't get mangled either. Also the code works with either {invoice.owing} or {invoice.total} which I probably will change with what COLIN GARDOM pointed out. I gotta test first though. Great template by the way.

UPDATE 12/27: I was having an issue with the auto notify and return url features so that paypal will notify SimpleInvoices that the invoice was paid. This is due to the old code in this template which I updated with new code below. This gives it a larger button and doesn't require you to hard code your Currency and other info. This was apart of the default template which I prefer this over by far. The code has already been replaced but here is the comparison. Also make sure your paid.gif has the right perms (755 for me) and the following in the style.css. I know this is a bit explicit but im sure many others are like me and they need exact instructions to help them at times when it comes to new things.

.rec {
background-image: url("http://sub.domain.com/templates/invoices/default/paid.gif");
background-repeat: no-repeat;
background-position: 55% 10%;
}

Replace the OLD with the NEW. Huh thats funny it is close to New Years :)

OLD:

<br>
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&[email protected]%2ecom&item_name={$customer.name} - Invoice No: {$invoice.id}&amount={$invoice.total}&no_shipping=0&no_note=1&currency_code=USD&lc=US&bn=PP%2dBuyNowBF&charset=UTF%2d8" target="_blank"><img src="https://www.paypal.com/en_US/i/btn/btn_paynow_LG.gif" border=0></a>

NEW:

<tr>
                <td colspan="6"><div style="font-size:8pt;" align="center">
                        {online_payment_link
                                type=$preference.include_online_payment business=$biller.paypal_business_name
                                item_name=$invoice.index_name invoice=$invoice.id
                                amount=$invoice.total currency_code=$preference.currency_code
                                link_wording=$LANG.paypal_link
                                notify_url=$biller.paypal_notify_url return_url=$biller.paypal_return_url
                                domain_id = $invoice.domain_id include_image=true
                        }
                        </div>
                </td>
        </tr>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="{$css}">
<link rel="shortcut icon" href="http://x.x.x.x/fav-icon/favicon.ico" />
<title>{$customer.name} - {$preference.pref_inv_wording} {$LANG.number_short}{$invoice.id}</title>
</head> {php}
global $customer;
{/php}

       {if $invoice.owing == 0.00 }
<body class="rec">


        {else}
<body>
        {/if}
<br>
<div id="container">
        <div id="header">
        </div>

        <table width="100%" align="center">
                <tr>
                        <th align="left"><span><h1>{$preference.pref_inv_heading}</h1></span></th><td colspan="5"><img src="{$logo}"

border="0" hspace="0" align="right"></td>

                </tr>
                </table>



<!-- Biller section - start -->

<table class="right">



<tr >
<td class='tbl1-right' align='right' >{$biller.street_address}</td>
</tr>


<tr >
<td class='tbl1-right' align='right' >{$biller.street_address2}</td>
</tr>
<tr >
<td class='tbl1-right' align='right'>   {$biller.city}
                </td>
</tr>   <tr>

<td class='tbl1-right' align='right' >{$biller.zip_code}</td>
                </tr>
<tr><td class='tbl1-right' align='right' >{$biller.phone}</td></tr>
<tr><td class='tbl1-right' align='right' ><a href="mailto:{$biller.email}">{$biller.email}</a></td></tr>
<tr><td class='tbl1-right' align='right' >{$biller.custom_field1}</td></tr>
</table>
<!-- Biller section - end -->


<br>
<!-- Customer section - start -->       <table class="left">


        <tr>
                        <td class="tbl1-left tbl1-top tbl1-bottom col11" ><b></b></td>
                        <td class="tbl1-top tbl1-bottom col11 tbl1-right" colspan="3"><b>{$customer.name}</b></td>
        </tr>

        {if $customer.attention != null }
    <tr>
            <td class='tbl1-left'></td>
                        <td align=left class='tbl1-right' colspan="3" >{$customer.attention}</td>
                </tr>
       {/if}
        {if $customer.street_address != null }
    <tr >
            <td class='tbl1-left'></td>
                        <td class='tbl1-right' align=left colspan="3">{$customer.street_address}</td>
    </tr>
        {/if}
        {if $customer.street_address2 != null}
                {if $customer.street_address == null}
    <tr>
            <td class='tbl1-left'></td>
                        <td class='tbl1-right' align=left colspan="3">{$customer.street_address2}</td>
    </tr>
                {/if}
                {if $customer.street_address != null}
    <tr>
                        <td class='tbl1-left'></td>
                        <td class='tbl1-right' align=left colspan="3">{$customer.street_address2}</td>
    </tr>
                {/if}
        {/if}

                {merge_address field1=$customer.city field2=$customer.state field3=$customer.zip_code street1=$customer.street_address

street2=$customer.street_addtess2 class1="tbl1-left" class2="tbl1-right" colspan="3"}

         {if $customer.country != null}
    <tr>
            <td class='tbl1-left'></td>
                        <td class='tbl1-right' colspan="3">{$customer.country}</td>
    </tr>
        {/if}

{if $customer.phone != null}
    <tr>
            <td class='tbl1-left'></td>
                        <td class='tbl1-right' colspan="3">{$customer.phone}</td>

    </tr>
        {/if}

{if $customer.mobile_phone != null}
    <tr>
            <td class='tbl1-left'></td>
                        <td class='tbl1-right' colspan="3">{$customer.mobile_phone}</td>
    </tr>
        {/if}

{if $customer.email != null}
    <tr>
            <td class='tbl1-left'></td>
                        <td class='tbl1-right' colspan="3"><a href="mailto:{$customer.email}">{$customer.email}</a></td>
    </tr>
        {/if}



        {print_if_not_null label=$customFieldLabels.customer_cf1 field=$customer.custom_field1 class1='tbl1-left' class2='tbl1-right'

colspan="3"}
        {print_if_not_null label=$customFieldLabels.customer_cf2 field=$customer.custom_field2 class1='tbl1-left' class2='tbl1-right'

colspan="3"}
        {print_if_not_null label=$customFieldLabels.customer_cf3 field=$customer.custom_field3 class1='tbl1-left' class2='tbl1-right'

colspan="3"}
        {print_if_not_null label=$customFieldLabels.customer_cf4 field=$customer.custom_field4 class1='tbl1-left' class2='tbl1-right'

colspan="3"}

                <tr>
                        <td class="tbl1-top" colspan="4"></td>
                </tr>
        </table>

        <br><!-- Customer section - end -->

<br>
<!-- Summary - start -->
<table width=100% >
<tr>
<td align="center" colspan=5 class="col11 tbl1"><b>{$preference.pref_inv_wording} {$LANG.summary}</b></td>
</tr>
<tr class="col1">
<td width=20% align="center"><b>{$preference.pref_inv_wording} {$LANG.number_short}</b></td>
<td width=20% align="center"><b>{$preference.pref_inv_wording} {$LANG.date}</b></td>

<!-- Show the Invoice Custom Fields if valid -->

{ if $invoice.custom_field1 != null}
                                                <td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf1}</td>
                                <td class="tbl1-left">{$invoice.custom_field1}</td>
                                {/if}
                { if $invoice.custom_field2 != null}
                                                <td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf2}</td>
                                <td class="tbl1-left">{$invoice.custom_field2}</td>
                                {/if}
                { if $invoice.custom_field3 != null}
                                                <td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf3}</td>
                                <td class="tbl1-left">{$invoice.custom_field3}</td>
                                {/if}
                { if $invoice.custom_field4 != null}
                                                <td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf4}</td>
                                <td class="tbl1-left">{$invoice.custom_field4}</td>{/if}

<td width=20% align="center"><b>{$LANG.total}</b></td>
<td width=20% align="center"><b>{$LANG.paid}</b></td>
<td width=20% align="center"><b>{$LANG.owing}</b></td>
</tr>

<tr class="col11">
<td width=20% align="center">{$invoice.id}</td>
<td width=20% align="center">{$invoice.date}</td>

<!-- Show the Invoice Custom Fields if valid -->
                { if $invoice.custom_field1 != null}
                        <td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf1}:</td>             <td

class="tbl1-left">{$invoice.custom_field1}</td>                 {/if}   { if $invoice.custom_field2 != null}
                                                <td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf2}</td>

<td class="tbl1-left">{$invoice.custom_field2}</td>
                                {/if}   { if $invoice.custom_field3 != null}
                                                <td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf3}</td>

<td class="tbl1-left">{$invoice.custom_field3}</td>
                                {/if}           { if $invoice.custom_field4 != null}
                                                <td nowrap class="tbl1-left">{$customFieldLabels.invoice_cf4}</td>

<td class="tbl1-left">{$invoice.custom_field4}</td>                             {/if}

<td width=20% align="center">{$preference.pref_currency_sign}{$invoice.total|number_format:2}</td>
<td width=20% align="center">{$preference.pref_currency_sign}{$invoice.paid|number_format:2}</td>
<td width=20% align="center">{$preference.pref_currency_sign}{$invoice.owing|number_format:2}</td>
</tr>
</table>

<!-- Summary - end -->
<br>

<!-- Invoice items - start -->  <table class="left" width="100%">
                <tr>
                        <td colspan="6"><br /></td>
                </tr>

        {if $invoice.type_id == 2 }
                                        <tr class="col1">
                                <td class="tbl1 "><b>{$LANG.quantity_short}</b></td>
                                <td class="tbl1 "><b>{$LANG.description}</b></td>
                                <td class="tbl1 "><b>{$LANG.unit_price}</b></td>
                                <td class="tbl1 "><b>{$LANG.gross_total}</b></td>
                                <td class="tbl1 "><b>{$LANG.tax}</b></td>
                                <td class="tbl1 " align="right"><b>{$LANG.total_uppercase}</b></td>
                        </tr>

                                {foreach from=$invoiceItems item=invoiceItem}

                        <tr class="tbl1" >
                                <td class="tbl1">{$invoiceItem.quantity|number_format:2}</td>
                                <td class="tbl1">{$invoiceItem.product.description}</td>
                                <td class="tbl1">{$preference.pref_currency_sign}{$invoiceItem.unit_price|number_format:2}</td>
                                <td class="tbl1">{$preference.pref_currency_sign}{$invoiceItem.gross_total|number_format:2}</td>
                                <td class="tbl1">{$preference.pref_currency_sign}{$invoiceItem.tax_amount|number_format:2}</td>
                                <td class="tbl1" align="right">{$preference.pref_currency_sign}{$invoiceItem.total|number_format:2}</td>
                        </tr>
            <tr>
                <td class="tbl1-left"></td>
                                <td class="tbl1-right" colspan="5">
                                        <table width="100%">
                                                <tr>

                                        {inv_itemised_cf label=$customFieldLabels.product_cf1 field=$invoiceItem.product.custom_field1}
                                        {do_tr number=1 class="blank-class"}
                                        {inv_itemised_cf label=$customFieldLabels.product_cf2 field=$invoiceItem.product.custom_field2}
                                        {do_tr number=2 class="blank-class"}
                                        {inv_itemised_cf label=$customFieldLabels.product_cf3 field=$invoiceItem.product.custom_field3}
                                        {do_tr number=3 class="blank-class"}
                                        {inv_itemised_cf label=$customFieldLabels.product_cf4 field=$invoiceItem.product.custom_field4}
                                        {do_tr number=4 class="blank-class"}

                                                </tr>
                                        </table>
                </td>
            </tr>
                {/foreach}
        {/if}

        {if $invoice.type_id == 3 }
                        <tr class="tbl1 col1">
                                <td class="tbl1"><b>{$LANG.quantity_short}</b></td>
                                <td class="tbl1"><b>{$LANG.item}</b></td>
                                <td class="tbl1"><b>{$LANG.unit_price}</b></td>
                                <td class="tbl1"><b>{$LANG.gross_total}</b></td>
                                <td class="tbl1"><b>{$LANG.tax}</b></td>
                                <td align="right" class="tbl1"><b>{$LANG.total_uppercase}</b></td>
                        </tr>

                        {foreach from=$invoiceItems item=invoiceItem}

                        <tr class="tbl1-left tbl1-right">
                                <td class="tbl1-left" >{$invoiceItem.quantity|number_format:2}</td>
                                <td>{$invoiceItem.product.description}</td>
                                <td class="tbl1-right" colspan="4"></td>
                        </tr>

            <tr>
                <td class="tbl1-left"></td>
                                <td class="tbl1-right" colspan="5">
                    <table width="100%">
                        <tr>

                                        {inv_itemised_cf label=$customFieldLabels.product_cf1 field=$invoiceItem.product.custom_field1}
                                        {do_tr number=1 class="blank-class"}
                                        {inv_itemised_cf label=$customFieldLabels.product_cf2 field=$invoiceItem.product.custom_field2}
                                        {do_tr number=2 class="blank-class"}
                                        {inv_itemised_cf label=$customFieldLabels.product_cf3 field=$invoiceItem.product.custom_field3}
                                        {do_tr number=3 class="blank-class"}
                                        {inv_itemised_cf label=$customFieldLabels.product_cf4 field=$invoiceItem.product.custom_field4}
                                        {do_tr number=4 class="blank-class"}

                        </tr>
                    </table>
                </td>
            </tr>

                        <tr class="tbl1-left tbl1-right">
                                <td class="tbl1-left"></td>
                                <td class="tbl1-right" colspan="5"><font size=1>{$invoiceItem.description}</font></td>
                        </tr>
                        <tr class="tbl1-left tbl1-right tbl1-bottom">
                                <td class="tbl1-left tbl1-bottom" ></td>
                                <td class="tbl1-bottom"></td>
                                <td class="tbl1-bottom">{$preference.pref_currency_sign}{$invoiceItem.unit_price|number_format:2}</td>
                                <td class="tbl1-bottom">{$preference.pref_currency_sign}{$invoiceItem.gross_total|number_format:2}</td>
                                <td class="tbl1-bottom ">{$preference.pref_currency_sign}{$invoiceItem.tax_amount|number_format:2}</td>
                                <td align="right" class="tbl1-right

tbl1-bottom">{$preference.pref_currency_sign}{$invoiceItem.total|number_format:2}</td>
                        </tr>
                        {/foreach}
        {/if}

        {if $invoice.type_id == 1 }
                    <table class="left" width="100%">

                <tr class="tbl1 col1" >
                    <td class="tbl1 col11 tbl1-right" colspan="6"><b>{$LANG.description}</b></td>
                </tr>

          {foreach from=$invoiceItems item= invoiceItem}

                            <tr class="tbl1-left tbl1-right">
                    <td class="tbl1-left tbl1-right" colspan="6">{$invoiceItem.description}</td>
                </tr>
                <tr class="tbl1-left tbl1-right">
                    <td colspan="6" class="tbl1-left tbl1-right"><br></td>
                </tr>

                {/foreach}
        {/if}

{if ($invoice.type_id == 2 && $invoice.note != "") || ($invoice.type_id == 3 && $invoice.note != "" )  }

                <tr>
                        <td class="tbl1-left tbl1-right" colspan="6"><br></td>
                </tr>
                <tr>
                        <td class="tbl1-left tbl1-right" colspan="6" align="left"><b>{$LANG.notes}:</b></td>
                </tr>
                <tr>
                        <td class="tbl1-left tbl1-right" colspan="6">{$invoice.note}</td>
                </tr>

{/if}

        <tr class="tbl1-left tbl1-right">
                <td class="tbl1-left tbl1-right" colspan="6" ><br></td>
        </tr>

        <tr>
                <td class="tbl1-left" colspan="2"></td>
                <td align="right" colspan="3">{$LANG.gross_total}</td>
{php}   global $invoice; $this->assign('invoice_gross_total', $invoice[total] - $invoice[total_tax]); {/php}
{if $invoice.type_id == 1} <!-- Only Type 1 is a single entry - hence last row gross is valid as gross_total - see Invoice 2 in sample

data-->
                <td align="right" class="tbl1-right">{$preference.pref_currency_sign}{$invoiceItems.0.gross_total|number_format:2}</td>
{else}
                <td align="right" class="tbl1-right">{$preference.pref_currency_sign}{$invoice_gross_total|number_format:2}</td>
{/if}
        </tr>
        <tr class="tbl1-left tbl1-right">
                <td class="tbl1-left" colspan="2"></td>
                <td align="right" colspan="3">{$LANG.tax_total}</td>
                <td align="right" class="tbl1-right" >{$preference.pref_currency_sign}{$invoice.total_tax|number_format:2}</td>
        </tr>
        <tr class="tbl1-left tbl1-right">
                <td class="tbl1-left tbl1-right" colspan="6" ><br></td>
        </tr>
        <tr class="tbl1-left tbl1-right tbl1-bottom">
                <td class="tbl1-left tbl1-bottom" colspan="2"></td>
                <td class="tbl1-bottom" align="right" colspan="3"><b>{$preference.pref_inv_wording} {$LANG.amount}</b></td>
                <td  class="tbl1-bottom tbl1-right"

align="right"><u>{$preference.pref_currency_sign}{$invoice.total|number_format:2}</u></td>
        </tr>
        <tr>
                <td colspan="6"><br /><br /></td>
        </tr>


<!-- invoice items section - end -->

<!-- invoice details section - start -->

        <tr>
                <td class="tbl1-left tbl1-right" colspan="6"><i>{$preference.pref_inv_detail_line}</i></td>
        </tr>
        <tr>
                <td class="tbl1-left tbl1-right" colspan="6">{$preference.pref_inv_payment_method}</td>
        </tr>
        <tr>
                <td class="tbl1-left tbl1-right" colspan="6">{$preference.pref_inv_payment_line1_name}

{$preference.pref_inv_payment_line1_value}</td>
        </tr>
        <tr>
                <td class="tbl1-left tbl1-bottom tbl1-right" colspan="6">{$preference.pref_inv_payment_line2_name}

{$preference.pref_inv_payment_line2_value}</td>
        </tr>
        <tr>
                <td><br></td>
        </tr>{if $invoice.owing == 0.00 }<tr align=center><td colspan=6>--- Your Payment Was Appreciated ---<br><br></td>{else}<tr><td colspan=6><div

align="center" style="font-family: arial; font-size: 11pt; color: blue">Please make checks payable to</td></tr><tr><td colspan=6><div

align="center" style="font-family: arial; font-size: 12pt; color: red"><b>COMPANY NAME</b><br><br></td></tr><tr><td width=100%

colspan=6><div align="center" style="font-family: arial; font-size: 11pt; color: blue">Secure Online Payment via PayPal

<tr>
                <td colspan="6"><div style="font-size:8pt;" align="center">
                        {online_payment_link
                                type=$preference.include_online_payment business=$biller.paypal_business_name
                                item_name=$invoice.index_name invoice=$invoice.id
                                amount=$invoice.total currency_code=$preference.currency_code
                                link_wording=$LANG.paypal_link
                                notify_url=$biller.paypal_notify_url return_url=$biller.paypal_return_url
                                domain_id = $invoice.domain_id include_image=true
                        }
                        </div>
                </td>
        </tr>
</div><br><br>

</td></tr>{/if}


        <tr>
                <td colspan="6"><div style="font-size:8pt;" align="center">{$biller.footer}</div></td>
        </tr>

        <!-- invoice details section - end -->

</table>

<div id="footer"></div>

</div>

</body>
</html>
R.Taylor, 2010/03/22 00:09

Where do you put the code?

R.Taylor, 2010/03/22 01:56

And how do you save the paid.gif to my server?

COLIN GARDOM, 2011/07/12 15:16

Couldn't make it pass values to url at first but now ok using Richards alternative, hope this doesn't mess something else up ;) - Did change {$invoice.total} to {$invoice.owing} though, or customer ends up paying his deposit again =)

Michael Bogle, 2012/02/12 11:07

Asked to have the items description show up in template. This is needed for when a biller has a general item and wants to define what that item is in the description fields. May require a change in the order of what shows first Item or Description to make it looks nicer. Otherwise a long description is put in a small place in the output.

Using http://www.simpleinvoices.org/wiki/template_-_no_labels

Code added to /var/www/<si directory>/templates/invoices/default/template.tpl line 236 Under

 <tr class="tbl1" >
                                <td class="tbl1">{$invoiceItem.quantity|number_format:2}</td>
                                <td class="tbl1">{$invoiceItem.product.description}</td>
                                <td class="tbl1">{$preference.pref_currency_sign}{$invoiceItem.unit_price|number_format:2}</td>
                                <td class="tbl1">{$preference.pref_currency_sign}{$invoiceItem.gross_total|number_format:2}</td>
                                <td class="tbl1">{$preference.pref_currency_sign}{$invoiceItem.tax_amount|number_format:2}</td>
                                <td class="tbl1" align="right">{$preference.pref_currency_sign}{$invoiceItem.total|number_format:2}</td>
<!-- Invoice items show description - start -->
                                        <tr class="tbl1">
                                                <td align="left" class="tbl1">{$invoiceItem.description}</td>
                                        </tr>
<!-- Invoice items show description - end -->

Full code with description column before item column

<!-- Invoice items - start -->  <table class="left" width="100%">
                <tr>
                        <td colspan="6"><br /></td>
                </tr>

        {if $invoice.type_id == 2 }
                                        <tr class="col1">
                                <td class="tbl1 "><b>{$LANG.description}</b></td>
                                <td class="tbl1 "><b>{$LANG.quantity_short}</b></td>
                                <td class="tbl1 "><b>{$LANG.unit_price}</b></td>
                                <td class="tbl1 "><b>{$LANG.gross_total}</b></td>
                                <td class="tbl1 "><b>{$LANG.tax}</b></td>
                                <td class="tbl1 " align="right"><b>{$LANG.total_uppercase}</b></td>
                        </tr>

                                {foreach from=$invoiceItems item=invoiceItem}

                        <tr class="tbl1" >
                                <td class="tbl1">{$invoiceItem.product.description}</td>
                                <td class="tbl1">{$invoiceItem.quantity|number_format:2}</td>
                                <td class="tbl1">{$preference.pref_currency_sign}{$invoiceItem.unit_price|number_format:2}</td>
                                <td class="tbl1">{$preference.pref_currency_sign}{$invoiceItem.gross_total|number_format:2}</td>
                                <td class="tbl1">{$preference.pref_currency_sign}{$invoiceItem.tax_amount|number_format:2}</td>
                                <td class="tbl1" align="right">{$preference.pref_currency_sign}{$invoiceItem.total|number_format:2}</td>
<!-- Invoice items show description - start -->
                                        <tr class="tbl1">
                                                <td align="left" class="tbl1">{$invoiceItem.description}</td>
                                        </tr>
<!-- Invoice items show description - end -->
                        </tr>
 
 | wiki/template_-_no_labels.txt · Last modified: 2016/10/11 06:15 (external edit)