meemup-library 1.5.85 → 1.5.86
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.
- package/dist/controllers/LabelPreviewController.js +3 -3
- package/dist/controllers/PreviewContentController.js +100 -100
- package/dist/controllers/PrintContentController.js +273 -273
- package/dist/controllers/SimplePreviewController.js +217 -217
- package/dist/enums/EnumAccountRole.d.ts +5 -0
- package/dist/enums/EnumAccountRole.js +6 -0
- package/dist/interfaces/IAccount.d.ts +2 -0
- package/dist/interfaces/IAccount.js +3 -1
- package/package.json +28 -28
|
@@ -116,9 +116,9 @@ class LabelPreviewController {
|
|
|
116
116
|
row.extras.filter(i => !i.doNotPrintOnReceipt).forEach(element => {
|
|
117
117
|
let extraText = this.pizzaSideText(element.pizzaSide) + element.quantity + "X " + element.extraItemTitle;
|
|
118
118
|
let extraAmount = template.showPrices ? MoneyController.format(element.totalAmount, currencySymbol) : "";
|
|
119
|
-
content += `<div style="display: flex; flex-direction: row; justify-content: flex-start; padding-left: 16px">
|
|
120
|
-
<p style="font-size:${template.fontSize}px; flex: 1; width: 100%; text-align: left;">${extraText}</p>
|
|
121
|
-
<p style="font-size:${template.fontSize}px; max-width: 90px; text-align: right;">${extraAmount}</p>
|
|
119
|
+
content += `<div style="display: flex; flex-direction: row; justify-content: flex-start; padding-left: 16px">
|
|
120
|
+
<p style="font-size:${template.fontSize}px; flex: 1; width: 100%; text-align: left;">${extraText}</p>
|
|
121
|
+
<p style="font-size:${template.fontSize}px; max-width: 90px; text-align: right;">${extraAmount}</p>
|
|
122
122
|
</div>`;
|
|
123
123
|
});
|
|
124
124
|
content += `</div>`;
|
|
@@ -298,61 +298,61 @@ class _PreviewContentController {
|
|
|
298
298
|
}
|
|
299
299
|
paymentFailed(detail, currency) {
|
|
300
300
|
var _a, _b, _c;
|
|
301
|
-
return `<div style="padding-top: 16px; padding-bottom: 16px;">
|
|
302
|
-
<div style="display: flex; flex-direction: row; align-items: center; justify-content: center;">
|
|
303
|
-
<img alt="" src="https://beta.meemup.com/api/shop/logo/${detail.company.id}"
|
|
304
|
-
style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
|
|
305
|
-
</div>
|
|
306
|
-
<div
|
|
307
|
-
style="display: flex; flex-direction: row; align-items: center; justify-content: space-between; margin-left: 10%; margin-right: 10%; margin-top: 16px; padding-left: 16px; padding-right: 16px;">
|
|
308
|
-
<strong style="font-size: 18px;">AMOUNT</strong>
|
|
309
|
-
<strong style="font-size: 18px;">${currency} ${detail.order.totalAmount}</strong>
|
|
310
|
-
</div>
|
|
311
|
-
<div
|
|
312
|
-
style="display: flex; flex-direction: row; align-items: center; justify-content: center; border-bottom: 2px solid black; margin-left: 10%; margin-right: 10%; padding: 16px;">
|
|
313
|
-
<strong style="font-size: 18px; padding-right: 16px;"></strong>
|
|
314
|
-
<strong style="font-size: 18px;">#0</strong>
|
|
315
|
-
</div>
|
|
316
|
-
<div
|
|
317
|
-
style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 16px 10%; border-bottom: 2px solid black;">
|
|
318
|
-
<strong style="font-size: 18px;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</strong>
|
|
319
|
-
<p style="font-size: 12px; font-weight: bold; margin-top: 8px; padding-bottom: 16px;">${(_b = detail.paymentInfo) === null || _b === void 0 ? void 0 : _b.message}</p>
|
|
320
|
-
</div>
|
|
321
|
-
<div style="margin-left: 16px; margin-right: 16px;">
|
|
322
|
-
${(_c = detail.paymentInfo) === null || _c === void 0 ? void 0 : _c.metadata.map(i => (`<div style="display: flex; flex-direction: row; align-items: center; justify-content: flex-start; margin-bottom: 8px;">
|
|
323
|
-
<strong style="font-size: 12px; margin-right: 16px;">${i.text}</strong>
|
|
324
|
-
<strong style="font-size: 12px;">${i.value}</strong>
|
|
325
|
-
</div>`))}
|
|
326
|
-
|
|
327
|
-
</div>
|
|
301
|
+
return `<div style="padding-top: 16px; padding-bottom: 16px;">
|
|
302
|
+
<div style="display: flex; flex-direction: row; align-items: center; justify-content: center;">
|
|
303
|
+
<img alt="" src="https://beta.meemup.com/api/shop/logo/${detail.company.id}"
|
|
304
|
+
style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
|
|
305
|
+
</div>
|
|
306
|
+
<div
|
|
307
|
+
style="display: flex; flex-direction: row; align-items: center; justify-content: space-between; margin-left: 10%; margin-right: 10%; margin-top: 16px; padding-left: 16px; padding-right: 16px;">
|
|
308
|
+
<strong style="font-size: 18px;">AMOUNT</strong>
|
|
309
|
+
<strong style="font-size: 18px;">${currency} ${detail.order.totalAmount}</strong>
|
|
310
|
+
</div>
|
|
311
|
+
<div
|
|
312
|
+
style="display: flex; flex-direction: row; align-items: center; justify-content: center; border-bottom: 2px solid black; margin-left: 10%; margin-right: 10%; padding: 16px;">
|
|
313
|
+
<strong style="font-size: 18px; padding-right: 16px;"></strong>
|
|
314
|
+
<strong style="font-size: 18px;">#0</strong>
|
|
315
|
+
</div>
|
|
316
|
+
<div
|
|
317
|
+
style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 16px 10%; border-bottom: 2px solid black;">
|
|
318
|
+
<strong style="font-size: 18px;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</strong>
|
|
319
|
+
<p style="font-size: 12px; font-weight: bold; margin-top: 8px; padding-bottom: 16px;">${(_b = detail.paymentInfo) === null || _b === void 0 ? void 0 : _b.message}</p>
|
|
320
|
+
</div>
|
|
321
|
+
<div style="margin-left: 16px; margin-right: 16px;">
|
|
322
|
+
${(_c = detail.paymentInfo) === null || _c === void 0 ? void 0 : _c.metadata.map(i => (`<div style="display: flex; flex-direction: row; align-items: center; justify-content: flex-start; margin-bottom: 8px;">
|
|
323
|
+
<strong style="font-size: 12px; margin-right: 16px;">${i.text}</strong>
|
|
324
|
+
<strong style="font-size: 12px;">${i.value}</strong>
|
|
325
|
+
</div>`))}
|
|
326
|
+
|
|
327
|
+
</div>
|
|
328
328
|
</div>`;
|
|
329
329
|
}
|
|
330
330
|
packageLabel(detail, template) {
|
|
331
331
|
const { font, fontSize, width, paper } = template;
|
|
332
332
|
const mediumFontSize = (fontSize * 1.5).toFixed(0);
|
|
333
333
|
const largeFontSize = (fontSize * 2.5).toFixed(0);
|
|
334
|
-
return `<div style="font-family : ${font}; font-size: ${fontSize + "px"};font-weight : normal; padding : 10px; border: 1px solid black; width: ${this.calculatePaperSize(paper, width)};">
|
|
335
|
-
<div
|
|
336
|
-
style="display: flex; flex-direction: row; align-items: center; justify-content: space-between; border-bottom: 1px solid black;">
|
|
337
|
-
<strong style="font-size: ${mediumFontSize + "px"};">${detail.order.orderTypeString}</strong>
|
|
338
|
-
<strong style="font-size: ${mediumFontSize + "px"};">#${detail.order.orderNumber}</strong>
|
|
339
|
-
</div>
|
|
340
|
-
<div style="border-bottom: 1px solid black; padding: 8px 0;">
|
|
341
|
-
${detail.products.map((i) => (`<div style="padding : 2px 0;">${i.title}</div>`)).join("")}
|
|
342
|
-
</div>
|
|
343
|
-
<div
|
|
344
|
-
style="margin-top: 16px; margin-bottom: 6px; padding-bottom: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-bottom: 1px solid black;">
|
|
345
|
-
<strong style="font-size: ${mediumFontSize + "px"};">${detail.order.orderTypeString}</strong>
|
|
346
|
-
<strong style="font-size: ${largeFontSize + "px"};">${detail.order.orderNumber}</strong>
|
|
347
|
-
<div>${detail.customer.fullName}</div>
|
|
348
|
-
</div>
|
|
349
|
-
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 10%; margin-right: 10%;">
|
|
350
|
-
<div>${this.formatDateTime(detail.order.desiredDate)}</div>
|
|
351
|
-
<div style="display: flex; flex-direction: row; align-items: center; justify-content: center; margin-top: 16px;">
|
|
352
|
-
<img alt="" src="https://beta.meemup.com/api/ordering/${detail.order.id}/${detail.company.id}/QR"
|
|
353
|
-
style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
|
|
354
|
-
</div>
|
|
355
|
-
</div>
|
|
334
|
+
return `<div style="font-family : ${font}; font-size: ${fontSize + "px"};font-weight : normal; padding : 10px; border: 1px solid black; width: ${this.calculatePaperSize(paper, width)};">
|
|
335
|
+
<div
|
|
336
|
+
style="display: flex; flex-direction: row; align-items: center; justify-content: space-between; border-bottom: 1px solid black;">
|
|
337
|
+
<strong style="font-size: ${mediumFontSize + "px"};">${detail.order.orderTypeString}</strong>
|
|
338
|
+
<strong style="font-size: ${mediumFontSize + "px"};">#${detail.order.orderNumber}</strong>
|
|
339
|
+
</div>
|
|
340
|
+
<div style="border-bottom: 1px solid black; padding: 8px 0;">
|
|
341
|
+
${detail.products.map((i) => (`<div style="padding : 2px 0;">${i.title}</div>`)).join("")}
|
|
342
|
+
</div>
|
|
343
|
+
<div
|
|
344
|
+
style="margin-top: 16px; margin-bottom: 6px; padding-bottom: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-bottom: 1px solid black;">
|
|
345
|
+
<strong style="font-size: ${mediumFontSize + "px"};">${detail.order.orderTypeString}</strong>
|
|
346
|
+
<strong style="font-size: ${largeFontSize + "px"};">${detail.order.orderNumber}</strong>
|
|
347
|
+
<div>${detail.customer.fullName}</div>
|
|
348
|
+
</div>
|
|
349
|
+
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 10%; margin-right: 10%;">
|
|
350
|
+
<div>${this.formatDateTime(detail.order.desiredDate)}</div>
|
|
351
|
+
<div style="display: flex; flex-direction: row; align-items: center; justify-content: center; margin-top: 16px;">
|
|
352
|
+
<img alt="" src="https://beta.meemup.com/api/ordering/${detail.order.id}/${detail.company.id}/QR"
|
|
353
|
+
style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
|
|
354
|
+
</div>
|
|
355
|
+
</div>
|
|
356
356
|
</div>`;
|
|
357
357
|
}
|
|
358
358
|
preview(account, detail, template) {
|
|
@@ -643,50 +643,50 @@ class _PreviewContentController {
|
|
|
643
643
|
});
|
|
644
644
|
}
|
|
645
645
|
standardHtmlContainer(strHtml) {
|
|
646
|
-
return `<!DOCTYPE html>
|
|
647
|
-
<html>
|
|
648
|
-
<head>
|
|
649
|
-
<meta charset="UTF-8">
|
|
650
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
651
|
-
<style>
|
|
652
|
-
|
|
653
|
-
html {
|
|
654
|
-
font-size: 14px;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
* {
|
|
658
|
-
padding: 0;
|
|
659
|
-
margin: 0;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
p,strong {
|
|
663
|
-
line-height: 1.5rem;
|
|
664
|
-
font-weight : 500;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
td{
|
|
668
|
-
padding-top: 2px;
|
|
669
|
-
padding-bottom: 2px;
|
|
670
|
-
line-height: 1.6rem;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
body {
|
|
674
|
-
width : 76mm;
|
|
675
|
-
margin: 0;
|
|
676
|
-
padding: 0;
|
|
677
|
-
background-color: #ffffff;
|
|
678
|
-
font-family: 'Roboto', 'Arial', "Arial Black", "Comic Sans MS", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", 'Segoe UI', 'Oxygen',
|
|
679
|
-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
680
|
-
sans-serif , -apple-system, BlinkMacSystemFont;
|
|
681
|
-
-webkit-font-smoothing: antialiased;
|
|
682
|
-
-moz-osx-font-smoothing: grayscale;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
</style>
|
|
686
|
-
</head>
|
|
687
|
-
<body>
|
|
688
|
-
${strHtml}
|
|
689
|
-
</body>
|
|
646
|
+
return `<!DOCTYPE html>
|
|
647
|
+
<html>
|
|
648
|
+
<head>
|
|
649
|
+
<meta charset="UTF-8">
|
|
650
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
651
|
+
<style>
|
|
652
|
+
|
|
653
|
+
html {
|
|
654
|
+
font-size: 14px;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
* {
|
|
658
|
+
padding: 0;
|
|
659
|
+
margin: 0;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
p,strong {
|
|
663
|
+
line-height: 1.5rem;
|
|
664
|
+
font-weight : 500;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
td{
|
|
668
|
+
padding-top: 2px;
|
|
669
|
+
padding-bottom: 2px;
|
|
670
|
+
line-height: 1.6rem;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
body {
|
|
674
|
+
width : 76mm;
|
|
675
|
+
margin: 0;
|
|
676
|
+
padding: 0;
|
|
677
|
+
background-color: #ffffff;
|
|
678
|
+
font-family: 'Roboto', 'Arial', "Arial Black", "Comic Sans MS", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", 'Segoe UI', 'Oxygen',
|
|
679
|
+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
680
|
+
sans-serif , -apple-system, BlinkMacSystemFont;
|
|
681
|
+
-webkit-font-smoothing: antialiased;
|
|
682
|
+
-moz-osx-font-smoothing: grayscale;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
</style>
|
|
686
|
+
</head>
|
|
687
|
+
<body>
|
|
688
|
+
${strHtml}
|
|
689
|
+
</body>
|
|
690
690
|
</html>`;
|
|
691
691
|
}
|
|
692
692
|
createClosingWorkDay(data, companyTitle) {
|
|
@@ -815,14 +815,14 @@ class _PreviewContentController {
|
|
|
815
815
|
content += `<p style="display:block; font-size: ${template.fontSize * 2}px; text-align: left; margin-bottom:16px;">${total + ", " + afterTotal}</p>`;
|
|
816
816
|
content += `<p style="display:block; font-size: ${template.fontSize}px; text-align: left;">Reg. date ${dayjs(detail.order.registrationDate).format(Formats.displayDateTime)}</p>`;
|
|
817
817
|
content += `<p style="display:block; font-size: ${template.fontSize}px; text-align: left;">Order REF:${detail.order.id} , #${detail.order.orderNumber}</p>`;
|
|
818
|
-
content += `<div style="display:flex; flex-direction : row; justify-content: space-between; align-items :center; ">
|
|
819
|
-
<p style="font-size: ${template.fontSize * 2}px; text-align: left;">Total, ${afterTotal}</p>
|
|
820
|
-
<p style="font-size: ${template.fontSize * 2}px; text-align: right;">${total}</p>
|
|
818
|
+
content += `<div style="display:flex; flex-direction : row; justify-content: space-between; align-items :center; ">
|
|
819
|
+
<p style="font-size: ${template.fontSize * 2}px; text-align: left;">Total, ${afterTotal}</p>
|
|
820
|
+
<p style="font-size: ${template.fontSize * 2}px; text-align: right;">${total}</p>
|
|
821
821
|
</div>`;
|
|
822
|
-
content += `<div style="display:flex; flex-direction : row; justify-content:center; align-items:center; gap : 8px; margin-top:16px; margin-bottom: 16px;">
|
|
823
|
-
<div style="border-top:1px solid black; flex:1;"></div>
|
|
824
|
-
<p style="font-size: ${template.fontSize}px; text-align: right;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</p>
|
|
825
|
-
<div style="border-top:1px solid black; flex:1;"></div>
|
|
822
|
+
content += `<div style="display:flex; flex-direction : row; justify-content:center; align-items:center; gap : 8px; margin-top:16px; margin-bottom: 16px;">
|
|
823
|
+
<div style="border-top:1px solid black; flex:1;"></div>
|
|
824
|
+
<p style="font-size: ${template.fontSize}px; text-align: right;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</p>
|
|
825
|
+
<div style="border-top:1px solid black; flex:1;"></div>
|
|
826
826
|
</div>`;
|
|
827
827
|
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) {
|
|
828
828
|
content += `<div style="margin-bottom:16px;">`;
|