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.

146 lines
4.3 KiB

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