Procházet zdrojové kódy

Ajout du champs paiement_automatique à Commande

Ce champs permet de détecter les commandes qui doivent être débitées automatiquement via une tâche cron le jour J.
refactoring
keun před 6 roky
rodič
revize
4c0e74f1df
3 změnil soubory, kde provedl 18 přidání a 1 odebrání
  1. +1
    -0
      common/models/Commande.php
  2. +2
    -1
      common/models/CommandeAuto.php
  3. +15
    -0
      console/migrations/m180315_090156_add_champs_commande_paiement_auto.php

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

@@ -15,6 +15,7 @@ use common\models\Etablissement;
* @property string $date_update
* @property integer $id_point_vente
* @property integer $id_production
* @property boolean $paiement_automatique
*/
class Commande extends \yii\db\ActiveRecord {


+ 2
- 1
common/models/CommandeAuto.php Zobrazit soubor

@@ -180,7 +180,8 @@ class CommandeAuto extends \yii\db\ActiveRecord {
$commande->type = Commande::TYPE_AUTO;
$commande->id_point_vente = $this->id_point_vente;
$commande->id_production = $production->id;

$commande->paiement_automatique = $this->paiement_automatique ;
$point_vente_user = PointVenteUser::find()
->where(['id_point_vente' => $this->id_point_vente, 'id_user' => $this->id_user])
->one();

+ 15
- 0
console/migrations/m180315_090156_add_champs_commande_paiement_auto.php Zobrazit soubor

@@ -0,0 +1,15 @@
<?php

use yii\db\Migration;
use yii\db\Schema;

class m180315_090156_add_champs_commande_paiement_auto extends Migration {

public function up() {
$this->addColumn('commande', 'paiement_automatique', Schema::TYPE_BOOLEAN.' DEFAULT 0') ;
}

public function down() {
$this->dropColumn('commande', 'paiement_automatique') ;
}
}

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