Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Downloadable_Adminhtml_Downloadable_FileController
  • Mage_Downloadable_Adminhtml_Downloadable_Product_EditController
  • Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable
  • Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable_Links
  • Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable_Samples
  • Mage_Downloadable_Block_Adminhtml_Sales_Items_Column_Downloadable_Name
  • Mage_Downloadable_Block_Catalog_Product_Links
  • Mage_Downloadable_Block_Catalog_Product_Samples
  • Mage_Downloadable_Block_Catalog_Product_View_Type
  • Mage_Downloadable_Block_Checkout_Cart_Item_Renderer
  • Mage_Downloadable_Block_Checkout_Success
  • Mage_Downloadable_Block_Customer_Products_List
  • Mage_Downloadable_Block_Sales_Order_Email_Items_Downloadable
  • Mage_Downloadable_Block_Sales_Order_Email_Items_Order_Downloadable
  • Mage_Downloadable_Block_Sales_Order_Item_Renderer_Downloadable
  • Mage_Downloadable_CustomerController
  • Mage_Downloadable_DownloadController
  • Mage_Downloadable_Helper_Catalog_Product_Configuration
  • Mage_Downloadable_Helper_Data
  • Mage_Downloadable_Helper_Download
  • Mage_Downloadable_Helper_File
  • Mage_Downloadable_Model_CatalogIndex_Data_Downloadable
  • Mage_Downloadable_Model_Link
  • Mage_Downloadable_Model_Link_Api
  • Mage_Downloadable_Model_Link_Api_Uploader
  • Mage_Downloadable_Model_Link_Api_V2
  • Mage_Downloadable_Model_Link_Api_Validator
  • Mage_Downloadable_Model_Link_Purchased
  • Mage_Downloadable_Model_Link_Purchased_Item
  • Mage_Downloadable_Model_Mysql4_Indexer_Price
  • Mage_Downloadable_Model_Mysql4_Link
  • Mage_Downloadable_Model_Mysql4_Link_Collection
  • Mage_Downloadable_Model_Mysql4_Link_Purchased
  • Mage_Downloadable_Model_Mysql4_Link_Purchased_Collection
  • Mage_Downloadable_Model_Mysql4_Link_Purchased_Item
  • Mage_Downloadable_Model_Mysql4_Link_Purchased_Item_Collection
  • Mage_Downloadable_Model_Mysql4_Sample
  • Mage_Downloadable_Model_Mysql4_Sample_Collection
  • Mage_Downloadable_Model_Observer
  • Mage_Downloadable_Model_Product_Price
  • Mage_Downloadable_Model_Product_Type
  • Mage_Downloadable_Model_Resource_Indexer_Price
  • Mage_Downloadable_Model_Resource_Link
  • Mage_Downloadable_Model_Resource_Link_Collection
  • Mage_Downloadable_Model_Resource_Link_Purchased
  • Mage_Downloadable_Model_Resource_Link_Purchased_Collection
  • Mage_Downloadable_Model_Resource_Link_Purchased_Item
  • Mage_Downloadable_Model_Resource_Link_Purchased_Item_Collection
  • Mage_Downloadable_Model_Resource_Sample
  • Mage_Downloadable_Model_Resource_Sample_Collection
  • Mage_Downloadable_Model_Sales_Order_Pdf_Items_Abstract
  • Mage_Downloadable_Model_Sales_Order_Pdf_Items_Creditmemo
  • Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice
  • Mage_Downloadable_Model_Sample
  • Mage_Downloadable_Model_System_Config_Source_Contentdisposition
  • Mage_Downloadable_Model_System_Config_Source_Orderitemstatus
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Downloadable
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: 
 28: /**
 29:  * Order Invoice Downloadable Pdf Items renderer
 30:  *
 31:  * @category   Mage
 32:  * @package    Mage_Downloadable
 33:  * @author     Magento Core Team <core@magentocommerce.com>
 34:  */
 35: class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice
 36:     extends Mage_Downloadable_Model_Sales_Order_Pdf_Items_Abstract
 37: {
 38:     /**
 39:      * Draw item line
 40:      *
 41:      */
 42:     public function draw()
 43:     {
 44:         $order  = $this->getOrder();
 45:         $item   = $this->getItem();
 46:         $pdf    = $this->getPdf();
 47:         $page   = $this->getPage();
 48:         $lines  = array();
 49: 
 50:         // draw Product name
 51:         $lines[0] = array(array(
 52:             'text' => Mage::helper('core/string')->str_split($item->getName(), 35, true, true),
 53:             'feed' => 35,
 54:         ));
 55: 
 56:         // draw SKU
 57:         $lines[0][] = array(
 58:             'text'  => Mage::helper('core/string')->str_split($this->getSku($item), 17),
 59:             'feed'  => 290,
 60:             'align' => 'right'
 61:         );
 62: 
 63:         // draw QTY
 64:         $lines[0][] = array(
 65:             'text'  => $item->getQty() * 1,
 66:             'feed'  => 435,
 67:             'align' => 'right'
 68:         );
 69: 
 70:         // draw item Prices
 71:         $i = 0;
 72:         $prices = $this->getItemPricesForDisplay();
 73:         $feedPrice = 395;
 74:         $feedSubtotal = $feedPrice + 170;
 75:         foreach ($prices as $priceData){
 76:             if (isset($priceData['label'])) {
 77:                 // draw Price label
 78:                 $lines[$i][] = array(
 79:                     'text'  => $priceData['label'],
 80:                     'feed'  => $feedPrice,
 81:                     'align' => 'right'
 82:                 );
 83:                 // draw Subtotal label
 84:                 $lines[$i][] = array(
 85:                     'text'  => $priceData['label'],
 86:                     'feed'  => $feedSubtotal,
 87:                     'align' => 'right'
 88:                 );
 89:                 $i++;
 90:             }
 91:             // draw Price
 92:             $lines[$i][] = array(
 93:                 'text'  => $priceData['price'],
 94:                 'feed'  => $feedPrice,
 95:                 'font'  => 'bold',
 96:                 'align' => 'right'
 97:             );
 98:             // draw Subtotal
 99:             $lines[$i][] = array(
100:                 'text'  => $priceData['subtotal'],
101:                 'feed'  => $feedSubtotal,
102:                 'font'  => 'bold',
103:                 'align' => 'right'
104:             );
105:             $i++;
106:         }
107: 
108:         // draw Tax
109:         $lines[0][] = array(
110:             'text'  => $order->formatPriceTxt($item->getTaxAmount()),
111:             'feed'  => 495,
112:             'font'  => 'bold',
113:             'align' => 'right'
114:         );
115: 
116:         // custom options
117:         $options = $this->getItemOptions();
118:         if ($options) {
119:             foreach ($options as $option) {
120:                 // draw options label
121:                 $lines[][] = array(
122:                     'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true),
123:                     'font' => 'italic',
124:                     'feed' => 35
125:                 );
126: 
127:                 if ($option['value']) {
128:                     if (isset($option['print_value'])) {
129:                         $_printValue = $option['print_value'];
130:                     } else {
131:                         $_printValue = strip_tags($option['value']);
132:                     }
133:                     $values = explode(', ', $_printValue);
134:                     foreach ($values as $value) {
135:                         $lines[][] = array(
136:                             'text' => Mage::helper('core/string')->str_split($value, 30, true, true),
137:                             'feed' => 40
138:                         );
139:                     }
140:                 }
141:             }
142:         }
143: 
144:         // downloadable Items
145:         $_purchasedItems = $this->getLinks()->getPurchasedItems();
146: 
147:         // draw Links title
148:         $lines[][] = array(
149:             'text' => Mage::helper('core/string')->str_split($this->getLinksTitle(), 70, true, true),
150:             'font' => 'italic',
151:             'feed' => 35
152:         );
153: 
154:         // draw Links
155:         foreach ($_purchasedItems as $_link) {
156:             $lines[][] = array(
157:                 'text' => Mage::helper('core/string')->str_split($_link->getLinkTitle(), 50, true, true),
158:                 'feed' => 40
159:             );
160:         }
161: 
162:         $lineBlock = array(
163:             'lines'  => $lines,
164:             'height' => 20
165:         );
166: 
167:         $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
168:         $this->setPage($page);
169:     }
170: }
171: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0