![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/cartforge.co/vendor/magento/module-sales/Block/Adminhtml/Order/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Sales\Block\Adminhtml\Order; /** * Adminhtml creditmemo bar * * @deprecated 101.0.6 * @api * @author Magento Core Team <[email protected]> * @since 100.0.2 */ class Totalbar extends \Magento\Sales\Block\Adminhtml\Order\AbstractOrder { /** * Totals * * @var array */ protected $_totals = []; /** * Retrieve required options from parent * * @return void * @throws \Magento\Framework\Exception\LocalizedException */ protected function _beforeToHtml() { if (!$this->getParentBlock()) { throw new \Magento\Framework\Exception\LocalizedException( __('Please correct the parent block for this block.') ); } $this->setOrder($this->getParentBlock()->getOrder()); $this->setSource($this->getParentBlock()->getSource()); $this->setCurrency($this->getParentBlock()->getOrder()->getOrderCurrency()); foreach ($this->getParentBlock()->getOrderTotalbarData() as $v) { $this->addTotal($v[0], $v[1], $v[2]); } parent::_beforeToHtml(); } /** * Get totals * * @return array */ protected function getTotals() { return $this->_totals; } /** * Add total * * @param string $label * @param float $value * @param bool $grand * @return $this */ public function addTotal($label, $value, $grand = false) { $this->_totals[] = ['label' => $label, 'value' => $value, 'grand' => $grand]; return $this; } }