Пример #1
0
 protected function _drawHeader(Zend_Pdf_Page $page)
 {
     if (Mage::getStoreConfig('advancedinvoiceprinting_options/general/enable') == 0) {
         return parent::_drawHeader($page);
     }
     /* Add table head */
     $this->_setFontRegular($page, 10);
     $page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));
     $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
     $page->setLineWidth(0.5);
     $page->drawRectangle(25, $this->y, 570, $this->y - 15, Zend_Pdf_Page::SHAPE_DRAW_STROKE);
     $this->y -= 10;
     $page->setFillColor(new Zend_Pdf_Color_Rgb(0, 0, 0));
     //columns headers
     $lines[0][] = array('text' => Mage::helper('sales')->__('Products'), 'feed' => 35);
     $lines[0][] = array('text' => Mage::helper('sales')->__('SKU'), 'feed' => 290, 'align' => 'right');
     $lines[0][] = array('text' => Mage::helper('sales')->__('Qty'), 'feed' => 435, 'align' => 'right');
     $lines[0][] = array('text' => Mage::helper('sales')->__('Price'), 'feed' => 360, 'align' => 'right');
     $lines[0][] = array('text' => Mage::helper('sales')->__('Tax'), 'feed' => 495, 'align' => 'right');
     $lines[0][] = array('text' => Mage::helper('sales')->__('Subtotal'), 'feed' => 565, 'align' => 'right');
     $lineBlock = array('lines' => $lines, 'height' => 5);
     $this->drawLineBlocks($page, array($lineBlock), array('table_header' => true));
     $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
     $this->y -= 20;
 }
Пример #2
0
 /**
  * Draw header for item table
  *
  * use _drawHeader for Magento 1.7+
  * maintain compatibility with Magento 1.5
  *
  * @param $page
  */
 protected function _printTableHead($page)
 {
     if (method_exists($this, '_drawHeader')) {
         return parent::_drawHeader($page);
     }
     $page->setFillColor(new Zend_Pdf_Color_GrayScale(1));
     $this->_setFontRegular($page);
     /* Add table */
     $page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
     $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
     $page->setLineWidth(0.5);
     $page->drawRectangle(25, $this->y, 570, $this->y - 15);
     $this->y -= 10;
     /* Add table head */
     $page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4));
     $page->drawText(Mage::helper('sales')->__('Products'), 35, $this->y, 'UTF-8');
     $page->drawText(Mage::helper('sales')->__('SKU'), 255, $this->y, 'UTF-8');
     $page->drawText(Mage::helper('sales')->__('Price'), 380, $this->y, 'UTF-8');
     $page->drawText(Mage::helper('sales')->__('Qty'), 430, $this->y, 'UTF-8');
     $page->drawText(Mage::helper('sales')->__('Tax'), 480, $this->y, 'UTF-8');
     $page->drawText(Mage::helper('sales')->__('Subtotal'), 535, $this->y, 'UTF-8');
     $this->y -= 15;
 }