本文整理汇总了PHP中Magento\Weee\Helper\Data::getBaseWeeeTaxInclTax方法的典型用法代码示例。如果您正苦于以下问题:PHP Data::getBaseWeeeTaxInclTax方法的具体用法?PHP Data::getBaseWeeeTaxInclTax怎么用?PHP Data::getBaseWeeeTaxInclTax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Weee\Helper\Data
的用法示例。
在下文中一共展示了Data::getBaseWeeeTaxInclTax方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBaseFinalUnitDisplayPriceInclTax
/**
* Get base final unit display price including tax, this will add Weee amount to unit price include tax
*
* @return float
*/
public function getBaseFinalUnitDisplayPriceInclTax()
{
$basePriceInclTax = $this->getItem()->getBasePriceInclTax();
if (!$this->weeeHelper->isEnabled()) {
return $basePriceInclTax;
}
return $basePriceInclTax + $this->weeeHelper->getBaseWeeeTaxInclTax($this->getItem());
}
示例2: collect
/**
* Collect Weee amounts for the credit memo
*
* @param Creditmemo $creditmemo
* @return $this
*/
public function collect(Creditmemo $creditmemo)
{
$store = $creditmemo->getStore();
$totalTax = 0;
$baseTotalTax = 0;
$weeeTaxAmount = 0;
$baseWeeeTaxAmount = 0;
foreach ($creditmemo->getAllItems() as $item) {
if ($item->getOrderItem()->isDummy()) {
continue;
}
$weeeAmountExclTax = ($this->_weeeData->getWeeeTaxInclTax($item) - $this->_weeeData->getTotalTaxAppliedForWeeeTax($item)) * $item->getQty();
$totalTax += $weeeAmountExclTax;
$baseWeeeAmountExclTax = ($this->_weeeData->getBaseWeeeTaxInclTax($item) - $this->_weeeData->getBaseTotalTaxAppliedForWeeeTax($item)) * $item->getQty();
$baseTotalTax += $baseWeeeAmountExclTax;
$item->setWeeeTaxAppliedRowAmount($weeeAmountExclTax);
$item->setBaseWeeeTaxAppliedRowAmount($baseWeeeAmountExclTax);
$weeeTaxAmount += $this->_weeeData->getWeeeTaxInclTax($item) * $item->getQty();
$baseWeeeTaxAmount += $this->_weeeData->getBaseWeeeTaxInclTax($item) * $item->getQty();
$newApplied = array();
$applied = $this->_weeeData->getApplied($item);
foreach ($applied as $one) {
$one['base_row_amount'] = $one['base_amount'] * $item->getQty();
$one['row_amount'] = $one['amount'] * $item->getQty();
$one['base_row_amount_incl_tax'] = $one['base_amount_incl_tax'] * $item->getQty();
$one['row_amount_incl_tax'] = $one['amount_incl_tax'] * $item->getQty();
$newApplied[] = $one;
}
$this->_weeeData->setApplied($item, $newApplied);
$item->setWeeeTaxRowDisposition($item->getWeeeTaxDisposition() * $item->getQty());
$item->setBaseWeeeTaxRowDisposition($item->getBaseWeeeTaxDisposition() * $item->getQty());
}
if ($this->_weeeData->includeInSubtotal($store)) {
$creditmemo->setSubtotal($creditmemo->getSubtotal() + $totalTax);
$creditmemo->setBaseSubtotal($creditmemo->getBaseSubtotal() + $baseTotalTax);
}
$creditmemo->setSubtotalInclTax($creditmemo->getSubtotalInclTax() + $weeeTaxAmount);
$creditmemo->setBaseSubtotalInclTax($creditmemo->getBaseSubtotalInclTax() + $baseWeeeTaxAmount);
$creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $totalTax);
$creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseTotalTax);
return $this;
}