|
|
|
|
|
|
|
|
); |
|
|
); |
|
|
} else if ($orderReductionCart->getUnit() == 'amount') { |
|
|
} else if ($orderReductionCart->getUnit() == 'amount') { |
|
|
if ($orderReductionCart->getBehaviorTaxRate() == 'tax-excluded') { |
|
|
if ($orderReductionCart->getBehaviorTaxRate() == 'tax-excluded') { |
|
|
$price = $orderReductionCart->getValue(); |
|
|
|
|
|
|
|
|
$amount = $orderReductionCart->getValue(); |
|
|
} else if ($orderReductionCart->getBehaviorTaxRate() == 'tax-included') { |
|
|
} else if ($orderReductionCart->getBehaviorTaxRate() == 'tax-included') { |
|
|
$price = $orderReductionCart->getValue() / $this->getTaxRateAverage($order); |
|
|
|
|
|
|
|
|
$amount = $this->round($orderReductionCart->getValue() / $this->getTaxRateAverage($order)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
elseif ($orderReductionCart->getUnit() == 'amount') { |
|
|
elseif ($orderReductionCart->getUnit() == 'amount') { |
|
|
if ($orderReductionCart->getBehaviorTaxRate() == 'tax-excluded') { |
|
|
if ($orderReductionCart->getBehaviorTaxRate() == 'tax-excluded') { |
|
|
$amount = $orderReductionCart->getValue() * $this->getTaxRateAverage($order); |
|
|
|
|
|
|
|
|
$amount = $this->round($orderReductionCart->getValue() * $this->getTaxRateAverage($order)); |
|
|
} |
|
|
} |
|
|
elseif ($orderReductionCart->getBehaviorTaxRate() == 'tax-included') { |
|
|
elseif ($orderReductionCart->getBehaviorTaxRate() == 'tax-included') { |
|
|
$amount = $orderReductionCart->getValue() ; |
|
|
$amount = $orderReductionCart->getValue() ; |
|
|
|
|
|
|
|
|
$amount = $orderReductionCredit->getValue(); |
|
|
$amount = $orderReductionCredit->getValue(); |
|
|
} |
|
|
} |
|
|
else if ($orderReductionCredit->getBehaviorTaxRate() == 'tax-included') { |
|
|
else if ($orderReductionCredit->getBehaviorTaxRate() == 'tax-included') { |
|
|
$amount = $orderReductionCredit->getValue() / $this->getTaxRateAverage($order); |
|
|
|
|
|
|
|
|
$amount = $this->round($orderReductionCredit->getValue() / $this->getTaxRateAverage($order)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return $amount; |
|
|
return $amount; |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
$amountWithTax = 0; |
|
|
$amountWithTax = 0; |
|
|
if ($orderReductionCredit->getBehaviorTaxRate() == 'tax-excluded') { |
|
|
if ($orderReductionCredit->getBehaviorTaxRate() == 'tax-excluded') { |
|
|
$amountWithTax = $orderReductionCredit->getValue() * $this->getTaxRateAverage($order); |
|
|
|
|
|
|
|
|
$amountWithTax = $this->round($orderReductionCredit->getValue() * $this->getTaxRateAverage($order)); |
|
|
} |
|
|
} |
|
|
elseif ($orderReductionCredit->getBehaviorTaxRate() == 'tax-included') { |
|
|
elseif ($orderReductionCredit->getBehaviorTaxRate() == 'tax-included') { |
|
|
$amountWithTax = $orderReductionCredit->getValue(); |
|
|
$amountWithTax = $orderReductionCredit->getValue(); |