Exemplo n.º 1
0
 /**
  * Process row amount based on FPT total amount configuration setting
  *
  * @param   \Magento\Sales\Model\Quote\Address $address
  * @param   float $rowValueExclTax
  * @param   float $baseRowValueExclTax
  * @param   float $rowValueInclTax
  * @param   float $baseRowValueInclTax
  * @return  $this
  */
 protected function processTotalAmount($address, $rowValueExclTax, $baseRowValueExclTax, $rowValueInclTax, $baseRowValueInclTax)
 {
     if (!$this->weeeData->isTaxable($this->_store)) {
         //Accumulate the values.  Will be used later in the 'weee tax' collector
         $this->weeeTotalExclTax += $this->_store->roundPrice($rowValueExclTax);
         $this->weeeBaseTotalExclTax += $this->_store->roundPrice($baseRowValueExclTax);
     }
     //This value is used to calculate shipping cost; it will be overridden by tax collector
     $address->setSubtotalInclTax($address->getSubtotalInclTax() + $this->_store->roundPrice($rowValueInclTax));
     $address->setBaseSubtotalInclTax($address->getBaseSubtotalInclTax() + $this->_store->roundPrice($baseRowValueInclTax));
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Process row amount based on FPT total amount configuration setting
  *
  * @param   \Magento\Sales\Model\Quote\Address $address
  * @param   float $rowValueExclTax
  * @param   float $baseRowValueExclTax
  * @param   float $rowValueInclTax
  * @param   float $baseRowValueInclTax
  * @return  $this
  */
 protected function processTotalAmount($address, $rowValueExclTax, $baseRowValueExclTax, $rowValueInclTax, $baseRowValueInclTax)
 {
     if ($this->weeeData->includeInSubtotal($this->_store)) {
         $address->addTotalAmount('subtotal', $rowValueExclTax);
         $address->addBaseTotalAmount('subtotal', $baseRowValueExclTax);
     } else {
         $address->addTotalAmount('weee', $rowValueExclTax);
         $address->addBaseTotalAmount('weee', $baseRowValueExclTax);
     }
     $address->setSubtotalInclTax($address->getSubtotalInclTax() + $rowValueInclTax);
     $address->setBaseSubtotalInclTax($address->getBaseSubtotalInclTax() + $baseRowValueInclTax);
     return $this;
 }
Exemplo n.º 3
0
 /**
  * Process row amount based on FPT total amount configuration setting
  *
  * @param   \Magento\Sales\Model\Quote\Address $address
  * @param   float $rowValueExclTax
  * @param   float $baseRowValueExclTax
  * @param   float $rowValueInclTax
  * @param   float $baseRowValueInclTax
  * @return  $this
  */
 protected function _processTotalAmount($address, $rowValueExclTax, $baseRowValueExclTax, $rowValueInclTax, $baseRowValueInclTax)
 {
     //TODO: use tax service to calculate tax
     if ($this->_weeeData->includeInSubtotal($this->_store)) {
         $address->setExtraSubtotalAmount($this->_store->roundPrice($rowValueExclTax));
         $address->setBaseExtraSubtotalAmount($this->_store->roundPrice($baseRowValueExclTax));
     } else {
         $address->addTotalAmount('weee', $rowValueExclTax);
         $address->addBaseTotalAmount('weee', $baseRowValueExclTax);
     }
     $address->setExtraTaxAmount($rowValueInclTax - $rowValueExclTax);
     $address->setBaseExtraTaxAmount($baseRowValueInclTax - $baseRowValueExclTax);
     $address->setSubtotalInclTax($address->getSubtotalInclTax() + $this->_store->roundPrice($rowValueInclTax));
     $address->setBaseSubtotalInclTax($address->getBaseSubtotalInclTax() + $this->_store->roundPrice($baseRowValueInclTax));
     return $this;
 }