Browse Source

[backend] Producteur : ajout option point d'entrée par date ou point de vente

dev
Guillaume 3 years ago
parent
commit
8a09bd58e2
3 changed files with 29 additions and 1 deletions
  1. +6
    -0
      backend/views/producer/update.php
  2. +5
    -1
      common/models/Producer.php
  3. +18
    -0
      console/migrations/m210326_104759_add_option_order_entry_point.php

+ 6
- 0
backend/views/producer/update.php View File

@@ -289,6 +289,12 @@ $this->addBreadcrumb($this->getTitle()) ;
0 => 'Non',
1 => 'Oui'
], []); ?>

<?= $form->field($model, 'option_order_entry_point')
->dropDownList([
Producer::ORDER_ENTRY_POINT_DATE => 'Date',
Producer::ORDER_ENTRY_POINT_POINT_SALE => 'Point de vente',
], []); ?>
</div>
</div>


+ 5
- 1
common/models/Producer.php View File

@@ -95,6 +95,9 @@ class Producer extends ActiveRecordCommon
const ORDER_REFERENCE_TYPE_NONE = '' ;
const ORDER_REFERENCE_TYPE_YEARLY = 'yearly' ;

const ORDER_ENTRY_POINT_DATE = 'date' ;
const ORDER_ENTRY_POINT_POINT_SALE = 'point-sale' ;

var $secret_key_payplug;

/**
@@ -136,7 +139,7 @@ class Producer extends ActiveRecordCommon
}
}],
[['description', 'mentions', 'gcs', 'order_infos', 'slug', 'secret_key_payplug', 'background_color_logo', 'option_behavior_cancel_order', 'tiller_provider_token', 'tiller_restaurant_token', 'status',
'document_infos_bottom', 'document_infos_quotation', 'document_infos_invoice', 'document_infos_delivery_note', 'address', 'behavior_home_point_sale_day_list', 'behavior_order_select_distribution', 'option_payment_info', 'option_order_reference_type'], 'string'],
'document_infos_bottom', 'document_infos_quotation', 'document_infos_invoice', 'document_infos_delivery_note', 'address', 'behavior_home_point_sale_day_list', 'behavior_order_select_distribution', 'option_payment_info', 'option_order_reference_type', 'option_order_entry_point'], 'string'],
[['negative_balance', 'credit', 'active', 'online_payment', 'user_manage_subscription', 'option_allow_user_gift', 'use_credit_checked_default', 'tiller', 'document_display_orders_invoice', 'document_display_orders_delivery_note', 'document_display_prices_delivery_note', 'option_email_confirm', 'option_email_confirm_producer', 'option_csv_export_all_products', 'option_csv_export_by_piece', 'option_export_display_product_reference', 'option_allow_order_guest'], 'boolean'],
[['name', 'siret', 'logo', 'photo', 'postcode', 'city', 'code', 'type', 'credit_functioning', 'option_behavior_cancel_order', 'document_quotation_prefix', 'document_quotation_first_reference', 'document_invoice_prefix', 'document_invoice_first_reference', 'document_delivery_note_prefix', 'document_delivery_note_first_reference'], 'string', 'max' => 255],
[['free_price', 'credit_limit_reminder', 'credit_limit'], 'double'],
@@ -229,6 +232,7 @@ class Producer extends ActiveRecordCommon
'option_order_reference_type' => 'Type de référence',
'option_export_display_product_reference' => 'Afficher la référence des produits au moment de l\'export',
'option_allow_order_guest' => 'Autoriser les visiteurs à passer commande (création de compte à la fin du tunnel)',
'option_order_entry_point' => 'Point d\'entrée par point de vente ou par date'
];
}


+ 18
- 0
console/migrations/m210326_104759_add_option_order_entry_point.php View File

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

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

class m210326_104759_add_option_order_entry_point extends Migration
{
public function safeUp()
{
$this->addColumn('producer', 'option_order_entry_point', Schema::TYPE_STRING.' DEFAULT \''.Producer::ORDER_ENTRY_POINT_DATE.'\'');
}

public function safeDown()
{
$this->dropColumn('producer', 'option_order_entry_point');
}

}

Loading…
Cancel
Save