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

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

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