Browse Source

[backend] Récap : produits sur 2 colonnes

master
Guillaume 4 years ago
parent
commit
c6055dc11c
1 changed files with 14 additions and 1 deletions
  1. +14
    -1
      backend/views/distribution/report.php

+ 14
- 1
backend/views/distribution/report.php View File

} }


// par point de vente // par point de vente

$count = count($productsArray) ;
$limit = 100 ;
$isBig = $count > $limit ;

$html .= '<h3>Points de vente</h3>' ; $html .= '<h3>Points de vente</h3>' ;
$html .= '<table class="">' $html .= '<table class="">'
. '<thead>' . '<thead>'
. '<tr>' . '<tr>'
. '<th>Point de vente</th>' . '<th>Point de vente</th>'
. '<th>Produits</th>' . '<th>Produits</th>'
. ( $isBig ? '<th>Produits</th>' : '')
. '<th>Montant</th>' . '<th>Montant</th>'
. '</tr>' . '</tr>'
. '<tbody>'; . '<tbody>';
if (count($pointSale->orders)) if (count($pointSale->orders))
{ {
$html .= '<tr><td>'.$pointSale->name.'</td><td>' ; $html .= '<tr><td>'.$pointSale->name.'</td><td>' ;

$cpt = 0 ;
foreach ($productsArray as $product) { foreach ($productsArray as $product) {
foreach(Product::$unitsArray as $unit => $dataUnit) { foreach(Product::$unitsArray as $unit => $dataUnit) {
$quantity = Order::getProductQuantity($product->id, $pointSale->orders, false, $unit); $quantity = Order::getProductQuantity($product->id, $pointSale->orders, false, $unit);
$html .= $product->name . ' (' .$quantity .$theUnit.')<br />'; $html .= $product->name . ' (' .$quantity .$theUnit.')<br />';
} }
} }

if($isBig && $cpt == $limit) {
$html .= '</td><td>' ;
}

$cpt ++ ;
} }
$html = substr($html, 0, strlen($html) - 6) ; $html = substr($html, 0, strlen($html) - 6) ;

Loading…
Cancel
Save