瀏覽代碼

Ajout du total dans le récapitulatif PDF

master
keun 8 年之前
父節點
當前提交
7f4bc0c129
共有 1 個文件被更改,包括 19 次插入0 次删除
  1. +19
    -0
      backend/views/commande/report.php

+ 19
- 0
backend/views/commande/report.php 查看文件

@@ -1,6 +1,8 @@

<?php

use common\models\Commande ;

$num_jour_semaine = date('w', strtotime($date));
$arr_jour_semaine = [0 => 'dimanche', 1 => 'lundi', 2 => 'mardi', 3 => 'mercredi', 4 => 'jeudi', 5 => 'vendredi', 6 => 'samedi'];
$champs_horaires_point_vente = 'horaires_' . $arr_jour_semaine[$num_jour_semaine];
@@ -62,6 +64,23 @@ foreach ($points_vente as $pv) {
$html .= '</tr>' ;
}

$html .= '<tr><td><strong>Total</strong></td>' ;
$str_produits = '';
foreach ($produits as $p) {
if (!$p->vrac && isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$quantite = Commande::getQuantiteProduit($p->id, $pv->commandes);
$str_quantite = '';
if ($quantite) {
$str_quantite = $quantite;
$str_produits .= $str_quantite .' x '. $p->nom . '<br />';
}
}
}
$html .= '<td>'.$str_produits.'</td><td></td>' ;
$html .= '<td><strong>'.number_format($pv->recettes_pain, 2) . ' €</strong></td>';
$html .= '</tbody></table><pagebreak>' ;
}

Loading…
取消
儲存