Browse Source

[Administration] Export commandes PDF : ajout du nombre de commandes pour chaque point de vente

feature/rotating_product
Guillaume Bourgeois 6 months ago
parent
commit
6c4d236eae
1 changed files with 12 additions and 7 deletions
  1. +12
    -7
      domain/Distribution/Distribution/Export/DistributionReportPdfGenerator.php

+ 12
- 7
domain/Distribution/Distribution/Export/DistributionReportPdfGenerator.php View File

', ',
'methods' => [ 'methods' => [
'SetHeader' => ['Commandes du ' . date('d/m/Y', strtotime($distribution->date))], 'SetHeader' => ['Commandes du ' . date('d/m/Y', strtotime($distribution->date))],
'SetFooter' => ['Généré le {DATE j/m/Y à H:i} / Page {PAGENO}/{nbpg}'],
'SetFooter' => ['Généré le {DATE j/m/Y à H:i} - Page {PAGENO}/{nbpg}'],
] ]
]); ]);


$producer = $this->getProducerContext(); $producer = $this->getProducerContext();
$html = '' ; $html = '' ;
foreach ($pointsSaleArray as $pointSale) { foreach ($pointsSaleArray as $pointSale) {
if (count($pointSale->orders)) {
$countOrders = count($pointSale->orders);
if ($countOrders) {


$html .= '<h3>'.$pointSale->name.'</h3>' ;
$html .= '<h3>'.$pointSale->name.' ('.$countOrders.')</h3>' ;
$columnDeliveryNote = ($producer->option_export_display_column_delivery_note) ? '<th>BL</th>' : ''; $columnDeliveryNote = ($producer->option_export_display_column_delivery_note) ? '<th>BL</th>' : '';
$colCredit = ($pointSale->payment_method_credit) ? '<th>Cagnotte</th>' : '' ; $colCredit = ($pointSale->payment_method_credit) ? '<th>Cagnotte</th>' : '' ;


. '<tbody>'; . '<tbody>';


$revenues = 0 ; $revenues = 0 ;
$countOrdersTotal = 0;
foreach ($pointsSaleArray as $pointSale) foreach ($pointsSaleArray as $pointSale)
{ {
if (count($pointSale->orders))
{
$html .= '<tr><td>'.$pointSale->name.'</td><td>' ;
$countOrders = count($pointSale->orders);
if ($countOrders) {
$html .= '<tr><td>'
. $pointSale->name .' ('.$countOrders.')'
.'</td><td>' ;


$cpt = 0 ; $cpt = 0 ;
foreach ($productsArray as $product) { foreach ($productsArray as $product) {


$html .= '</td><td>'.Price::format($pointSale->revenues_with_tax, 2).'</td></tr>' ; $html .= '</td><td>'.Price::format($pointSale->revenues_with_tax, 2).'</td></tr>' ;
$revenues += $pointSale->revenues_with_tax ; $revenues += $pointSale->revenues_with_tax ;
$countOrdersTotal += $countOrders;
} }
} }


// total // total
$html .= '<tr><td><strong>Total</strong></td><td>' ;
$html .= '<tr><td><strong>Total ('.$countOrdersTotal.')</strong></td><td>' ;


$cpt = 0 ; $cpt = 0 ;
foreach ($productsArray as $product) { foreach ($productsArray as $product) {

Loading…
Cancel
Save