Explorar el Código

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

feature/rotating_product
Guillaume Bourgeois hace 6 meses
padre
commit
6c4d236eae
Se han modificado 1 ficheros con 12 adiciones y 7 borrados
  1. +12
    -7
      domain/Distribution/Distribution/Export/DistributionReportPdfGenerator.php

+ 12
- 7
domain/Distribution/Distribution/Export/DistributionReportPdfGenerator.php Ver fichero

@@ -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) {

Cargando…
Cancelar
Guardar