Procházet zdrojové kódy

Merge branch 'dev'

master
Guillaume před 4 roky
rodič
revize
c9d3117bc9
4 změnil soubory, kde provedl 17 přidání a 10 odebrání
  1. +3
    -3
      backend/controllers/DistributionController.php
  2. +2
    -2
      backend/controllers/ReportController.php
  3. +11
    -4
      backend/views/distribution/report.php
  4. +1
    -1
      common/models/User.php

+ 3
- 3
backend/controllers/DistributionController.php Zobrazit soubor

@@ -687,7 +687,8 @@ class DistributionController extends BackendController
if (count($pointSale->orders)) {
// listing commandes
$datas[] = ['> ' . $pointSale->name];
foreach ($pointSale->orders as $order) {

/*foreach ($pointSale->orders as $order) {
$orderLine = [$order->getStrUser()];

foreach ($productsIndexArray as $idProduct => $indexProduct) {
@@ -704,7 +705,7 @@ class DistributionController extends BackendController
}
}
$datas[] = $this->_lineOrderReportCSV($orderLine, $cpt - 1, true);
}
}*/

// total point de vente
$totalsPointSaleArray = $this->_totalReportCSV(
@@ -714,7 +715,6 @@ class DistributionController extends BackendController
$productsIndexArray
);
$datas[] = $this->_lineOrderReportCSV($totalsPointSaleArray, $cpt - 1, true);
$datas[] = [];
}
}


+ 2
- 2
backend/controllers/ReportController.php Zobrazit soubor

@@ -81,10 +81,10 @@ class ReportController extends BackendController
// distributions
$firstDistribution = Distribution::searchOne([], [
'orderby' => 'id ASC'
'orderby' => 'date ASC'
]) ;
$lastDistribution = Distribution::searchOne([], [
'orderby' => 'id DESC'
'orderby' => 'date DESC'
]) ;
$firstYear = date('Y',strtotime($firstDistribution->date)) ;

+ 11
- 4
backend/views/distribution/report.php Zobrazit soubor

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

+ 1
- 1
common/models/User.php Zobrazit soubor

@@ -396,7 +396,7 @@ class User extends ActiveRecordCommon implements IdentityInterface
$query->andFilterWhere(['like', 'phone', $params['phone']]);
}

$query->orderBy('user.lastname ASC, user.name ASC');
$query->orderBy('user.type DESC, user.lastname ASC, user.name ASC');

return $query;
}

Načítá se…
Zrušit
Uložit