Пример #1
0
 /**
  * Initialize creditmemo totals array
  *
  * @return Mage_Sales_Block_Order_Totals
  */
 protected function _initTotals()
 {
     parent::_initTotals();
     $this->addTotal(new Varien_Object(array('code' => 'adjustment_positive', 'value' => $this->getSource()->getAdjustmentPositive(), 'base_value' => $this->getSource()->getBaseAdjustmentPositive(), 'label' => $this->helper('sales')->__('Adjustment Refund'))));
     $this->addTotal(new Varien_Object(array('code' => 'adjustment_negative', 'value' => $this->getSource()->getAdjustmentNegative(), 'base_value' => $this->getSource()->getBaseAdjustmentNegative(), 'label' => $this->helper('sales')->__('Adjustment Fee'))));
     return $this;
 }
Пример #2
0
 /**
  * Initialize order totals array
  *
  * @return Mage_Sales_Block_Order_Totals
  */
 protected function _initTotals()
 {
     parent::_initTotals();
     $source = $this->getSource();
     $this->_totals['paid'] = new Varien_Object(array('code' => 'paid', 'strong' => true, 'value' => $this->getSource()->getTotalPaid(), 'base_value' => $this->getSource()->getBaseTotalPaid(), 'label' => $this->helper('sales')->__('Total Paid'), 'area' => 'footer'));
     $this->_totals['refunded'] = new Varien_Object(array('code' => 'refunded', 'strong' => true, 'value' => $this->getSource()->getTotalRefunded(), 'base_value' => $this->getSource()->getBaseTotalRefunded(), 'label' => $this->helper('sales')->__('Total Refunded'), 'area' => 'footer'));
     $this->_totals['due'] = new Varien_Object(array('code' => 'due', 'strong' => true, 'value' => $this->getSource()->getTotalDue(), 'base_value' => $this->getSource()->getBaseTotalDue(), 'label' => $this->helper('sales')->__('Total Due'), 'area' => 'footer'));
     /**
      * Add store rewards
      */
     $totals = $this->_totals;
     $newTotals = array();
     /*  if (count($totals)>0) {
         	foreach ($totals as $index=>$arr) {
         		if ($index == "grand_total") {
         			if (((float)$this->getSource()->getPaymentCharge()) != 0) {
          			$label = $this->__('Payment Charge');
                $newTotals['payment_charge'] = new Varien_Object(array(
                    'code'  => 'payment_charge',
                    'field' => 'payment_charge',
                    'base_value' => $source->getBasePaymentCharge(),
                    'value' => $source->getPaymentCharge(),
                    'label' => $label
                ));
         			}
         		}
         		$newTotals[$index] = $arr;
         	}
         	$this->_totals = $newTotals;
         }  */
     return $this;
 }
 /**
  * Initialize order totals array
  *
  * @return Mage_Sales_Block_Order_Totals
  */
 protected function _initTotals()
 {
     parent::_initTotals();
     $this->_totals['paid'] = new Varien_Object(array('code' => 'paid', 'strong' => true, 'value' => $this->getSource()->getTotalPaid(), 'base_value' => $this->getSource()->getBaseTotalPaid(), 'label' => $this->helper('sales')->__('Total Paid'), 'area' => 'footer'));
     $this->_totals['refunded'] = new Varien_Object(array('code' => 'refunded', 'strong' => true, 'value' => $this->getSource()->getTotalRefunded(), 'base_value' => $this->getSource()->getBaseTotalRefunded(), 'label' => $this->helper('sales')->__('Total Refunded'), 'area' => 'footer'));
     $this->_totals['due'] = new Varien_Object(array('code' => 'due', 'strong' => true, 'value' => $this->getSource()->getTotalDue(), 'base_value' => $this->getSource()->getBaseTotalDue(), 'label' => $this->helper('sales')->__('Total Due'), 'area' => 'footer'));
     return $this;
 }
Пример #4
0
 /**
  * Initialize order totals array
  *
  * @return Mage_Sales_Block_Order_Totals
  */
 protected function _initTotals()
 {
     parent::_initTotals();
     $feeAmount = $this->getOrder()->getFeeAmount() / 100;
     if ($feeAmount) {
         $this->addTotalBefore(new Varien_Object(array('code' => 'fee', 'value' => $feeAmount, 'base_value' => $feeAmount, 'label' => "Fee"), array('shipping', 'tax')));
         $this->_totals['grand_total'] = new Varien_Object(array('code' => 'grand_total', 'strong' => true, 'value' => $this->getSource()->getGrandTotal() + $feeAmount, 'base_value' => $this->getSource()->getBaseGrandTotal() + $feeAmount, 'label' => $this->helper('sales')->__('Grand Total'), 'area' => 'footer'));
     }
     return $this;
 }
