瀏覽代碼

Mise en page de l'export des commandes

Passage en portrait et les produits sur une seule ligne pour pouvoir afficher plus de commandes sur une seule page.
prodstable
keun 7 年之前
父節點
當前提交
47a473f904
共有 2 個檔案被更改,包括 14 行新增6 行删除
  1. +1
    -1
      backend/controllers/CommandeController.php
  2. +13
    -5
      backend/views/commande/report.php

+ 1
- 1
backend/controllers/CommandeController.php 查看文件

@@ -117,7 +117,7 @@ class CommandeController extends BackendController {
// A4 paper format
'format' => Pdf::FORMAT_A4,
// portrait orientation
'orientation' => Pdf::ORIENT_LANDSCAPE,
'orientation' => Pdf::ORIENT_PORTRAIT,
// stream to browser inline
'destination' => $destination,
'filename' => Yii::getAlias('@app/web/pdf/Commandes-'.$date.'-'.$id_etablissement.'.pdf'),

+ 13
- 5
backend/views/commande/report.php 查看文件

@@ -55,13 +55,13 @@ foreach ($points_vente as $pv) {
$add = false;
foreach ($c->commandeProduits as $cp) {
if ($p->id == $cp->id_produit) {
$str_produits .= $cp->quantite . ' x ' . $p->nom . '<br /> ';
$str_produits .= $cp->quantite . '&nbsp;' . $p->nom . ', ';
$add = true;
}
}
}
}
$html .= '<td>'.substr($str_produits, 0, strlen($str_produits) - 2).'</td>';
$html .= '<td>'.$c->commentaire.'</td>';
$html .= '<td>'.number_format($c->montant, 2) . ' € ';
@@ -95,11 +95,13 @@ foreach ($points_vente as $pv) {
$str_quantite = '';
if ($quantite) {
$str_quantite = $quantite;
$str_produits .= $str_quantite .' x '. $p->nom . '<br />';
$str_produits .= $str_quantite .'&nbsp;'. $p->nom . ', ';
}
}
}
$str_produits = substr($str_produits, 0, strlen($str_produits) - 2) ;
$html .= '<td>'.$str_produits.'</td><td></td>' ;
$html .= '<td><strong>'.number_format($pv->recettes_pain, 2) . ' €</strong></td>';
@@ -135,9 +137,12 @@ foreach ($points_vente as $pv)
}

if(strlen($str_quantite))
$html .= $str_quantite . ' x '.$p->nom.'<br />' ;
$html .= $str_quantite . '&nbsp;'.$p->nom.', ' ;
}
}
$html = substr($html, 0, strlen($html) - 2) ;
$html .= '</td><td>'.number_format($pv->recettes_pain, 2).' €</td></tr>' ;
$recettes += $pv->recettes_pain ;
}
@@ -149,9 +154,12 @@ foreach ($produits as $p) {
if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) {
$quantite = Commande::getQuantiteProduit($p->id, $commandes);
if(!$p->vrac && $quantite)
$html .= $quantite . ' x '.$p->nom.'<br />' ;
$html .= $quantite . '&nbsp;'.$p->nom.', ' ;
}
}

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

$html .= '</td><td><strong>'.number_format($recettes, 2).' €</strong></td></tr>' ;

$html .= '</tbody></table>' ;

Loading…
取消
儲存