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.

260 lines
6.4 KiB

  1. ::use 'design.mtt'::
  2. <div class="col-md-8">
  3. <h2>::_("Last orders")::</h2>
  4. ::if constOrders.length>0::
  5. <div class="article">
  6. <!-- CONSTANT ORDERS -->
  7. <h3>::_("CSA Contracts")::</h3>
  8. ::foreach c constOrders::
  9. <h4>::c.contract.name::</h4>
  10. <table class="table table-bordered table-condensed" >
  11. <tr>
  12. <th>::_("Qty||short version for quantity")::</th>
  13. <th>::_("Product")::</th>
  14. <th><a href="#" data-toggle="tooltip" data-placement="top" title="::_('Unit price including taxes')::">::_("U.P||short version of price per unit")::</a></th>
  15. <th>::_("Sub-total")::</th>
  16. <th>::_("Fees")::</th>
  17. <th>::_("Total")::</th>
  18. <th>::_("Paid")::</th>
  19. </tr>
  20. ::set total = 0::
  21. ::foreach m c.orders::
  22. <tr>
  23. <td>
  24. ::raw m.smartQt::
  25. </td>
  26. <td>
  27. <a href="#" onclick="_.overlay('/shop/productInfo/::m.productId::','::m.productName::')">
  28. <img src="::m.productImage::" style="width:32px;height:32px;" />
  29. ::m.productName::
  30. </a>
  31. ::if m.userName2 != null::
  32. <br /><span class="glyphicon glyphicon-refresh"></span> ::_("Order alternated with")::
  33. ::if user.id == m.userId::
  34. ::m.userName2::
  35. ::else::
  36. ::m.userName::
  37. ::end::
  38. ::end::
  39. </td>
  40. <td>
  41. ::formatNum(m.productPrice)::&nbsp;::currency()::
  42. </td>
  43. <td>
  44. ::formatNum(m.subTotal)::&nbsp;::currency()::
  45. </td>
  46. <td>
  47. <!-- frais -->
  48. ::if m.percentageValue!=null::
  49. <a href="#" data-toggle="tooltip" data-placement="top" title="::m.percentageName:: : ::m.percentageValue:: %">
  50. ::formatNum(m.fees)::&nbsp;::currency()::
  51. </a>
  52. ::end::
  53. </td>
  54. <td>
  55. <!-- total -->
  56. ::formatNum(m.total)::&nbsp;::currency()::
  57. ::set total = total + m.total::
  58. </td>
  59. <td>
  60. ::if m.paid==true::
  61. <span style="color:#00AA00;">::_("Paid")::</span>
  62. ::else::
  63. <span style="color:#DD0000;">::_("Unpaid")::</span>
  64. ::end::
  65. </td>
  66. </tr>
  67. ::end::
  68. <tr>
  69. <td colspan="7" class="text-right">
  70. <b>Total :
  71. ::formatNum(total)::&nbsp;::currency()::</b>
  72. ::set d = c.contract.getDistribs(false,null).length::
  73. ( soit ::formatNum(d*total)::&nbsp;::currency():: pour ::d:: livraisons )
  74. </td>
  75. </tr>
  76. </table>
  77. ::end::
  78. </div>
  79. ::end::
  80. <!-- VARYING ORDERS -->
  81. ::if count(varOrders)>0::
  82. <div class="article">
  83. ::foreach d varOrders::
  84. <h4>::_("Order delivered on"):: ::hDate(d.date)::</h4>
  85. <table class="table table-bordered table-condensed" >
  86. <tr>
  87. <th>::_("Qty||short version for quantity")::</th>
  88. <th>::_("Product")::</th>
  89. <th><a href="#" data-toggle="tooltip" data-placement="top" title="::_('Unit price including taxes')::">::_("U.P||short version of price per unit")::</a></th>
  90. <th>::_("Sub-total")::</th>
  91. <th>::_("Fees")::</th>
  92. <th>::_("Total")::</th>
  93. <th>::_("Paid")::</th>
  94. </tr>
  95. ::set total = 0::
  96. ::foreach o d.orders::
  97. <tr>
  98. <td>
  99. ::raw o.smartQt::
  100. </td>
  101. <td>
  102. <a href="#" onclick="_.overlay('/shop/productInfo/::o.productId::','::o.productName::')">
  103. <img src="::o.productImage::" style="width:32px;height:32px;" />
  104. ::o.productName::
  105. </a>
  106. </td>
  107. <td>
  108. ::formatNum(o.productPrice)::&nbsp;::currency()::
  109. </td>
  110. <td>
  111. ::formatNum(o.subTotal)::&nbsp;::currency()::
  112. </td>
  113. <td>
  114. $$nullSafe(::formatNum(o.fees)::)
  115. </td>
  116. <td>
  117. ::formatNum(o.total)::&nbsp;::currency()::
  118. ::set total = total + o.total::
  119. </td>
  120. <td>
  121. ::if o.paid==true::
  122. <span style="color:#00AA00;">::_("Paid")::</span>
  123. ::else::
  124. <span style="color:#DD0000;">::_("Unpaid")::</span>
  125. ::end::
  126. </td>
  127. </tr>
  128. ::end::
  129. <tr>
  130. <td colspan="4">
  131. ::if !user._amap.hasPayments()::
  132. $$edit(Modifier cette commande,/contract/editOrderByDate/::d.date::)
  133. ::end::
  134. </td>
  135. <td>TOTAL</td>
  136. <td><b>::formatNum(total)::&nbsp;::currency()::</b></td>
  137. </tr>
  138. </table>
  139. ::end::
  140. </div>
  141. ::end::
  142. </div>
  143. <div class="col-md-4">
  144. <h3>::_("Profile")::</h3>
  145. <div class="article">
  146. <p>
  147. $$contact(::user::)
  148. </p>
  149. <div class="pull-right">
  150. <a href="/account/quit?token=::token::" class="btn btn-default btn-sm" $$confirm(::_("Do you really want to quit this group ? You won't be a member anymore: you won't receive any new message and won't be able to see your previous orders in this group.")::)>
  151. <span class="glyphicon glyphicon-remove"></span>
  152. ::_("Leave this group")::
  153. </a>
  154. </div>
  155. $$edit(::_("Edit")::,/account/edit)
  156. </div>
  157. ::if user.getAmap().hasPayments()::
  158. <h3>::_("Payments")::</h3>
  159. <div class="article">
  160. <span style="font-size:1.3em;">
  161. ::_("Balance"):: :
  162. ::if userAmap.balance<0::
  163. ::set color = "C00"::
  164. ::else::
  165. ::set color = "0C0"::
  166. ::end::
  167. <span style="color:#::color::;">
  168. ::userAmap.balance:: ::currency()::
  169. </span>
  170. </span>
  171. <span style="margin-left:30px;">
  172. <a href="/account/payments" class="btn btn-default btn-small">
  173. <i class="fa fa-credit-card" aria-hidden="true"></i>
  174. ::_("Payments details")::
  175. </a>
  176. </span>
  177. </div>
  178. ::end::
  179. ::if user.isAmapManager()::
  180. <h3>::_("Tutorials")::</h3>
  181. <div class="article">
  182. <table class="table">
  183. ::foreach t tutos::
  184. <tr>
  185. <td>::t.name::</td>
  186. <td>
  187. ::if t.completion==null::
  188. <a href="/contract/?startTuto=::t.key::" class="btn btn-default btn-xs">
  189. <span class="glyphicon glyphicon-play"></span> ::_("Start")::
  190. </a>
  191. ::else::
  192. <a href="/contract/?stopTuto=::t.key::" class="btn btn-primary btn-xs">
  193. <span class="glyphicon glyphicon-remove"></span> ::_("Stop")::
  194. </a>
  195. ::end::
  196. </td>
  197. </tr>
  198. ::end::
  199. </table>
  200. ::if stopTuto::
  201. <div id="stopTuto" data-toggle="popover" title='::_("Tutorial stopped")::' data-placement="left" data-content="::_("You'll be able to restart it here.")::" ></div>
  202. <script>
  203. $(function(){
  204. setTimeout(function() { $("#stopTuto").popover("show"); }, 1000);
  205. });
  206. </script>
  207. ::end::
  208. </div>
  209. ::end::
  210. <h3>::_("Language")::</h3>
  211. <div class="article">
  212. ::_("Display the interface in another language"):: (beta)
  213. :
  214. <ul>
  215. ::raw langLinks::
  216. </ul>
  217. <p>
  218. ::_("Current language is")::
  219. <b>
  220. ::langText::
  221. </b>
  222. </p>
  223. </div>
  224. </div>
  225. ::end::