當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Data::getWeeeTaxInclTax方法代碼示例

本文整理匯總了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;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:18,代碼來源:ItemObserver.php

示例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());
 }
開發者ID:zhangjiachao,項目名稱:magento2,代碼行數:13,代碼來源:Renderer.php

示例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;
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:48,代碼來源:Weee.php


注:本文中的Magento\Weee\Helper\Data::getWeeeTaxInclTax方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。