Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
Drawline in PDF Invoice after each product
 
cooper
Sr. Member
 
Total Posts:  101
Joined:  2008-03-31
 

Hello,

I would like to insert just a line in PDF Invoice after each item.

So in app/code/local/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php I ‘ve added :

$page->setLineWidth(0.5);
$page->setLineColor(new Zend_Pdf_Color_GrayScale(0.8));
$page->drawLine(28, $pdf->y-$shift[0]+1, 568,$pdf->y-$shift[0]+1);

It works fine BUT only for simple products and not for packaged products.

I don’t know how to manage app/code/local/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php

Hope someone can help me........

Regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
vianetz
Guru
 
Avatar
Total Posts:  537
Joined:  2008-04-13
Munich, Germany
 

What do you mean with “packaged products”? Perhaps take a look at app/code/core/Mage/Bundle/Model/.... and app/code/core/Mage/Downloadable/Model/…

 Signature 

vianetz.com - Magento Development
Customizable layouts for invoices? Check out Advanced Invoice Layout For Magento.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cooper
Sr. Member
 
Total Posts:  101
Joined:  2008-03-31
 

Massi,

Many thanks for your help. I’m french and my english is funny, appromimative and too creative...... rasberry

I was talking about bundle products (and you’re right : downloadable have to be modified if necessary...).

With your indication I have found the files to be modified.

I really appreciate your guideline and maybe I should have a look at your extension wich seems to cover essentiels needs for most Magento user wink

I Hope you understand me despite of my poor english......

Regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
junaidbhura
Jr. Member
 
Total Posts:  11
Joined:  2010-07-01
 

If anyone still wants to know how to do this (Magento 1.4.1.0):

In: app\code\core\Mage\Sales\Model\Order\Pdf:

Aound line 93 you’ll see something like this:

/* Add body */
            foreach ($invoice->getAllItems() as $item){
                
if ($item->getOrderItem()->getParentItem()) {
                    
continue;
                
}

                
if ($this->15{
                    $page 
$this->newPage(array('table_header' => true));
                
}

                
/* Draw item */
                
$page $this->_drawItem($item$page$order);
            
}

Modify it to look like this:

/* Add body */
            foreach ($invoice->getAllItems() as $item){
                
if ($item->getOrderItem()->getParentItem()) {
                    
continue;
                
}

                
if ($this->15{
                    $page 
$this->newPage(array('table_header' => true));
                
}

                
/* Draw item */
                
$page $this->_drawItem($item$page$order);
        
$page->setLineWidth(0.5);
        
$page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
        
$page->drawLine(25$this->y570$this->y);
        
$this->-= 10;
            
}

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
713669 users|911 users currently online|495362 forum posts