public function initTotals() { $parent = $this->getParentBlock(); $this->_invoice = $parent->getInvoice(); if ($this->_invoice->getCodFee()) { $cod = new Varien_Object(); $cod->setLabel($this->__('Cash on Delivery fee')); $cod->setValue($this->_invoice->getCodFee()); $cod->setBaseValue($this->_invoice->getBaseCodFee()); $cod->setCode('cod_fee'); if (Mage::helper('cashondelivery')->displayCodBothPrices()) { $cod->setLabel($this->__('Cash on Delivery fee (Excl.Tax)')); $codIncl = new Varien_Object(); $codIncl->setLabel($this->__('Cash on Delivery fee (Incl.Tax)')); $codIncl->setValue($this->_invoice->getCodFee() + $this->_invoice->getCodTaxAmount()); $codIncl->setBaseValue($this->_invoice->getBaseCodFee() + $this->_invoice->getBaseCodTaxAmount()); $codIncl->setCode('cod_fee_incl'); $parent->addTotalBefore($cod, 'tax'); $parent->addTotalBefore($codIncl, 'tax'); } elseif (Mage::helper('cashondelivery')->displayCodFeeIncludingTax()) { $cod->setValue($this->_invoice->getCodFee() + $this->_invoice->getCodTaxAmount()); $cod->setBaseValue($this->_invoice->getBaseCodFee() + $this->_invoice->getBaseCodTaxAmount()); $parent->addTotalBefore($cod, 'tax'); } else { $parent->addTotalBefore($cod, 'tax'); } } return $this; }
public function initTotals() { $parent = $this->getParentBlock(); $paymentMethod = $parent->getOrder()->getPayment()->getMethodInstance()->getCode(); if (!in_array($paymentMethod, self::$_allowed_methods)) { return $this; } if ($parent->getOrder()->getBasePayexPaymentFeeTax()) { $total = new Varien_Object(); $total->setLabel(Mage::helper('payex')->__('Payment fee (Incl.Tax)')); $total->setValue($parent->getOrder()->getPayexPaymentFee() + $parent->getOrder()->getPayexPaymentFeeTax()); $total->setBaseValue($parent->getOrder()->getPayexBasePaymentFee() + $parent->getOrder()->getPayexBasePaymentFeeTax()); $total->setCode('payex_payment_fee_with_tax'); $parent->addTotalBefore($total, 'tax'); } if ($parent->getOrder()->getBasePayexPaymentFee()) { $total = new Varien_Object(); $total->setLabel(Mage::helper('payex')->__('Payment fee (Excl.Tax)')); $total->setValue($parent->getOrder()->getPayexPaymentFee()); $total->setBaseValue($parent->getOrder()->getPayexBasePaymentFee()); $total->setCode('payex_payment_fee'); $parent->addTotalBefore($total, 'payex_payment_fee_with_tax'); } return $this; }
public function addToBlock($block) { $order = $block->getOrder(); $label = Mage::getStoreConfig('payment/' . $order->getPayment()->getMethod() . '/surcharge_label'); $fee = new Varien_Object(); $fee->setCode('surcharge_incl'); $fee->setLabel($label); $fee->setBaseValue(10); $fee->setValue(11); $block->addTotalBefore($fee, 'shipping'); return $block; }
public function initTotals() { if ($this->giftwrapAmount() > 0) { $total = new Varien_Object(); $total->setCode('giftwrap'); $total->setValue($this->giftwrapAmount()); $total->setBaseValue(0); $total->setLabel('Gift wrap'); $parent = $this->getParentBlock(); $parent->addTotal($total, 'subtotal'); } }
public function initTotals() { if ($this->discountAmount() != 0) { $total = new Varien_Object(); $total->setCode('webposdiscount'); $total->setValue(-$this->discountAmount()); $total->setBaseValue(0); $total->setLabel('Discount(Admin)'); $parent = $this->getParentBlock(); $parent->addTotal($total, 'subtotal'); } }
public function initTotals() { $parent = $this->getParentBlock(); if ($this->_invoice->getCodFee()) { $cod = new Varien_Object(); $cod->setLabel($this->__('Refund Cash on Delivery fee')); $cod->setValue($parent->getSource()->getCodFee()); $cod->setBaseValue($parent->getSource()->getBaseCodFee()); $cod->setCode('cod_fee'); $parent->addTotalBefore($cod, 'adjustment_positive'); } return $this; }
public function initTotals() { $amount = $this->getAffiliateplusDiscount(); if (floatval($amount)) { $total = new Varien_Object(); $total->setCode('affiliateplus_discount'); $total->setValue($amount); $total->setBaseValue($this->getBaseAffiliateplusDiscount()); $total->setLabel('Affiliate Discount' . $this->getAffiliateCouponLabel()); $parent = $this->getParentBlock(); $parent->addTotal($total, 'subtotal'); } }
public function initTotals() { // var_dump($this->discountAmount()); if ($this->discountAmount() != 0) { $total = new Varien_Object(); $total->setCode('onestepcheckoutdiscount'); $total->setValue(-$this->discountAmount()); $total->setBaseValue(-$this->baseDiscountAmout()); $total->setLabel('Discount(Admin)'); $parent = $this->getParentBlock(); $parent->addTotal($total, 'subtotal'); } }
public function initTotals() { $amount = $this->getLuckydrawDiscount(); if (floatval($amount)) { $total = new Varien_Object(); $total->setCode('luckydraw_discount'); $total->setValue($amount); $total->setBaseValue($this->getBaseLuckydrawDiscount()); $total->setLabel('Lucky Draw Discount'); $parent = $this->getParentBlock(); $parent->addTotal($total, 'subtotal'); } }
/** * add fee to order detail view * * @return $this */ public function initTotals() { $parent = $this->getParentBlock(); $this->_order = $parent->getOrder(); if ($this->_order->getShopgatePaymentFee()) { $fee = new Varien_Object(); $fee->setLabel($this->__('Payment Fee')); $fee->setValue($this->_order->getShopgatePaymentFee()); $fee->setBaseValue($this->_order->getBaseShopgatePaymentFee()); $fee->setCode($this->getCode()); $parent->addTotalBefore($fee, 'tax'); } return $this; }
public function initTotals() { $parent = $this->getParentBlock(); if ($parent->getSource()) { $fee = new Varien_Object(); $fee->setLabel($this->__('Refund Payment fee')); $fee->setValue($parent->getSource()->getCapayableFee()); $fee->setBaseValue($parent->getSource()->getBaseCapayableFee()); $fee->setCode('payment_fee'); $fee->setBlockName('capayable_fee'); $parent->addTotalBefore($fee, 'adjustment_positive'); } return $this; }
public function initTotals() { $parent = $this->getParentBlock(); if ($parent->getOrder()->getPayment()->getMethodInstance()->getCode() !== 'factoring') { return $this; } if ($parent->getOrder()->getBaseFactoringPaymentFee()) { $total = new Varien_Object(); $total->setLabel($this->__('Payment fee')); $total->setValue($parent->getOrder()->getFactoringPaymentFee()); $total->setBaseValue($parent->getOrder()->getFactoringBasePaymentFee()); $total->setCode('factoring_payment_fee'); $parent->addTotalBefore($total, 'tax'); } return $this; }
public function addToBlock($block) { $order = $block->getOrder(); $info = $order->getPayment()->getMethodInstance()->getInfoInstance(); $storeId = Mage::app()->getStore()->getId(); $vatOption = Mage::getStoreConfig("tax/sales_display/price", $storeId); $invoiceFee = $info->getAdditionalInformation('billmateinvoice_fee'); $invoiceTax = $info->getAdditionalInformation('billmateinvoice_fee_tax'); $origInvFee = Mage::getStoreConfig('payment/billmateinvoice/billmate_fee'); if ($invoiceTax != 0 && $invoiceFee == $origInvFee) { $invoiceFee += $invoiceTax; } $extra = ''; $fee = new Varien_Object(); $fee->setCode('billmateinvoice_fee'); $label = Mage::helper('billmateinvoice')->__('Billmate Invoice Fee (Incl. Vat)'); $fee->setLabel($label); $fee->setBaseValue($invoiceFee); $fee->setValue($invoiceFee); $block->addTotalBefore($fee, 'shipping'); return $block; }
public function initTotals() { // $parent = Mage_Adminhtml_Block_Sales_Order_Invoice_Totals // $this->_invoice = Mage_Sales_Model_Order_Invoice $parent = $this->getParentBlock(); $this->_invoice = $parent->getInvoice(); if (!$this->_invoice) { return $this; } $payment = $this->_invoice->getOrder()->getPayment(); $methodTitle = Mage::helper('capayable')->getMethodTitle($payment->getMethod()); if ($this->_invoice->getCapayableFee()) { $fee = new Varien_Object(); $fee->setLabel($this->__($methodTitle)); $fee->setValue($this->_invoice->getCapayableFee()); $fee->setBaseValue($this->_invoice->getBaseCapayableFee()); $fee->setCode('payment_fee'); if (Mage::helper('capayable')->displayBothPrices()) { $fee->setLabel($this->__('Payment fee (Excl.Tax)')); $feeIncl = new Varien_Object(); $feeIncl->setLabel($this->__('Payment fee (Incl.Tax)')); $feeIncl->setValue($this->_invoice->getCapayableFee() + $this->_invoice->getCapayableFeeTaxAmount()); $feeIncl->setBaseValue($this->_invoice->getBaseCapayableFee() + $this->_invoice->getBaseCapayableFeeTaxAmount()); $feeIncl->setCode('payment_fee_incl'); $parent->addTotalBefore($fee, 'tax'); $parent->addTotalBefore($feeIncl, 'tax'); } elseif (Mage::helper('capayable')->displayFeeIncludingTax()) { $fee->setValue($this->_invoice->getCapayableFee() + $this->_invoice->getCapayableFeeTaxAmount()); $fee->setBaseValue($this->_invoice->getBaseCapayableFee() + $this->_invoice->getBaseCapayableFeeTaxAmount()); $parent->addTotalBefore($fee, 'tax'); } else { $parent->addTotalBefore($fee, 'tax'); } } return $this; }
public function addToBlock($block) { $order = $block->getOrder(); $info = $order->getPayment()->getMethodInstance()->getInfoInstance(); $storeId = Mage::app()->getStore()->getId(); $taxOption = Mage::getStoreConfig("tax/sales_display/shipping", $storeId); $country = $order->getShippingAddress()->getCountry(); //$lang = Mage::helper('klarnaPaymentModule/lang'); $label = Mage::getStoreConfig('payment/' . $order->getPayment()->getMethod() . '/payment_fee_label'); $paymentFee = $info->getAdditionalInformation('invoice_fee'); $basePaymentFee = $info->getAdditionalInformation('base_invoice_fee'); $paymentFeeExcludingVat = $info->getAdditionalInformation('invoice_fee_exluding_vat'); $basePaymentFeeExcludingVat = $info->getAdditionalInformation('base_invoice_fee_exluding_vat'); /** * 1 : Show exluding tax * 2 : Show including tax * 3 : Show both */ if ($taxOption === '1' || $taxOption === '3') { $label = Mage::getStoreConfig('payment/' . $order->getPayment()->getMethod() . '/payment_fee_label'); $fee = new Varien_Object(); $fee->setCode('invoice_fee_excl'); if ($taxOption == '3') { $label .= ' (Excl.Tax)'; } $fee->setLabel($label); $fee->setBaseValue($basePaymentFeeExcludingVat); $fee->setValue($paymentFeeExcludingVat); $block->addTotalBefore($fee, 'shipping'); } if ($taxOption === '2' || $taxOption === '3') { $label = Mage::getStoreConfig('payment/' . $order->getPayment()->getMethod() . '/payment_fee_label'); $fee = new Varien_Object(); $fee->setCode('invoice_fee_incl'); if ($taxOption == '3') { $label .= ' (Incl.Tax)'; } $fee->setLabel($label); $fee->setBaseValue($basePaymentFee); $fee->setValue($paymentFee); $block->addTotalBefore($fee, 'shipping'); } return $block; }