Mage_Sales_Model_Order_Pdf_Items_Invoice_Default Class Reference

Inheritance diagram for Mage_Sales_Model_Order_Pdf_Items_Invoice_Default:

Mage_Sales_Model_Order_Pdf_Items_Abstract Mage_Core_Model_Abstract Varien_Object Mage_Sales_Model_Order_Pdf_Items_Invoice_Grouped

List of all members.

Public Member Functions

 draw ()


Detailed Description

Definition at line 35 of file Default.php.


Member Function Documentation

draw (  ) 

Draw item line

Reimplemented from Mage_Sales_Model_Order_Pdf_Items_Abstract.

Reimplemented in Mage_Sales_Model_Order_Pdf_Items_Invoice_Grouped.

Definition at line 41 of file Default.php.

00042     {
00043         $order  = $this->getOrder();
00044         $item   = $this->getItem();
00045         $pdf    = $this->getPdf();
00046         $page   = $this->getPage();
00047         $lines  = array();
00048 
00049         // draw Product name
00050         $lines[0] = array(array(
00051             'text' => Mage::helper('core/string')->str_split($item->getName(), 60, true, true),
00052             'feed' => 35,
00053         ));
00054 
00055         // draw SKU
00056         $lines[0][] = array(
00057             'text'  => Mage::helper('core/string')->str_split($this->getSku($item), 25),
00058             'feed'  => 240
00059         );
00060 
00061         // draw QTY
00062         $lines[0][] = array(
00063             'text'  => $item->getQty()*1,
00064             'feed'  => 435
00065         );
00066 
00067         if ($options = $this->getItemOptions()) {
00068             foreach ($options as $option) {
00069                 // draw options label
00070                 $lines[][] = array(
00071                     'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 60, false, true),
00072                     'font' => 'italic',
00073                     'feed' => 35
00074                 );
00075 
00076                 if ($option['value']) {
00077                     $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']);
00078                     $values = explode(', ', $_printValue);
00079                     foreach ($values as $value) {
00080                         $lines[][] = array(
00081                             'text' => Mage::helper('core/string')->str_split($value, 55, true, true),
00082                             'feed' => 40
00083                         );
00084                     }
00085                 }
00086             }
00087         }
00088 
00089         // draw Price
00090         $lines[0][] = array(
00091             'text'  => $order->formatPriceTxt($item->getPrice()),
00092             'feed'  => 395,
00093             'font'  => 'bold',
00094             'align' => 'right'
00095         );
00096 
00097         // draw Tax
00098         $lines[0][] = array(
00099             'text'  => $order->formatPriceTxt($item->getTaxAmount()),
00100             'feed'  => 495,
00101             'font'  => 'bold',
00102             'align' => 'right'
00103         );
00104 
00105         // draw Subtotal
00106         $lines[0][] = array(
00107             'text'  => $order->formatPriceTxt($item->getRowTotal()),
00108             'feed'  => 565,
00109             'font'  => 'bold',
00110             'align' => 'right'
00111         );
00112 
00113         $lineBlock = array(
00114             'lines'  => $lines,
00115             'height' => 10
00116         );
00117 
00118         $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
00119         $this->setPage($page);
00120     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:47 2009 for Magento by  doxygen 1.5.8