Public Member Functions | |
fetchRuleRatesForCustomerTaxClass ($customerTaxClass) | |
Protected Member Functions | |
_construct () |
Definition at line 27 of file Tax.php.
_construct | ( | ) | [protected] |
Resource initialization
Reimplemented from Mage_Core_Model_Resource_Abstract.
Definition at line 29 of file Tax.php.
00030 { 00031 $this->_init('tax/tax_rule', 'rule_id'); 00032 }
fetchRuleRatesForCustomerTaxClass | ( | $ | customerTaxClass | ) |
Definition at line 34 of file Tax.php.
00035 { 00036 $read = $this->_getReadAdapter(); 00037 $select = $read->select() 00038 ->from(array('rule'=>$this->getTable('tax/tax_rule'))) 00039 ->join(array('rd'=>$this->getTable('tax/tax_rate_data')), "rd.rate_type_id=rule.tax_rate_type_id", array('value'=>new Zend_Db_Expr('rate_value/100'))) 00040 ->join(array('r'=>$this->getTable('tax/tax_rate')), "r.tax_rate_id=rd.tax_rate_id", array('country'=>'tax_country_id', 'postcode'=>'tax_postcode')) 00041 ->joinLeft(array('reg'=>$this->getTable('directory/country_region')), "reg.region_id=r.tax_region_id", array('state'=>'code')) 00042 ->where('rule.tax_customer_class_id=?', $customerTaxClass); 00043 $rows = $read->fetchAll($select); 00044 00045 return $rows; 00046 }