Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Improved Invoice Layout

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 04-08-2009, 04:17 AM
 
jaydee jaydee is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 37
 

Default Re: Improved Invoice Layout

Quote:
Originally Posted by CTC
does this mod work with 4.2?

Made on 4.1.9 and confirmed with up to 4.1.11. Can't speak for 4.2. Why not try and let us know?

Always backup first.
__________________
jd.
-
X-Cart Gold 4.1.9
Red-Hat Server
Reply With Quote
  #12  
Old 04-08-2009, 07:00 AM
 
retrtrtrytrutru retrtrtrytrutru is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 101
 

Default Re: Improved Invoice Layout

Hi jaydee, I found this thread while searching for a way to change how taxes are displayed on our invoices. We supply to companies as well as consumers so sometimes we have to invoice with taxes applied and sometime the invoice is tax exempt. I'm looking for a way to display the invoices like this example:

Code:
PRODUCT PRICE QTY AMOUNT ------------------------------------------------------ abcdef 100,00 1 100,00 ghijkl 150,00 2 300,00 -------- SUBTOTAL: 400,00 SHIPPING COSTS: 5,00 VAT 19%: 76,95 -------- TOTAL: 481,95

And for tax exempt invoices:

Code:
PRODUCT PRICE QTY AMOUNT ------------------------------------------------------ abcdef 100,00 1 100,00 ghijkl 150,00 2 300,00 -------- SUBTOTAL: 400,00 SHIPPING COSTS: 5,00 -------- TOTAL: 405,00 Note: This order is tax exempt
Any idea if you can accomplish this? I already applied your layout to test but then our taxes are displayed like:

Code:
Subtotal: 593,81 Shipping cost: 0,00 Total: 593,81 including VAT 19,0%: 94,81

Thanks in advance for any info
__________________
www.qualitylamps.eu
X-Cart Gold 4.1.8, PHP 5.2.6, MySQL 5.0.51a, Apache 2.2.9

www.vervangjelamp.nl
X-Cart Gold 4.2.0, PHP 5.2.6, MySQL 5.0.37-standard, Apache/2

Sorry for the weird user name, I registered it by mistake
Reply With Quote
  #13  
Old 04-08-2009, 04:00 PM
 
jaydee jaydee is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 37
 

Default Re: Improved Invoice Layout

You should certainly be able to do this, but I'm not sure on the specifics unfortunately. Did your old invoice layout do this before you applied my changes? The new one should still be able to as the code changes are only visual.

Under Management > Taxing System, have you checked 'Enable tax exemption for customers'? This would be your first point of call.

The lines for the tax display are in order_data.tpl, starting around line 38.

You should be able to add this somewhere:

{if $_userinfo.tax_exempt eq "Y"}
<p>Note: This order is tax exempt</p>
{/if}

This will display the message if they are tax exempt.

Cheers,
__________________
jd.
-
X-Cart Gold 4.1.9
Red-Hat Server
Reply With Quote
  #14  
Old 04-09-2009, 01:45 AM
 
retrtrtrytrutru retrtrtrytrutru is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 101
 

Default Re: Improved Invoice Layout

Hi jaydee,

The second example with the "this order is tax exempt" is already working just fine but the problem is with the VAT invoice. I want to display product prices without the VAT, regarless if the customer has to pay it or not, and only show the VAT amount added to the subtotal area of the invoice... If I play with the settings in the backend it also has its affect on the website, this is unwanted because that works ok.

I'll play around with it some more to fix it myself. If anyone has any info or has already done it, please let me know
__________________
www.qualitylamps.eu
X-Cart Gold 4.1.8, PHP 5.2.6, MySQL 5.0.51a, Apache 2.2.9

www.vervangjelamp.nl
X-Cart Gold 4.2.0, PHP 5.2.6, MySQL 5.0.37-standard, Apache/2

Sorry for the weird user name, I registered it by mistake
Reply With Quote
  #15  
Old 04-09-2009, 02:21 AM
 
retrtrtrytrutru retrtrtrytrutru is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 101
 

Default Re: Improved Invoice Layout

Sorry to hijack your thread jaydee but I think I have narrowed it down. In order_data.tpl I only have to change the Total column but I don't fully understand it, yet:

Code:
{math assign="total" equation="amount*price" amount=$product.amount price=$product.display_price|default:$product.price|default:0}{include file="currency.tpl" value=$total}
In simple terms, I think this basically says take the product amount/quantity and multply it with the display price. I think I can safely change this to:

