1: <?php
2: /**
3: * Magento
4: *
5: * NOTICE OF LICENSE
6: *
7: * This source file is subject to the Open Software License (OSL 3.0)
8: * that is bundled with this package in the file LICENSE.txt.
9: * It is also available through the world-wide-web at this URL:
10: * http://opensource.org/licenses/osl-3.0.php
11: * If you did not receive a copy of the license and are unable to
12: * obtain it through the world-wide-web, please send an email
13: * to license@magentocommerce.com so we can send you a copy immediately.
14: *
15: * DISCLAIMER
16: *
17: * Do not edit or add to this file if you wish to upgrade Magento to newer
18: * versions in the future. If you wish to customize Magento for your
19: * needs please refer to http://www.magentocommerce.com for more information.
20: *
21: * @category Mage
22: * @package Mage_Adminhtml
23: * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25: */
26:
27: /**
28: * Subtotal Total Row Renderer
29: *
30: * @author Magento Core Team <core@magentocommerce.com>
31: */
32:
33: class Mage_Adminhtml_Block_Sales_Order_Create_Totals_Shipping
34: extends Mage_Adminhtml_Block_Sales_Order_Create_Totals_Default
35: {
36: protected $_template = 'sales/order/create/totals/shipping.phtml';
37:
38: /**
39: * Check if we need display shipping include and exclude tax
40: *
41: * @return bool
42: */
43: public function displayBoth()
44: {
45: return Mage::getSingleton('tax/config')->displayCartShippingBoth();
46: }
47:
48: /**
49: * Check if we need display shipping include tax
50: *
51: * @return bool
52: */
53: public function displayIncludeTax()
54: {
55: return Mage::getSingleton('tax/config')->displayCartShippingInclTax();
56: }
57:
58: /**
59: * Get shipping amount include tax
60: *
61: * @return float
62: */
63: public function getShippingIncludeTax()
64: {
65: return $this->getTotal()->getAddress()->getShippingAmount() +
66: $this->getTotal()->getAddress()->getShippingTaxAmount();
67: }
68:
69: /**
70: * Get shipping amount exclude tax
71: *
72: * @return float
73: */
74: public function getShippingExcludeTax()
75: {
76: return $this->getTotal()->getAddress()->getShippingAmount();
77: }
78:
79: /**
80: * Get label for shipping include tax
81: *
82: * @return float
83: */
84: public function getIncludeTaxLabel()
85: {
86: return $this->helper('tax')->__('Shipping Incl. Tax (%s)', $this->escapeHtml($this->getTotal()->getAddress()->getShippingDescription()));
87: }
88:
89: /**
90: * Get label for shipping exclude tax
91: *
92: * @return float
93: */
94: public function getExcludeTaxLabel()
95: {
96: return $this->helper('tax')->__('Shipping Excl. Tax (%s)', $this->escapeHtml($this->getTotal()->getAddress()->getShippingDescription()));
97: }
98: }
99: