ソースを参照

[backend] Récap : produits sur 2 colonnes

dev
Guillaume 4年前
コミット
00551c3f2d
1個のファイルの変更18行の追加4行の削除
  1. +18
    -4
      backend/views/distribution/report.php

+ 18
- 4
backend/views/distribution/report.php ファイルの表示

@@ -45,6 +45,10 @@ $fieldInfosPointSale = 'infos_' . $dayWeekArray[$dayWeek];

$html = '' ;

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

// par point de vente
foreach ($pointsSaleArray as $pointSale) {
if (count($pointSale->orders)) {
@@ -57,6 +61,7 @@ foreach ($pointsSaleArray as $pointSale) {
. '<tr>'
. '<th>Client</th>'
. '<th>Produits</th>'
. ($isBig ? '<th>Produits</th>' : '')
. '<th>Commentaire</th>'
. $colCredit
. '<th>Montant</th>'
@@ -130,6 +135,7 @@ foreach ($pointsSaleArray as $pointSale) {
$html .= '<tr><td><strong>Total</strong></td>' ;
$strProducts = '';
$cpt = 0 ;
foreach ($productsArray as $product) {
foreach(Product::$unitsArray as $unit => $dataUnit) {
$quantity = Order::getProductQuantity($product->id, $pointSale->orders, false, $unit);
@@ -138,6 +144,12 @@ foreach ($pointsSaleArray as $pointSale) {
$strProducts .= $product->name . ' (' .$quantity .$theUnit.')<br />';
}
}

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

$cpt ++ ;
}
$strProducts = substr($strProducts, 0, strlen($strProducts) - 6) ;
@@ -154,10 +166,6 @@ 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>'
@@ -203,6 +211,7 @@ foreach ($pointsSaleArray as $pointSale)
// total
$html .= '<tr><td><strong>Total</strong></td><td>' ;

$cpt = 0 ;
foreach ($productsArray as $product) {
foreach(Product::$unitsArray as $unit => $dataUnit) {
$quantity = Order::getProductQuantity($product->id, $ordersArray, false, $unit);
@@ -211,6 +220,11 @@ foreach ($productsArray as $product) {
$html .= $product->name . ' (' .$quantity .$theUnit.')<br />';
}
}
if($isBig && $cpt == $limit) {
$html .= '</td><td>' ;
}

$cpt ++ ;
}

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

読み込み中…
キャンセル
保存