Jump to content

Help with Invoice


Recommended Posts

I am needing help with the invoice. Basically I would like to have the sales tax on a line on the invoice as follows:

 

Subtotal

Shipping & Handling

Sales Tax (0.00 when not applicable and of course display charge when applicable)

Total

 

The only one above that I can not get to display would be the sales tax and I need help getting that to display.

 

Thanks

Link to comment
Share on other sites

if (self::$_priceDisplayMethod == PS_TAX_EXC)
 {$pdf->Cell($width, 0, self::l('Sales Tax').' : ', 0, 0, 'R');
 $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice(self::$order->total_tax, self::$currency, true)), 0, 0, 'R');
	   $pdf->Ln(4);}

 

What is wrong in this code? The line displays correctly but I can't get the tax rate to show.

Link to comment
Share on other sites

This is solved now. I got the tax rate to display below the Shipping charges, now my invoice displays subtotal, shipping & handling, Sales Tax and Total.

 

To display the sales tax use the code below :

 

foreach (array_keys($priceBreakDown['taxes']) AS $tax_rate){

 $pdf->Cell($width, 0, self::l('Sales Tax').' : ', 0, 0, 'R');
 $pdf->Cell($w[3], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalsProductsWithTaxAndReduction'][$tax_rate] - $priceBreakDown['totalsProductsWithoutTaxAndReduction'][$tax_rate], self::$currency, true)), 0, 0, 'R');
	   $pdf->Ln(4);}

 

That goes in classes/pdf.php and that gets placed after the Total Products (tax exclu) code and the total (tax exclu) code and that will display the sales tax rate for you if you are only needing to display one sales tax (basically for US stores that require a state sales tax)

 

You can edit 'Sales Tax' in the code above and change it to whatever you want that line to say.

 

Works for version 1.4.4.1

Link to comment
Share on other sites

Can you explain exactly which line number in version 1.4.4.1 you put this code to get this to print on order invoice.

 

What about the mail alerts and email confirmation of orders. That is where I would like this to appear. I could do it if I knew exactly the field name to call for total without sales tax, sales tax total and total with sales tax.

 

I would add it here in the modults>mail alerts>en> folder starting line 44 in version 1.4.4.1:

sort of like this (can you help with items in RED?):

 

<tr style="text-align:right;">

<td> </td>

<td colspan="3" style="background-color:#B9BABE; padding:0.6em 0.4em;">Products without tax {field name for total without tax here???}</td>

<td style="background-color:#B9BABE; padding:0.6em 0.4em;">{totalsProductsWithoutTaxAndReduction?? not sure this is the right one here}</td>

</tr>

<tr style="text-align:right;">

<td> </td>

<td colspan="3" style="background-color:#B9BABE; padding:0.6em 0.4em;">Total Tax{field name for total tax here???}</td>

<td style="background-color:#B9BABE; padding:0.6em 0.4em;">{totalsProductsWithTax?? not sure this is the right one here}</td>

</tr>

<tr style="text-align:right;">

<td> </td>

<td colspan="3" style="background-color:#B9BABE; padding:0.6em 0.4em;">Total for Products With Tax</td>

<td style="background-color:#B9BABE; padding:0.6em 0.4em;">{total_products}</td>

</tr>

<tr style="text-align:right;">

<td> </td>

<td colspan="3" style="background-color:#EBECEE; padding:0.6em 0.4em;">Discounts</td>

<td style="background-color:#EBECEE; padding:0.6em 0.4em;">{total_discounts}</td>

</tr>

<tr style="text-align:right;">

<td> </td>

<td colspan="3" style="background-color:#EBECEE; padding:0.6em 0.4em;">Gift-wrapping</td>

<td style="background-color:#EBECEE; padding:0.6em 0.4em;">{total_wrapping}</td>

</tr>

<tr style="text-align:right;">

<td> </td>

<td colspan="3" style="background-color:#DDE2E6; padding:0.6em 0.4em;">Shipping</td>

<td style="background-color:#DDE2E6; padding:0.6em 0.4em;">{total_shipping}</td>

</tr>

Link to comment
Share on other sites

does anyone know if i want on the invoice and pdf invoice the total of all iteams quantity. how to do that

 

Like on the front end it shows the total on header with the following code "

ajax_cart_quantity

"

 

Help is much appreciated.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...