瀏覽代碼

[backend] Distribution : report Terre de pains

dev
Guillaume Bourgeois 5 年之前
父節點
當前提交
537bace116
共有 1 個文件被更改,包括 5 次插入14 次删除
  1. +5
    -14
      backend/controllers/DistributionController.php

+ 5
- 14
backend/controllers/DistributionController.php 查看文件

@@ -627,19 +627,10 @@ class DistributionController extends BackendController
$productsHasQuantity = [] ;
$cpt = 1 ;
foreach ($productsArray as $product) {
$productsHasQuantity[$product->id] = 0 ;
foreach(Product::$unitsArray as $unit => $dataUnit) {
$quantity = Order::getProductQuantity($product->id, $ordersArray, true, $unit);
if($quantity) {
$productsHasQuantity[$product->id] += $quantity ;
}
}
if($productsHasQuantity[$product->id] > 0) {
$theUnit = Product::strUnit($product->unit, 'wording_short', true) ;
$theUnit = ($theUnit == 'p.') ? '' : ' ('.$theUnit.')' ;
$productsNameArray[] = $product->name .$theUnit ;
$productsIndexArray[$product->id] = $cpt ++ ;
}
$theUnit = Product::strUnit($product->unit, 'wording_short', true) ;
$theUnit = ($theUnit == 'p.') ? '' : ' ('.$theUnit.')' ;
$productsNameArray[] = $product->name .$theUnit ;
$productsIndexArray[$product->id] = $cpt ++ ;
}
$datas[] = $productsNameArray ;

@@ -680,7 +671,7 @@ class DistributionController extends BackendController

// total point de vente
$totalsPointSaleArray = $this->_totalReportCSV(
'Total',
'Total point de vente',
$pointSale->orders,
$productsArray,
$productsIndexArray

Loading…
取消
儲存