本文整理汇总了PHP中Magento\Weee\Helper\Data::getWeeeTaxInclTax方法的典型用法代码示例。如果您正苦于以下问题:PHP Data::getWeeeTaxInclTax方法的具体用法?PHP Data::getWeeeTaxInclTax怎么用?PHP Data::getWeeeTaxInclTax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Weee\Helper\Data
的用法示例。
在下文中一共展示了Data::getWeeeTaxInclTax方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUnitDisplayPriceInclTax
/**
* Get display price for unit price including tax. The Weee amount will be added to unit price including tax
* depending on Weee display setting
*
* @param \Magento\Quote\Model\Quote\Item $item
* @return float
*/
private function getUnitDisplayPriceInclTax($item)
{
$priceInclTax = $item->getPriceInclTax();
if (!$this->weeeHelper->isEnabled($this->getStoreId())) {
return $priceInclTax;
}
if ($this->getIncludeWeeeFlag()) {
return $priceInclTax + $this->weeeHelper->getWeeeTaxInclTax($item);
}
return $priceInclTax;
}
示例2: getFinalUnitDisplayPriceInclTax
/**
* Get final unit display price including tax, this will add Weee amount to unit price include tax
*
* @return float
*/
public function getFinalUnitDisplayPriceInclTax()
{
$priceInclTax = $this->getItem()->getPriceInclTax();
if (!$this->weeeHelper->isEnabled()) {
return $priceInclTax;
}
return $priceInclTax + $this->weeeHelper->getWeeeTaxInclTax($this->getItem());
}
示例3: 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;
}