Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

VAT Tax rate on invoice (for each product)
 
dmibau
Member
 
Total Posts:  72
Joined:  2010-07-12
 

How can I show on invoice tax rates for each product?

I tried to change something in
Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php but I don’t know how to get tax rate for each product.

Tax amount is get like this:

// draw Tax
        $lines[0][] = array(
            
'text'  => $order->formatPriceTxt($item->getTaxAmount()),
            
'feed'  => 495,
            
'font'  => 'bold',
            
'align' => 'right'
        
);

But how to get tax percent for each product?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dmibau
Member
 
Total Posts:  72
Joined:  2010-07-12
 

Please, help.

I also needed to print invoice creation date. I found that it can be get like this:

$invoice->getCreatedAt()

But I can’t find how to get tax percent for each product on an invoice.

 
Magento Community Magento Community
Magento Community
Magento Community
 
wedeking
Jr. Member
 
Total Posts:  17
Joined:  2008-06-03
 

$taxPercent = $item->getOrderItem()->getTaxPercent();
$taxPercent = number_format($taxPercent,2,’,’,’’);
$taxPercent = $taxPercent.” %”;

at least the last two lines of code are a “bit” dirty. But after several hours, I’m glad that its running at all wink.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dmibau
Member
 
Total Posts:  72
Joined:  2010-07-12
 

Thanks, you have saved my life, man. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Paulus
Guru
 
Total Posts:  335
Joined:  2008-07-21
 

Hi,

We did you add those lines? We’re looking into a way to display various tax rates and totals in the pdf invoice.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dmibau
Member
 
Total Posts:  72
Joined:  2010-07-12
 

I modified app\code\local\Mage\Sales\Model\Order\Pdf\Items\Invoice\default.php (around line 75):

// draw QTY
        $lines[0][] = array(
            
'text'  => $item->getQty()*1,
            
'feed'  => 400
        
);
        
        
// I ADDED THIS:
        
$taxPercent $item->getOrderItem()->getTaxPercent();
        
$taxPercent number_format($taxPercent,2,',','') . '%';
        
$lines[0][] = array(
            
'text'  => $taxPercent,
            
'feed'  => 460,
            
'font'  => 'bold',
            
'align' => 'right'
        
);

I also tried to add full tax summary in invoice totals, but I don’t know how to do that. If anyone can help, please reply here: http://www.magentocommerce.com/boards/viewthread/208550/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Paulus
Guru
 
Total Posts:  335
Joined:  2008-07-21
 

Thanks for the heads up, did you have a look at this?
http://www.magentocommerce.com/extension/specs/3655/flex-pdf_print-outs_customizer#specs

We sent an email to see if it can do what we need, no reply yet though.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dmibau
Member
 
Total Posts:  72
Joined:  2010-07-12
 

I didn’t try this extension yet, I prefer to customize invoice myself (I’m so close grin ), payable extension is ultimate solution.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Paulus
Guru
 
Total Posts:  335
Joined:  2008-07-21
 

If you ever get to the point on how to display all taxes right, i’m all ears;-)

 
Magento Community Magento Community
Magento Community
Magento Community
 
loeffel
Guru
 
Avatar
Total Posts:  427
Joined:  2009-02-03
 

Thanks dmibau, your code was very helpful and exactly what I was lookin for. I too would love to be able to display full tax summary in totals - has anybody ever figured out, what the backend setting actually does? Becau`se it doesn’t seem to change anything for me..

 
Magento Community Magento Community
Magento Community
Magento Community
 
dmibau
Member
 
Total Posts:  72
Joined:  2010-07-12
 

Here’s a simple solution http://www.magentocommerce.com/boards/viewthread/208550/
Not the best one, but it works. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
moomoo
Sr. Member
 
Avatar
Total Posts:  192
Joined:  2009-07-10
 

Hey folks, if you’re after an easy solution we have this now working in our pickPack module:

Custom PDFs with Tax Info

(You can also do other cool stuff, like print off invoices/packing sheets with any order status, show a combined pick list of all SKUs, etc)

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top