getBuyPriceTax() public method

public getBuyPriceTax ( ) : WellCommerce\Bundle\TaxBundle\Entity\TaxInterface
return WellCommerce\Bundle\TaxBundle\Entity\TaxInterface
コード例 #1
0
 /**
  * Recalculates buy prices for product
  *
  * @param ProductInterface $product
  */
 protected function refreshProductBuyPrices(ProductInterface $product)
 {
     $buyPrice = $product->getBuyPrice();
     $grossAmount = $buyPrice->getGrossAmount();
     $taxRate = $product->getBuyPriceTax()->getValue();
     $netAmount = TaxHelper::calculateNetPrice($grossAmount, $taxRate);
     $buyPrice->setTaxRate($taxRate);
     $buyPrice->setTaxAmount($grossAmount - $netAmount);
     $buyPrice->setNetAmount($netAmount);
 }