Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertOrderTaxOnBackendExcludingIncludingTax.php
Go to the documentation of this file.
1 <?php
8 
13 {
19  protected $severeness = 'high';
20 
27  public function getOrderTotals($actualPrices)
28  {
29  $viewBlock = $this->salesOrderView->getOrderTotalsBlock();
30  $actualPrices['subtotal_excl_tax'] = $viewBlock->getSubtotalExclTax();
31  $actualPrices['subtotal_incl_tax'] = $viewBlock->getSubtotalInclTax();
32 
33  $actualPrices['discount'] = $viewBlock->getDiscount();
34 
35  $actualPrices['shipping_excl_tax'] = $viewBlock->getShippingExclTax();
36  $actualPrices['shipping_incl_tax'] = $viewBlock->getShippingInclTax();
37  $actualPrices['tax'] = $viewBlock->getTax();
38  $actualPrices['grand_total_excl_tax'] = $viewBlock->getGrandTotalExclTax();
39  $actualPrices['grand_total_incl_tax'] = $viewBlock->getGrandTotalInclTax();
40 
41  return $actualPrices;
42  }
43 
50  public function getInvoiceNewTotals($actualPrices)
51  {
52  $totalsBlock = $this->orderInvoiceNew->getTotalsBlock();
53  $actualPrices['subtotal_excl_tax'] = $totalsBlock->getSubtotalExclTax();
54  $actualPrices['subtotal_incl_tax'] = $totalsBlock->getSubtotalInclTax();
55 
56  $actualPrices['discount'] = $totalsBlock->getDiscount();
57 
58  $actualPrices['shipping_excl_tax'] = $totalsBlock->getShippingExclTax();
59  $actualPrices['shipping_incl_tax'] = $totalsBlock->getShippingInclTax();
60  $actualPrices['tax'] = $totalsBlock->getTax();
61 
62  $actualPrices['grand_total_excl_tax'] = $totalsBlock->getGrandTotalExclTax();
63  $actualPrices['grand_total_incl_tax'] = $totalsBlock->getGrandTotalInclTax();
64 
65  return $actualPrices;
66  }
67 
74  public function getCreditMemoNewTotals($actualPrices)
75  {
76  $totalsBlock = $this->orderCreditMemoNew->getTotalsBlock();
77  $actualPrices['subtotal_excl_tax'] = $totalsBlock->getSubtotalExclTax();
78  $actualPrices['subtotal_incl_tax'] = $totalsBlock->getSubtotalInclTax();
79 
80  $actualPrices['discount'] = $totalsBlock->getDiscount();
81 
82  $actualPrices['tax'] = $totalsBlock->getTax();
83  $actualPrices['grand_total_excl_tax'] = $totalsBlock->getGrandTotalExclTax();
84  $actualPrices['grand_total_incl_tax'] = $totalsBlock->getGrandTotalInclTax();
85 
86  return $actualPrices;
87  }
88 }