Pārlūkot izejas kodu

[backend] Report PDF : totaux en TTC

refactoring
Guillaume Bourgeois pirms 4 gadiem
vecāks
revīzija
3947800719
2 mainītis faili ar 6 papildinājumiem un 3 dzēšanām
  1. +3
    -3
      backend/views/distribution/report.php
  2. +3
    -0
      common/models/PointSale.php

+ 3
- 3
backend/views/distribution/report.php Parādīt failu

@@ -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 Parādīt failu

@@ -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;
}
}
}

Notiek ielāde…
Atcelt
Saglabāt