You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

578 lines
41KB

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