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 Creditmemo 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_Creditmemo
 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'  => 255,
 60:             'align' => 'right'
 61:         );
 62: 
 63:         // draw Total (ex)
 64:         $lines[0][] = array(
 65:             'text'  => $order->formatPriceTxt($item->getRowTotal()),
 66:             'feed'  => 330,
 67:             'font'  => 'bold',
 68:             'align' => 'right',
 69:         );
 70: 
 71:         // draw Discount
 72:         $lines[0][] = array(
 73:             'text'  => $order->formatPriceTxt(-$item->getDiscountAmount()),
 74:             'feed'  => 380,
 75:             'font'  => 'bold',
 76:             'align' => 'right'
 77:         );
 78: 
 79:         // draw QTY
 80:         $lines[0][] = array(
 81:             'text'  => $item->getQty() * 1,
 82:             'feed'  => 445,
 83:             'font'  => 'bold',
 84:             'align' => 'right',
 85:         );
 86: 
 87:         // draw Tax
 88:         $lines[0][] = array(
 89:             'text'  => $order->formatPriceTxt($item->getTaxAmount()),
 90:             'feed'  => 495,
 91:             'font'  => 'bold',
 92:             'align' => 'right'
 93:         );
 94: 
 95:         // draw Total (inc)
 96:         $subtotal = $item->getRowTotal() + $item->getTaxAmount() + $item->getHiddenTaxAmount()
 97:             - $item->getDiscountAmount();
 98:         $lines[0][] = array(
 99:             'text'  => $order->formatPriceTxt($subtotal),
100:             'feed'  => 565,
101:             'font'  => 'bold',
102:             'align' => 'right'
103:         );
104: 
105:         // draw options
106:         $options = $this->getItemOptions();
107:         if ($options) {
108:             foreach ($options as $option) {
109:                 // draw options label
110:                 $lines[][] = array(
111:                     'text' => Mage::helper('core/string')->str_split(strip_tags($option['label']), 40, true, true),
112:                     'font' => 'italic',
113:                     'feed' => 35
114:                 );
115: 
116:                 // draw options value
117:                 $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']);
118:                 $lines[][] = array(
119:                     'text' => Mage::helper('core/string')->str_split($_printValue, 30, true, true),
120:                     'feed' => 40
121:                 );
122:             }
123:         }
124: 
125:         // downloadable Items
126:         $_purchasedItems = $this->getLinks()->getPurchasedItems();
127: 
128:         // draw Links title
129:         $lines[][] = array(
130:             'text' => Mage::helper('core/string')->str_split($this->getLinksTitle(), 70, true, true),
131:             'font' => 'italic',
132:             'feed' => 35
133:         );
134: 
135:         // draw Links
136:         foreach ($_purchasedItems as $_link) {
137:             $lines[][] = array(
138:                 'text' => Mage::helper('core/string')->str_split($_link->getLinkTitle(), 50, true, true),
139:                 'feed' => 40
140:             );
141:         }
142: 
143:         $lineBlock = array(
144:             'lines'  => $lines,
145:             'height' => 20
146:         );
147: 
148:         $page = $pdf->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
149:         $this->setPage($page);
150:     }
151: }
152: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0