Exemplo n.º 1
0
 /**
  * Add order tax information to select
  *
  * @param Mage_Sales_Model_Resource_Order_Collection $collection
  * @return Mage_Sales_Model_Api2_Order
  */
 protected function _addTaxInfo(Mage_Sales_Model_Resource_Order_Collection $collection)
 {
     $taxInfoFields = array();
     if ($this->_isTaxNameAllowed()) {
         $taxInfoFields['tax_name'] = 'order_tax.title';
     }
     if ($this->_isTaxRateAllowed()) {
         $taxInfoFields['tax_rate'] = 'order_tax.percent';
     }
     if ($taxInfoFields) {
         $collection->getSelect()->joinLeft(array('order_tax' => $collection->getTable('sales_order_tax')), 'main_table.entity_id = order_tax.order_id', $taxInfoFields);
     }
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Add order payment method field to select
  *
  * @param Mage_Sales_Model_Resource_Order_Collection $collection
  * @return Iways_PayPalPlus_Model_Api2_Order
  */
 protected function _addPaymentMethodInfo(Mage_Sales_Model_Resource_Order_Collection $collection)
 {
     $collection->getSelect()->joinLeft(array('payment_method' => $collection->getTable('sales/order_payment')), 'main_table.entity_id = payment_method.parent_id', array('payment_method' => 'payment_method.method', 'ppp_pui_reference_number', 'ppp_pui_instruction_type', 'ppp_pui_payment_due_date', 'ppp_pui_note', 'ppp_pui_bank_name', 'ppp_pui_account_holder_name', 'ppp_pui_international_bank_account_number', 'ppp_pui_bank_identifier_code', 'ppp_pui_routing_number', 'ppp_pui_amount', 'ppp_pui_currency'));
     return $this;
 }