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.

172 lines
5.1 KiB

  1. ::use 'design.mtt'::
  2. <div class="col-md-12">
  3. <div class="article">
  4. <div class="text-center">
  5. <h3>
  6. Distribution du ::hDate(date)::
  7. </h3>
  8. <h4><span class="glyphicon glyphicon-map-marker"></span>::place::</h4>
  9. <br/>
  10. <!--::if(confirmed)::
  11. ::_("Validated")::
  12. ::else::
  13. ::_("Not validated")::
  14. ::end::-->
  15. </div>
  16. <div class="text-center">
  17. <a href="/distribution/listByDate/::date.toString().substr(0,10)::/::place.id::/csv" class="btn btn-default btn-sm"> <span class="glyphicon glyphicon-list-alt"></span> ::_("CSV Export"):: </a>
  18. <a href="/distribution/listByDate/::date.toString().substr(0,10)::/::place.id::" class="btn btn-default btn-sm"> <span class="glyphicon glyphicon-print"></span> ::_("Attendance sheet"):: </a>
  19. ::if ctotal::
  20. <a href="/contractAdmin/ordersByDate/::date.toString().substr(0,10)::/::place.id::" class="btn btn-default btn-sm">::_("Totals per member")::</a>
  21. ::else::
  22. <a href="/contractAdmin/ordersByDate/::date.toString().substr(0,10)::/::place.id::?ctotal=1" class="btn btn-default btn-sm">::_("Sub-totals per contract")::</a>
  23. ::end::
  24. <a href="/contractAdmin/vendorsByDate/::date.toString().substr(0,10)::/::place.id::" class="btn btn-default btn-sm">::_("Totals per supplier")::</a>
  25. </div>
  26. <hr/>
  27. <table class="table table-bordered table-hover table-condensed" style="width:100%;">
  28. ::set total = 0:: <!-- big total -->
  29. ::set subtotal = 0:: <!-- total per user -->
  30. ::set contractTotal = 0:: <!-- total per contract -->
  31. ::foreach m orders::
  32. ::set i = repeat.m.index::
  33. <!-- name change -->
  34. ::if orders[i-1]==null || m.userName != orders[i-1].userName || m.userName2 != orders[i-1].userName2::
  35. <tr style="background-color:#666;">
  36. <td colspan="9" style="font-size:120%;color:#e7e7e7;">
  37. ::set basket = getBasket(m.userId,place.id,date)::
  38. <div class="basketNumber" ::cond basket!=null:: >
  39. <i class="fa fa-shopping-basket" aria-hidden="true"></i> ::_("Num"):: ::basket.num::
  40. </div>
  41. ::m.userName::
  42. ::if m.userName2!=null::
  43. <span class="glyphicon glyphicon-refresh"></span> ::_("alternately with"):: ::m.userName2::
  44. ::end::
  45. ::set contractTotal = 0::
  46. </td>
  47. </tr>
  48. <tr>
  49. <th>::_("Contract")::</th>
  50. <th>::_("Qty")::</th>
  51. <th>::_("Ref")::</th>
  52. <th>::_("Product")::</th>
  53. <th><a href="#" data-toggle="tooltip" data-placement="top" title="::_("Unit price incl. VAT")::">::_("U.P.")::</a></th>
  54. <th>::_("Sub-total")::</th>
  55. <th>::_("Fees")::</th>
  56. <th>::_("Total")::</th>
  57. <th>::_("Paid")::</th>
  58. </tr>
  59. ::end::
  60. <!-- 1 order line -->
  61. <tr>
  62. <td>
  63. <a href="/contractAdmin/view/::m.contractId::">
  64. ::short(m.contractName,40)::
  65. </a>
  66. </td>
  67. <td>
  68. ::if(m.quantity==0 && m.canceled)::
  69. <span style="color:#AAA">::_("Canceled")::</span>
  70. ::else::
  71. ::raw m.smartQt::
  72. ::end::
  73. </td>
  74. <td class="ref">
  75. $$nullSafe(::m.productRef::)
  76. </td>
  77. <td>
  78. ::short(m.productName,40)::
  79. </td>
  80. <td>
  81. ::formatNum(m.productPrice)::&nbsp;::currency()::
  82. </td>
  83. <td>
  84. ::formatNum(m.subTotal)::&nbsp;::currency()::
  85. </td>
  86. <td>
  87. <!-- fees -->
  88. ::if m.percentageValue!=null::
  89. <a href="#" data-toggle="tooltip" data-placement="top" title="::m.percentageName:: : ::m.percentageValue:: %">
  90. ::formatNum(m.fees)::&nbsp;::currency()::
  91. </a>
  92. ::end::
  93. </td>
  94. <td>
  95. <!-- total -->
  96. ::formatNum(m.total)::&nbsp;::currency()::
  97. ::set total = total + m.total::
  98. ::set subtotal = subtotal + m.total::
  99. ::set contractTotal = contractTotal + m.total::
  100. </td>
  101. <td>
  102. ::if m.paid==true::
  103. <span style="color:#00AA00;">::_("Paid")::</span>
  104. ::else::
  105. <span style="color:#DD0000;">::_("Not paid")::</span>
  106. ::end::
  107. </td>
  108. </tr>
  109. <!-- contract total -->
  110. ::if ctotal && (orders[i+1]==null || m.contractName != orders[i+1].contractName || m.userName != orders[i+1].userName )::
  111. <tr style="background:#DDD;">
  112. <th colspan="7" class="text-right">Total ::m.contractName::</th>
  113. <th>::formatNum(contractTotal)::&nbsp;::currency()::</th>
  114. <th></th>
  115. ::set contractTotal = 0::
  116. </tr>
  117. ::end::
  118. <!-- member total -->
  119. ::if (orders[i+1]==null || m.userName != orders[i+1].userName) ::
  120. ::if subtotal!=0::
  121. <tr style="border-top:2px solid #AAA;">
  122. <th colspan="7" class="text-right">::_("Total member")::</th>
  123. <th>::formatNum(subtotal)::&nbsp;::currency()::</th>
  124. <th></th>
  125. ::set subtotal = 0::
  126. </tr>
  127. ::end::
  128. ::end::
  129. <!-- end orders loop -->
  130. ::end::
  131. <!-- big total -->
  132. <tr style="background:#CCC;font-size:1.3em;">
  133. <th colspan="7" class="text-right">::_("Total of all orders:"):: </th>
  134. <th>::formatNum(total)::&nbsp;::currency()::</th>
  135. <th></th>
  136. </tr>
  137. </table>
  138. </div>
  139. </div>
  140. ::end::