/** * Initialize all order totals relates with tax * * @return Mage_Tax_Block_Sales_Order_Tax */ public function initTotals() { $parent = $this->getParentBlock(); $this->_order = $parent->getOrder(); $this->_source = $parent->getSource(); $store = $this->getStore(); $allowTax = $this->_source->getTaxAmount() > 0 || $this->_config->displaySalesZeroTax($store); $grandTotal = (double) $this->_source->getGrandTotal(); if (!$grandTotal || $allowTax && !$this->_config->displaySalesTaxWithGrandTotal($store)) { $this->_addTax(); } $this->_initSubtotal(); $this->_initShipping(); $this->_initDiscount(); $this->_initGrandTotal(); return $this; }
/** * Initialize all order totals relates with tax * * @return Mage_Tax_Block_Sales_Order_Tax */ public function initTotals() { /** @var $parent Mage_Adminhtml_Block_Sales_Order_Invoice_Totals */ $parent = $this->getParentBlock(); $this->_quote = $parent->getQuote(); $this->_source = $parent->getSource(); $store = $this->getStore(); $allowTax = $this->_source->getTaxAmount() > 0 || $this->_config->displaySalesZeroTax($store); $grandTotal = (double) $this->_source->getGrandTotal(); if (!$grandTotal || $allowTax && !$this->_config->displaySalesTaxWithGrandTotal($store)) { $this->_addTax(); } $this->_initSubtotal(); $this->_initShipping(); $this->_initDiscount(); $this->_initGrandTotal(); return $this; }