瀏覽代碼

Gestion de stock

feature/export_comptable
Guillaume 4 年之前
父節點
當前提交
7507df1c84
共有 1 個檔案被更改,包括 23 行新增0 行删除
  1. +23
    -0
      ShopBundle/Model/ProductFamily.php

+ 23
- 0
ShopBundle/Model/ProductFamily.php 查看文件

@@ -182,6 +182,29 @@ abstract class ProductFamily extends AbstractDocumentEntity implements ProductPr
return $this->getTitle();
}

public function getAvailableQuantityInherited()
{
$availableQuantity = 0 ;

switch ($this->getBehaviorCountStock()) {

case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE :
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY :

$availableQuantity = $this->getAvailableQuantity() ;
break;

case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT :

foreach($this->getProducts() as $product) {
$availableQuantity += $product->getAvailableQuantityInherited() ;
}
break ;
}

return $availableQuantity ;
}

public function getTaxRateInherited()
{
if ($this->getTaxRate()) {

Loading…
取消
儲存