Browse Source

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

feature/rotating_product
Guillaume Bourgeois 7 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

@@ -126,7 +126,7 @@ class DistributionReportPdfGenerator extends AbstractGenerator implements Distri
',
'methods' => [
'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}'],
]
]);

@@ -145,9 +145,10 @@ class DistributionReportPdfGenerator extends AbstractGenerator implements Distri
$producer = $this->getProducerContext();
$html = '' ;
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>' : '';
$colCredit = ($pointSale->payment_method_credit) ? '<th>Cagnotte</th>' : '' ;

@@ -339,11 +340,14 @@ class DistributionReportPdfGenerator extends AbstractGenerator implements Distri
. '<tbody>';

$revenues = 0 ;
$countOrdersTotal = 0;
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 ;
foreach ($productsArray as $product) {
@@ -363,11 +367,12 @@ class DistributionReportPdfGenerator extends AbstractGenerator implements Distri

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

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

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

Loading…
Cancel
Save