Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

672 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
  311. v-if="(categoryCurrent && categoryCurrent.id == category.id) || category.id == null">
  312. <tr v-for="product in products"
  313. v-if="product.id_product_category == category.id && product.productDistribution && product.productDistribution[0] && product.productDistribution[0].active == 1">
  314. <td class="photo">
  315. <a class="product-photo" :href="product.photo_big" :title="product.name">
  316. <img v-if="product.photo.length" class="photo-product" :src="product.photo"/>
  317. </a>
  318. </td>
  319. <td class="name product-name-description-block">
  320. <span class="name">{{ product.name }}</span>
  321. <span class="other">
  322. <span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
  323. </span>
  324. <div>
  325. <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)"
  326. class="label label-danger">Épuisé</span>
  327. </div>
  328. <div class="description" v-if="product.description.length">
  329. {{ product.description }}
  330. </div>
  331. <div class="description-long" v-if="product.recipe.length">
  332. <a href="javascript:void(0);" class="show-more-link">En savoir
  333. plus</a>
  334. <div class="content">
  335. {{ product.recipe }}
  336. </div>
  337. </div>
  338. </td>
  339. <td class="price-unit">
  340. <template v-if="productHasPrice(product)">
  341. <div>
  342. {{ formatPrice(getBestProductPrice(product.id,
  343. product.quantity_form)) }}<br/>
  344. <span class="unit">{{ product.wording_unit }}</span>
  345. </div>
  346. <div v-if="productHasPriceWithFromQuantity(product)"
  347. class="alert alert-info decreasing-prices">
  348. <ul>
  349. <li v-for="price in product.prices"
  350. v-if="price.from_quantity > 0">
  351. <strong>{{ formatPrice(price.price_with_tax)
  352. }}</strong><br/>à partir de {{
  353. price.from_quantity }} {{ product.wording_unit_ref
  354. }}
  355. </li>
  356. </ul>
  357. </div>
  358. </template>
  359. </td>
  360. <td class="td-quantity">
  361. <template v-if="productHasPrice(product)">
  362. <div class="input-group">
  363. <span class="input-group-btn">
  364. <button class="btn btn-default btn-moins"
  365. type="button"
  366. @click="productQuantityClick(product, product.unit == 'piece' ? -1 : -parseFloat(product.step))"
  367. :disabled="product.quantity_form == 0"><span
  368. class="glyphicon glyphicon-minus"></span></button>
  369. </span>
  370. <input type="text" v-model="product.quantity_form"
  371. class="form-control quantity" readonly="readonly"/>
  372. <span class="input-group-addon">{{ product.unit == 'piece' ? 'p.' : product.unit }}</span>
  373. <span class="input-group-btn">
  374. <button class="btn btn-default btn-plus"
  375. type="button"
  376. @click="productQuantityClick(product, product.unit == 'piece' ? 1 : parseFloat(product.step))"
  377. :disabled="product.quantity_form == product.quantity_remaining && product.quantity_max > 0"><span
  378. class="glyphicon glyphicon-plus"></span></button>
  379. </span>
  380. </div>
  381. </template>
  382. </td>
  383. <td class="price-total">
  384. <template
  385. v-if="productHasPrice(product) && product.quantity_form > 0">
  386. {{ formatPrice(getBestProductPrice(product.id,
  387. product.quantity_form) * (product.quantity_form /
  388. product.coefficient_unit )) }}
  389. </template>
  390. </td>
  391. </tr>
  392. </template>
  393. </template>
  394. <tr class="total">
  395. <td class="summary" colspan="4">
  396. <template v-if="priceTotal() > 0">
  397. <h3>&gt; Résumé</h3>
  398. <ul>
  399. <li v-for="product in products" v-if="product.quantity_form > 0">
  400. <span class="quantity">{{ product.quantity_form }} {{ product.unit == 'piece' ? 'p.' : product.unit }} x</span>
  401. <span class="name">{{ product.name }}</span>
  402. <!--<span class="other">
  403. <span v-if="product.description.length">/</span>
  404. <span class="description">{{ product.description }}</span>-->
  405. <span class="other">
  406. <span v-if="product.weight">({{ product.weight }}&nbsp;g)</span>
  407. </span>
  408. </li>
  409. </ul>
  410. </template>
  411. </td>
  412. <td class="price-total">{{ priceTotal(true) }}</td>
  413. </tr>
  414. </tbody>
  415. </table>
  416. <div id="content-step-payment">
  417. <div>
  418. <div class="delivery">
  419. <div class="delivery-home" v-if="pointSaleActive.is_home_delivery">
  420. <label for="deliver-address">Adresse de livraison</label>
  421. <textarea id="deliver-address" v-model="deliveryAddress" class="form-control"
  422. required="required"></textarea>
  423. </div>
  424. </div>
  425. <div class="comment">
  426. <label for="order-comment">Commentaire</label>
  427. <textarea id="order-comment" v-model="comment" class="form-control"></textarea>
  428. </div>
  429. <template
  430. v-if="producer.credit == 1 && pointSaleActive.credit == 1 && (pointSaleActive.credit_functioning == 'mandatory' || (pointSaleActive.credit_functioning == 'user' && user.credit_active)) && !checkCreditLimit(order) ">
  431. <div class="alert alert-danger">
  432. Vous devez
  433. <template v-if="producer.online_payment == 1"><a
  434. href="<?= \Yii::$app->urlManager->createUrl(['credit/add']) ?>">recharger
  435. votre crédit</a></template>
  436. <template v-else>recharger votre crédit</template>
  437. auprès de votre producteur ou supprimer des produits.</span>
  438. Votre producteur n'autorise pas un crédit inférieur
  439. à <strong>{{ formatPrice(producer.credit_limit) }}</strong>.
  440. </div>
  441. <div class="block-actions">
  442. <a class="btn btn-primary"
  443. href="<?= \Yii::$app->urlManager->createUrl(['site/index']) ?>">Retour à
  444. l'accueil</a>
  445. </div>
  446. </template>
  447. <template v-else>
  448. <div class="credit">
  449. <div v-if="user && producer.credit == 1 && pointSaleActive.credit == 1 && (pointSaleActive.credit_functioning != 'user' || (pointSaleActive.credit_functioning == 'user' && user.credit_active))">
  450. <input type="checkbox" id="use-credit" v-model="useCredit" disabled="disabled"
  451. v-if="pointSaleActive.credit_functioning == 'mandatory' || (pointSaleActive.credit_functioning == 'user' && user.credit_active)"/>
  452. <input type="checkbox" id="use-credit" v-model="useCredit" v-else/> <label
  453. for="use-credit">Utiliser mon Crédit ({{ formatPrice(user.credit)
  454. }})</label>
  455. <div class="info" v-if="useCredit">
  456. <template v-if="order == null || order.amount_paid == 0">
  457. <span v-if="checkCreditLimit(order)">{{ priceTotal(true) }} seront débités</span>
  458. <span v-else>
  459. {{ formatPrice(user.credit) }} seront débités. (Limite de crédit à {{ formatPrice(producer.credit_limit) }})<br/>
  460. Restera {{ formatPrice(priceTotal() - user.credit) }} à régler.
  461. </span>
  462. </template>
  463. <template
  464. v-else-if="order != null && order.amount_paid > 0 && order.amount_paid < priceTotal()">
  465. <span v-if="checkCreditLimit(order)">{{ formatPrice(priceTotal() - order.amount_paid) }} seront débités</span>
  466. <span v-else>
  467. {{ formatPrice(user.credit) }} seront débités. (Limite de crédit à {{ formatPrice(producer.credit_limit) }})<br/>
  468. Restera {{ formatPrice(priceTotal() - order.amount_paid - user.credit) }} à régler.
  469. </span>
  470. </template>
  471. <template v-else-if="order != null && order.amount_paid > priceTotal()">
  472. <span>{{ formatPrice(order.amount_paid - priceTotal()) }} seront remboursés</span>
  473. </template>
  474. </div>
  475. </div>
  476. <div v-else>
  477. <span class="glyphicon glyphicon-chevron-right"></span>
  478. <?php if ($producerModule->isOnlinePaymentActiveAndTypeOrder($producer)): ?>
  479. La commande est à payer en ligne lors de l'étape suivante.
  480. <?php elseif ($producer->option_payment_info && strlen($producer->option_payment_info) > 0): ?>
  481. Confirmez votre commande et retrouvez les informations liées au paiement sur la page suivante.
  482. <?php else: ?>
  483. La commande sera à régler sur place.
  484. <?php endif; ?>
  485. </div>
  486. </div>
  487. <div id="signup-guest" v-if="!user && producer.option_allow_order_guest">
  488. <h3>Informations personnelles</h3>
  489. <form action="#">
  490. <div class="form-group field-signupguest-email required">
  491. <label class="control-label" for="signupguest-email">Email</label>
  492. <input type="email" id="signupguest-email" class="form-control"
  493. name="SignupForm[email]">
  494. <p class="help-block help-block-error"></p>
  495. </div>
  496. <div class="form-group field-signupguest-firstname required">
  497. <label class="control-label" for="signupguest-firstname">Prénom</label>
  498. <input type="text" id="signupguest-firstname" class="form-control"
  499. name="SignupForm[firstname]">
  500. <p class="help-block help-block-error"></p>
  501. </div>
  502. <div class="form-group field-signupguest-lastname required">
  503. <label class="control-label" for="signupguest-lastname">Nom</label>
  504. <input type="text" id="signupguest-lastname" class="form-control"
  505. name="SignupForm[lastname]">
  506. <p class="help-block help-block-error"></p>
  507. </div>
  508. <div class="form-group field-signupguest-phone required">
  509. <label class="control-label" for="signupguest-phone">Téléphone</label>
  510. <input type="text" id="signupguest-phone" class="form-control"
  511. name="SignupForm[phone]">
  512. <p class="help-block help-block-error"></p>
  513. </div>
  514. </form>
  515. </div>
  516. <div class="block-actions">
  517. <button class="btn btn-primary" disabled="disabled" v-if="disableConfirmButton || !oneProductOrdered()">Je
  518. confirme ma commande
  519. </button>
  520. <button class="btn btn-primary" v-else @click="confirmClick">Je confirme ma
  521. commande
  522. </button>
  523. </div>
  524. </template>
  525. </div>
  526. </div>
  527. </div>
  528. <div class="alert alert-warning" v-else>
  529. Aucun produit disponible
  530. </div>
  531. </div>
  532. </div>
  533. </transition>
  534. <transition name="slide">
  535. </transition>
  536. </div>
  537. </div>
  538. <div id="infos" v-if="producer != null && producer.order_infos != null && producer.order_infos.length">
  539. <div class="panel panel-default">
  540. <div class="panel-heading">
  541. <i class="glyphicon glyphicon-info-sign"></i> Informations
  542. </div>
  543. <div class="panel-body">
  544. {{ producer.order_infos }}
  545. </div>
  546. </div>
  547. </div>
  548. <div v-if="producer != null && producer.online_payment && producer.option_online_payment_type == 'credit'"
  549. id="credit-online-payment">
  550. <div class="panel panel-default">
  551. <div class="panel-heading">
  552. <i class="glyphicon glyphicon-euro"></i> Paiement en ligne
  553. <a href="<?= \Yii::$app->urlManager->createUrl(['credit/add']) ?>" class="btn btn-sm btn-default"><i
  554. class="glyphicon glyphicon-credit-card"></i> Créditer mon compte</a>
  555. </div>
  556. <div class="panel-body">
  557. Vous utilisez le crédit pour régler vos commandes ? Simplifiez les paiements avec votre producteur
  558. en créditant votre compte par carte bancaire.
  559. </div>
  560. </div>
  561. </div>
  562. <?php
  563. $producer = GlobalParam::getCurrentProducer();
  564. if ($producerModule->hasSpecificDelays($producer)): ?>
  565. <div id="specific-delays" class="panel panel-default">
  566. <div class="panel-heading">
  567. Délais de commande spécifiques
  568. </div>
  569. <div class="panel-body">
  570. <table class="table table-bordered">
  571. <thead>
  572. <tr>
  573. <th>Jour</th>
  574. <th>Délai</th>
  575. </tr>
  576. </thead>
  577. <?php foreach ($producerModule->getSpecificDelays($producer) as $day => $delay): ?>
  578. <?php if ($delay['order_delay'] && $delay['order_deadline']): ?>
  579. <tr>
  580. <td>
  581. <?php
  582. switch ($day) {
  583. case 'monday':
  584. echo 'Lundi';
  585. break;
  586. case 'tuesday':
  587. echo 'Mardi';
  588. break;
  589. case 'wednesday':
  590. echo 'Mercredi';
  591. break;
  592. case 'thursday':
  593. echo 'Jeudi';
  594. break;
  595. case 'friday':
  596. echo 'Vendredi';
  597. break;
  598. case 'saturday':
  599. echo 'Samedi';
  600. break;
  601. case 'sunday':
  602. echo 'Dimanche';
  603. break;
  604. }
  605. ?>
  606. </td>
  607. <td>
  608. <span><?= $delay['order_delay'] ?> jour<?= ($delay['order_delay'] > 1) ? 's' : '' ?></span>
  609. à l'avance,
  610. avant
  611. <span><?= ($delay['order_deadline'] == 24) ? 'minuit' : $delay['order_deadline'] . 'h'; ?></span>
  612. </td>
  613. </tr>
  614. <?php endif; ?>
  615. <?php endforeach; ?>
  616. </table>
  617. </div>
  618. </div>
  619. <?php endif; ?>
  620. </div>
  621. </div>
  622. <script type="text/x-template" id="template-step-date">
  623. <li id="step-date" :class="'col-md-4'+((step == 'date') ? ' active' : '')+(first ? ' first' : '')">
  624. <button @click="changeStep('date')" :class="'btn '+ (step == 'date' ? 'btn-primary' : 'btn-default')"
  625. :disabled="producer && producer.option_order_entry_point == 'point-sale' && !pointSaleActive">
  626. <span class="button-content"><span class="glyphicon glyphicon-time"></span> Date</span></span>
  627. </button>
  628. <div class="info-step" v-if="dateFormat">
  629. {{ dateFormat }}
  630. </div>
  631. </li>
  632. </script>
  633. <script type="text/x-template" id="template-step-point-sale">
  634. <li id="step-point-sale" :class="'col-md-4'+((step == 'point-sale') ? ' active ' : '')+(first ? ' first' : '')">
  635. <button @click="changeStep('point-sale')"
  636. :class="'btn '+ (step == 'point-sale' ? 'btn-primary' : 'btn-default')"
  637. :disabled="producer && (producer.option_order_entry_point == 'date' && step == 'date')">
  638. <span class="button-content"><span
  639. class="glyphicon glyphicon-map-marker"></span> <?= $producerModule->getPointSaleWording($producer); ?></span>
  640. </button>
  641. <div class="info-step" v-if="pointSaleActive">
  642. {{ pointSaleActive.name }}
  643. </div>
  644. </li>
  645. </script>