meemup-library 1.5.30 → 1.5.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -771,29 +771,36 @@ class _PreviewContentController {
771
771
  });
772
772
  }
773
773
  createPaymentInfoReceipt(detail, template) {
774
- var _a;
774
+ var _a, _b, _c, _d;
775
775
  const { font, width, paper, paddingTop, paddingBottom, } = template;
776
776
  const fontFamily = (font === "Font A" || font === "Font B") ? "arial" : font;
777
- let content = `<div style="font-family : ${fontFamily}; font-weight : normal; padding : ${paddingTop}px 0 ${paddingBottom}px 0; width: ${this.calculatePaperSize(paper, width)};"> `;
778
- content += `<p style="display:block; font-size: ${template.fontSize}px; text-align: center;">${detail.company.title}</p>`;
777
+ let content = `<div style="font-family : ${fontFamily}; font-weight : normal; line-height:1.6rem; padding : ${paddingTop}px 0 ${paddingBottom}px 0; width: ${this.calculatePaperSize(paper, width)};"> `;
778
+ content += `<p style="display:block; font-size: ${template.fontSize * 2}px; text-align: center;">${detail.company.title}</p>`;
779
779
  content += `<p style="display:block; font-size: ${template.fontSize}px; text-align: center;">${detail.company.address}</p>`;
780
780
  content += `<p style="display:block; font-size: ${template.fontSize}px; text-align: center;">${PhoneController.toDisplay(detail.company.phone)}</p>`;
781
781
  content += `<p style="display:block; font-size: ${template.fontSize}px; text-align: left; margin-top:24px;">Payment type and status:</p>`;
782
782
  const total = MoneyController.format(detail.order.totalAmount, detail.company.currencySymbol);
783
783
  const afterTotal = detail.order.paymentState === EnumPaymentState.Paid ? "PAID" : "NOT PAID";
784
- content += `<p style="display:block; font-size: ${template.fontSize * 2}px; text-align: left; margin-bottom:24px;">${total + ", " + afterTotal}</p>`;
785
- content += `<p style="display:block; font-size: ${template.fontSize}px; text-align: left;">Reg. date ${dayjs(detail.order.registrationDate).format(Formats.displayDateTime)}</p>`;
786
- content += `<p style="display:block; font-size: ${template.fontSize}px; text-align: left;">Order REF:${detail.order.id} , #${detail.order.orderNumber}</p>`;
784
+ content += `<p style="display:block; font-size: ${template.fontSize * 2}px; text-align: left; margin-bottom:16px;">${total + ", " + afterTotal}</p>`;
785
+ content += `<p style="display:block; font-size: ${template.fontSize}px; text-align: left;">Reg. date &nbsp;&nbsp; ${dayjs(detail.order.registrationDate).format(Formats.displayDateTime)}</p>`;
786
+ content += `<p style="display:block; font-size: ${template.fontSize}px; text-align: left;">Order &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REF:${detail.order.id} , #${detail.order.orderNumber}</p>`;
787
787
  content += `<div style="display:flex; flex-direction : row; justify-content: space-between; align-items :center; ">
788
788
  <p style="font-size: ${template.fontSize * 2}px; text-align: left;">Total, ${afterTotal}</p>
789
789
  <p style="font-size: ${template.fontSize * 2}px; text-align: right;">${total}</p>
790
790
  </div>`;
791
- content += `<div style="display:flex; flex-direction : row; justify-content:center; align-items:center; gap : 8px; margin-top:24px; margin-bottom: 24px;">
791
+ content += `<div style="display:flex; flex-direction : row; justify-content:center; align-items:center; gap : 8px; margin-top:16px; margin-bottom: 16px;">
792
792
  <div style="border-top:1px solid black; flex:1;"></div>
793
- <p style="font-size: ${template.fontSize * 2}px; text-align: right;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</p>
793
+ <p style="font-size: ${template.fontSize}px; text-align: right;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</p>
794
794
  <div style="border-top:1px solid black; flex:1;"></div>
795
795
  </div>`;
796
- content += SimplePreviewController.printMetaData(template, detail);
796
+ if (detail.paymentInfo !== null && Array.isArray((_b = detail.paymentInfo) === null || _b === void 0 ? void 0 : _b.metadata) && ((_d = (_c = detail.paymentInfo) === null || _c === void 0 ? void 0 : _c.metadata) === null || _d === void 0 ? void 0 : _d.length) > 0) {
797
+ content += `<div style="margin-bottom:16px;">`;
798
+ detail.paymentInfo.metadata.forEach(item => {
799
+ content += `<p style="display: block; text-align: left; font-size: ${template.fontSize}px;">${item.text}: ${item.value}</p>`;
800
+ });
801
+ content += `</div>`;
802
+ }
803
+ // content += SimplePreviewController.printMetaData(template, detail);
797
804
  content += SimplePreviewController.printFooter(template, detail);
798
805
  content += `</div>`;
799
806
  return (`<div style="display: flex;"><div style="width : auto;">${content}</div></div>`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meemup-library",
3
- "version": "1.5.30",
3
+ "version": "1.5.31",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "remove:one": "rimraf dist",
12
12
  "remove:two": "rimraf ./src/dist",
13
13
  "test": "echo \"Error: no test specified\" && exit 1",
14
- "commit": "git add . && git commit -m \"version.1.5.30\" && git push origin "
14
+ "commit": "git add . && git commit -m \"version.1.5.31\" && git push origin "
15
15
  },
16
16
  "files": [
17
17
  "/dist"