_isScopePrivate = true; } /** * @var Creditmemo|null */ protected $_creditmemo = null; /** * @return Creditmemo|null */ public function getCreditmemo() { if ($this->_creditmemo === null) { if ($this->hasData('creditmemo')) { $this->_creditmemo = $this->_getData('creditmemo'); } elseif ($this->_coreRegistry->registry('current_creditmemo')) { $this->_creditmemo = $this->_coreRegistry->registry('current_creditmemo'); } elseif ($this->getParentBlock()->getCreditmemo()) { $this->_creditmemo = $this->getParentBlock()->getCreditmemo(); } } return $this->_creditmemo; } /** * @param Creditmemo $creditmemo * @return $this */ public function setCreditmemo($creditmemo) { $this->_creditmemo = $creditmemo; return $this; } /** * Get totals source object * * @return Creditmemo */ public function getSource() { return $this->getCreditmemo(); } /** * Initialize order totals array * * @return $this */ protected function _initTotals() { parent::_initTotals(); $this->removeTotal('base_grandtotal'); if ((double)$this->getSource()->getAdjustmentPositive()) { $total = new \Magento\Framework\DataObject( [ 'code' => 'adjustment_positive', 'value' => $this->getSource()->getAdjustmentPositive(), 'label' => __('Adjustment Refund'), ] ); $this->addTotal($total); } if ((double)$this->getSource()->getAdjustmentNegative()) { $total = new \Magento\Framework\DataObject( [ 'code' => 'adjustment_negative', 'value' => $this->getSource()->getAdjustmentNegative(), 'label' => __('Adjustment Fee'), ] ); $this->addTotal($total); } /** getCanDisplayTotalPaid()): ?>