Totals.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Block\Adminhtml\Order;
  7. /**
  8. * Adminhtml order totals block
  9. *
  10. * @api
  11. * @author Magento Core Team <core@magentocommerce.com>
  12. * @since 100.0.2
  13. */
  14. class Totals extends \Magento\Sales\Block\Adminhtml\Totals//\Magento\Sales\Block\Adminhtml\Order\AbstractOrder
  15. {
  16. /**
  17. * Initialize order totals array
  18. *
  19. * @return $this
  20. */
  21. protected function _initTotals()
  22. {
  23. parent::_initTotals();
  24. $this->_totals['paid'] = new \Magento\Framework\DataObject(
  25. [
  26. 'code' => 'paid',
  27. 'strong' => true,
  28. 'value' => $this->getSource()->getTotalPaid(),
  29. 'base_value' => $this->getSource()->getBaseTotalPaid(),
  30. 'label' => __('Total Paid'),
  31. 'area' => 'footer',
  32. ]
  33. );
  34. $this->_totals['refunded'] = new \Magento\Framework\DataObject(
  35. [
  36. 'code' => 'refunded',
  37. 'strong' => true,
  38. 'value' => $this->getSource()->getTotalRefunded(),
  39. 'base_value' => $this->getSource()->getBaseTotalRefunded(),
  40. 'label' => __('Total Refunded'),
  41. 'area' => 'footer',
  42. ]
  43. );
  44. $this->_totals['due'] = new \Magento\Framework\DataObject(
  45. [
  46. 'code' => 'due',
  47. 'strong' => true,
  48. 'value' => $this->getSource()->getTotalDue(),
  49. 'base_value' => $this->getSource()->getBaseTotalDue(),
  50. 'label' => __('Total Due'),
  51. 'area' => 'footer',
  52. ]
  53. );
  54. return $this;
  55. }
  56. }