</span> | </span> | ||||
<span v-else>{{ order.username }}</span> | <span v-else>{{ order.username }}</span> | ||||
<span v-if="order.comment && order.comment.length > 0" class="glyphicon glyphicon-comment"></span> | <span v-if="order.comment && order.comment.length > 0" class="glyphicon glyphicon-comment"></span> | ||||
<span v-if="order.delivery_home && order.delivery_address && order.delivery_address.length > 0" class="glyphicon glyphicon-home"></span> | |||||
</td> | </td> | ||||
<td class="column-point-sale" v-if="idActivePointSale == 0"> | <td class="column-point-sale" v-if="idActivePointSale == 0"> | ||||
{{ order.pointSale.name }} | {{ order.pointSale.name }} | ||||
<strong><span class="glyphicon glyphicon-menu-right"></span> Commentaire</strong><br /> | <strong><span class="glyphicon glyphicon-menu-right"></span> Commentaire</strong><br /> | ||||
{{ order.comment }} | {{ order.comment }} | ||||
</div> | </div> | ||||
<div v-if="order.delivery_home && order.delivery_address && order.delivery_address.length > 0" class="delivery"> | |||||
<strong><span class="glyphicon glyphicon-menu-right"></span> Livraison à domicile</strong><br /> | |||||
{{ order.delivery_address }} | |||||
</div> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</template> | </template> |
if($isBig) { | if($isBig) { | ||||
$html .= '<td></td>' ; | $html .= '<td></td>' ; | ||||
} | } | ||||
$html .= '<td>'.$order->comment.'</td>'; | |||||
$html .= '<td>'.$order->getCommentReport().'</td>'; | |||||
if($pointSale->credit) { | if($pointSale->credit) { | ||||
$credit = '' ; | $credit = '' ; |
Producer::ORDER_ENTRY_POINT_DATE => 'Date', | Producer::ORDER_ENTRY_POINT_DATE => 'Date', | ||||
Producer::ORDER_ENTRY_POINT_POINT_SALE => 'Point de vente', | Producer::ORDER_ENTRY_POINT_POINT_SALE => 'Point de vente', | ||||
], []); ?> | ], []); ?> | ||||
<?= $form->field($model, 'option_delivery') | |||||
->dropDownList([ | |||||
0 => 'Non', | |||||
1 => 'Oui' | |||||
], []); ?> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
.distribution-index #orders table tr.view .comment { | .distribution-index #orders table tr.view .comment { | ||||
margin-top: 20px; | margin-top: 20px; | ||||
} | } | ||||
/* line 309, ../sass/distribution/_index.scss */ | |||||
/* line 304, ../sass/distribution/_index.scss */ | |||||
.distribution-index #orders table tr.view .delivery { | |||||
margin-top: 20px; | |||||
} | |||||
/* line 313, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .modal-container { | .distribution-index .modal-form-order .modal-container { | ||||
width: 100%; | width: 100%; | ||||
padding: 0px; | padding: 0px; | ||||
} | } | ||||
/* line 313, ../sass/distribution/_index.scss */ | |||||
/* line 317, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .modal-container .modal-body { | .distribution-index .modal-form-order .modal-container .modal-body { | ||||
padding-right: 15px; | padding-right: 15px; | ||||
} | } | ||||
/* line 315, ../sass/distribution/_index.scss */ | |||||
/* line 319, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .modal-container .modal-body table { | .distribution-index .modal-form-order .modal-container .modal-body table { | ||||
margin-bottom: 150px; | margin-bottom: 150px; | ||||
} | } | ||||
/* line 320, ../sass/distribution/_index.scss */ | |||||
/* line 324, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .modal-container .modal-footer { | .distribution-index .modal-form-order .modal-container .modal-footer { | ||||
border-top-color: #f4f4f4; | border-top-color: #f4f4f4; | ||||
position: fixed; | position: fixed; | ||||
text-align: center; | text-align: center; | ||||
border-top: solid 1px #e0e0e0; | border-top: solid 1px #e0e0e0; | ||||
} | } | ||||
/* line 332, ../sass/distribution/_index.scss */ | |||||
/* line 336, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .modal-container .modal-footer .actions-form button { | .distribution-index .modal-form-order .modal-container .modal-footer .actions-form button { | ||||
float: none; | float: none; | ||||
} | } | ||||
/* line 339, ../sass/distribution/_index.scss */ | |||||
/* line 343, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .btn-credit { | .distribution-index .modal-form-order .btn-credit { | ||||
float: right; | float: right; | ||||
} | } | ||||
/* line 345, ../sass/distribution/_index.scss */ | |||||
/* line 349, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products .product-ordered td { | .distribution-index .modal-form-order table.table-products .product-ordered td { | ||||
background-color: #e9e9e9; | background-color: #e9e9e9; | ||||
} | } | ||||
/* line 349, ../sass/distribution/_index.scss */ | |||||
/* line 353, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products .product-ordered input { | .distribution-index .modal-form-order table.table-products .product-ordered input { | ||||
font-size: 16px; | font-size: 16px; | ||||
font-weight: bold; | font-weight: bold; | ||||
} | } | ||||
/* line 355, ../sass/distribution/_index.scss */ | |||||
/* line 359, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.price { | .distribution-index .modal-form-order table.table-products td.price { | ||||
width: 150px; | width: 150px; | ||||
} | } | ||||
/* line 357, ../sass/distribution/_index.scss */ | |||||
/* line 361, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.price input { | .distribution-index .modal-form-order table.table-products td.price input { | ||||
text-align: center; | text-align: center; | ||||
} | } | ||||
/* line 362, ../sass/distribution/_index.scss */ | |||||
/* line 366, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity { | .distribution-index .modal-form-order table.table-products td.quantity { | ||||
width: 165px; | width: 165px; | ||||
} | } | ||||
/* line 365, ../sass/distribution/_index.scss */ | |||||
/* line 369, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity input { | .distribution-index .modal-form-order table.table-products td.quantity input { | ||||
text-align: center; | text-align: center; | ||||
color: black; | color: black; | ||||
} | } | ||||
/* line 370, ../sass/distribution/_index.scss */ | |||||
/* line 374, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity .form-control { | .distribution-index .modal-form-order table.table-products td.quantity .form-control { | ||||
border-right: 0px none; | border-right: 0px none; | ||||
padding-right: 4px; | padding-right: 4px; | ||||
} | } | ||||
/* line 375, ../sass/distribution/_index.scss */ | |||||
/* line 379, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity .input-group-addon { | .distribution-index .modal-form-order table.table-products td.quantity .input-group-addon { | ||||
padding: 5px; | padding: 5px; | ||||
padding-left: 0px; | padding-left: 0px; | ||||
border-left: 0px none; | border-left: 0px none; | ||||
border-right: 0px none; | border-right: 0px none; | ||||
} | } | ||||
/* line 384, ../sass/distribution/_index.scss */ | |||||
/* line 388, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity-remaining { | .distribution-index .modal-form-order table.table-products td.quantity-remaining { | ||||
text-align: right; | text-align: right; | ||||
} | } | ||||
/* line 387, ../sass/distribution/_index.scss */ | |||||
/* line 391, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity-remaining.quantity-remaining, .distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite { | .distribution-index .modal-form-order table.table-products td.quantity-remaining.quantity-remaining, .distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite { | ||||
color: #00A65A; | color: #00A65A; | ||||
} | } | ||||
/* line 391, ../sass/distribution/_index.scss */ | |||||
/* line 395, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity-remaining.negative { | .distribution-index .modal-form-order table.table-products td.quantity-remaining.negative { | ||||
color: #DD4B39; | color: #DD4B39; | ||||
} | } | ||||
/* line 395, ../sass/distribution/_index.scss */ | |||||
/* line 399, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite, .distribution-index .modal-form-order table.table-products td.quantity-remaining.empty { | .distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite, .distribution-index .modal-form-order table.table-products td.quantity-remaining.empty { | ||||
font-size: 18px; | font-size: 18px; | ||||
} | } | ||||
/* line 402, ../sass/distribution/_index.scss */ | |||||
/* line 406, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .actions-form button { | .distribution-index .modal-form-order .actions-form button { | ||||
margin-left: 15px; | margin-left: 15px; | ||||
} | } | ||||
/* line 410, ../sass/distribution/_index.scss */ | |||||
/* line 414, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-payment .info-box .info-box-icon { | .distribution-index .modal-payment .info-box .info-box-icon { | ||||
width: 50px; | width: 50px; | ||||
} | } | ||||
/* line 413, ../sass/distribution/_index.scss */ | |||||
/* line 417, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-payment .info-box .info-box-icon i { | .distribution-index .modal-payment .info-box .info-box-icon i { | ||||
font-size: 30px; | font-size: 30px; | ||||
} | } | ||||
/* line 418, ../sass/distribution/_index.scss */ | |||||
/* line 422, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-payment .info-box .info-box-content { | .distribution-index .modal-payment .info-box .info-box-content { | ||||
margin-left: 50px; | margin-left: 50px; | ||||
} | } |
.comment { | .comment { | ||||
margin-top: 20px; | margin-top: 20px; | ||||
} | } | ||||
.delivery { | |||||
margin-top: 20px; | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } |
return [ | return [ | ||||
[['id_user', 'date', 'status'], 'required', 'message' => ''], | [['id_user', 'date', 'status'], 'required', 'message' => ''], | ||||
[['id_user', 'id_point_sale', 'id_distribution', 'id_subscription', 'id_invoice', 'id_quotation', 'id_delivery_note'], 'integer'], | [['id_user', 'id_point_sale', 'id_distribution', 'id_subscription', 'id_invoice', 'id_quotation', 'id_delivery_note'], 'integer'], | ||||
[['auto_payment', 'tiller_synchronization'], 'boolean'], | |||||
[['status', 'reference'], 'string'], | |||||
[['auto_payment', 'tiller_synchronization', 'delivery_home'], 'boolean'], | |||||
[['status', 'reference', 'delivery_address'], 'string'], | |||||
[['date', 'date_update', 'comment', 'comment_point_sale', 'mean_payment'], 'safe'] | [['date', 'date_update', 'comment', 'comment_point_sale', 'mean_payment'], 'safe'] | ||||
]; | ]; | ||||
} | } | ||||
'id_invoice' => 'Facture', | 'id_invoice' => 'Facture', | ||||
'id_quotation' => 'Devis', | 'id_quotation' => 'Devis', | ||||
'id_delivery_note' => 'Bon de livraison', | 'id_delivery_note' => 'Bon de livraison', | ||||
'reference' => 'Référence' | |||||
'reference' => 'Référence', | |||||
'delivery_home' => 'Livraison à domicile', | |||||
'delivery_address' => 'Adresse de livraison' | |||||
]; | ]; | ||||
} | } | ||||
$this->save() ; | $this->save() ; | ||||
} | } | ||||
} | } | ||||
public function getCommentReport() | |||||
{ | |||||
$comment = '' ; | |||||
$hasComment = false ; | |||||
if($this->comment && strlen($this->comment) > 0) { | |||||
$hasComment = true ; | |||||
$comment .= $this->comment ; | |||||
} | |||||
if($this->delivery_home && $this->delivery_address && strlen($this->delivery_address) > 0) { | |||||
if($hasComment) { | |||||
$comment .= '<br /><br />' ; | |||||
} | |||||
$comment .= '<strong>Livraison à domicile :</strong><br />' ; | |||||
$comment .= nl2br($this->delivery_address) ; | |||||
} | |||||
return $comment ; | |||||
} | |||||
} | } |
}], | }], | ||||
[['description', 'mentions', 'gcs', 'order_infos', 'slug', 'secret_key_payplug', 'background_color_logo', 'option_behavior_cancel_order', 'tiller_provider_token', 'tiller_restaurant_token', 'status', | [['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', 'option_order_entry_point'], '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'], | |||||
[['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', 'option_delivery'], '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], | [['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'], | [['free_price', 'credit_limit_reminder', 'credit_limit'], 'double'], | ||||
['free_price', 'compare', 'compareValue' => 0, 'operator' => '>=', 'type' => 'number', 'message' => 'Prix libre doit être supérieur ou égal à 0'], | ['free_price', 'compare', 'compareValue' => 0, 'operator' => '>=', 'type' => 'number', 'message' => 'Prix libre doit être supérieur ou égal à 0'], | ||||
'option_order_reference_type' => 'Type de référence', | '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_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_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' | |||||
'option_order_entry_point' => 'Point d\'entrée par point de vente ou par date', | |||||
'option_delivery' => 'Proposer la livraison à domicile' | |||||
]; | ]; | ||||
} | } | ||||
<?php | |||||
use yii\db\Migration; | |||||
use yii\db\Schema; | |||||
class m210330_072516_add_option_delivery extends Migration | |||||
{ | |||||
public function safeUp() | |||||
{ | |||||
$this->addColumn('producer', 'option_delivery', Schema::TYPE_BOOLEAN. ' DEFAULT 0'); | |||||
$this->addColumn('order', 'delivery_home', Schema::TYPE_BOOLEAN.' DEFAULT 0'); | |||||
$this->addColumn('order', 'delivery_address', Schema::TYPE_TEXT); | |||||
} | |||||
public function safeDown() | |||||
{ | |||||
$this->dropColumn('producer', 'option_delivery'); | |||||
$this->dropColumn('order', 'delivery_home'); | |||||
$this->dropColumn('order', 'delivery_address'); | |||||
} | |||||
} | |||||
'id' => $order->id_point_sale | 'id' => $order->id_point_sale | ||||
]); | ]); | ||||
// commentaire point de vente | |||||
$order->comment_point_sale = ($pointSale && strlen($pointSale->getComment())) ? | $order->comment_point_sale = ($pointSale && strlen($pointSale->getComment())) ? | ||||
$pointSale->getComment() : ''; | $pointSale->getComment() : ''; | ||||
// la commande est automatiquement réactivée lors d'une modification | // la commande est automatiquement réactivée lors d'une modification | ||||
$order->date_delete = null; | $order->date_delete = null; | ||||
// delivery | |||||
$order->delivery_home = isset($posts['Order']['delivery_home']) ? $posts['Order']['delivery_home'] : false ; | |||||
$order->delivery_address = (isset($posts['Order']['delivery_address']) && $order->delivery_home) ? $posts['Order']['delivery_address'] : null ; | |||||
// comment | |||||
$order->comment = isset($posts['Order']['comment']) ? $posts['Order']['comment'] : null ; | |||||
// sauvegarde de la commande | // sauvegarde de la commande | ||||
$order->save(); | $order->save(); | ||||
$format = 'Y-m-d'; | $format = 'Y-m-d'; | ||||
$dateObject = DateTime::createFromFormat($format, $date); | $dateObject = DateTime::createFromFormat($format, $date); | ||||
$user = User::getCurrent() ; | |||||
// PointSale current | // PointSale current | ||||
$pointSaleCurrent = PointSale::findOne($pointSaleId) ; | $pointSaleCurrent = PointSale::findOne($pointSaleId) ; | ||||
'credit_limit' => is_numeric($producer->credit_limit) ? $producer->credit_limit : null, | 'credit_limit' => is_numeric($producer->credit_limit) ? $producer->credit_limit : null, | ||||
'option_allow_order_guest' => $producer->option_allow_order_guest, | 'option_allow_order_guest' => $producer->option_allow_order_guest, | ||||
'option_order_entry_point' => $producer->option_order_entry_point, | 'option_order_entry_point' => $producer->option_order_entry_point, | ||||
'option_delivery' => $producer->option_delivery | |||||
]; | ]; | ||||
// Distributions | // Distributions | ||||
if($userProducer) { | if($userProducer) { | ||||
$json['user'] = [ | $json['user'] = [ | ||||
'address' => $user->address, | |||||
'credit' => $userProducer->credit, | 'credit' => $userProducer->credit, | ||||
'credit_active' => $userProducer->credit_active, | 'credit_active' => $userProducer->credit_active, | ||||
]; | ]; |
<ul> | <ul> | ||||
<?php if($order->reference && strlen($order->reference) > 0): ?><li><span class="glyphicon glyphicon-check"></span> Commande N°<strong><?= Html::encode($order->reference); ?></strong></li><?php endif; ?> | <?php if($order->reference && strlen($order->reference) > 0): ?><li><span class="glyphicon glyphicon-check"></span> Commande N°<strong><?= Html::encode($order->reference); ?></strong></li><?php endif; ?> | ||||
<li><span class="glyphicon glyphicon-time"></span>Le <?= date('d/m/Y',strtotime($order->distribution->date)) ?></li> | <li><span class="glyphicon glyphicon-time"></span>Le <?= date('d/m/Y',strtotime($order->distribution->date)) ?></li> | ||||
<li><span class="glyphicon glyphicon-map-marker"></span><?= Html::encode($order->pointSale->name) ?><?php if(strlen($order->pointSale->name)): ?> | |||||
<br /> <span class="locality">à <?= Html::encode($order->pointSale->locality) ?></span><?php endif; ?></li> | |||||
<li><span class="glyphicon glyphicon-map-marker"></span> | |||||
<?php if($order->delivery_home): ?> | |||||
Livraison à domicile | |||||
<br /><span class="locality"><?= nl2br(Html::encode($order->delivery_address)); ?></span> | |||||
<?php else: ?> | |||||
<?= Html::encode($order->pointSale->name) ?><?php if(strlen($order->pointSale->name)): ?> | |||||
<br /> <span class="locality">à <?= Html::encode($order->pointSale->locality) ?></span><?php endif; ?></li> | |||||
<?php endif; ?> | |||||
</ul> | </ul> | ||||
</div> | </div> | ||||
<div class="col-md-6"> | <div class="col-md-6"> |
</transition> | </transition> | ||||
<transition name="slide"> | <transition name="slide"> | ||||
<div id="content-step-payment" v-if="step == 'payment'"> | <div id="content-step-payment" v-if="step == 'payment'"> | ||||
<div class="delivery"> | |||||
<div class="delivery-home" v-if="producer.option_delivery"> | |||||
<input type="checkbox" name="delivery" id="delivery" v-model="delivery" /> | |||||
<label for="delivery">Je souhaite être livré à domicile</label> | |||||
</div> | |||||
<div class="delivery-address" v-if="delivery"> | |||||
<label for="deliver-address">Adresse de livraison</label> | |||||
<textarea id="deliver-address" v-model="deliveryAddress" class="form-control" required="required"></textarea> | |||||
</div> | |||||
</div> | |||||
<div class="comment"> | <div class="comment"> | ||||
<label for="order-comment">Commentaire</label> | <label for="order-comment">Commentaire</label> | ||||
<textarea id="order-comment" v-model="comment" class="form-control"></textarea> | <textarea id="order-comment" v-model="comment" class="form-control"></textarea> |
font-size: 23px; | font-size: 23px; | ||||
} | } | ||||
/* line 335, ../sass/order/_order.scss */ | /* line 335, ../sass/order/_order.scss */ | ||||
.order-order #main #app-order-order #content-step-payment .credit .info { | |||||
margin-left: 20px; | |||||
color: gray; | |||||
.order-order #main #app-order-order #content-step-payment .delivery { | |||||
margin-bottom: 20px; | |||||
} | |||||
/* line 338, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order #content-step-payment .delivery .delivery-home { | |||||
margin-bottom: 20px; | |||||
} | } | ||||
/* line 341, ../sass/order/_order.scss */ | |||||
/* line 347, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order #content-step-payment .comment { | .order-order #main #app-order-order #content-step-payment .comment { | ||||
margin-bottom: 20px; | margin-bottom: 20px; | ||||
} | } | ||||
/* line 352, ../sass/order/_order.scss */ | /* line 352, ../sass/order/_order.scss */ | ||||
.order-order #main #app-order-order #content-step-payment .credit .info { | |||||
margin-left: 20px; | |||||
color: gray; | |||||
} | |||||
/* line 365, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order #infos { | .order-order #main #app-order-order #infos { | ||||
margin-top: 30px; | margin-top: 30px; | ||||
} | } | ||||
/* line 354, ../sass/order/_order.scss */ | |||||
/* line 367, ../sass/order/_order.scss */ | |||||
.order-order #main #app-order-order #infos .panel-body { | .order-order #main #app-order-order #infos .panel-body { | ||||
padding-top: 0px; | padding-top: 0px; | ||||
white-space: pre-line; | white-space: pre-line; | ||||
} | } | ||||
/* line 364, ../sass/order/_order.scss */ | |||||
/* line 377, ../sass/order/_order.scss */ | |||||
#main #content .panel h3 { | #main #content .panel h3 { | ||||
font-family: "highvoltageregular"; | font-family: "highvoltageregular"; | ||||
margin: 0px; | margin: 0px; |
useCredit: false, | useCredit: false, | ||||
errors: [], | errors: [], | ||||
disableConfirmButton: false, | disableConfirmButton: false, | ||||
delivery: false, | |||||
deliveryAddress: null, | |||||
calendar: { | calendar: { | ||||
mode: 'single', | mode: 'single', | ||||
attrs: [], | attrs: [], | ||||
}}) | }}) | ||||
.then(function(response) { | .then(function(response) { | ||||
// distributions | |||||
var distributions = response.data.distributions; | var distributions = response.data.distributions; | ||||
app.calendar.attrs = []; | app.calendar.attrs = []; | ||||
} | } | ||||
} | } | ||||
// distribution | |||||
if (response.data.distribution) { | if (response.data.distribution) { | ||||
app.distribution = response.data.distribution; | app.distribution = response.data.distribution; | ||||
} | } | ||||
// liste commandes | |||||
var orders = []; | var orders = []; | ||||
if (response.data.orders) { | if (response.data.orders) { | ||||
orders = response.data.orders; | orders = response.data.orders; | ||||
} | } | ||||
} | } | ||||
// produits | |||||
if(response.data.products) { | if(response.data.products) { | ||||
app.products = response.data.products ; | app.products = response.data.products ; | ||||
} | } | ||||
// catégories | |||||
if(response.data.categories) { | if(response.data.categories) { | ||||
app.categories = response.data.categories ; | app.categories = response.data.categories ; | ||||
app.setCategoryCurrent(response.data.categories[0]) ; | app.setCategoryCurrent(response.data.categories[0]) ; | ||||
} | } | ||||
if(type != 'products') { | if(type != 'products') { | ||||
app.producer = response.data.producer; | app.producer = response.data.producer; | ||||
} | } | ||||
} | } | ||||
// commande | |||||
app.order = null ; | app.order = null ; | ||||
if(response.data.order) { | if(response.data.order) { | ||||
app.order = response.data.order ; | app.order = response.data.order ; | ||||
app.comment = app.order.comment ; | |||||
console.log(app.order) ; | |||||
app.delivery = app.order.delivery_home ; | |||||
if(app.order.delivery_address && app.order.delivery_address.length > 0) { | |||||
app.deliveryAddress = app.order.delivery_address ; | |||||
} | |||||
app.pointSaleActive = app.getPointSale(response.data.order.id_point_sale) ; | app.pointSaleActive = app.getPointSale(response.data.order.id_point_sale) ; | ||||
} | } | ||||
else { | else { | ||||
app.comment = null ; | |||||
app.delivery = false ; | |||||
app.deliveryAddress = null ; | |||||
if(app.user.address.length > 0) { | |||||
app.deliveryAddress = app.user.address ; | |||||
} | |||||
app.pointSaleActive = null ; | app.pointSaleActive = null ; | ||||
} | } | ||||
} | } | ||||
this.step = step ; | this.step = step ; | ||||
window.scroll(0, $('#page-title').position().top - 25) ; | window.scroll(0, $('#page-title').position().top - 25) ; | ||||
if(oldStep == 'date' && step == 'point-sale') { | |||||
if((oldStep == 'date' && step == 'point-sale') | |||||
|| (oldStep == 'date' && step == 'products')) { | |||||
this.init('basic') ; | this.init('basic') ; | ||||
} | } | ||||
if((oldStep == 'date' && step == 'products') | |||||
|| (oldStep == 'point-sale' && step == 'products') | |||||
if((oldStep == 'point-sale' && step == 'products') | |||||
|| (oldStep == 'point-sale' && step == 'date')) { | || (oldStep == 'point-sale' && step == 'date')) { | ||||
this.init('products') ; | this.init('products') ; | ||||
confirmClick: function() { | confirmClick: function() { | ||||
var app = this ; | var app = this ; | ||||
// delivery | |||||
if(app.delivery && !app.deliveryAddress) { | |||||
this.errors = [] ; | |||||
this.errors.push('Veuillez saisir une adresse de livraison') ; | |||||
return false ; | |||||
} | |||||
// guest form | |||||
var $signupGuestForm = $('#signup-guest form') ; | var $signupGuestForm = $('#signup-guest form') ; | ||||
if($signupGuestForm.length > 0 && !$signupGuestForm.valid()) { | if($signupGuestForm.length > 0 && !$signupGuestForm.valid()) { | ||||
$signupGuestForm.submit() ; | $signupGuestForm.submit() ; | ||||
return false ; | return false ; | ||||
} | } | ||||
app.disableConfirmButton = true ; | |||||
var productsArray = {} ; | |||||
for(var key in this.products) { | |||||
if( this.products[key].quantity_form != null && | |||||
this.products[key].quantity_form > 0) { | |||||
productsArray[this.products[key].id] = this.products[key].quantity_form ; | |||||
} | |||||
} | |||||
var user = false ; | var user = false ; | ||||
if(this.producer.option_allow_order_guest && !this.user) { | if(this.producer.option_allow_order_guest && !this.user) { | ||||
user = { | user = { | ||||
phone: $('#signupguest-phone').val(), | phone: $('#signupguest-phone').val(), | ||||
} ; | } ; | ||||
} | } | ||||
// products | |||||
var productsArray = {} ; | |||||
for(var key in this.products) { | |||||
if( this.products[key].quantity_form != null && | |||||
this.products[key].quantity_form > 0) { | |||||
productsArray[this.products[key].id] = this.products[key].quantity_form ; | |||||
} | |||||
} | |||||
app.disableConfirmButton = true ; | |||||
axios.post('ajax-process', { | axios.post('ajax-process', { | ||||
Order: { | Order: { | ||||
id_distribution : this.distribution.id, | id_distribution : this.distribution.id, | ||||
id_point_sale: this.pointSaleActive.id, | id_point_sale: this.pointSaleActive.id, | ||||
comment: this.comment | |||||
comment: this.comment, | |||||
delivery_home: this.delivery, | |||||
delivery_address: this.deliveryAddress | |||||
}, | }, | ||||
code_point_sale: this.pointsSaleCodes[this.pointSaleActive.id], | code_point_sale: this.pointsSaleCodes[this.pointSaleActive.id], | ||||
products: productsArray, | products: productsArray, |
} | } | ||||
#content-step-payment { | #content-step-payment { | ||||
.delivery { | |||||
margin-bottom: 20px ; | |||||
.delivery-home { | |||||
margin-bottom: 20px ; | |||||
} | |||||
.delivery-address { | |||||
} | |||||
} | |||||
.comment { | |||||
margin-bottom: 20px ; | |||||
} | |||||
.credit { | .credit { | ||||
.info { | .info { | ||||
margin-left: 20px ; | margin-left: 20px ; | ||||
color: gray ; | color: gray ; | ||||
} | } | ||||
} | } | ||||
.comment { | |||||
margin-bottom: 20px ; | |||||
} | |||||
} | } | ||||
#specific-delays { | #specific-delays { |