Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

671 lines
45KB

  1. <?php
  2. /**
  3. * Copyright distrib (2018)
  4. *
  5. * contact@opendistrib.net
  6. *
  7. * Ce logiciel est un programme informatique servant à aider les producteurs
  8. * à distribuer leur production en circuits courts.
  9. *
  10. * Ce logiciel est régi par la licence CeCILL soumise au droit français et
  11. * respectant les principes de diffusion des logiciels libres. Vous pouvez
  12. * utiliser, modifier et/ou redistribuer ce programme sous les conditions
  13. * de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
  14. * sur le site "http://www.cecill.info".
  15. *
  16. * En contrepartie de l'accessibilité au code source et des droits de copie,
  17. * de modification et de redistribution accordés par cette licence, il n'est
  18. * offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons,
  19. * seule une responsabilité restreinte pèse sur l'auteur du programme, le
  20. * titulaire des droits patrimoniaux et les concédants successifs.
  21. *
  22. * A cet égard l'attention de l'utilisateur est attirée sur les risques
  23. * associés au chargement, à l'utilisation, à la modification et/ou au
  24. * développement et à la reproduction du logiciel par l'utilisateur étant
  25. * donné sa spécificité de logiciel libre, qui peut le rendre complexe à
  26. * manipuler et qui le réserve donc à des développeurs et des professionnels
  27. * avertis possédant des connaissances informatiques approfondies. Les
  28. * utilisateurs sont donc invités à charger et tester l'adéquation du
  29. * logiciel à leurs besoins dans des conditions permettant d'assurer la
  30. * sécurité de leurs systèmes et ou de leurs données et, plus généralement,
  31. * à l'utiliser et l'exploiter dans les mêmes conditions de sécurité.
  32. *
  33. * Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
  34. * pris connaissance de la licence CeCILL, et que vous en avez accepté les
  35. * termes.
  36. */
  37. use common\helpers\GlobalParam;
  38. use common\logic\Distribution\Distribution\Module\DistributionModule;
  39. use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution;
  40. use common\logic\Producer\Producer\Model\Producer;
  41. use common\logic\Producer\Producer\Module\ProducerModule;
  42. \producer\assets\VuejsOrderOrderAsset::register($this);
  43. $distributionModule =DistributionModule::getInstance();
  44. $producerModule = ProducerModule::getInstance();
  45. $producer = $this->context->getProducerCurrent();
  46. $this->setTitle('Commander');
  47. ?>
  48. <script>
  49. var appInitValues = {
  50. urlLogin: '<?= \Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer', 'id' => $this->context->getProducerCurrent()->id, 'return_url' => \Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/order', 'slug_producer' => $this->context->getProducerCurrent()->slug])]) ?>',
  51. producerOptionOrderEntryPoint: '<?= $producer->option_order_entry_point ?>',
  52. <?php if (isset($order)): ?>pointSaleActiveId: <?= $order->id_point_sale ?><?php endif; ?>
  53. };
  54. </script>
  55. <div id="app-order-order" :class="{'loaded': !loadingInit}">
  56. <?php if (isset($order)): ?>
  57. <span id="order-distribution-date"><?= $order->distribution->date; ?></span>
  58. <?php endif; ?>
  59. <?php if (isset($date)): ?>
  60. <span id="distribution-date"><?= $date; ?></span>
  61. <?php endif; ?>
  62. <div v-if="loadingInit">
  63. Chargement ...
  64. </div>
  65. <div class="wrapper">
  66. <div v-if="!loadingInit && distributions.length == 0" class="alert alert-warning">
  67. Aucune distribution à venir chez ce producteur.
  68. </div>
  69. <div v-else>
  70. <div id="steps">
  71. <ul>
  72. <?php if ($producer->option_order_entry_point == Producer::ORDER_ENTRY_POINT_DATE): ?>
  73. <step-date
  74. first="true"
  75. :step="step"
  76. :point-sale-active="pointSaleActive"
  77. :date-format="dateFormat"
  78. :change-step="changeStep"
  79. :producer="producer"
  80. ></step-date>
  81. <step-point-sale
  82. :step="step"
  83. :point-sale-active="pointSaleActive"
  84. :change-step="changeStep"
  85. :producer="producer"
  86. ></step-point-sale>
  87. <?php else: ?>
  88. <step-point-sale
  89. first="true"
  90. :step="step"
  91. :point-sale-active="pointSaleActive"
  92. :change-step="changeStep"
  93. :producer="producer"
  94. ></step-point-sale>
  95. <step-date
  96. :step="step"
  97. :point-sale-active="pointSaleActive"
  98. :date-format="dateFormat"
  99. :change-step="changeStep"
  100. :producer="producer"
  101. ></step-date>
  102. <?php endif; ?>
  103. <li id="step-products" :class="'col-md-4 '+((step == 'products') ? 'active ' : '')">
  104. <button @click="changeStep('products')"
  105. :class="'btn '+ (step == 'products' ? 'btn-primary' : 'btn-default')"
  106. :disabled="step == 'date' || step == 'point-sale'">
  107. <span class="button-content"><span
  108. class="glyphicon glyphicon-th-list"></span> Produits</span>
  109. </button>
  110. <div class="info-step" v-if="oneProductOrdered()">
  111. {{ countProductOrdered() }} produit{{ (countProductOrdered() > 1) ? 's' : '' }}
  112. </div>
  113. </li>
  114. <!--<li id="step-payment" :class="'col-md-3 '+((step == 'payment') ? 'active' : '')">
  115. <button @click="changeStep('payment')"
  116. :class="'btn '+ (step == 'payment' ? 'btn-primary' : 'btn-default')"
  117. :disabled="step == 'date' || step == 'point-sale' || step == 'products'">
  118. <span class="button-content"><span
  119. class="glyphicon glyphicon-ok"></span> Confirmation</span>
  120. </button>
  121. </li>-->
  122. </ul>
  123. <div class="clr"></div>
  124. </div>
  125. <div class="content">
  126. <div v-if="errors && errors.length" class="alert alert-danger">
  127. <ul>
  128. <li v-for="error in errors">
  129. <div v-html="error"></div>
  130. </li>
  131. </ul>
  132. </div>
  133. <div v-else-if="loading && step != 'payment'">
  134. Chargement ...
  135. </div>
  136. <transition name="slide">
  137. <div id="content-step-date" v-if="step == 'date'">
  138. <div v-if="!loading">
  139. <?php if ($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST): ?>
  140. <div style="display:none ;">
  141. <?php endif; ?>
  142. <div id="legend">
  143. <div><span id="distribution-date-color"></span> Prochains jours de distribution
  144. </div>
  145. <div><span id="order-date-color"></span> Vos commandes déjà enregistrées</div>
  146. </div>
  147. <div id="calendar">
  148. <v-calendar
  149. is-inline
  150. is-expanded
  151. v-model="date"
  152. mode="single"
  153. color="green"
  154. :columns="calendar.columns"
  155. :formats="calendar.formats"
  156. :theme-styles="calendar.themeStyles"
  157. :attributes="calendar.attrs"
  158. :available-dates="calendar.availableDates"
  159. @dayclick='dayClick'
  160. ></v-calendar>
  161. </div>
  162. <?php if ($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST): ?>
  163. </div>
  164. <?php endif; ?>
  165. <?php if ($producer->behavior_order_select_distribution == Producer::BEHAVIOR_ORDER_SELECT_DISTRIBUTION_LIST): ?>
  166. <div id="distributions-list">
  167. <?php $incomingDistributions = $distributionModule->findDistributionsIncoming(); ?>
  168. <?php foreach ($incomingDistributions as $distribution): ?>
  169. <?php
  170. $pointSaleDistributions = PointSaleDistribution::searchAll([
  171. 'id_distribution' => $distribution->id,
  172. 'delivery' => 1
  173. ], []);
  174. ?>
  175. <div class="panel panel-default">
  176. <div class="panel-body">
  177. <button class="btn btn-primary" @click="dayClickList"
  178. data-distribution-date="<?= $distribution->date . ' 00:00:00' ?>">
  179. Sélectionner cette distribution
  180. </button>
  181. <span class="date"><?= ucfirst(strftime('%A %d %B', strtotime($distribution->date))); ?></span>
  182. <?php
  183. if ($pointSaleDistributions && count($pointSaleDistributions) > 0) {
  184. echo '<div class="point-sales">';
  185. foreach ($pointSaleDistributions as $pointSaleDistribution) {
  186. if ($pointSaleDistribution->pointSale->status == 1) {
  187. echo $pointSaleDistribution->pointSale->name . '';
  188. if (strlen($pointSaleDistribution->pointSale->locality)) {
  189. echo ' (' . $pointSaleDistribution->pointSale->locality . ')';
  190. }
  191. echo '<br />';
  192. }
  193. }
  194. echo '</div>';
  195. }
  196. ?>
  197. </div>
  198. </div>
  199. <?php endforeach; ?>
  200. </div>
  201. <?php endif; ?>
  202. </div>
  203. </div>
  204. </transition>
  205. <transition name="slide">
  206. <div id="content-step-point-sale" v-if="step == 'point-sale'">
  207. <div v-if="!loading">
  208. <h3>Où souhaitez-vous récupérer votre commande ?</h3>
  209. <table id="points-sale" class="table table-bordered" v-if="pointsSale.length">
  210. <thead>
  211. <tr>
  212. <th>Nom</th>
  213. <th>Localité</th>
  214. <th></th>
  215. </tr>
  216. </thead>
  217. <tbody>
  218. <tr v-for="pointSale in orderedPointsSale"
  219. v-if="pointSale && (producer.option_order_entry_point == 'point-sale' || (producer.option_order_entry_point == 'date' && pointSale.pointSaleDistribution.delivery))"
  220. :class="(pointSaleActive && pointSale.id == pointSaleActive.id) ? 'selected' : ''">
  221. <td class="name">
  222. <span class="the-name">{{ pointSale.name }}</span>
  223. <div class="comment" v-if="pointSale.userPointSale">
  224. {{ pointSale.userPointSale.comment }}
  225. </div>
  226. <div class="comment" v-if="pointSale.infos && pointSale.infos.length > 0"
  227. v-html="pointSale.infos"></div>
  228. <div class="minimum-order-amount" v-if="pointSale.minimum_order_amount">
  229. Montant minimum de commande : {{ formatPrice(pointSale.minimum_order_amount) }}
  230. </div>
  231. </td>
  232. <td class="locality">{{ pointSale.locality }}</td>
  233. <td class="actions">
  234. <template
  235. v-if="(order == null || order.id_point_sale != pointSale.id) && pointSale.maximum_number_orders && pointSale.count_orders && pointSale.count_orders >= pointSale.maximum_number_orders">
  236. <span class="label label-default">
  237. <template v-if="pointSale.is_bread_box">
  238. Déjà réservée
  239. </template>
  240. <template v-else>
  241. Maximum de commande atteint
  242. </template>
  243. </span>
  244. </template>
  245. <template v-else>
  246. <div :class="'form-group' + (pointSale.invalid_code ? ' has-error' : '')">
  247. <div class="input-group"
  248. v-if="pointSale.code && pointSale.code.length > 0">
  249. <span class="input-group-addon"><span
  250. class="glyphicon glyphicon-lock"></span></span>
  251. <input v-model="pointsSaleCodes[pointSale.id]" type="password"
  252. placeholder="Code" class="form-control input-code"/>
  253. </div>
  254. </div>
  255. <div v-if="!user && producer.credit == 1 && pointSale.credit == 1">
  256. <a :href="urlLogin" class="btn btn-default">
  257. <span class="glyphicon glyphicon-log-in"></span>
  258. Connexion obligatoire
  259. </a>
  260. </div>
  261. <div v-else>
  262. <button class="btn btn-primary" @click="pointSaleClick"
  263. :data-code="pointSale.code && pointSale.code.length > 0"
  264. :data-id-point-sale="pointSale.id">
  265. <span class="glyphicon glyphicon-map-marker"></span>
  266. Choisir
  267. </button>
  268. </div>
  269. </template>
  270. </td>
  271. </tr>
  272. </tbody>
  273. </table>
  274. <div class="alert alert-warning" v-else>
  275. Aucun point de vente disponible pour ce jour de distribution.
  276. </div>
  277. </div>
  278. </div>
  279. </transition>
  280. <transition name="slide">
  281. <div id="content-step-products" v-if="step == 'products'">
  282. <div v-if="!loading">
  283. <div v-if="products.length">
  284. <table id="products" class="table table-bordered">
  285. <thead>
  286. <tr>
  287. <th class="photo">Photo</th>
  288. <th class="name">Nom</th>
  289. <th class="price">Prix unitaire</th>
  290. <th class="quantity">Quantité</th>
  291. <th class="total">Total</th>
  292. </tr>
  293. </thead>
  294. <tbody>
  295. <template v-for="category in categories">
  296. <tr v-if="category.id && countProductsByCategory(category)">
  297. <td class="category-name" colspan="5" @click="setCategoryCurrent(category)">
  298. <span v-if="categoryCurrent && categoryCurrent.id == category.id"
  299. class="glyphicon glyphicon-triangle-bottom"></span>
  300. <span v-else class="glyphicon glyphicon-triangle-right"></span>
  301. {{ category.name }}
  302. <span class="label label-default">{{ countProductsByCategory(category) }} produit<template
  303. v-if="countProductsByCategory(category) > 1">s</template></span>
  304. <span v-if="countSelectedProductsByCategory(category) > 0"
  305. class="label label-success">{{ countSelectedProductsByCategory(category) }} produit<template
  306. v-if="countSelectedProductsByCategory(category) > 1">s</template> sélectionné<template
  307. v-if="countSelectedProductsByCategory(category) > 1">s</template></span>
  308. </td>
  309. </tr>
  310. <template v-if="(categoryCurrent && categoryCurrent.id == category.id) || category.id == null">
  311. <tr v-for="product in products"
  312. v-if="product.id_product_category == category.id && isProductAvailable(product)">
  313. <td class="photo">
  314. <a class="product-photo" :href="product.photo_big" :title="product.name">
  315. <img v-if="product.photo.length" class="photo-product" :src="product.photo"/>
  316. </a>
  317. </td>
  318. <td class="name product-name-description-block">
  319. <span class="name">{{ product.name }}</span>
  320. <span class="other">
  321. <span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
  322. </span>
  323. <div>
  324. <span v-if="product.quantity_max > 0 && ((product.quantity_form / product.coefficient_unit == product.quantity_remaining) || ((product.quantity_remaining * product.coefficient_unit) - product.quantity_form) < product.step)"
  325. class="label label-danger">Épuisé</span>
  326. </div>
  327. <div class="description" v-if="product.description.length">
  328. {{ product.description }}
  329. </div>
  330. <div class="description-long" v-if="product.recipe.length">
  331. <a href="javascript:void(0);" class="show-more-link">En savoir
  332. plus</a>
  333. <div class="content">
  334. {{ product.recipe }}
  335. </div>
  336. </div>
  337. </td>
  338. <td class="price-unit">
  339. <template v-if="productHasPrice(product)">
  340. <div>
  341. {{ formatPrice(getBestProductPrice(product.id,
  342. product.quantity_form)) }}<br/>
  343. <span class="unit">{{ product.wording_unit }}</span>
  344. </div>
  345. <div v-if="productHasPriceWithFromQuantity(product)"
  346. class="alert alert-info decreasing-prices">
  347. <ul>
  348. <li v-for="price in product.prices"
  349. v-if="price.from_quantity > 0">
  350. <strong>{{ formatPrice(price.price_with_tax)
  351. }}</strong><br/>à partir de {{
  352. price.from_quantity }} {{ product.wording_unit_ref
  353. }}
  354. </li>
  355. </ul>
  356. </div>
  357. </template>
  358. </td>
  359. <td class="td-quantity">
  360. <template v-if="productHasPrice(product)">
  361. <div class="input-group">
  362. <span class="input-group-btn">
  363. <button class="btn btn-default btn-moins"
  364. type="button"
  365. @click="productQuantityClick(product, product.unit == 'piece' ? -1 : -parseFloat(product.step))"
  366. :disabled="product.quantity_form == 0"><span
  367. class="glyphicon glyphicon-minus"></span></button>
  368. </span>
  369. <input type="text" v-model="product.quantity_form"
  370. class="form-control quantity" readonly="readonly"/>
  371. <span class="input-group-addon">{{ product.unit == 'piece' ? 'p.' : product.unit }}</span>
  372. <span class="input-group-btn">
  373. <button class="btn btn-default btn-plus"
  374. type="button"
  375. @click="productQuantityClick(product, product.unit == 'piece' ? 1 : parseFloat(product.step))"
  376. :disabled="product.quantity_form == product.quantity_remaining && product.quantity_max > 0"><span
  377. class="glyphicon glyphicon-plus"></span></button>
  378. </span>
  379. </div>
  380. </template>
  381. </td>
  382. <td class="price-total">
  383. <template
  384. v-if="productHasPrice(product) && product.quantity_form > 0">
  385. {{ formatPrice(getBestProductPrice(product.id,
  386. product.quantity_form) * (product.quantity_form /
  387. product.coefficient_unit )) }}
  388. </template>
  389. </td>
  390. </tr>
  391. </template>
  392. </template>
  393. <tr class="total">
  394. <td class="summary" colspan="4">
  395. <template v-if="priceTotal() > 0">
  396. <h3>&gt; Résumé</h3>
  397. <ul>
  398. <li v-for="product in products" v-if="product.quantity_form > 0">
  399. <span class="quantity">{{ product.quantity_form }} {{ product.unit == 'piece' ? 'p.' : product.unit }} x</span>
  400. <span class="name">{{ product.name }}</span>
  401. <!--<span class="other">
  402. <span v-if="product.description.length">/</span>
  403. <span class="description">{{ product.description }}</span>-->
  404. <span class="other">
  405. <span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
  406. </span>
  407. </li>
  408. </ul>
  409. </template>
  410. </td>
  411. <td class="price-total">{{ priceTotal(true) }}</td>
  412. </tr>
  413. </tbody>
  414. </table>
  415. <div id="content-step-payment">
  416. <div>
  417. <div class="delivery">
  418. <div class="delivery-home" v-if="pointSaleActive.is_home_delivery">
  419. <label for="deliver-address">Adresse de livraison</label>
  420. <textarea id="deliver-address" v-model="deliveryAddress" class="form-control"
  421. required="required"></textarea>
  422. </div>
  423. </div>
  424. <div class="comment">
  425. <label for="order-comment">Commentaire</label>
  426. <textarea id="order-comment" v-model="comment" class="form-control"></textarea>
  427. </div>
  428. <template
  429. v-if="producer.credit == 1 && pointSaleActive.credit == 1 && (pointSaleActive.credit_functioning == 'mandatory' || (pointSaleActive.credit_functioning == 'user' && user.credit_active)) && !checkCreditLimit(order) ">
  430. <div class="alert alert-danger">
  431. Vous devez
  432. <template v-if="producer.online_payment == 1"><a
  433. href="<?= \Yii::$app->urlManager->createUrl(['credit/add']) ?>">recharger
  434. votre crédit</a></template>
  435. <template v-else>recharger votre crédit</template>
  436. auprès de votre producteur ou supprimer des produits.</span>
  437. Votre producteur n'autorise pas un crédit inférieur
  438. à <strong>{{ formatPrice(producer.credit_limit) }}</strong>.
  439. </div>
  440. <div class="block-actions">
  441. <a class="btn btn-primary"
  442. href="<?= \Yii::$app->urlManager->createUrl(['site/index']) ?>">Retour à
  443. l'accueil</a>
  444. </div>
  445. </template>
  446. <template v-else>
  447. <div class="credit">
  448. <div v-if="user && producer.credit == 1 && pointSaleActive.credit == 1 && (pointSaleActive.credit_functioning != 'user' || (pointSaleActive.credit_functioning == 'user' && user.credit_active))">
  449. <input type="checkbox" id="use-credit" v-model="useCredit" disabled="disabled"
  450. v-if="pointSaleActive.credit_functioning == 'mandatory' || (pointSaleActive.credit_functioning == 'user' && user.credit_active)"/>
  451. <input type="checkbox" id="use-credit" v-model="useCredit" v-else/> <label
  452. for="use-credit">Utiliser mon Crédit ({{ formatPrice(user.credit)
  453. }})</label>
  454. <div class="info" v-if="useCredit">
  455. <template v-if="order == null || order.amount_paid == 0">
  456. <span v-if="checkCreditLimit(order)">{{ priceTotal(true) }} seront débités</span>
  457. <span v-else>
  458. {{ formatPrice(user.credit) }} seront débités. (Limite de crédit à {{ formatPrice(producer.credit_limit) }})<br/>
  459. Restera {{ formatPrice(priceTotal() - user.credit) }} à régler.
  460. </span>
  461. </template>
  462. <template
  463. v-else-if="order != null && order.amount_paid > 0 && order.amount_paid < priceTotal()">
  464. <span v-if="checkCreditLimit(order)">{{ formatPrice(priceTotal() - order.amount_paid) }} seront débités</span>
  465. <span v-else>
  466. {{ formatPrice(user.credit) }} seront débités. (Limite de crédit à {{ formatPrice(producer.credit_limit) }})<br/>
  467. Restera {{ formatPrice(priceTotal() - order.amount_paid - user.credit) }} à régler.
  468. </span>
  469. </template>
  470. <template v-else-if="order != null && order.amount_paid > priceTotal()">
  471. <span>{{ formatPrice(order.amount_paid - priceTotal()) }} seront remboursés</span>
  472. </template>
  473. </div>
  474. </div>
  475. <div v-else>
  476. <span class="glyphicon glyphicon-chevron-right"></span>
  477. <?php if ($producerModule->isOnlinePaymentActiveAndTypeOrder($producer)): ?>
  478. La commande est à payer en ligne lors de l'étape suivante.
  479. <?php elseif ($producer->option_payment_info && strlen($producer->option_payment_info) > 0): ?>
  480. Confirmez votre commande et retrouvez les informations liées au paiement sur la page suivante.
  481. <?php else: ?>
  482. La commande sera à régler sur place.
  483. <?php endif; ?>
  484. </div>
  485. </div>
  486. <div id="signup-guest" v-if="!user && producer.option_allow_order_guest">
  487. <h3>Informations personnelles</h3>
  488. <form action="#">
  489. <div class="form-group field-signupguest-email required">
  490. <label class="control-label" for="signupguest-email">Email</label>
  491. <input type="email" id="signupguest-email" class="form-control"
  492. name="SignupForm[email]">
  493. <p class="help-block help-block-error"></p>
  494. </div>
  495. <div class="form-group field-signupguest-firstname required">
  496. <label class="control-label" for="signupguest-firstname">Prénom</label>
  497. <input type="text" id="signupguest-firstname" class="form-control"
  498. name="SignupForm[firstname]">
  499. <p class="help-block help-block-error"></p>
  500. </div>
  501. <div class="form-group field-signupguest-lastname required">
  502. <label class="control-label" for="signupguest-lastname">Nom</label>
  503. <input type="text" id="signupguest-lastname" class="form-control"
  504. name="SignupForm[lastname]">
  505. <p class="help-block help-block-error"></p>
  506. </div>
  507. <div class="form-group field-signupguest-phone required">
  508. <label class="control-label" for="signupguest-phone">Téléphone</label>
  509. <input type="text" id="signupguest-phone" class="form-control"
  510. name="SignupForm[phone]">
  511. <p class="help-block help-block-error"></p>
  512. </div>
  513. </form>
  514. </div>
  515. <div class="block-actions">
  516. <button class="btn btn-primary" disabled="disabled" v-if="disableConfirmButton || !oneProductOrdered()">Je
  517. confirme ma commande
  518. </button>
  519. <button class="btn btn-primary" v-else @click="confirmClick">Je confirme ma
  520. commande
  521. </button>
  522. </div>
  523. </template>
  524. </div>
  525. </div>
  526. </div>
  527. <div class="alert alert-warning" v-else>
  528. Aucun produit disponible
  529. </div>
  530. </div>
  531. </div>
  532. </transition>
  533. <transition name="slide">
  534. </transition>
  535. </div>
  536. </div>
  537. <div id="infos" v-if="producer != null && producer.order_infos != null && producer.order_infos.length">
  538. <div class="panel panel-default">
  539. <div class="panel-heading">
  540. <i class="glyphicon glyphicon-info-sign"></i> Informations
  541. </div>
  542. <div class="panel-body">
  543. {{ producer.order_infos }}
  544. </div>
  545. </div>
  546. </div>
  547. <div v-if="producer != null && producer.online_payment && producer.option_online_payment_type == 'credit'"
  548. id="credit-online-payment">
  549. <div class="panel panel-default">
  550. <div class="panel-heading">
  551. <i class="glyphicon glyphicon-euro"></i> Paiement en ligne
  552. <a href="<?= \Yii::$app->urlManager->createUrl(['credit/add']) ?>" class="btn btn-sm btn-default"><i
  553. class="glyphicon glyphicon-credit-card"></i> Créditer mon compte</a>
  554. </div>
  555. <div class="panel-body">
  556. Vous utilisez le crédit pour régler vos commandes ? Simplifiez les paiements avec votre producteur
  557. en créditant votre compte par carte bancaire.
  558. </div>
  559. </div>
  560. </div>
  561. <?php
  562. $producer = GlobalParam::getCurrentProducer();
  563. if ($producerModule->hasSpecificDelays($producer)): ?>
  564. <div id="specific-delays" class="panel panel-default">
  565. <div class="panel-heading">
  566. Délais de commande spécifiques
  567. </div>
  568. <div class="panel-body">
  569. <table class="table table-bordered">
  570. <thead>
  571. <tr>
  572. <th>Jour</th>
  573. <th>Délai</th>
  574. </tr>
  575. </thead>
  576. <?php foreach ($producerModule->getSpecificDelays($producer) as $day => $delay): ?>
  577. <?php if ($delay['order_delay'] && $delay['order_deadline']): ?>
  578. <tr>
  579. <td>
  580. <?php
  581. switch ($day) {
  582. case 'monday':
  583. echo 'Lundi';
  584. break;
  585. case 'tuesday':
  586. echo 'Mardi';
  587. break;
  588. case 'wednesday':
  589. echo 'Mercredi';
  590. break;
  591. case 'thursday':
  592. echo 'Jeudi';
  593. break;
  594. case 'friday':
  595. echo 'Vendredi';
  596. break;
  597. case 'saturday':
  598. echo 'Samedi';
  599. break;
  600. case 'sunday':
  601. echo 'Dimanche';
  602. break;
  603. }
  604. ?>
  605. </td>
  606. <td>
  607. <span><?= $delay['order_delay'] ?> jour<?= ($delay['order_delay'] > 1) ? 's' : '' ?></span>
  608. à l'avance,
  609. avant
  610. <span><?= ($delay['order_deadline'] == 24) ? 'minuit' : $delay['order_deadline'] . 'h'; ?></span>
  611. </td>
  612. </tr>
  613. <?php endif; ?>
  614. <?php endforeach; ?>
  615. </table>
  616. </div>
  617. </div>
  618. <?php endif; ?>
  619. </div>
  620. </div>
  621. <script type="text/x-template" id="template-step-date">
  622. <li id="step-date" :class="'col-md-4'+((step == 'date') ? ' active' : '')+(first ? ' first' : '')">
  623. <button @click="changeStep('date')" :class="'btn '+ (step == 'date' ? 'btn-primary' : 'btn-default')"
  624. :disabled="producer && producer.option_order_entry_point == 'point-sale' && !pointSaleActive">
  625. <span class="button-content"><span class="glyphicon glyphicon-time"></span> Date</span></span>
  626. </button>
  627. <div class="info-step" v-if="dateFormat">
  628. {{ dateFormat }}
  629. </div>
  630. </li>
  631. </script>
  632. <script type="text/x-template" id="template-step-point-sale">
  633. <li id="step-point-sale" :class="'col-md-4'+((step == 'point-sale') ? ' active ' : '')+(first ? ' first' : '')">
  634. <button @click="changeStep('point-sale')"
  635. :class="'btn '+ (step == 'point-sale' ? 'btn-primary' : 'btn-default')"
  636. :disabled="producer && (producer.option_order_entry_point == 'date' && step == 'date')">
  637. <span class="button-content"><span
  638. class="glyphicon glyphicon-map-marker"></span> <?= $producerModule->getPointSaleWording($producer); ?></span>
  639. </button>
  640. <div class="info-step" v-if="pointSaleActive">
  641. {{ pointSaleActive.name }}
  642. </div>
  643. </li>
  644. </script>