meemup-library 1.6.1 → 1.6.3

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.
@@ -222,7 +222,11 @@ class _PreviewContentController {
222
222
  content += SimplePreviewController.printCustomerInformation(template, detail);
223
223
  content += SimplePreviewController.printProductCount(template, detail);
224
224
  content += SimplePreviewController.printTextBeforeProducts(template);
225
- content += SimplePreviewController.printProducts(template, detail);
225
+ let value = SimplePreviewController.printProducts(template, detail);
226
+ if (value !== "")
227
+ content += value;
228
+ else
229
+ return "";
226
230
  content += SimplePreviewController.printCustomerRemark(template, detail);
227
231
  content += SimplePreviewController.printDeliveryInstructionsRemarks(template, detail);
228
232
  content += SimplePreviewController.printCustomerSignature(template, detail);
@@ -261,7 +265,11 @@ class _PreviewContentController {
261
265
  content += SimplePreviewController.printCustomerInformation(template, detail);
262
266
  content += SimplePreviewController.printProductCount(template, detail);
263
267
  content += SimplePreviewController.printTextBeforeProducts(template);
264
- content += SimplePreviewController.printLargeProducts(template, detail);
268
+ let value = SimplePreviewController.printLargeProducts(template, detail);
269
+ if (value !== "")
270
+ content += value;
271
+ else
272
+ return "";
265
273
  content += SimplePreviewController.printCustomerRemark(template, detail);
266
274
  content += SimplePreviewController.printDeliveryInstructionsRemarks(template, detail);
267
275
  content += SimplePreviewController.printCustomerSignature(template, detail);
@@ -229,6 +229,7 @@ class SimplePreviewController {
229
229
  }
230
230
  printProducts(template, detail) {
231
231
  var _a, _b, _c;
232
+ let flag = true;
232
233
  let content = this.createDivContainer(template);
233
234
  content += `<table style="width: 100%; border-collapse: collapse;">
234
235
  <thead style="border-bottom: 1px solid #000000;">
@@ -242,6 +243,7 @@ class SimplePreviewController {
242
243
  `;
243
244
  const bundledProducts = detail.products.filter(i => Array.isArray(i.tags) && i.tags.findIndex(tag => tag.startsWith(BundleIdPreName)) !== -1);
244
245
  if (bundledProducts.length > 0) {
246
+ flag = false;
245
247
  const bundleGroups = [];
246
248
  bundledProducts.forEach(pro => {
247
249
  var _a;
@@ -317,6 +319,11 @@ class SimplePreviewController {
317
319
  }
318
320
  const unBundledProducts = detail.products.filter(i => !(Array.isArray(i.tags) && i.tags.findIndex(tag => tag.startsWith(BundleIdPreName)) !== -1));
319
321
  const list = this.filterByCategoryList(this.sortProduct(unBundledProducts, template.sortProducts), template.printOnlyCertainCategoriesList, template.printOnlyCertainCategories, template.printOnlyCertainProductsList, template.printOnlyCertainProducts);
322
+ if (list.length > 0) {
323
+ flag = false;
324
+ }
325
+ if (flag)
326
+ return "";
320
327
  list.forEach((row) => {
321
328
  let cat;
322
329
  if (!template.showCategoryTitle || !row.categoryTitle || row.categoryTitle.trim().length === 0)
@@ -453,6 +460,7 @@ class SimplePreviewController {
453
460
  }
454
461
  printLargeProducts(template, detail) {
455
462
  var _a, _b, _c;
463
+ let flag = true;
456
464
  let content = this.createDivContainer(template);
457
465
  const largeFontSize = template.printer === 5 ? 22 : parseInt((template.fontSize + 10) + "");
458
466
  content += `<table style="width: 100%; border-collapse: collapse;">
@@ -467,6 +475,7 @@ class SimplePreviewController {
467
475
  `;
468
476
  const bundledProducts = detail.products.filter(i => Array.isArray(i.tags) && i.tags.findIndex(tag => tag.startsWith(BundleIdPreName)) !== -1);
469
477
  if (bundledProducts.length > 0) {
478
+ flag = false;
470
479
  const bundleGroups = [];
471
480
  bundledProducts.forEach(pro => {
472
481
  var _a;
@@ -540,6 +549,11 @@ class SimplePreviewController {
540
549
  }
541
550
  const unBundledProducts = detail.products.filter(i => !(Array.isArray(i.tags) && i.tags.findIndex(tag => tag.startsWith(BundleIdPreName)) !== -1));
542
551
  const list = this.filterByCategoryList(this.sortProduct(unBundledProducts, template.sortProducts), template.printOnlyCertainCategoriesList, template.printOnlyCertainCategories, template.printOnlyCertainProductsList, template.printOnlyCertainProducts);
552
+ if (list.length > 0) {
553
+ flag = false;
554
+ }
555
+ if (flag)
556
+ return "";
543
557
  list.forEach((row) => {
544
558
  const productName = (template.showCategoryTitle ? `[${row.categoryTitle}] ` : "") + ((template.showProductKitchenName && typeof row.kitchenReceiptName === "string" && row.kitchenReceiptName.trim().length > 0) ? row.kitchenReceiptName : row.title).trim();
545
559
  const amount = template.showPrices ? MoneyController.format(row.totalAmount, detail.company.currencySymbol) : "";
@@ -0,0 +1,5 @@
1
+ declare enum PosOrderDisplayType {
2
+ DisplayTable = 0,
3
+ DisplayGrid = 1
4
+ }
5
+ export default PosOrderDisplayType;
@@ -0,0 +1,6 @@
1
+ var PosOrderDisplayType;
2
+ (function (PosOrderDisplayType) {
3
+ PosOrderDisplayType[PosOrderDisplayType["DisplayTable"] = 0] = "DisplayTable";
4
+ PosOrderDisplayType[PosOrderDisplayType["DisplayGrid"] = 1] = "DisplayGrid";
5
+ })(PosOrderDisplayType || (PosOrderDisplayType = {}));
6
+ export default PosOrderDisplayType;
@@ -1,3 +1,4 @@
1
+ import PosOrderDisplayType from "../../enums/enum-pos-order-display-type";
1
2
  import EnumNewOrderWarning from "../../enums/EnumNewOrderWarning";
2
3
  import EnumNotifyNewReservation from "../../enums/EnumNotifyNewReservation";
3
4
  import EnumNotifyOnlineStoreNewOrder from "../../enums/EnumNotifyOnlineStoreNewOrder";
@@ -75,6 +76,7 @@ interface IPointOfSaleLocalSetting {
75
76
  cashDrawers: IPointOfSaleLocalSettingCashDrawer[];
76
77
  defaultCashDrawerId: number | null;
77
78
  useSignalRAuth: boolean;
79
+ orderDisplayType: PosOrderDisplayType;
78
80
  }
79
81
  export default IPointOfSaleLocalSetting;
80
82
  export declare const initPointOfSaleLocalSetting: IPointOfSaleLocalSetting;
@@ -1,3 +1,4 @@
1
+ import PosOrderDisplayType from "../../enums/enum-pos-order-display-type";
1
2
  import EnumNewOrderWarning from "../../enums/EnumNewOrderWarning";
2
3
  import EnumNotifyNewReservation from "../../enums/EnumNotifyNewReservation";
3
4
  import EnumNotifyOnlineStoreNewOrder from "../../enums/EnumNotifyOnlineStoreNewOrder";
@@ -74,4 +75,5 @@ export const initPointOfSaleLocalSetting = {
74
75
  cashDrawers: [],
75
76
  defaultCashDrawerId: null,
76
77
  useSignalRAuth: false,
78
+ orderDisplayType: PosOrderDisplayType.DisplayGrid
77
79
  };
@@ -1,4 +1,5 @@
1
1
  import IPointOfSaleOrderExtraItem from "./IPointOfSaleOrderExtraItem";
2
+ import PointOfSaleOrderItemSeat from "./point-of-sale-order-item-seat";
2
3
  interface IPointOfSaleOrderItem {
3
4
  id: number;
4
5
  categoryId: number;
@@ -25,6 +26,7 @@ interface IPointOfSaleOrderItem {
25
26
  taxable: boolean | null;
26
27
  productName: string;
27
28
  tags: string[] | null;
29
+ seats: PointOfSaleOrderItemSeat[];
28
30
  _id?: string;
29
31
  discount?: number;
30
32
  }
@@ -23,5 +23,6 @@ export const initPointOfSaleOrderItem = {
23
23
  stampCardBonusItem: false,
24
24
  taxable: false,
25
25
  productName: "",
26
- tags: []
26
+ tags: [],
27
+ seats: []
27
28
  };
@@ -0,0 +1,4 @@
1
+ export default interface PointOfSaleOrderItemSeat {
2
+ seatId: number;
3
+ ratio: number;
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meemup-library",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
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.6.1\" && git push origin "
14
+ "commit": "git add . && git commit -m \"version.1.6.3\" && git push origin "
15
15
  },
16
16
  "files": [
17
17
  "/dist"