protected function _initTotals() { parent::_initTotals(); $this->addTotal(new Varien_Object(array('code' => 'payment_fee', 'strong' => false, 'value' => $this->getSource()->getPaymentFeeAmount(), 'base_value' => $this->getSource()->getBasePaymentFeeAmount(), 'label' => $this->helper('adyen')->__('Payment Fee'), 'area' => '')), 'subtotal'); $this->addTotal(new Varien_Object(array('code' => 'payment_installment_fee', 'strong' => false, 'value' => $this->getSource()->getPaymentInstallmentFeeAmount(), 'base_value' => $this->getSource()->getBasePaymentInstallmentFeeAmount(), 'label' => $this->helper('adyen')->__('Payment Fee Installments'), 'area' => '')), 'subtotal'); return $this; }
public function _initTotals() { parent::_initTotals(); if ($this->cashAmount() > 0) { $this->_totals['webpos_cash'] = new Varien_Object(array('code' => 'webpos_cash', 'strong' => true, 'value' => $this->cashAmount(), 'base_value' => $this->cashAmount('base'), 'label' => $this->helper('sales')->__('Amount Tendered'))); } }
protected function _beforeToHtml() { parent::_beforeToHtml(); $this->setCanDisplayTotalPaid($this->getParentBlock()->getCanDisplayTotalPaid()); $this->setCanDisplayTotalRefunded($this->getParentBlock()->getCanDisplayTotalRefunded()); $this->setCanDisplayTotalDue($this->getParentBlock()->getCanDisplayTotalDue()); }
/** * Retrieve required options from parent */ protected function _beforeToHtml() { if (!$this->getParentBlock()) { Mage::throwException(Mage::helper('adminhtml')->__('Invalid parrent block for this block')); } $this->setOrder($this->getParentBlock()->getSource()); parent::_beforeToHtml(); }
/** * Initialize order totals array * * @return Mage_Sales_Block_Order_Totals */ protected function _initTotals() { parent::_initTotals(); $source = $this->getSource(); if ($this->getSource()->getInterest() > 0) { $this->addTotalBefore(new Varien_Object(array('code' => 'interest', 'strong' => true, 'value' => $this->getSource()->getInterest(), 'base_value' => $this->getSource()->getBaseInterest(), 'label' => $this->__('Interest'), 'area' => 'footer')), 'grand_total'); } return $this; }
protected function _initTotals() { parent::_initTotals(); $initAmount = $this->getSource()->getSubscriptionInitAmount(); if ($initAmount != 0) { $this->addTotal(new Varien_Object(array('code' => 'subscription_init_amount', 'value' => $initAmount, 'base_value' => $initAmount, 'label' => $initAmount > 0 ? Mage::helper('customweb_subscription')->__('Initial Subscription Fee') : Mage::helper('customweb_subscription')->__('Initial Subscription Discount'))), $initAmount > 0 ? 'fee' : 'discount'); } return $this; }
/** * Initialize order totals array * * @return Mage_Sales_Block_Order_Totals */ protected function _initTotals() { parent::_initTotals(); $source = $this->getSource(); if ($this->getSource()->getMundipaggInterest() > 0) { $this->addTotalBefore(new Varien_Object(array('code' => 'mundipagg_interest', 'field' => 'interest', 'value' => $this->getSource()->getMundipaggInterest(), 'label' => $this->__('Interest'))), 'grand_total'); } return $this; }
protected function _initTotals() { parent::_initTotals(); if (Mage::getStoreConfig('vc_giftwrap/general/enable')) { $price = Mage::helper('vc_giftwrap')->getAmountByOrderId($this->getOrder()->getId()); $this->_totals['giftcard'] = new Varien_Object(array('code' => 'giftcard', 'value' => $price, 'base_value' => $price, 'label' => $this->helper('vc_giftwrap')->__('Gift Wrap'))); } return $this; }
protected function _initTotals() { parent::_initTotals(); if (Mage::helper('customfee')->canApply()) { $subtotal = $this->getSource()->getSubtotal(); $amount = $this->getFeeAmount($subtotal); $this->addTotalBefore(new Varien_Object(array('code' => 'customfee', 'value' => $amount, 'base_value' => $amount, 'label' => $this->getLabel()), array('shipping', 'tax'))); } return $this; }
/** * Initialize order totals array * * @return Mage_Sales_Block_Order_Totals */ protected function _initTotals() { parent::_initTotals(); $amount = number_format($this->getOrder()->getGiftcardDiscount(), 2); $gcCode = $this->getOrder()->getGiftcardCode(); if ($amount > 0) { $this->addTotalBefore(new Varien_Object(array('code' => $this->getCode(), 'value' => -$amount, 'base_value' => -$amount, 'label' => 'Gift Card (' . $gcCode . ')')), 'grand_total'); } return $this; }
protected function _initTotals() { parent::_initTotals(); //Retrieve Creditpoint Amount from sales_flat_order table order wise $creditPointAmount = $this->getSource()->getCreditpointAmount(); $creditPoints = number_format(Mage::getModel('creditpoint/creditpoint')->load($this->getSource()->getEntityId(), 'order_id')->getAppliedCreditPoint()); if ($creditPointAmount > 0) { $this->addTotalBefore(new Varien_Object(array('code' => Mage::helper('creditpoint')->getCode(), 'value' => '-' . $creditPointAmount, 'base_value' => '-' . $creditPointAmount, 'strong' => false, 'label' => Mage::helper('creditpoint')->getCreditPointLabel($creditPoints)), array('shipping', 'tax'))); } return $this; }
/** * Initialize order totals array * * @return Mage_Sales_Block_Order_Totals */ protected function _initTotals() { parent::_initTotals(); $amt = $this->getSource()->getFeeAmount(); $baseAmt = $this->getSource()->getBaseFeeAmount(); if ($amt) { $this->addTotalBefore(new Varien_Object(array('code' => 'codpayment', 'value' => $amt, 'base_value' => $baseAmt, 'label' => 'Cash On Delivery Charges')), 'fee_amount'); } //Mage::log($amt,null,"order.log"); return $this; }
/** * Initialize order totals array * * @return Mage_Sales_Block_Order_Totals */ protected function _initTotals() { parent::_initTotals(); // If Order processed with fee, we add it to Totals Order view $feeAmount = $this->getOrder()->getFeeAmount() / 100; if ($feeAmount) { $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')); $this->_totals['due'] = new Varien_Object(array('code' => 'due', 'strong' => true, 'value' => $this->getSource()->getBaseTotalDue() > 0 ? $this->getSource()->getBaseTotalDue() + $feeAmount : $this->getSource()->getBaseTotalDue(), 'base_value' => $this->getSource()->getBaseTotalDue() > 0 ? $this->getSource()->getBaseTotalDue() + $feeAmount : $this->getSource()->getBaseTotalDue(), 'label' => $this->helper('sales')->__('Total Due'), 'area' => 'footer')); $this->addTotalBefore(new Varien_Object(array('code' => 'fee', 'value' => $feeAmount, 'base_value' => $feeAmount, 'label' => "Fee"), array('shipping', 'tax'))); } return $this; }
protected function _initTotals() { parent::_initTotals(); $order = $this->getSource(); $code = $order->getPayment()->getMethod(); $amount = $order->getServicecostPdf(); $method = $order->getPayment()->getMethodInstance(); if ($amount) { $this->addTotalBefore(new Varien_Object(array('code' => 'servicecost', 'value' => $amount, 'base_value' => $amount, 'label' => Mage::helper('msp')->getFeeLabel($code)), array('tax'))); } return $this; }
/** * Initialize order totals array * * @return Mage_Sales_Block_Order_Totals */ protected function _initTotals() { parent::_initTotals(); $source = $this->getSource(); if ($this->getSource()->getJuros() > 0) { $this->addTotalBefore(new Varien_Object(array('code' => 'juros', 'strong' => true, 'value' => $this->getSource()->getJuros(), 'base_value' => $this->getSource()->getBaseJuros(), 'label' => Mage::getStoreConfig('payment/apelidocielo/texto_juros'), 'area' => 'footer')), 'grand_total'); } if ($this->getSource()->getDesconto() < 0) { $this->addTotalBefore(new Varien_Object(array('code' => 'desconto', 'strong' => true, 'value' => $this->getSource()->getDesconto(), 'base_value' => $this->getSource()->getBaseDesconto(), 'label' => Mage::getStoreConfig('payment/apelidocielo/texto_desconto_a_vista'), 'area' => 'footer')), 'grand_total'); } return $this; }
/** * Initialize order totals array * * @return Mage_Sales_Block_Order_Totals */ protected function _initTotals() { parent::_initTotals(); $order = $this->getOrder(); $payment = $order->getPayment(); if (substr($payment->getMethod(), 0, 5) != "sisow") { return $this; } $info = $order->getPayment()->getMethodInstance()->getInfoInstance(); if (!$info->getAdditionalInformation("invoice_fee")) { return $this; } return Mage::helper('sisow/paymentfee')->addToBlock($this); }
protected function _initTotals() { parent::_initTotals(); $order = $this->getOrder(); $payment = $order->getPayment(); if ($payment->getMethod() != "billmateinvoice") { return $this; } $info = $order->getPayment()->getMethodInstance()->getInfoInstance(); if (!$info->getAdditionalInformation("billmateinvoice_fee")) { return $this; } return Mage::helper('billmateinvoice/total')->addToBlock($this); }
protected function _initTotals() { parent::_initTotals(); $add_giftwrap = false; $items = $this->getSource()->getAllItems(); foreach ($items as $item) { if ($item->getData('gomage_gift_wrap')) { $add_giftwrap = true; break; } } if ($add_giftwrap) { $this->_totals['gomage_gift_wrap'] = new Varien_Object(array('code' => 'gomage_gift_wrap', 'value' => $this->getSource()->getGomageGiftWrapAmount(), 'base_value' => $this->getSource()->getBaseGomageGiftWrapAmount(), 'label' => Mage::helper('gomage_checkout')->getConfigData('gift_wrapping/title'))); } return $this; }
/** * Initialize order totals array * * @return Mage_Sales_Block_Order_Totals */ protected function _initTotals() { parent::_initTotals(); $order = $this->getOrder(); $payment = $order->getPayment(); $paymentMethodCode = $payment->getMethodInstance()->getCode(); if (Mage::helper('base')->isIdeasaPaymentMethod($paymentMethodCode)) { $amount = Mage::getModel($paymentMethodCode . '/discount')->getIdeasaDiscount($order); if (abs($amount) > 0) { $baseAmount = Mage::getModel($paymentMethodCode . '/discount')->getIdeasaBaseDiscount($order); $code = Mage::getModel($paymentMethodCode . '/discount')->getIdeasaDiscountCode(); $this->addTotal(new Varien_Object(array('code' => $code, 'value' => $amount, 'base_value' => $baseAmount, 'label' => Mage::helper($paymentMethodCode)->__('Payment Discount')))); } } return $this; }
/** * Initialize order totals array * * @return Mage_Sales_Block_Order_Totals */ protected function _initTotals() { parent::_initTotals(); $store = $this->getOrder()->getStore()->getId(); $taxConfig = Mage::getModel('adyen_fee/tax_config'); if ($taxConfig->displaySalesPaymentFeeBoth($store)) { $this->addPaymentFeeWithTax(true); $this->addPaymentFeeWithoutTax(true); } elseif ($taxConfig->displaySalesPaymentFeeInclTax($store)) { $this->addPaymentFeeWithTax(); } else { $this->addPaymentFeeWithoutTax(); } $this->addTotal(new Varien_Object(array('code' => 'payment_percentage_fee', 'strong' => false, 'value' => $this->getSource()->getPaymentPercentageFee(), 'base_value' => $this->getSource()->getBasePaymentPercentageFee(), 'label' => $this->helper('adyen')->__('Payment Percentage Fee'), 'area' => '')), 'subtotal'); $this->addTotal(new Varien_Object(array('code' => 'payment_installment_fee', 'strong' => false, 'value' => $this->getSource()->getPaymentInstallmentFeeAmount(), 'base_value' => $this->getSource()->getBasePaymentInstallmentFeeAmount(), 'label' => $this->helper('adyen')->__('Payment Fee Installments'), 'area' => '')), 'subtotal'); return $this; }
protected function _initTotals() { parent::_initTotals(); $affiliate_credit = Mage::getModel('credit/creditorder')->load($this->getOrder()->getIncrementId()); $affiliate = $affiliate_credit->getAffiliate(); $credit = $affiliate_credit->getCredit(); $baseCurrencyCode = Mage::getModel('sales/order')->loadByIncrementId($this->getOrder()->getIncrementId())->getData('base_currency_code'); $currentCurrencyCode = Mage::getModel('sales/order')->loadByIncrementId($this->getOrder()->getIncrementId())->getData('order_currency_code'); $affiliate_show = Mage::helper('directory')->currencyConvert($affiliate, $baseCurrencyCode, $currentCurrencyCode); $credit_show = Mage::helper('directory')->currencyConvert($credit, $baseCurrencyCode, $currentCurrencyCode); if ($affiliate > 0) { $this->_totals['affiliate_discount'] = new Varien_Object(array('code' => 'affiliate_discount', 'value' => -$affiliate_show, 'base_value' => -$affiliate, 'label' => Mage::helper('affiliate')->__('Affiliate Discount'))); } if ($credit > 0) { $this->_totals['credit_discount'] = new Varien_Object(array('code' => 'credit_discount', 'value' => -$credit_show, 'base_value' => -$credit, 'label' => Mage::helper('credit')->__('Credit Discount'))); } return $this; }
protected function _initTotals() { parent::_initTotals(); $rewardpoints = Mage::getModel('rewardpoints/rewardpointsorder')->load($this->getOrder()->getId()); $baseCurrencyCode = Mage::getModel('sales/order')->loadByIncrementId($this->getOrder()->getIncrementId())->getData('base_currency_code'); $currentCurrencyCode = Mage::getModel('sales/order')->loadByIncrementId($this->getOrder()->getIncrementId())->getData('order_currency_code'); $store_id = Mage::getModel('sales/order')->load($this->getOrder()->getId())->getStoreId(); $earn_rewardpoint = (int) $rewardpoints->getEarnRewardpoint(); $total_rewardpoint_use = $rewardpoints->getRewardPoint() + $rewardpoints->getRewardpointSellProduct(); if ($earn_rewardpoint > 0) { $total = new Varien_Object(array('code' => 'earn_rewardpoints', 'value' => Mage::helper('rewardpoints')->formatPoints($earn_rewardpoint, $store_id), 'base_value' => Mage::helper('rewardpoints')->formatPoints($earn_rewardpoint, $store_id), 'label' => Mage::helper('rewardpoints')->__('You Earn'), 'strong' => false, 'is_formated' => true)); $this->addTotal($total, 'first'); } if ($total_rewardpoint_use > 0) { $total = new Varien_Object(array('code' => 'rewardpoints', 'value' => Mage::helper('rewardpoints')->formatPoints($total_rewardpoint_use, $store_id), 'base_value' => Mage::helper('rewardpoints')->formatPoints($total_rewardpoint_use, $store_id), 'label' => Mage::helper('rewardpoints')->__('Total Points'), 'strong' => true, 'is_formated' => true)); $this->addTotal($total, 'last'); } if ($rewardpoints->getMoney()) { $rewardpoints_show = Mage::helper('directory')->currencyConvert($rewardpoints->getMoney(), $baseCurrencyCode, $currentCurrencyCode); $total1 = new Varien_Object(array('code' => 'rewardpoints_discount', 'value' => $rewardpoints_show, 'base_value' => $rewardpoints->getMoney(), 'label' => Mage::helper('rewardpoints')->__('Discount'))); $this->addTotal($total1, 'subtotal'); } return $this; }
/** * important can't delete */ public function _construct() { $this->_beforeToHtml(); parent::_construct(); }