Пример #5
0
 /**
  * Initialize order totals array
  *
  * @return Mage_Sales_Block_Order_Totals
  */
 protected function _initTotals()
 {
     parent::_initTotals();
     $this->_totals['count'] = new Varien_Object(array('code' => 'count', 'strong' => true, 'is_formated' => true, 'value' => $this->getSource()->getItemsCount(), 'base_value' => $this->getSource()->getItemsCount(), 'label' => $this->helper('smasoft_oneclickorder')->__('Total items'), 'area' => 'footer'));
     $magentoOrder = $this->getOrder()->getMagentoOrder();
     if ($magentoOrder) {
         $this->_totals['paid'] = new Varien_Object(array('code' => 'paid', 'strong' => true, 'value' => $magentoOrder->getTotalPaid(), 'base_value' => $magentoOrder->getBaseTotalPaid(), 'label' => $this->helper('sales')->__('Total Paid'), 'area' => 'footer'));
     }
     return $this;
 }
Пример #6
0
 /**
  * Initialize order totals array
  *
  * @return Mage_Sales_Block_Order_Totals
  */
 protected function _initTotals()
 {
     parent::_initTotals();
     if ($_SESSION['teo_post_total'] > $_SESSION['teo_pre_total']) {
         $this->_totals['paid'] = new Varien_Object(array('code' => 'paid', 'strong' => true, 'value' => $_SESSION['teo_pre_total'], 'base_value' => $_SESSION['teo_pre_total'], 'label' => $this->helper('sales')->__('Total Paid'), 'area' => 'footer'));
     } else {
         $this->_totals['paid'] = new Varien_Object(array('code' => 'paid', 'strong' => true, 'value' => $this->getSource()->getBaseTotalPaid(), 'base_value' => $this->getSource()->getBaseTotalPaid(), 'label' => $this->helper('sales')->__('Total Paid'), 'area' => 'footer'));
     }
     $this->_totals['refunded'] = new Varien_Object(array('code' => 'refunded', 'strong' => true, 'value' => $this->getSource()->getTotalRefunded(), 'base_value' => $this->getSource()->getBaseTotalRefunded(), 'label' => $this->helper('sales')->__('Total Refunded'), 'area' => 'footer'));
     if ($_SESSION['teo_post_total'] > $_SESSION['teo_pre_total']) {
         $this->_totals['due'] = new Varien_Object(array('code' => 'due', 'strong' => true, 'value' => $_SESSION['teo_post_total'] - $_SESSION['teo_pre_total'], 'base_value' => $_SESSION['teo_post_total'] - $_SESSION['teo_pre_total'], 'label' => $this->helper('sales')->__('Total Due'), 'area' => 'footer'));
     } else {
         $this->_totals['due'] = new Varien_Object(array('code' => 'due', 'strong' => true, 'value' => $this->getSource()->getBaseTotalDue(), 'base_value' => $this->getSource()->getBaseTotalDue(), 'label' => $this->helper('sales')->__('Total Due'), 'area' => 'footer'));
     }
     return $this;
 }
 /**
  * Initialize order totals array
  *
  * @return Mage_Sales_Block_Order_Totals
  */
 protected function _initTotals()
 {
     parent::_initTotals();
     $vendorOrder = Mage::registry('vendor_order');
     if (!$vendorOrder) {
         $vendorOrder = $this->getParentBlock()->getVendorOrder();
     }
     if ($vendorOrder) {
         $this->setVendorOrder($vendorOrder);
         $this->_updateTotalForVendor('subtotal', $vendorOrder, 'subtotal');
         $this->_updateTotalForVendor('shipping', $vendorOrder, 'shipping_amount');
         $this->_updateTotalForVendor('discount', $vendorOrder, 'discount_amount', $this->helper('sales')->__('Discount'));
         $this->_updateTotalForVendor('grand_total', $vendorOrder, 'grand_total');
     }
     return $this;
 }
Пример #8
0
 /**
  * Initialize order totals array
  *
  * @return Mage_Sales_Block_Order_Totals
  */
 protected function _initTotals()
 {
     parent::_initTotals();
     $source = $this->getSource();
     /**
      * Add store rewards
      */
     $totals = $this->_totals;
     $newTotals = array();
     if (count($totals) > 0) {
         foreach ($totals as $index => $arr) {
             if ($index == "grand_total") {
                 if ((double) $this->getSource()->getPaymentCharge() != 0) {
                     $label = $this->__('Payment Charge');
                     $newTotals['payment_charge'] = new Varien_Object(array('code' => 'payment_charge', 'field' => 'payment_charge', 'value' => $source->getPaymentCharge(), 'label' => $label));
                 }
             }
             $newTotals[$index] = $arr;
         }
         $this->_totals = $newTotals;
     }
     return $this;
 }
 /**
  * Initialize order totals array
  *
  * @return Mage_Sales_Block_Order_Totals
  */
 protected function _initTotals()
 {
     parent::_initTotals();
     return $this;
 }