Code:
{math assign="total" equation="amount*price" amount=$product.amount price=$product.price|default:0}{include file="currency.tpl" value=$total}
This will multiply the procuct quantity with the product price instead of the display price. Only question I have here, do you know what the |default:0 string means, in simple terms of course. I am worried that if I remove it something will go wrong so if I know how to read this I can continue again...
__________________
www.qualitylamps.eu
X-Cart Gold 4.1.8, PHP 5.2.6, MySQL 5.0.51a, Apache 2.2.9

www.vervangjelamp.nl
X-Cart Gold 4.2.0, PHP 5.2.6, MySQL 5.0.37-standard, Apache/2

Sorry for the weird user name, I registered it by mistake
Reply With Quote
  #16  
Old 04-09-2009, 03:39 AM
 
jaydee jaydee is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 37
 

Default Re: Improved Invoice Layout

I'm not certain what the default:0 tag means, but I would guess that it will set the price as 0 if there is no price or display price. It goes left to right until it finds a variable that isn't empty, and rather than making $price empty, it sets the 'default' value as 0.

I have my taxing system set up in the same way you describe how you need yours, and it works great.

Under 'Taxing System' I have all the options unchecked (except for 'enable tax exemption'), and in the tax details I have all the checkboxes unchecked as well. These options are all pretty self explanatory so try a few configurations until you get what you need.

Taxes are tricky!
__________________
jd.
-
X-Cart Gold 4.1.9
Red-Hat Server
Reply With Quote

The following user thanks jaydee for this useful post:
retrtrtrytrutru (04-09-2009)
  #17  
Old 04-09-2009, 04:01 AM
 
jon@leapfrogcomputers.co. jon@leapfrogcomputers.co. is offline
 

Member
  
Join Date: Jul 2006
Posts: 21
 

Default Re: Improved Invoice Layout

Very nice - Thanks
__________________
Version 4.4.1 Gold
Reply With Quote
  #18  
Old 04-09-2009, 05:22 AM
 
retrtrtrytrutru retrtrtrytrutru is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 101
 

Default Re: Improved Invoice Layout

Quote:
Originally Posted by jaydee
Taxes are tricky!
Yeah, very tricky sometimes which is why I posted here before I start modding stuff and mess everything up. I'll digg into it and see what happens, I'm sure I'll find out and get it set-up properly Thanks for the help.

BTW: in my backend I have:

Display cart/order totals including tax
Display a tax rate for each projector option in cart/order:

both enabled, I need them to be enabled because it's used on the frontpage of the website. When a customer logs in with tax exempt enabled all prices are displayed without VAT, if a customer needs to pay taxes it shows the excluding and including VAT prices.
__________________
www.qualitylamps.eu
X-Cart Gold 4.1.8, PHP 5.2.6, MySQL 5.0.51a, Apache 2.2.9

www.vervangjelamp.nl
X-Cart Gold 4.2.0, PHP 5.2.6, MySQL 5.0.37-standard, Apache/2

Sorry for the weird user name, I registered it by mistake
Reply With Quote
  #19  
Old 04-24-2009, 04:20 PM
  Keys Care's Avatar 
Keys Care Keys Care is offline
 

eXpert
  
Join Date: Feb 2007
Location: Cheyenne - Santa Monica - Oregon
Posts: 214
 

Default Re: Improved Invoice Layout

Thanks for this mod. I have been messing around with my invoices for a while and this helped to clean things up a bit for me.

I have two questions.

1) the order details are in a variable window that expands to the full size of the browser. Is their a way to make it letter width?

2) I am trying to move the additional information to after the order details. Can you point our the beginning and end of the code to move it. I have tried a few times, but corrupt the code each time.

Thanks

Bob
__________________
All-Natural Healing Skin and Pet Care Products
4.6.0 Gold, ShipWorks 3
Reply With Quote
  #20  
Old 06-03-2009, 05:22 AM
 
jaydee jaydee is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 37
 

Default Re: Improved Invoice Layout

Quote:
Originally Posted by Keys Care
1) the order details are in a variable window that expands to the full size of the browser. Is their a way to make it letter width?

Have a look at line 7 of order_invoice.tpl. This is where the table width is set. By default, if the invoice is not being shown in an email, the width is 100%. If it is email, its 600 pixels. You should be able to set width="..." to whatever you need.

Quote:
Originally Posted by Keys Care
2) I am trying to move the additional information to after the order details. Can you point our the beginning and end of the code to move it. I have tried a few times, but corrupt the code each time.

This should be lines 94-125, but I'm not 100% sure. I don't use this myself so I've left the default X-Cart code in place. You might need to make some changes.

Sorry for the very, very delayed reply, but better late than never! Hopefully you've already found a solution
__________________
jd.
-
X-Cart Gold 4.1.9
Red-Hat Server
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:21 PM.

   

 
X-Cart forums © 2001-2020