report_customer_ranking.xml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <template xml:space="preserve">
  3. <t t-name="ReportCustomerRanking">
  4. <div class="report_view">
  5. <div class="reporting_page_header">
  6. <h1 class="report_title">Ranking de Clientes</h1>
  7. </div>
  8. <div class="container search-form" style="border-bottom:1px solid #eee; width:95%;">
  9. <div class="row">
  10. <div class="col-lg-3 company filter-style">
  11. <label>Empresa</label>
  12. <select id="current-company" class="form-control form-control-sm"></select>
  13. </div>
  14. <div class="col-lg-3 store filter-style">
  15. <label>Sucursal</label>
  16. <select id="current-store" class="form-control form-control-sm">
  17. </select>
  18. </div>
  19. <div class="col-lg-3 type filter-style">
  20. <label>Tipo de Venta</label>
  21. <select id="current-type" class="form-control form-control-sm">
  22. <option value="9999999">Todos los tipos</option>
  23. <option value="tpv">Terminal</option>
  24. <option value="sale">Normal</option>
  25. </select>
  26. </div>
  27. <div class="col-lg-3 category filter-style">
  28. <label>Categoría</label>
  29. <select id="current-category" class="form-control form-control-sm">
  30. </select>
  31. </div>
  32. <div class="col-lg-3 brand filter-style">
  33. <label>Marca</label>
  34. <select id="current-brand" class="form-control form-control-sm">
  35. </select>
  36. </div>
  37. <div class="col-lg-3 attribute filter-style">
  38. <label>Atributo</label>
  39. <select id="current-attribute" class="form-control form-control-sm">
  40. </select>
  41. </div>
  42. <div class="col-lg-3 attribute-value filter-style">
  43. <label>Valor del Atributo</label>
  44. <select id="current-attribute-value" class="form-control form-control-sm">
  45. </select>
  46. </div>
  47. <div class="col-lg-3 filter-style">
  48. <label>Fechas</label>
  49. <select id="current-date" class="form-control form-control-sm">
  50. <option value="9999999">Sin fechas</option>
  51. <option value="today">Hoy</option>
  52. <option value="yesterday">Ayer</option>
  53. <option value="currentMonth">Mes Actual</option>
  54. <option value="lastMonth">Mes Pasado</option>
  55. <option value="range">Busqueda Avanzada</option>
  56. </select>
  57. </div>
  58. </div>
  59. <div class="row" >
  60. <div class="datepicker" style="display:none;">
  61. <div class="col-lg-3 filter-style col-md-offset-3">
  62. <div class="input-group">
  63. <span class="input-group-addon" id="basic-addon1">Desde</span>
  64. <input type="text" id="from" class="form-control" aria-describedby="basic-addon1"/>
  65. </div>
  66. </div>
  67. <div class="col-lg-3 filter-style">
  68. <div class="input-group">
  69. <span class="input-group-addon" id="basic-addon1">Hasta</span>
  70. <input type="text" id="to" class="form-control" aria-describedby="basic-addon1"/>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="row">
  76. <div class="text-center" style="padding-top:20px;">
  77. <button id="generate" class="oe_button oe_form_button myButton">Generar</button>
  78. </div>
  79. <br/>
  80. </div>
  81. </div>
  82. <div class="report-form" style="display:none;">
  83. <div id="toolbar">
  84. <button class="myButton print-report" value="pdf">Imprimir Informe</button>
  85. </div>
  86. <div class="container" style="width:95%;">
  87. <table class="table" id="table"
  88. data-pagination="true"
  89. data-toggle="table"
  90. data-toolbar="#toolbar"
  91. data-show-columns="true"
  92. data-classes="table table-condensed"
  93. data-row-style="rowStyle"
  94. data-search="true"
  95. data-show-export="true"
  96. data-show-toggle="true"
  97. data-show-footer="true"
  98. data-footer-style="footerStyle"
  99. data-buttons-class="oe_button oe_form_button myButton"
  100. data-show-pagination-switch="true"
  101. data-page-size="10"
  102. data-search-on-enter-key="true"
  103. data-undefined-text=" "
  104. data-pagination-v-align="top"
  105. >
  106. <thead style="background:none;">
  107. <tr>
  108. <th data-field="ruc"
  109. data-align="left"
  110. data-footer-formatter="Totales"
  111. >RUC</th>
  112. <th data-field="name"
  113. data-align="left"
  114. >Clientes</th>
  115. <th data-field="total"
  116. data-align="right"
  117. data-footer-formatter="TotalFooter"
  118. >Monto</th>
  119. </tr>
  120. </thead>
  121. </table>
  122. </div>
  123. </div>
  124. <script>
  125. <!--
  126. TOTAL CANTIDAD
  127. -->
  128. function QuantityFooter(rowsTable) {
  129. var decimal_places = 0;
  130. var thousands_separator = '.';
  131. var decimal_separator = ',';
  132. if(rowsTable.length > 0){
  133. decimal_places = rowsTable[0].decimal_places;
  134. thousands_separator = rowsTable[0].thousands_separator;
  135. decimal_separator = rowsTable[0].decimal_separator;
  136. }
  137. var amount = _.reduce(_.map(rowsTable,function(item){
  138. return item.quantity_no_format;
  139. }), function(memo, num){
  140. return memo + num;
  141. },0);
  142. return accounting.formatNumber(amount,decimal_places,thousands_separator,decimal_separator);
  143. }
  144. <!--
  145. TOTAL MONTO
  146. -->
  147. function TotalFooter(rowsTable) {
  148. var decimal_places = 0;
  149. var thousands_separator = '.';
  150. var decimal_separator = ',';
  151. if(rowsTable.length > 0){
  152. decimal_places = rowsTable[0].decimal_places;
  153. thousands_separator = rowsTable[0].thousands_separator;
  154. decimal_separator = rowsTable[0].decimal_separator;
  155. }
  156. var amount = _.reduce(_.map(rowsTable,function(item){
  157. return item.total_no_format;
  158. }), function(memo, num){
  159. return memo + num;
  160. },0);
  161. return accounting.formatNumber(amount,decimal_places,thousands_separator,decimal_separator);
  162. }
  163. <!--
  164. FOOTER STYLE
  165. -->
  166. function footerStyle(row, index) {
  167. return {
  168. css: {
  169. "font-weight": "bold"
  170. }
  171. };
  172. };
  173. </script>
  174. </div>
  175. </t>
  176. </template>