Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Tax.php
Go to the documentation of this file.
1 <?php
7 
8 class Tax extends \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal
9 {
13  protected $_taxConfig;
14 
22  public function __construct(
23  \Magento\Tax\Helper\Data $taxHelper,
24  \Magento\Tax\Model\Calculation $taxCalculation,
25  \Magento\Tax\Model\ResourceModel\Sales\Order\Tax\CollectionFactory $ordersFactory,
26  \Magento\Tax\Model\Config $taxConfig,
27  array $data = []
28  ) {
29  $this->_taxConfig = $taxConfig;
30  parent::__construct($taxHelper, $taxCalculation, $ordersFactory, $data);
31  }
32 
44  public function getTotalsForDisplay()
45  {
46  $store = $this->getOrder()->getStore();
47  if ($this->_taxConfig->displaySalesTaxWithGrandTotal($store)) {
48  return [];
49  }
50 
51  $totals = [];
52 
53  if ($this->_taxConfig->displaySalesFullSummary($store)) {
54  $totals = $this->getFullTaxInfo();
55  }
56 
57  $totals = array_merge($totals, parent::getTotalsForDisplay());
58 
59  return $totals;
60  }
61 }
$totals
Definition: totalbar.phtml:10
__construct(\Magento\Tax\Helper\Data $taxHelper, \Magento\Tax\Model\Calculation $taxCalculation, \Magento\Tax\Model\ResourceModel\Sales\Order\Tax\CollectionFactory $ordersFactory, \Magento\Tax\Model\Config $taxConfig, array $data=[])
Definition: Tax.php:22