Procházet zdrojové kódy

Merge branch 'fix/commandes_annulees' into dev

dev
Guillaume Bourgeois před 6 roky
rodič
revize
a96de0a188
2 změnil soubory, kde provedl 20 přidání a 2 odebrání
  1. +1
    -2
      backend/controllers/CommandeController.php
  2. +19
    -0
      common/models/Commande.php

+ 1
- 2
backend/controllers/CommandeController.php Zobrazit soubor

@@ -177,7 +177,7 @@ class CommandeController extends BackendController
$commande->init();

// remboursement de la commande
if ($commande->id_user && $commande->getMontantPaye() && Etablissement::getConfig('credit_pain')) {
if ($commande->id_user && $commande->date_delete && $commande->getMontantPaye() && Etablissement::getConfig('credit_pain')) {
$commande->creditHistorique(
CreditHistorique::TYPE_REMBOURSEMENT,
$commande->getMontantPaye(),
@@ -338,7 +338,6 @@ class CommandeController extends BackendController
// commandes
$commandes = Commande::findBy([
'date' => $date,
'date_delete' => 'NULL'
]);

$recettes = 0;

+ 19
- 0
common/models/Commande.php Zobrazit soubor

@@ -471,6 +471,25 @@ class Commande extends \yii\db\ActiveRecord

if (isset($params['date']))
$commandes = $commandes->andWhere(['production.date' => $params['date']]);
if (isset($params['date_delete'])) {
if($params['date_delete'] == 'NULL') {
$commandes = $commandes->andWhere('commande.date_delete IS NULL');
}
else {
$commandes = $commandes->andWhere(['commande.date_delete' => $params['date_delete']]);
}
}
if (isset($params['date_update'])) {
if($params['date_update'] == 'NULL') {
$commandes = $commandes->andWhere('commande.date_update IS NULL');
}
else {
$commandes = $commandes->andWhere(['commande.date_update' => $params['date_update']]);
}
}

if (isset($params['type']))
$commandes = $commandes->andWhere(['commande.type' => $params['type']]);

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