= $form->field($model, 'active')->radioList([1 => 'Oui', 0 => 'Non']) ?>
= $form->field($model, 'name')->textInput(['maxlength' => 255]) ?>
= $form->field($model, 'reference')->textInput(['maxlength' => 255]) ?>
= $form->field($model, 'id_product_category')->dropDownList(ProductCategory::populateDropdownList()); ?>
= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?>
= $form->field($model, 'recipe')->textarea()->label('Description longue') ?>
= $form->field($model, 'unit')
->dropDownList(ArrayHelper::map(Product::$unitsArray, 'unit', 'wording'))
->label('Unité (pièce, poids ou volume)'); ?>
taxRate;
$taxRateNamesArray = array_merge(array(0 => 'Tva par défaut'), ArrayHelper::map(TaxRate::find()->all(), 'id', function ($model) {
return $model->name;
}));
$taxRateValuesArray = array_merge(array(0 => $taxRateDefault->value), ArrayHelper::map(TaxRate::find()->all(), 'id', function ($model) {
return $model->value;
}));
foreach ($taxRateValuesArray as $key => $taxRateValue) {
$taxRateValuesArrayFormatted[$key] = array('data-tax-rate-value' => $taxRateValue);
}
?>
value != 0): ?>
= $form->field($model, 'id_tax_rate')->dropDownList($taxRateNamesArray, ['options' => $taxRateValuesArrayFormatted])->label('Taxe'); ?>
= $form->field($model, 'price', [
'template' => '
',
]) ?>
= $form->field($model, 'step')->textInput()->hint('Définit ce qui est ajouté ou enlevé lors des changements de quantité.') ?>
= $form->field($model, 'weight')->textInput()->label('Poids (g)') ?>
= $form->field($model, 'quantity_max')->textInput() ?>
= $form->field($model, 'quantity_max_monday')->textInput() ?>
= $form->field($model, 'quantity_max_tuesday')->textInput() ?>
= $form->field($model, 'quantity_max_wednesday')->textInput() ?>
= $form->field($model, 'quantity_max_thursday')->textInput() ?>
= $form->field($model, 'quantity_max_friday')->textInput() ?>
= $form->field($model, 'quantity_max_saturday')->textInput() ?>
= $form->field($model, 'quantity_max_sunday')->textInput() ?>
isNewRecord) {
echo $form->field($model, 'apply_distributions')
->checkbox()
->hint('Sélectionnez cette option si vous souhaitez que ces modifications (actif / non actif, quantité max) soient répercutées dans les distributions à venir déjà initialisées.');
}
?>
= $form->field($model, 'photo')->fileInput() ?>
photo)) {
$url = Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl . '/uploads/' . $model->photo;
$url = str_replace('//uploads','/uploads', $url) ;
echo '
';
echo '
Supprimer la photo ';
}
?>
Jours de distribution
= $form->field($model, 'monday')->checkbox() ?>
= $form->field($model, 'tuesday')->checkbox() ?>
= $form->field($model, 'wednesday')->checkbox() ?>
= $form->field($model, 'thursday')->checkbox() ?>
= $form->field($model, 'friday')->checkbox() ?>
= $form->field($model, 'saturday')->checkbox() ?>
= $form->field($model, 'sunday')->checkbox() ?>
Disponibilité points de vente
= $form->field($model, 'available_on_points_sale')->radioList([1 => 'Disponible', 0 => 'Indisponible']) ?>
Et available_on_points_sale): ?>indisponibledisponible sur les points de vente
where(['id_producer' => GlobalParam::getCurrentProducerId()])
->orderBy('is_bread_box ASC, name ASC')
->all(); ?>
= Html::activeCheckboxList($model, 'pointsSale', ArrayHelper::map($pointSaleArray, 'id', function ($pointSale, $defaultValue) use ($model) {
return Html::encode($pointSale->name) ;
}), ['encode' => false, 'class' => '']) ?>