meemup-library 1.9.2 → 1.9.4

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.
@@ -221,6 +221,13 @@ class SimplePreviewController {
221
221
  <span style="font-size:${fontSize}px; flex: 1; width: 100%; text-align: left; font-weight: bold;">${productName}</span>
222
222
  <span style="font-size:${fontSize}px; max-width: 90px; text-align: right;">${price}</span>
223
223
  </div>`;
224
+ if (row.discount !== 0) {
225
+ let discountText = `${MoneyController.format(row.discount, detail.company.currencySymbol)} discount`;
226
+ content += `<div style="display:flex; flex-direction:row; align-items:center; justify-content: flex-start; gap: 8px;">
227
+ <span style="font-size:${fontSize}px; min-width:40px; width: 40px; text-align: left;"></span>
228
+ <span style="font-size:${fontSize}px; flex: 1; width: 100%; text-align: left; column-span: 2; padding-left: 24px;">${discountText}</span>
229
+ </div>`;
230
+ }
224
231
  if (row.extrasNames) {
225
232
  row.extras
226
233
  .filter(item => !item.doNotPrintOnReceipt)
@@ -263,17 +270,19 @@ class SimplePreviewController {
263
270
  printCustomerRemark(template, detail) {
264
271
  if (!detail.order.remarks || detail.order.remarks.trim().length === 0)
265
272
  return "";
273
+ const fontSize = template.layout === EnumPrintLayout.LARGE ? (template.printer === 5 ? 22 : template.fontSize + 10) : template.fontSize;
266
274
  return `${this.createDivContainer(template)}
267
275
  ${this.printSimpleDashLine()}
268
- <p style="text-align: left; font-size: ${template.fontSize}px; padding-top: 4px; padding-bottom: 4px;">${detail.order.remarks}</p>
276
+ <p style="text-align: left; font-size: ${fontSize}px; padding-top: 4px; padding-bottom: 4px;">${detail.order.remarks}</p>
269
277
  </div>`;
270
278
  }
271
279
  printDeliveryInstructionsRemarks(template, detail) {
272
280
  if (detail.order.orderType !== EnumOrderType.delivery || !detail.order.deliveryInstructionsRemarks || detail.order.deliveryInstructionsRemarks.trim().length === 0)
273
281
  return "";
282
+ const fontSize = template.layout === EnumPrintLayout.LARGE ? (template.printer === 5 ? 22 : template.fontSize + 10) : template.fontSize;
274
283
  return `${this.createDivContainer(template)}
275
284
  ${this.printSimpleDashLine()}
276
- <p style="text-align: left; font-size: ${template.fontSize}px; padding-top: 4px; padding-bottom: 4px;">${detail.order.deliveryInstructionsRemarks}</p>
285
+ <p style="text-align: left; font-size: ${fontSize}px; padding-top: 4px; padding-bottom: 4px;">${detail.order.deliveryInstructionsRemarks}</p>
277
286
  </div>`;
278
287
  }
279
288
  printCustomerSignature(template, detail) {
@@ -452,6 +461,13 @@ class SimplePreviewController {
452
461
  <td style="font-size:${activeFontSize}px; min-width:40px; width: 40px; text-align: left;">${isLarge ? '&ensp;' : ''}</td>
453
462
  <td style="font-size:${activeFontSize}px; flex: 1; width: 100%; text-align: left; column-span: 2;">${product}</td>
454
463
  </tr>`;
464
+ if (row.discount !== 0) {
465
+ let discountText = `${MoneyController.format(row.discount, detail.company.currencySymbol)} discount`;
466
+ content += `<tr>
467
+ <td style="${isLarge ? 'min-width:40px; width: 40px;' : `font-size:${activeFontSize}px; min-width:40px; width: 40px; text-align: left;`}">${isLarge ? '&ensp;' : ''}</td>
468
+ <td style="font-size:${activeFontSize}px; flex: 1; width: 100%; text-align: left; column-span: 2; padding-left: 24px;">${discountText}</td>
469
+ </tr>`;
470
+ }
455
471
  if (row.extrasNames) {
456
472
  row.extras
457
473
  .filter(item => !item.doNotPrintOnReceipt)
@@ -492,6 +508,14 @@ class SimplePreviewController {
492
508
  <td style="font-size:${activeFontSize}px; flex: 1; width: 100%; text-align: left; font-weight: bold;">${productName}</td>
493
509
  <td style="font-size:${activeFontSize}px; max-width: 90px; text-align: right;">${amount}</td>
494
510
  </tr>`;
511
+ if (row.discount !== 0) {
512
+ let discountText = `${MoneyController.format(row.discount, detail.company.currencySymbol)} discount`;
513
+ content += `<tr>
514
+ <td style="font-size:${activeFontSize}px; min-width:40px; width: 40px; text-align: left;">${isLarge ? '&ensp;' : ''}</td>
515
+ <td style="font-size:${activeFontSize}px; flex: 1; width: 100%; text-align: left;">${discountText}</td>
516
+ <td style="font-size:${activeFontSize}px; max-width: 90px; text-align: right;"></td>
517
+ </tr>`;
518
+ }
495
519
  row.extras.filter(i => !i.doNotPrintOnReceipt).forEach(element => {
496
520
  const side = this.pizzaSideText(element.pizzaSide, template.skipWholePizzaToppingText);
497
521
  const extraText = `${side}${element.quantity}${isLarge ? '× ' : 'x '}${element.extraItemTitle}`.trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meemup-library",
3
- "version": "1.9.2",
3
+ "version": "1.9.4",
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.9.2\" && git push origin "
14
+ "commit": "git add . && git commit -m \"version.1.9.4\" && git push origin "
15
15
  },
16
16
  "files": [
17
17
  "/dist"