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.

order.php 38KB

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