Просмотр исходного кода

[backend] Récap : produits sur 2 colonnes

refactoring
Guillaume 4 лет назад
Родитель
Сommit
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) ;

Загрузка…
Отмена
Сохранить