|
|
@@ -153,12 +153,18 @@ foreach ($pointsSaleArray as $pointSale) { |
|
|
|
} |
|
|
|
|
|
|
|
// par point de vente |
|
|
|
|
|
|
|
$count = count($productsArray) ; |
|
|
|
$limit = 100 ; |
|
|
|
$isBig = $count > $limit ; |
|
|
|
|
|
|
|
$html .= '<h3>Points de vente</h3>' ; |
|
|
|
$html .= '<table class="">' |
|
|
|
. '<thead>' |
|
|
|
. '<tr>' |
|
|
|
. '<th>Point de vente</th>' |
|
|
|
. '<th>Produits</th>' |
|
|
|
. ( $isBig ? '<th>Produits</th>' : '') |
|
|
|
. '<th>Montant</th>' |
|
|
|
. '</tr>' |
|
|
|
. '<tbody>'; |
|
|
@@ -169,7 +175,8 @@ foreach ($pointsSaleArray as $pointSale) |
|
|
|
if (count($pointSale->orders)) |
|
|
|
{ |
|
|
|
$html .= '<tr><td>'.$pointSale->name.'</td><td>' ; |
|
|
|
|
|
|
|
|
|
|
|
$cpt = 0 ; |
|
|
|
foreach ($productsArray as $product) { |
|
|
|
foreach(Product::$unitsArray as $unit => $dataUnit) { |
|
|
|
$quantity = Order::getProductQuantity($product->id, $pointSale->orders, false, $unit); |
|
|
@@ -178,6 +185,12 @@ foreach ($pointsSaleArray as $pointSale) |
|
|
|
$html .= $product->name . ' (' .$quantity .$theUnit.')<br />'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if($isBig && $cpt == $limit) { |
|
|
|
$html .= '</td><td>' ; |
|
|
|
} |
|
|
|
|
|
|
|
$cpt ++ ; |
|
|
|
} |
|
|
|
|
|
|
|
$html = substr($html, 0, strlen($html) - 6) ; |