Bläddra i källkod

[backend] Export PDF : correctif bug crédit (affichage crédit autre producteur)

refactoring
Guillaume 4 år sedan
förälder
incheckning
e929a07053
1 ändrade filer med 11 tillägg och 4 borttagningar
  1. +11
    -4
      backend/views/distribution/report.php

+ 11
- 4
backend/views/distribution/report.php Visa fil

@@ -92,14 +92,13 @@ foreach ($pointsSaleArray as $pointSale) {
foreach ($productsArray as $product) {
$add = false;
foreach ($order->productOrder as $productOrder) {
if ($product->id == $productOrder->id_product) {
if($product->id == $productOrder->id_product) {
$unit = (Product::strUnit($productOrder->unit, 'wording_short', true) == 'p.') ? '' : ' '.Product::strUnit($productOrder->unit, 'wording_short', true) ;
$strProducts .= $product->name . ' (' .$productOrder->quantity .$unit.')<br />';
$add = true;
}
}
}

$html .= '<td>'.substr($strProducts, 0, strlen($strProducts) - 6).'</td>';
if($isBig) {
@@ -109,9 +108,17 @@ foreach ($pointsSaleArray as $pointSale) {
if($pointSale->credit) {
$credit = '' ;
if(isset($order->user) && isset($order->user->userProducer)) {
$credit = number_format($order->user->userProducer[0]->credit,2).' €' ;

if(isset($order->user) && $order->user->id) {
$userProducer = UserProducer::searchOne([
'id_user' => $order->user->id
]);

if($userProducer) {
$credit = number_format($userProducer->credit,2).' €' ;
}
}

$html .= '<td>'.$credit.'</td>' ;
}

Laddar…
Avbryt
Spara