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.

252 lines
6.4 KiB

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>::_("Attendance sheet")::</title>
  6. <link href="/css/print.css" rel="stylesheet"/>
  7. </head>
  8. <body>
  9. <h1>::user._amap.name::</h1>
  10. <h2>Livraison du ::hDate(date)::</h2>
  11. <table style="width:100%;">
  12. ::set name = ""::
  13. ::set name2 = ""::
  14. ::set total = 0::
  15. ::set productNum = 0::
  16. <tr>
  17. <th>::_("Name")::</th>
  18. <th>::_("Contact details")::</th>
  19. <th>::_("Qty")::</th>
  20. <th>::_("Product")::</th>
  21. <th>::_("U.P.")::</th>
  22. <th>::_("Fees")::</th>
  23. <th>::_("Total")::</th>
  24. <th>::_("Signature")::</th>
  25. </tr>
  26. ::foreach m orders::
  27. ::if m.userName != name || m.userName2 != name2::
  28. ::set class="name"::
  29. ::else::
  30. ::set class=""::
  31. ::end::
  32. <tr class="::class::">
  33. <td>
  34. ::if m.userName != name || m.userName2 != name2::
  35. ::set basket = getBasket(m.userId,place.id,date)::
  36. <span ::cond basket!=null::>::_("Num"):: ::basket.num:: - </span>
  37. <b>::m.userName::</b>
  38. ::if m.userName2 != null::
  39. <br />::_("alternately with"):: <b>::m.userName2::</b>
  40. ::end::
  41. ::set total = 0::
  42. ::set productNum = 0::
  43. ::end::
  44. </td>
  45. <td>
  46. ::if m.userName != name || m.userName2 != name2::
  47. ::set u = getUser(m.userId):
  48. ::if u !=null::
  49. $$nullSafe(::u.phone::)
  50. ::end::
  51. ::if m.userName2 != null::
  52. ::set u = getUser(m.userId2):
  53. ::if u !=null::
  54. <br />$$nullSafe(::u.phone::)
  55. ::end::
  56. ::end::
  57. ::end::
  58. </td>
  59. ::set name = m.userName ::
  60. ::set name2 = m.userName2 ::
  61. <td>
  62. ::if(m.quantity==0 && m.canceled)::
  63. ::_("Canceled")::
  64. ::else::
  65. ::raw m.smartQt::
  66. ::end::
  67. ::set productNum = productNum+m.quantity::
  68. </td>
  69. <td>
  70. ::m.productName::
  71. </td>
  72. <td>
  73. ::formatNum(m.productPrice)::&nbsp;::currency()::
  74. </td>
  75. <td>
  76. ::if m.fees!=null::
  77. ::formatNum(m.fees)::&nbsp;::currency()::
  78. ::end::
  79. </td>
  80. <td>
  81. ::formatNum(m.total)::&nbsp;::currency()::
  82. ::set total = total + m.total::
  83. </td>
  84. <td style="width:20%;"></td>
  85. </tr>
  86. <!--TOTAL-->
  87. ::set next = orders[repeat.m.index+1]::
  88. ::if next==null || next.userName!=name || next.userName2!=name2::
  89. <tr>
  90. <td></td>
  91. <td></td>
  92. <td class="total">::formatNum(productNum)::</td>
  93. <td class="total" colspan="2"></td>
  94. <td class="total">::_("TOTAL")::</td>
  95. <td class="total">::formatNum(total)::&nbsp;::currency()::</td>
  96. <td></td>
  97. </tr>
  98. <!-- PAIEMENTS -->
  99. <tr ::cond user._amap.hasPayments()::>
  100. <!-- PAYMENT CHECK FOR SHOP MODE -->
  101. ::if (user._amap.hasShopMode())::
  102. <td></td>
  103. <th>::_("Payment:"):: </th>
  104. <td colspan="6">
  105. <table style="width:100%;border:1px solid #CCC;">
  106. ::if(basket!=null)::
  107. ::set tpaid=0::
  108. ::set op = basket.getOrderOperation(false)::
  109. ::if op!=null::
  110. ::foreach p op.getRelatedPayments()::
  111. <tr>
  112. <td style="min-width:30px;">
  113. ::if(p.pending==true)::
  114. <img src="/img/tick_no.png"/>
  115. ::else::
  116. <img src="/img/tick_ok_me.png"/>
  117. ::end::
  118. </td>
  119. <td>
  120. ::formatNum(p.amount):: ::currency()::
  121. ::set tpaid = p.amount+tpaid::
  122. </td>
  123. <td>
  124. ::p.name::
  125. </td>
  126. </tr>
  127. ::end::
  128. ::end::
  129. <!-- bug : 2 vars are the same but == doesnt work -->
  130. ::set total = numClean(total)::
  131. ::set tpaid = numClean(tpaid)::
  132. ::if(total!=tpaid)::
  133. <tr style="background-color:#EEE;">
  134. <td><img src="/img/tick_no.png"/></td>
  135. <td>::formatNum(total-tpaid):: ::currency()::</td>
  136. <td>
  137. ::if(total>tpaid)::
  138. ::_("To be paid"):: ::formatNum(total-tpaid):: ::currency()::
  139. ::else::
  140. ::_("Pay back"):: ::formatNum(tpaid-total):: ::currency()::
  141. ::end::
  142. </td>
  143. </tr>
  144. ::end::
  145. ::end::
  146. </table>
  147. </td>
  148. ::else::
  149. <!-- PAYMENT CHECK FOR STANDARD MODE -->
  150. <td></td>
  151. ::set ua = u.getUserAmap(user._amap)::
  152. ::set balance = ua.balance::
  153. <th>::_("Balance of the member:"):: ::ua.balance:: ::currency()::</th>
  154. <td colspan="6">
  155. ::set pending = 0::
  156. <table style="width:100%;border:1px solid #CCC;">
  157. <!-- payment to confirm -->
  158. ::foreach p ua.getLastOperations(5)::
  159. ::if p.type==2 && p.pending==true::
  160. <tr>
  161. <td style="width:30px;">
  162. ::if(p.pending==true)::
  163. <img src="/img/tick_no.png"/>
  164. ::else::
  165. <img src="/img/tick_ok_me.png"/>
  166. ::end::
  167. </td>
  168. <td>
  169. ::formatNum(p.amount):: ::currency()::
  170. - ::p.name::
  171. ::set pending = pending + p.amount::
  172. </td>
  173. </tr>
  174. ::end::
  175. ::end::
  176. <!-- need to pay more or cash back -->
  177. ::if(balance<0 && balance+pending!=0)::
  178. <tr style="background-color:#EEE;">
  179. <td style="width:30px;"><img src="/img/tick_no.png"/></td>
  180. <td>
  181. ::if(balance+pending<0)::
  182. ::_("To be paid"):: ::formatNum(abs(balance+pending)):: ::currency():: pour équilibrer le solde
  183. ::else::
  184. ::_("Pay back"):: ::formatNum(balance+pending):: ::currency():: pour équilibrer le solde
  185. ::end::
  186. </td>
  187. </tr>
  188. ::end::
  189. </table>
  190. </td>
  191. ::end::
  192. </tr>
  193. ::end::
  194. ::end::
  195. </table>
  196. <p>::raw nl2br(user.getAmap().txtDistrib)::</p>
  197. <p class="hidden">
  198. <i>::_("Push on \"Control + P\" to print this page.")::</i>
  199. </p>
  200. <table class="" ::cond sqlLog::>
  201. ::foreach r sqlLog::
  202. <tr ::attr class if(r.bad) 'badSql'::>
  203. <td>::r.t::ms</td>
  204. <td>::r.length::</td>
  205. <td><a href="#" onclick="javascript:alert('::r.explain::');return false;">Exp</a></td>
  206. <td><a href="#" onclick="javascript:alert('::r.stack::');return false;">Stack</a></td>
  207. <td>::r.sql::</td>
  208. </tr>
  209. ::end::
  210. </table>
  211. </body>
  212. </html>