Sfoglia il codice sorgente

[backend] Report PDF : totaux en TTC

refactoring
parent
commit
3947800719
2 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  1. +3
    -3
      backend/views/distribution/report.php
  2. +3
    -0
      common/models/PointSale.php

+ 3
- 3
backend/views/distribution/report.php Vedi File

@@ -146,7 +146,7 @@ foreach ($pointsSaleArray as $pointSale) {
if($pointSale->credit) {
$html .= '<td></td>' ;
}
$html .= '<td><strong>'.number_format($pointSale->revenues, 2) . ' €</strong></td>';
$html .= '<td><strong>'.Price::format($pointSale->revenues_with_tax) . '</strong></td>';
$html .= '</tbody></table><pagebreak>' ;
}
@@ -182,8 +182,8 @@ foreach ($pointsSaleArray as $pointSale)
$html = substr($html, 0, strlen($html) - 6) ;
$html .= '</td><td>'.number_format($pointSale->revenues, 2).' €</td></tr>' ;
$revenues += $pointSale->revenues ;
$html .= '</td><td>'.Price::format($pointSale->revenues_with_tax, 2).'</td></tr>' ;
$revenues += $pointSale->revenues_with_tax ;
}
}


+ 3
- 0
common/models/PointSale.php Vedi File

@@ -58,6 +58,7 @@ class PointSale extends ActiveRecordCommon
{
var $orders = [];
var $revenues = 0;
var $revenues_with_tax = 0;
var $data_select_orders;
var $data_options_orders;
var $users = [];
@@ -179,6 +180,7 @@ class PointSale extends ActiveRecordCommon
{
$this->orders = [];
$this->revenues = 0;
$this->revenues_with_tax = 0;

if ($ordersArray) {
foreach ($ordersArray as $order) {
@@ -187,6 +189,7 @@ class PointSale extends ActiveRecordCommon

if (is_null($order->date_delete)) {
$this->revenues += (float)$order->amount;
$this->revenues_with_tax += (float)$order->amount_with_tax;
}
}
}

Loading…
Annulla
Salva