|
|
@@ -53,109 +53,112 @@ $distributionModule = DistributionModule::getInstance(); |
|
|
|
|
|
|
|
<div class="point-sale-form"> |
|
|
|
|
|
|
|
<?php $form = ActiveForm::begin(); ?> |
|
|
|
|
|
|
|
<div class="col-md-8"> |
|
|
|
<?= $form->field($model, 'name')->textInput(['maxlength' => 255]) ?> |
|
|
|
<?= $form->field($model, 'locality')->textInput(['maxlength' => 255]) ?> |
|
|
|
<?= $form->field($model, 'address')->textarea(['rows' => 6]) ?> |
|
|
|
<?= $form->field($model, 'id_user', [ |
|
|
|
'template' => '{label} <a href="' . Yii::$app->urlManager->createUrl(['user/create']) . '" class="btn btn-xs btn-default">Nouvel utilisateur <span class="glyphicon glyphicon-plus"></span></a><div>{input}</div>{hint}', |
|
|
|
]) |
|
|
|
->dropDownList($userModule->populateUserDropdownList(), ['class' => 'select2']) |
|
|
|
->hint('Utilisé lors de la facturation'); ?> |
|
|
|
<?php |
|
|
|
$addHintCredit = ''; |
|
|
|
if (!$producerModule->getConfig('credit')): |
|
|
|
$addHintCredit = '<br /><strong>Attention, le système de Crédit est désactivé au niveau des ' . Html::a('paramètres globaux', ['producer/update']) . '.</strong>'; |
|
|
|
endif; |
|
|
|
|
|
|
|
echo $form->field($model, 'credit') |
|
|
|
->checkbox() |
|
|
|
->hint('Cochez cette case si le client peut régler ses commandes via son compte <strong>Crédit</strong> pour ce point de vente.' |
|
|
|
. $addHintCredit); |
|
|
|
?> |
|
|
|
|
|
|
|
<?= $form->field($model, 'credit_functioning') |
|
|
|
->dropDownList([ |
|
|
|
'' => 'Paramètres globaux (' . Producer::$creditFunctioningArray[$producerModule->getConfig('credit_functioning')] . ')', |
|
|
|
Producer::CREDIT_FUNCTIONING_OPTIONAL => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_OPTIONAL], |
|
|
|
Producer::CREDIT_FUNCTIONING_MANDATORY => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_MANDATORY], |
|
|
|
Producer::CREDIT_FUNCTIONING_USER => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_USER], |
|
|
|
], [])->hint(Producer::HINT_CREDIT_FUNCTIONING); ?> |
|
|
|
|
|
|
|
<?php /*$form->field($model, 'product_price_percent') |
|
|
|
<?php $form = ActiveForm::begin(); ?> |
|
|
|
|
|
|
|
<div class="col-md-8"> |
|
|
|
<?= $form->field($model, 'name')->textInput(['maxlength' => 255]) ?> |
|
|
|
<?= $form->field($model, 'locality')->textInput(['maxlength' => 255]) ?> |
|
|
|
<?= $form->field($model, 'address')->textarea(['rows' => 6]) ?> |
|
|
|
<?= $form->field($model, 'id_user', [ |
|
|
|
'template' => '{label} <a href="' . Yii::$app->urlManager->createUrl(['user/create']) . '" class="btn btn-xs btn-default">Nouvel utilisateur <span class="glyphicon glyphicon-plus"></span></a><div>{input}</div>{hint}', |
|
|
|
]) |
|
|
|
->dropDownList($userModule->populateUserDropdownList(), ['class' => 'select2']) |
|
|
|
->hint('Utilisé lors de la facturation'); ?> |
|
|
|
<?php |
|
|
|
$addHintCredit = ''; |
|
|
|
if (!$producerModule->getConfig('credit')): |
|
|
|
$addHintCredit = '<br /><strong>Attention, le système de Crédit est désactivé au niveau des ' . Html::a('paramètres globaux', ['producer/update']) . '.</strong>'; |
|
|
|
endif; |
|
|
|
|
|
|
|
echo $form->field($model, 'credit') |
|
|
|
->checkbox() |
|
|
|
->hint('Cochez cette case si le client peut régler ses commandes via son compte <strong>Crédit</strong> pour ce point de vente.' |
|
|
|
. $addHintCredit); |
|
|
|
?> |
|
|
|
|
|
|
|
<?= $form->field($model, 'credit_functioning') |
|
|
|
->dropDownList([ |
|
|
|
'' => 'Paramètres globaux (' . Producer::$creditFunctioningArray[$producerModule->getConfig('credit_functioning')] . ')', |
|
|
|
Producer::CREDIT_FUNCTIONING_OPTIONAL => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_OPTIONAL], |
|
|
|
Producer::CREDIT_FUNCTIONING_MANDATORY => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_MANDATORY], |
|
|
|
Producer::CREDIT_FUNCTIONING_USER => Producer::$creditFunctioningArray[Producer::CREDIT_FUNCTIONING_USER], |
|
|
|
], [])->hint(Producer::HINT_CREDIT_FUNCTIONING); ?> |
|
|
|
|
|
|
|
<?php /*$form->field($model, 'product_price_percent') |
|
|
|
->dropDownList( ProductPrice::percentValues(), [])->hint('Pourcentage appliqué aux prix de chaque produit dans ce point de vente.');*/ ?> |
|
|
|
|
|
|
|
<?= $form->field($model, 'maximum_number_orders')->textInput() ?> |
|
|
|
|
|
|
|
<h2>Boîte à pain</h2> |
|
|
|
<?= $form->field($model, 'is_bread_box')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'bread_box_code')->textInput() ?> |
|
|
|
|
|
|
|
<div id="delivery-days"> |
|
|
|
<h2>Jours de livraison</h2> |
|
|
|
<?= $form->field($model, 'delivery_monday')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'delivery_tuesday')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'delivery_wednesday')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'delivery_thursday')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'delivery_friday')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'delivery_saturday')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'delivery_sunday')->checkbox() ?> |
|
|
|
</div> |
|
|
|
<div class="clr"></div> |
|
|
|
|
|
|
|
<h2>Informations</h2> |
|
|
|
<?= $form->field($model, 'infos_monday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'infos_tuesday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'infos_wednesday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'infos_thursday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'infos_friday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'infos_saturday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'infos_sunday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'maximum_number_orders')->textInput() ?> |
|
|
|
|
|
|
|
<div id="delivery-days"> |
|
|
|
<h2>Jours de livraison</h2> |
|
|
|
<?= $form->field($model, 'delivery_monday')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'delivery_tuesday')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'delivery_wednesday')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'delivery_thursday')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'delivery_friday')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'delivery_saturday')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'delivery_sunday')->checkbox() ?> |
|
|
|
</div> |
|
|
|
<div class="col-md-4"> |
|
|
|
<div class="panel panel-default"> |
|
|
|
<div class="panel-heading"> |
|
|
|
<h3 class="panel-title">Accès</h3> |
|
|
|
</div> |
|
|
|
<div class="panel-body"> |
|
|
|
<?= $form->field($model, 'code') |
|
|
|
->label('Code d\'accès') |
|
|
|
->hint('Renseignez ce champs si vous souhaitez protéger ce point de vente par un code.') |
|
|
|
?> |
|
|
|
<?= $form->field($model, 'restricted_access') |
|
|
|
->checkbox() |
|
|
|
->hint('Cochez cette case si seulement un groupe restreint d\'utilisateurs peuvent accéder à ce point de vente.<br />' |
|
|
|
. 'Dans le cas des boîtes à pain, il vous est possible de spécifier un commentaire pour chaque utilisateur sélectionné afin de lui renseigner son numéro de boîte ou son code.') ?> |
|
|
|
<div id="users"> |
|
|
|
<?= Html::activeCheckboxList($model, 'users', ArrayHelper::map($users, 'user_id', function ($model_user, $defaultValue) use ($model) { |
|
|
|
$userModule = UserModule::getInstance(); |
|
|
|
return Html::encode($userModule->getUsernameFromArray($model_user)) . '<br />' |
|
|
|
. Html::activeTextInput( |
|
|
|
$model, |
|
|
|
'users_comment[' . $model_user['user_id'] . ']', |
|
|
|
[ |
|
|
|
'class' => 'form-control commentaire', |
|
|
|
'placeholder' => 'Commentaire', |
|
|
|
'value' => (isset($model->users_comment[$model_user['user_id']])) ? Html::encode($model->users_comment[$model_user['user_id']]) : '' |
|
|
|
]); |
|
|
|
}), ['encode' => false, 'class' => '']) ?> |
|
|
|
</div> |
|
|
|
<div class="clr"></div> |
|
|
|
|
|
|
|
<h2>Informations</h2> |
|
|
|
<?= $form->field($model, 'infos_monday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'infos_tuesday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'infos_wednesday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'infos_thursday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'infos_friday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'infos_saturday')->textarea(['rows' => 3]) ?> |
|
|
|
<?= $form->field($model, 'infos_sunday')->textarea(['rows' => 3]) ?> |
|
|
|
|
|
|
|
<h2>Livraison à domicile</h2> |
|
|
|
<?= $form->field($model, 'is_home_delivery')->checkbox() ?> |
|
|
|
|
|
|
|
<h2>Boîte à pain</h2> |
|
|
|
<?= $form->field($model, 'is_bread_box')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'bread_box_code')->textInput() ?> |
|
|
|
</div> |
|
|
|
<div class="col-md-4"> |
|
|
|
<div class="panel panel-default"> |
|
|
|
<div class="panel-heading"> |
|
|
|
<h3 class="panel-title">Accès</h3> |
|
|
|
</div> |
|
|
|
<div class="panel-body"> |
|
|
|
<?= $form->field($model, 'code') |
|
|
|
->label('Code d\'accès') |
|
|
|
->hint('Renseignez ce champs si vous souhaitez protéger ce point de vente par un code.') |
|
|
|
?> |
|
|
|
<?= $form->field($model, 'restricted_access') |
|
|
|
->checkbox() |
|
|
|
->hint('Cochez cette case si seulement un groupe restreint d\'utilisateurs peuvent accéder à ce point de vente.<br />' |
|
|
|
. 'Dans le cas des boîtes à pain, il vous est possible de spécifier un commentaire pour chaque utilisateur sélectionné afin de lui renseigner son numéro de boîte ou son code.') ?> |
|
|
|
<div id="users"> |
|
|
|
<?= Html::activeCheckboxList($model, 'users', ArrayHelper::map($users, 'user_id', function ($model_user, $defaultValue) use ($model) { |
|
|
|
$userModule = UserModule::getInstance(); |
|
|
|
return Html::encode($userModule->getUsernameFromArray($model_user)) . '<br />' |
|
|
|
. Html::activeTextInput( |
|
|
|
$model, |
|
|
|
'users_comment[' . $model_user['user_id'] . ']', |
|
|
|
[ |
|
|
|
'class' => 'form-control commentaire', |
|
|
|
'placeholder' => 'Commentaire', |
|
|
|
'value' => (isset($model->users_comment[$model_user['user_id']])) ? Html::encode($model->users_comment[$model_user['user_id']]) : '' |
|
|
|
]); |
|
|
|
}), ['encode' => false, 'class' => '']) ?> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="panel panel-default"> |
|
|
|
<div class="panel-heading"> |
|
|
|
<h3 class="panel-title">Génération des bons de livraison</h3> |
|
|
|
</div> |
|
|
|
<div class="panel-body"> |
|
|
|
<?= $form->field($model, 'button_generate_delivery_note_point_sale')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'button_generate_delivery_note_each_user')->checkbox() ?> |
|
|
|
</div> |
|
|
|
<div class="panel panel-default"> |
|
|
|
<div class="panel-heading"> |
|
|
|
<h3 class="panel-title">Génération des bons de livraison</h3> |
|
|
|
</div> |
|
|
|
<div class="panel-body"> |
|
|
|
<?= $form->field($model, 'button_generate_delivery_note_point_sale')->checkbox() ?> |
|
|
|
<?= $form->field($model, 'button_generate_delivery_note_each_user')->checkbox() ?> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<?php if($distributionModule->getExportManager()->isEnabled(ExportManager::SHOPPING_CART_LABELS_PDF)): ?> |
|
|
|
<?php if ($distributionModule->getExportManager()->isEnabled(ExportManager::SHOPPING_CART_LABELS_PDF)): ?> |
|
|
|
<div class="panel panel-default"> |
|
|
|
<div class="panel-heading"> |
|
|
|
<h3 class="panel-title">Exports</h3> |
|
|
@@ -164,14 +167,14 @@ $distributionModule = DistributionModule::getInstance(); |
|
|
|
<?= $form->field($model, 'exclude_export_shopping_cart_labels')->checkbox(); ?> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<?php endif; ?> |
|
|
|
</div> |
|
|
|
<div class="clr"></div> |
|
|
|
<?php endif; ?> |
|
|
|
</div> |
|
|
|
<div class="clr"></div> |
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
<?= Html::submitButton($model->isNewRecord ? 'Ajouter' : 'Modifier', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<?= Html::submitButton($model->isNewRecord ? 'Ajouter' : 'Modifier', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> |
|
|
|
</div> |
|
|
|
|
|
|
|
<?php ActiveForm::end(); ?> |
|
|
|
<?php ActiveForm::end(); ?> |
|
|
|
|
|
|
|
</div> |