payment_receipt_head.tpl 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
  6. <script type="text/javascript" src="modules/jsc/jquery.min.js"></script>
  7. <script type="text/javascript" src="modules/jsc/qr_gen_inpage/jquery.qrcode.min.js"></script>
  8. <script type="text/javascript" src="modules/jsc/qr_gen_inpage/qrcode.min.js"></script>
  9. <title>TITLE</title>
  10. <style>
  11. td.brdr-bottom {
  12. border-bottom: 1px solid #000;
  13. }
  14. td.brdr-bottom-right {
  15. border-bottom: 1px solid #000;
  16. border-right: 1px solid #000;
  17. }
  18. td.brdr-bottom-right-top {
  19. border-bottom: 1px solid #000;
  20. border-right: 1px solid #000;
  21. border-top: 1px solid #000;
  22. }
  23. td.brdr-bottom-left {
  24. border-bottom: 1px solid #000;
  25. border-left: 1px solid #000;
  26. }
  27. td.brdr-bottom-right-left {
  28. border-bottom: 1px solid #000;
  29. border-right: 1px solid #000;
  30. border-left: 1px solid #000;
  31. }
  32. td.brdr-bottom-right-left-top {
  33. border-bottom: 1px solid #000;
  34. border-right: 1px solid #000;
  35. border-left: 1px solid #000;
  36. border-top: 1px solid #000;
  37. }
  38. td.brdr-top {
  39. border-top: 1px solid #000;
  40. }
  41. td.brdr-top-right {
  42. border-top: 1px solid #000;
  43. border-right: 1px solid #000;
  44. }
  45. td.brdr-top-left {
  46. border-top: 1px solid #000;
  47. border-left: 1px solid #000;
  48. }
  49. td.brdr-left {
  50. border-left: 1px solid #000;
  51. }
  52. td.brdr-right {
  53. border-right: 1px solid #000;
  54. }
  55. td {
  56. padding-left: 5px;
  57. padding-bottom: 1px;
  58. padding-top: 2px;
  59. }
  60. @media print {
  61. .receipt_container {
  62. height: 21cm;
  63. padding-top: 3cm;
  64. }
  65. .pagebreak_footer {
  66. page-break-after: always;
  67. bottom: 0;
  68. }
  69. .footer_dashed_line {
  70. display: none;
  71. }
  72. }
  73. </style>
  74. </head>
  75. <body>
  76. <script type="text/javascript">
  77. /*
  78. Hack from Hatter Jiang (https://github.com/jht5945)
  79. for jquery.qrcode properly process long UTF-8 strings
  80. */
  81. var _countBits = function(_c) {
  82. var cnt = 0;
  83. while(_c > 0) {
  84. cnt++;
  85. _c = _c >>> 1;
  86. }
  87. return cnt;
  88. };
  89. function UnicodeToUtf8Bytes2(code) {
  90. if ((code == null) || (code < 0) ||
  91. (code > (Math.pow(2, 31) -1))) {
  92. return ["?".charCodeAt(0)];
  93. }
  94. if (code < 0x80) {
  95. return [code];
  96. }
  97. var arr = [];
  98. while ((code >>> 6) > 0) {
  99. arr.push(0x80 | (code & 0x3F));
  100. code = code >>> 6;
  101. }
  102. if ((arr.length + 2 + (_countBits(code))) > 8) {
  103. arr.push(0x80 | code);
  104. code = 0;
  105. }
  106. var pre = 0x80;
  107. for (var i = 0; i < arr.length; i++) {
  108. pre |= (0x80 >>> (i + 1));
  109. }
  110. arr.push(pre | code);
  111. return arr.reverse();
  112. }
  113. QR8bitByte.prototype.getLength = function(buffer) {
  114. var len = 0;
  115. for (var i = 0; i < this.data.length; i++) {
  116. var bytes = UnicodeToUtf8Bytes2(this.data.charCodeAt(i));
  117. len += bytes.length;
  118. }
  119. return len;
  120. };
  121. QR8bitByte.prototype.write = function(buffer) {
  122. for (var i = 0; i < this.data.length; i++) {
  123. var bytes = UnicodeToUtf8Bytes2(this.data.charCodeAt(i));
  124. for (var x = 0; x < bytes.length; x++) {
  125. buffer.put(bytes[x], 8);
  126. }
  127. }
  128. };
  129. /* Hack End*/
  130. function genQRs() {
  131. if ($('#qr_embedded').val() == "1") {
  132. console.log('QRs are embedded');
  133. return false;
  134. }
  135. // if you plan to save generated page as document -
  136. // need to prevent the duplication of QRs
  137. $('[name ^= "qr"] canvas').remove();
  138. var qrCodesCount = $('#qr_count').val();
  139. for (i = 1; i <= qrCodesCount; i++) {
  140. var qrContent = $('#qr_content_' + i).val();
  141. $('[name = "qr' + i + '"]').qrcode({
  142. text: qrContent,
  143. width: 150,
  144. height: 150,
  145. correctLevel : QRErrorCorrectLevel.M
  146. });
  147. }
  148. }
  149. </script>
  150. <script type="text/javascript" id="QRGen">
  151. $(document).ready(function() {
  152. genQRs();
  153. });
  154. </script>
  155. <div>
  156. <!--
  157. {QR_EXT_START}
  158. ООО "Рога&Копыта" ИНН: 456789213 Р/С: 204087899521005 +38(50)125-26-15 г. Аркхэм, ул. Вязов, 51, офис №1
  159. Л/С: {CONTRACT} {REALNAME} {STREET} {BUILD}{APT} моб. тел.: {MOBILE}
  160. К оплате: {SUMMCOINS}. Оплата за период: {PAYFORPERIODSTR}
  161. {QR_EXT_END}
  162. {DATES_FORMAT_START}Y-m-d{DATES_FORMAT_END}
  163. {MONTHYEAR_FORMAT_START}m-Y{MONTHYEAR_FORMAT_END}
  164. -->
  165. <input id="qr_count" type="hidden" value="{QR_CODES_CNT}" />
  166. <input id="qr_embedded" type="hidden" value="0" />