Public Member Functions | |
render (Varien_Object $row) | |
renderCss () | |
Protected Member Functions | |
_getCurrencyCode ($row) | |
_getRate ($row) | |
Protected Attributes | |
$_defaultWidth = 100 | |
Static Protected Attributes | |
static | $_currencies = array() |
Definition at line 35 of file Currency.php.
_getCurrencyCode | ( | $ | row | ) | [protected] |
Definition at line 67 of file Currency.php.
00068 { 00069 if ($code = $this->getColumn()->getCurrencyCode()) { 00070 return $code; 00071 } 00072 if ($code = $row->getData($this->getColumn()->getCurrency())) { 00073 return $code; 00074 } 00075 return false; 00076 }
_getRate | ( | $ | row | ) | [protected] |
Definition at line 78 of file Currency.php.
00079 { 00080 if ($rate = $this->getColumn()->getRate()) { 00081 return floatval($rate); 00082 } 00083 if ($rate = $row->getData($this->getColumn()->getRateField())) { 00084 return floatval($rate); 00085 } 00086 return 1; 00087 }
render | ( | Varien_Object $ | row | ) |
Renders grid column
Varien_Object | $row |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.
Reimplemented in Mage_Adminhtml_Block_Report_Grid_Column_Renderer_Currency.
Definition at line 50 of file Currency.php.
00051 { 00052 if ($data = $row->getData($this->getColumn()->getIndex())) { 00053 $currency_code = $this->_getCurrencyCode($row); 00054 00055 if (!$currency_code) { 00056 return $data; 00057 } 00058 00059 $data = floatval($data) * $this->_getRate($row); 00060 $data = sprintf("%f", $data); 00061 $data =Mage::app()->getLocale()->currency($currency_code)->toCurrency($data); 00062 return $data; 00063 } 00064 return $this->getColumn()->getDefault(); 00065 }
renderCss | ( | ) |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.
Definition at line 89 of file Currency.php.
00090 { 00091 return parent::renderCss() . ' a-right'; 00092 }
$_currencies = array() [static, protected] |
Currency objects cache
Definition at line 42 of file Currency.php.
$_defaultWidth = 100 [protected] |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.
Definition at line 37 of file Currency.php.