/** * Get payment amount data with excluded tax * @param \Magento\Sales\Model\Order $order * @return array */ private function getNonTaxableAmount(Order $order) { return ['subtotal' => $this->_formatPrice($order->getBaseSubtotal()), 'total' => $this->_formatPrice($order->getPayment()->getBaseAmountAuthorized()), 'tax' => $this->_formatPrice($order->getBaseTaxAmount()), 'shipping' => $this->_formatPrice($order->getBaseShippingAmount()), 'discount' => $this->_formatPrice(abs($order->getBaseDiscountAmount()))]; }
/** * Get payment amount data with excluded tax * @param \Magento\Sales\Model\Order $order * @return array */ private function getNonTaxableAmount(Order $order) { // PayPal denied transaction with 0 amount $subtotal = $order->getBaseSubtotal() ?: $order->getPayment()->getBaseAmountAuthorized(); return ['subtotal' => $this->formatPrice($subtotal), 'total' => $this->formatPrice($order->getPayment()->getBaseAmountAuthorized()), 'tax' => $this->formatPrice($order->getBaseTaxAmount()), 'shipping' => $this->formatPrice($order->getBaseShippingAmount()), 'discount' => $this->formatPrice(abs($order->getBaseDiscountAmount()))]; }
/** * Repeat sql formula from \Magento\SalesRule\Model\Resource\Report\Rule\Createdat::_aggregateByOrder * * @param \Magento\Sales\Model\Order $order * @return float */ private function getTotalAmount(\Magento\Sales\Model\Order $order) { return ($order->getBaseSubtotal() - $order->getBaseSubtotalCanceled() - (abs($order->getBaseDiscountAmount()) - abs($order->getBaseDiscountCanceled())) + ($order->getBaseTaxAmount() - $order->getBaseTaxCanceled())) * $order->getBaseToGlobalRate(); }
/** * {@inheritdoc} */ public function getBaseSubtotal() { return $this->_salesModel->getBaseSubtotal(); }