Advertisement
Sethadon

Sample MMEX Report (XML w/ Incorrect Subtotal)

Jun 17th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  5. <title><TMPL_VAR REPORTNAME></title>
  6. <script src = "memory:ChartNew.js"></script>
  7. <script src = "memory:sorttable.js"></script>
  8. <link href = "memory:master.css" rel = "stylesheet">
  9. </head>
  10. <body>
  11. <div class = "container">
  12. <h3><TMPL_VAR REPORTNAME></h3>
  13. <TMPL_VAR TODAY><hr>
  14. <div class = "row">
  15. <div class = "col-xs-2"></div>
  16. <div class = "col-xs-8">
  17. <table class = "table">
  18. <thead>
  19. <tr>
  20. <th>TRANSCODE</th>
  21. <th>PAYEENAME</th>
  22. <th>SUBCATEGNAME</th>
  23. <th>TOTRANSAMOUNT</th>
  24. <th>TRANSDATE</th>
  25. <th>NOTES</th>
  26.  
  27. </tr>
  28. </thead>
  29. <tbody>
  30. <TMPL_LOOP NAME=CONTENTS>
  31. <tr>
  32. <td><TMPL_VAR "TRANSCODE"></td>
  33. <td><TMPL_VAR "PAYEENAME"></td>
  34. <td><TMPL_VAR "SUBCATEGNAME"></td>
  35. <td class = "money"><TMPL_VAR "TOTRANSAMOUNT"></td>
  36. <td><TMPL_VAR "TRANSDATE"></td>
  37. <td><TMPL_VAR "NOTES"></td>
  38.  
  39. </tr>
  40. </TMPL_LOOP>
  41. </tbody>
  42. <tfoot>
  43. <tr>
  44. <th>TOTAL</th>
  45. <th></th>
  46. <th></th>
  47. <th class = "money"><TMPL_VAR "TOTRANSAMOUNT"></th>
  48. <th></th>
  49. <th></th>
  50. </tr>
  51. </tfoot>
  52. </table>
  53. </div>
  54. </div>
  55.  
  56. </div>
  57. <TMPL_LOOP ERRORS>
  58. <TMPL_VAR ERROR>
  59. </TMPL_LOOP>
  60. </body>
  61. <script>
  62. <!-- Format double to base currency -->
  63. function currency(n) {
  64. n = parseFloat(n);
  65. n = isNaN(n) ? 0 : n.toFixed(2);
  66. var out = n.toString().replace(".", "|");
  67. out = out.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "<TMPL_VAR GROUP_SEPARATOR>");
  68. out = out.replace("|", "<TMPL_VAR DECIMAL_POINT>");
  69. return out;
  70. }
  71. var elements= document.getElementsByClassName("money");
  72. for (var i = 0; i < elements.length; i++) {
  73. var element = elements[i];
  74. element.style.textAlign='right';
  75. if (element.innerHTML.indexOf("-") > -1) {
  76. element.style.color="red";
  77. }
  78. element.innerHTML = '<TMPL_VAR PFX_SYMBOL>' + currency(element.innerHTML) +'<TMPL_VAR SFX_SYMBOL>';
  79. }
  80. </script>
  81. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement