meemup-library 1.2.6 → 1.2.8
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/ApiController.d.ts +1 -1
- package/dist/controllers/ColorController.d.ts +13 -13
- package/dist/controllers/ColorController.js +11 -11
- package/dist/controllers/MoneyController.js +4 -1
- package/dist/controllers/OrderScreenController.d.ts +5 -5
- package/dist/controllers/PrintContentController.js +268 -268
- package/dist/controllers/ProductModalController.d.ts +16 -18
- package/dist/controllers/ProductModalController.js +5 -3
- package/dist/controllers/ZoneController.d.ts +7 -7
- package/dist/controllers/ZoneController.js +7 -7
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/interfaces/IExtra.d.ts +2 -2
- package/dist/interfaces/IExtra.js +16 -1
- package/dist/interfaces/IPointOfSaleLocalSetting.js +1 -2
- package/dist/interfaces/IProduct.d.ts +2 -1
- package/dist/interfaces/IProductExtra.d.ts +3 -9
- package/dist/interfaces/IProductExtra.js +3 -1
- package/dist/interfaces/ISelectedExtraItem.d.ts +2 -2
- package/dist/interfaces/ISelectedProductExtra.js +1 -3
- package/dist/interfaces/IStore.d.ts +4 -4
- package/dist/interfaces/database/{IDProductDefaultExtra.d.ts → IProductDefaultExtra.d.ts} +2 -2
- package/dist/types/TBaseExtra.d.ts +2 -2
- package/package.json +29 -29
- package/dist/interfaces/database/IDExtra.d.ts +0 -14
- package/dist/interfaces/database/IDExtraItem.d.ts +0 -18
- package/dist/interfaces/database/IDExtraItem.js +0 -1
- package/dist/interfaces/database/IDProduct.d.ts +0 -57
- package/dist/interfaces/database/IDProduct.js +0 -1
- package/dist/interfaces/database/IDProductDefaultExtra.js +0 -1
- /package/dist/interfaces/database/{IDExtra.js → IProductDefaultExtra.js} +0 -0
|
@@ -5,7 +5,6 @@ import IDriverAccount from "../interfaces/IDriverAccount";
|
|
|
5
5
|
export default class ApiController {
|
|
6
6
|
account: IAccount | IDriverAccount;
|
|
7
7
|
constructor(account: IAccount | IDriverAccount);
|
|
8
|
-
private getCompanyId;
|
|
9
8
|
defaultHeader(authorization?: boolean): Promise<{
|
|
10
9
|
Authorization?: string | undefined;
|
|
11
10
|
companyId: string;
|
|
@@ -18,4 +17,5 @@ export default class ApiController {
|
|
|
18
17
|
getWithAuth(url: string, header?: any): Promise<IAnswer>;
|
|
19
18
|
get(url: string, header?: any): Promise<IAnswer>;
|
|
20
19
|
deleteWithAuth(url: string, header?: any): Promise<IAnswer>;
|
|
20
|
+
private getCompanyId;
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import IPointOfSaleSetting from "../interfaces/IPointOfSaleSetting";
|
|
2
|
-
import
|
|
2
|
+
import IProduct from "../interfaces/IProduct";
|
|
3
3
|
/**
|
|
4
4
|
* کلاس ColorController برای مدیریت رنگها و تولید رنگ متن بر اساس رنگ پس زمینه استفاده میشود.
|
|
5
5
|
*/
|
|
@@ -11,10 +11,10 @@ declare class ColorController {
|
|
|
11
11
|
*/
|
|
12
12
|
generateContrastColorForHex(background_color: string): string;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
* متد generateContrastColorForRgba برای تولید رنگ متن بر اساس رنگ پس زمینه به صورت RGBA استفاده میشود.
|
|
15
|
+
* @param rgba_color رنگ پس زمینه به صورت RGBA (رنگ، سبز، آبی، شفافیت).
|
|
16
|
+
* @returns رنگ متن متناسب (به صورت hex) که برای نمایش بر روی رنگ پس زمینه انتخاب شده است.
|
|
17
|
+
*/
|
|
18
18
|
generateContrastColorForRgba(rgba_color: string): string;
|
|
19
19
|
/**
|
|
20
20
|
* متد generateContrastColorForRgb برای تولید رنگ متن بر اساس رنگ پس زمینه به صورت RGB استفاده میشود.
|
|
@@ -23,15 +23,15 @@ declare class ColorController {
|
|
|
23
23
|
*/
|
|
24
24
|
generateContrastColorForRgb(rgb_color: string): string;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
* متد generateContrastColorForBackground برای تولید رنگ متن بر اساس رنگ پس زمینه مورد نظر استفاده میشود.
|
|
27
|
+
* اگر رنگ پس زمینه null یا "transparent" باشد، رنگ متن #000000 (سیاه) برگردانده میشود.
|
|
28
|
+
* در غیر این صورت، از سه متد generateContrastColorForRgb و generateContrastColorForRgba و generateContrastColorForHex برای تولید رنگ متن استفاده میشود.
|
|
29
|
+
* اگر در هیچکدام از سه متد مورد نظر نگنجید، رنگ متن #000000 (سیاه) برگردانده میشود.
|
|
30
|
+
* @param background_color رنگ پس زمینه به هر فرمتی که میتواند string یا null باشد.
|
|
31
|
+
* @returns رنگ متن متناظر (به صورت hex) که برای نمایش بر روی رنگ پس زمینه انتخاب شده است.
|
|
32
|
+
*/
|
|
33
33
|
generateContrastColorForBackground(background_color: string | null, default_text_color?: string): string;
|
|
34
|
-
generateColorForPosProduct(product:
|
|
34
|
+
generateColorForPosProduct(product: IProduct, setting: IPointOfSaleSetting, defaultBackgroundColor: any, defaultTextColor: any): {
|
|
35
35
|
backgroundColor: any;
|
|
36
36
|
textColor: any;
|
|
37
37
|
};
|
|
@@ -20,10 +20,10 @@ class ColorController {
|
|
|
20
20
|
return text_color;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
* متد generateContrastColorForRgba برای تولید رنگ متن بر اساس رنگ پس زمینه به صورت RGBA استفاده میشود.
|
|
24
|
+
* @param rgba_color رنگ پس زمینه به صورت RGBA (رنگ، سبز، آبی، شفافیت).
|
|
25
|
+
* @returns رنگ متن متناسب (به صورت hex) که برای نمایش بر روی رنگ پس زمینه انتخاب شده است.
|
|
26
|
+
*/
|
|
27
27
|
generateContrastColorForRgba(rgba_color) {
|
|
28
28
|
var _a;
|
|
29
29
|
// استخراج مقادیر R، G، B از RGBA
|
|
@@ -56,13 +56,13 @@ class ColorController {
|
|
|
56
56
|
return text_color;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
* متد generateContrastColorForBackground برای تولید رنگ متن بر اساس رنگ پس زمینه مورد نظر استفاده میشود.
|
|
60
|
+
* اگر رنگ پس زمینه null یا "transparent" باشد، رنگ متن #000000 (سیاه) برگردانده میشود.
|
|
61
|
+
* در غیر این صورت، از سه متد generateContrastColorForRgb و generateContrastColorForRgba و generateContrastColorForHex برای تولید رنگ متن استفاده میشود.
|
|
62
|
+
* اگر در هیچکدام از سه متد مورد نظر نگنجید، رنگ متن #000000 (سیاه) برگردانده میشود.
|
|
63
|
+
* @param background_color رنگ پس زمینه به هر فرمتی که میتواند string یا null باشد.
|
|
64
|
+
* @returns رنگ متن متناظر (به صورت hex) که برای نمایش بر روی رنگ پس زمینه انتخاب شده است.
|
|
65
|
+
*/
|
|
66
66
|
generateContrastColorForBackground(background_color, default_text_color = "#000") {
|
|
67
67
|
// اگر رنگ پس زمینه null یا "transparent" باشد، رنگ سیاه را برگردانید
|
|
68
68
|
if (background_color === null || background_color.trim().toLowerCase() === "transparent") {
|
|
@@ -23,7 +23,10 @@ export default new class MoneyController {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
format(money, currency = "$", preText = "") {
|
|
26
|
-
return `${preText}${currency}${Intl.NumberFormat("en-US", {
|
|
26
|
+
return `${preText}${currency}${Intl.NumberFormat("en-US", {
|
|
27
|
+
minimumFractionDigits: 2,
|
|
28
|
+
maximumFractionDigits: 2
|
|
29
|
+
}).format(this.round(money))}`;
|
|
27
30
|
}
|
|
28
31
|
sum(values) {
|
|
29
32
|
let sum = 0;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import IOrderScreenState from "../interfaces/IOrderScreenState";
|
|
2
2
|
import EnumOrderType from "../enums/EnumOrderType";
|
|
3
3
|
import IOrderItem from "../interfaces/order/IOrderItem";
|
|
4
|
-
import IDProduct from "../interfaces/database/IDProduct";
|
|
5
4
|
import ICategory from "../interfaces/ICategory";
|
|
5
|
+
import IProduct from "../interfaces/IProduct";
|
|
6
6
|
declare const _default: {
|
|
7
7
|
checkDayWeek: (index: number, weekDays: number) => boolean;
|
|
8
8
|
fetchCategories(categories: ICategory[]): ICategory[];
|
|
9
|
-
fetchProducts(arg: IOrderScreenState, products:
|
|
10
|
-
searchProduct(products:
|
|
11
|
-
productPrice(product:
|
|
12
|
-
productCountInOrder(product:
|
|
9
|
+
fetchProducts(arg: IOrderScreenState, products: IProduct[], categories: ICategory[]): IProduct[];
|
|
10
|
+
searchProduct(products: IProduct[], word: string): IProduct[];
|
|
11
|
+
productPrice(product: IProduct, orderType: EnumOrderType): number;
|
|
12
|
+
productCountInOrder(product: IProduct, items: IOrderItem[]): number;
|
|
13
13
|
};
|
|
14
14
|
export default _default;
|
|
@@ -208,290 +208,290 @@ export default new class {
|
|
|
208
208
|
const { order, company, customer, products, paymentInfo } = detail;
|
|
209
209
|
const { printOnlyCertainCategoriesList, printOnlyCertainCategories, printOnlyCertainProductsList, printOnlyCertainProducts, customerAddressFontSize, showCustomerInfo, orderInfo, showPrices, textAfterAddress, textAfterAddressCenter, nameAddressShow, nameAddressCenter, font, fontSize, marginBottom, marginLeft, marginRight, marginTop, logoAvailable, logoCenter, logoUrl, sortProducts, textBeforeProducts, textBeforeProductsCenter, customerOnlinePaymentAgrementSection, id, promotionCodeNote, promotionId, qrCodeOrderDetails, showCategoryTitle, showProductKitchenName, textEnd, textEndCenter, width, paper } = template;
|
|
210
210
|
const address = this.createAddressText(customer);
|
|
211
|
-
return (`
|
|
212
|
-
<div style="font-family: ${font}; font-weight: 500; font-size: ${fontSize + "px"}; min-width: ${this.calculatePaperSize(paper, width)}; width: ${this.calculatePaperSize(paper, width)}; padding : ${marginTop + "mm"} ${marginRight + "mm"} ${marginBottom + "mm"} ${marginLeft + "mm"};">
|
|
213
|
-
<img alt="" style=" display : ${logoAvailable ? "block" : "none"}; margin : ${logoCenter ? "auto" : "0"}; width: 200px; min-height : 50px;" src="${rootUrl}${company.id}/${logoUrl}" />
|
|
214
|
-
<p style=" margin: 5px 0; line-height: 1; display: ${nameAddressShow ? "block" : "none"}; text-align:${nameAddressCenter ? "center" : "start"};">
|
|
215
|
-
${company.title}
|
|
216
|
-
</p>
|
|
217
|
-
<p style="margin:5px 0; display:${nameAddressShow ? "block" : "none"}; text-align:${nameAddressCenter ? "center" : "start"};">
|
|
218
|
-
${company.address}
|
|
219
|
-
</p>
|
|
220
|
-
<p style="margin: 5px 0; line-height: 1; display: ${nameAddressShow ? "block" : "none"}; text-align:${nameAddressCenter ? "center" : "start"};">
|
|
221
|
-
${PhoneController.formatPhoneNumber(company.phone)}
|
|
222
|
-
</p>
|
|
223
|
-
<p style="margin: 5px 0; line-height: 1; display: ${textAfterAddress ? "block" : "none"}; text-align:${textAfterAddressCenter ? "center" : "start"};">
|
|
224
|
-
${textAfterAddress}
|
|
225
|
-
</p>
|
|
226
|
-
|
|
227
|
-
<div style=" display:${order.orderTypeString ? "flex" : "none"}; flex-direction: column; align-items: center; justify-content: center; margin: 8px 0;" >
|
|
228
|
-
|
|
229
|
-
<p style=" font-size: x-large; font-weight: bold; text-align: center;line-height: 0.7; margin: 5px 0;"> #${order.orderNumber} ${order.orderTypeString} </p>
|
|
230
|
-
|
|
231
|
-
<strong style="font-size: x-large; text-align: center;">
|
|
232
|
-
⏱${order.asSoonAsPossible && "ASAP"} ${this.formatDateTime(order.desiredDate, "time")}
|
|
233
|
-
</strong>
|
|
234
|
-
|
|
235
|
-
${order.estimatedTime ? `<strong style="display:block; font-size:x-large; text-align:center;">Est. Time ${this.substring(order.estimatedTime, 0, order.estimatedTime.length - 3)}</strong>` : ""}
|
|
236
|
-
</div>
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
<div style="display: ${showPrices ? "block" : "none"}; border-top: 1px solid black;">
|
|
240
|
-
<strong style="display : block; margin: 5px 0; line-height: 1;">PAY INFORMATION: </strong>
|
|
241
|
-
<strong style="font-size: large; margin: 0 0 16px 0; line-height: 1.5;">${order.paymentTypeString + (order.paymentType === 2 ? `: ${this.ccyFormat(order.totalAmount, symbol)} ` : " ") + " - " + order.paymentStateString}</strong>
|
|
242
|
-
|
|
243
|
-
<p style="margin: 5px 0; line-height: 1; display: ${order.paymentType === 1 ? "block" : "none"};">Credit Card : <strong>**** **** **** ${order.lastFourDigits}</strong></p>
|
|
244
|
-
|
|
245
|
-
</div>
|
|
246
|
-
|
|
247
|
-
<p style="display:${orderInfo ? "block" : "none"}; margin: 5px 0; line-height: 1;"> Order number : <strong>#${order.orderNumber}</strong> </p>
|
|
248
|
-
<p style="display:${orderInfo ? "block" : "none"}; margin: 5px 0; line-height: 1;">
|
|
249
|
-
${order.orderTypeString}:<span style="font-size: x-large;">⏱</span><strong>on ${this.formatDateTime(order.desiredDate)}</strong>
|
|
250
|
-
</p>
|
|
251
|
-
|
|
252
|
-
${order.estimatedTime ? `<p style="display: block; margin: 5px 0; line-height: 1;">Estimated Time : <strong>${(_a = order.estimatedTime) === null || _a === void 0 ? void 0 : _a.substring(0, order.estimatedTime.length - 3)}</strong></p>` : ""}
|
|
253
|
-
|
|
254
|
-
<p style="display:block; margin: 5px 0; line-height: 1;">Reg. Date:<strong>${this.formatDateTime(order.registrationDate)}</strong> </p>
|
|
255
|
-
|
|
256
|
-
<div style="border-top: 1px solid black;">
|
|
257
|
-
|
|
258
|
-
<div style="display:${showCustomerInfo ? "block" : "none"}">
|
|
259
|
-
|
|
260
|
-
<strong style="display:block; margin: 5px 0; line-height: 1;"> CUSTOMER DATA : </strong>
|
|
261
|
-
<p style="display:${customer.fullName ? "block" : "none"}; margin: 5px 0; line-height: 1;">${customer.fullName}</p>
|
|
262
|
-
<p style="display:${customer.phoneNumber ? "block" : "none"}; margin: 5px 0; line-height: 1;">${PhoneController.formatPhoneNumber(customer.phoneNumber)}</p>
|
|
263
|
-
<p style="display:${address ? "block" : "none"}; font-size: ${customerAddressFontSize + "px"}; margin: 5px 0; line-height: 1;">
|
|
264
|
-
${address !== null ? address[0] : null}
|
|
265
|
-
<br/>
|
|
266
|
-
${address !== null ? address[1] : null}
|
|
267
|
-
</p>
|
|
268
|
-
<p style="display:${customer.email ? "block" : "none"}; margin: 5px 0; line-height: 1;">${customer.email}</p>
|
|
269
|
-
|
|
270
|
-
</div>
|
|
271
|
-
|
|
272
|
-
<strong style="display:block; font-size: ${(fontSize * 1.2).toFixed(0) + "px"}; margin: 10px 0; line-height: 1;">
|
|
273
|
-
${this.sum(this.filterByCategoryList(this.sortProduct(products, sortProducts), printOnlyCertainCategoriesList, printOnlyCertainCategories, printOnlyCertainProductsList, printOnlyCertainProducts).map((row) => row.quantity))} ITEM
|
|
274
|
-
</strong>
|
|
275
|
-
|
|
276
|
-
<p style="display:${textBeforeProducts ? "block" : "none"}; margin: 5px 0; padding-left : 15px; text-align : ${textBeforeProductsCenter ? "center" : "start"}; line-height: 1;"> ${textBeforeProducts} </p>
|
|
277
|
-
|
|
278
|
-
</div>
|
|
279
|
-
|
|
280
|
-
<div style="border-top : 1px solid black;">
|
|
281
|
-
|
|
282
|
-
<div style="padding : 4px 1px; display : flex; flex-direction : row; border-bottom : 1px solid black; font-weight : bold;">
|
|
283
|
-
|
|
284
|
-
<div style="width : 40px; min-width : 40px; max-width : 40px;">#</div>
|
|
285
|
-
<div style="flex-wrap : wrap; word-wrap : break-word;">Products</div>
|
|
286
|
-
<div style="flex-grow : 1; text-align: end;">Price</div>
|
|
287
|
-
|
|
288
|
-
</div>
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
${this.filterByCategoryList(this.sortProduct(products, sortProducts), printOnlyCertainCategoriesList, printOnlyCertainCategories, printOnlyCertainProductsList, printOnlyCertainProducts).map((row) => (`<div style="border-bottom : 1px solid black; padding : 0 1px; display : flex; flex-direction : row; justify-content : flex-end;">
|
|
292
|
-
|
|
293
|
-
<div style="width : 40px; min-width : 40px; max-width : 40px">${row.quantity}X</div>
|
|
294
|
-
|
|
295
|
-
<div style="flex-wrap : wrap; word-wrap : break-word; text-align : left;">
|
|
296
|
-
|
|
297
|
-
${(showCategoryTitle && row.categoryTitle !== "" && row.categoryTitle !== null) ? "[" + row.categoryTitle + "]" : ""} ${showProductKitchenName && row.kitchenReceiptName !== "" ? row.kitchenReceiptName : row.title}
|
|
298
|
-
${row.extrasNames ? row.extrasNames.split(" , ").map(i => `<div>+${i}</div>`).join("") : ""}
|
|
299
|
-
${row.note ? `<div><span style="font-size: x-large;">🗨</span>{note}</div>` : ""}
|
|
300
|
-
|
|
301
|
-
</div>
|
|
302
|
-
|
|
303
|
-
<div style="flex-grow : 1; text-align : right;">${this.ccyFormat(row.totalAmount, symbol)}</div>
|
|
304
|
-
</div>`)).join("")}
|
|
305
|
-
|
|
306
|
-
<div style="display : ${showPrices ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
|
|
307
|
-
<div style="min-width : 150px; flex-grow : 1; text-align: end;">Order Amount :</div>
|
|
308
|
-
<div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.orderAmount, symbol)}</div>
|
|
309
|
-
</div>
|
|
310
|
-
|
|
311
|
-
<div style="display : ${order.orderType === 1 && order.deliveryCost > 0 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
|
|
312
|
-
<div style="min-width : 150px; flex-grow : 1; text-align: end;">Delivery costs : </div>
|
|
313
|
-
<div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.deliveryCost, symbol)}</div>
|
|
314
|
-
</div>
|
|
315
|
-
|
|
316
|
-
<div style="display : ${order.discountAmount > 0 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
|
|
317
|
-
<div style="min-width : 150px; flex-grow : 1; text-align: end;">Discount : </div>
|
|
318
|
-
<div style="min-width : 100px; text-align: end;">${(order.discountAmount > 0 ? "- " : "") + this.ccyFormat(order.discountAmount, symbol)}</div>
|
|
319
|
-
</div>
|
|
320
|
-
|
|
321
|
-
<div style="display : flex; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
|
|
322
|
-
<div style="min-width : 150px; flex-grow : 1; text-align: end;">Subtotal : </div>
|
|
323
|
-
<div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.subtotalAmount, symbol)}</div>
|
|
324
|
-
</div>
|
|
325
|
-
|
|
326
|
-
<div style="display : ${order.hstAmount > 0 && order.serviceFee < 1 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
|
|
327
|
-
<div style="min-width : 150px; flex-grow : 1; text-align: end;">HST(${this.ccyFormat(order.hstPercentage)}%) : </div>
|
|
328
|
-
<div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.hstAmount, symbol)}</div>
|
|
329
|
-
</div>
|
|
330
|
-
|
|
331
|
-
<div style="display : ${order.tipAmount > 0 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
|
|
332
|
-
<div style="min-width : 150px; flex-grow : 1; text-align: end;">Tip : </div>
|
|
333
|
-
<div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.tipAmount, symbol)}</div>
|
|
334
|
-
</div>
|
|
335
|
-
|
|
336
|
-
<div style="display : flex; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px solid black;">
|
|
337
|
-
<strong style="min-width : 150px; flex-grow : 1; font-size: larger; text-align: end;">${order.paymentType === 1 ? "Total" : "Total & Still to pay"} : </strong>
|
|
338
|
-
<strong style="min-width : 100px; font-size: larger; text-align: end;">${this.ccyFormat(order.totalAmount, symbol)}</strong>
|
|
339
|
-
</div>
|
|
340
|
-
|
|
341
|
-
</div>
|
|
342
|
-
|
|
343
|
-
<div class="border-top : 1px solid black;">
|
|
344
|
-
<div style="margin : 5px 0; line-height: 1;">
|
|
345
|
-
<strong>Remarks customer:</strong>
|
|
346
|
-
<em style="display : ${!order.remarks ? "initial" : "none"}">There are no remarks</em>
|
|
347
|
-
</div>
|
|
348
|
-
<strong style="display : ${order.remarks ? "block" : "none"};">${order.remarks}</strong>
|
|
349
|
-
</div>
|
|
350
|
-
|
|
351
|
-
<div style="display : ${order.paymentType === 1 && customerOnlinePaymentAgrementSection ? "block" : "none"}; border-top : 1px solid black; text-align : center;">
|
|
352
|
-
|
|
353
|
-
<p style="margin : 5px 0; line-height: 1;"><strong>CREDIT CARD : </strong>**** **** **** ${order.lastFourDigits}</p>
|
|
354
|
-
|
|
355
|
-
<strong style="margin : 5px 0; line-height: 1;">
|
|
356
|
-
I agree to pay above total amount according to card issuer agreement
|
|
357
|
-
</strong>
|
|
358
|
-
<br/>
|
|
359
|
-
<br/>
|
|
360
|
-
<strong style="margin : 5px 0; line-height: 1;">SIGNATURE</strong>
|
|
361
|
-
</div>
|
|
362
|
-
|
|
363
|
-
<div style="display : ${promotionId ? "block" : "none"}; border-top : 1px solid black; margin : 5px 0; line-height: 1; text-align : ${textEndCenter ? "center" : "start"}">
|
|
364
|
-
${promotionCodeNote}
|
|
365
|
-
</div>
|
|
366
|
-
|
|
367
|
-
<div style="margin : 0 16px; display : ${(paymentInfo !== null && order.paymentType === 8 && ((_b = paymentInfo === null || paymentInfo === void 0 ? void 0 : paymentInfo.metadata) === null || _b === void 0 ? void 0 : _b.length) > 0) ? "block" : "none"};">
|
|
368
|
-
${paymentInfo === null || paymentInfo === void 0 ? void 0 : paymentInfo.metadata.map((item) => (`<div style="display : flex; flex-direction : row; align-items : center; justify-content : flex-start; margin-bottom : 8px;">
|
|
369
|
-
<strong style="margin : 0 16px 0 0; line-height: 1;"> ${item.text} </strong>
|
|
370
|
-
<strong style="margin : 0 16px 0 0; line-height: 1;" > ${item.value}</strong>
|
|
371
|
-
</div>`))}
|
|
372
|
-
</div>
|
|
373
|
-
|
|
374
|
-
<div style="display : ${qrCodeOrderDetails ? "flex" : "none"}; justify-content: center; align-items: center; border-top : 1px solid black; border-bottom : 1px solid black;">
|
|
375
|
-
<img alt="" style="width: 100px; height: 100px; margin: auto;" src="${order.qrCodeDetailUrl}" />
|
|
376
|
-
</div>
|
|
377
|
-
|
|
378
|
-
<p style="display : ${textEnd ? "block" : "none"}; text-align : ${textEndCenter ? "center" : "start"}; line-height: 1; margin-top: 4px;">${textEnd}</p>
|
|
379
|
-
|
|
380
|
-
<strong style="display: block; font-size : x-small; text-align : center; margin-top: 4px; ">fs-${company.id}-${order.id}-${id}</strong>
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
</div>
|
|
211
|
+
return (`
|
|
212
|
+
<div style="font-family: ${font}; font-weight: 500; font-size: ${fontSize + "px"}; min-width: ${this.calculatePaperSize(paper, width)}; width: ${this.calculatePaperSize(paper, width)}; padding : ${marginTop + "mm"} ${marginRight + "mm"} ${marginBottom + "mm"} ${marginLeft + "mm"};">
|
|
213
|
+
<img alt="" style=" display : ${logoAvailable ? "block" : "none"}; margin : ${logoCenter ? "auto" : "0"}; width: 200px; min-height : 50px;" src="${rootUrl}${company.id}/${logoUrl}" />
|
|
214
|
+
<p style=" margin: 5px 0; line-height: 1; display: ${nameAddressShow ? "block" : "none"}; text-align:${nameAddressCenter ? "center" : "start"};">
|
|
215
|
+
${company.title}
|
|
216
|
+
</p>
|
|
217
|
+
<p style="margin:5px 0; display:${nameAddressShow ? "block" : "none"}; text-align:${nameAddressCenter ? "center" : "start"};">
|
|
218
|
+
${company.address}
|
|
219
|
+
</p>
|
|
220
|
+
<p style="margin: 5px 0; line-height: 1; display: ${nameAddressShow ? "block" : "none"}; text-align:${nameAddressCenter ? "center" : "start"};">
|
|
221
|
+
${PhoneController.formatPhoneNumber(company.phone)}
|
|
222
|
+
</p>
|
|
223
|
+
<p style="margin: 5px 0; line-height: 1; display: ${textAfterAddress ? "block" : "none"}; text-align:${textAfterAddressCenter ? "center" : "start"};">
|
|
224
|
+
${textAfterAddress}
|
|
225
|
+
</p>
|
|
226
|
+
|
|
227
|
+
<div style=" display:${order.orderTypeString ? "flex" : "none"}; flex-direction: column; align-items: center; justify-content: center; margin: 8px 0;" >
|
|
228
|
+
|
|
229
|
+
<p style=" font-size: x-large; font-weight: bold; text-align: center;line-height: 0.7; margin: 5px 0;"> #${order.orderNumber} ${order.orderTypeString} </p>
|
|
230
|
+
|
|
231
|
+
<strong style="font-size: x-large; text-align: center;">
|
|
232
|
+
⏱${order.asSoonAsPossible && "ASAP"} ${this.formatDateTime(order.desiredDate, "time")}
|
|
233
|
+
</strong>
|
|
234
|
+
|
|
235
|
+
${order.estimatedTime ? `<strong style="display:block; font-size:x-large; text-align:center;">Est. Time ${this.substring(order.estimatedTime, 0, order.estimatedTime.length - 3)}</strong>` : ""}
|
|
236
|
+
</div>
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
<div style="display: ${showPrices ? "block" : "none"}; border-top: 1px solid black;">
|
|
240
|
+
<strong style="display : block; margin: 5px 0; line-height: 1;">PAY INFORMATION: </strong>
|
|
241
|
+
<strong style="font-size: large; margin: 0 0 16px 0; line-height: 1.5;">${order.paymentTypeString + (order.paymentType === 2 ? `: ${this.ccyFormat(order.totalAmount, symbol)} ` : " ") + " - " + order.paymentStateString}</strong>
|
|
242
|
+
|
|
243
|
+
<p style="margin: 5px 0; line-height: 1; display: ${order.paymentType === 1 ? "block" : "none"};">Credit Card : <strong>**** **** **** ${order.lastFourDigits}</strong></p>
|
|
244
|
+
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<p style="display:${orderInfo ? "block" : "none"}; margin: 5px 0; line-height: 1;"> Order number : <strong>#${order.orderNumber}</strong> </p>
|
|
248
|
+
<p style="display:${orderInfo ? "block" : "none"}; margin: 5px 0; line-height: 1;">
|
|
249
|
+
${order.orderTypeString}:<span style="font-size: x-large;">⏱</span><strong>on ${this.formatDateTime(order.desiredDate)}</strong>
|
|
250
|
+
</p>
|
|
251
|
+
|
|
252
|
+
${order.estimatedTime ? `<p style="display: block; margin: 5px 0; line-height: 1;">Estimated Time : <strong>${(_a = order.estimatedTime) === null || _a === void 0 ? void 0 : _a.substring(0, order.estimatedTime.length - 3)}</strong></p>` : ""}
|
|
253
|
+
|
|
254
|
+
<p style="display:block; margin: 5px 0; line-height: 1;">Reg. Date:<strong>${this.formatDateTime(order.registrationDate)}</strong> </p>
|
|
255
|
+
|
|
256
|
+
<div style="border-top: 1px solid black;">
|
|
257
|
+
|
|
258
|
+
<div style="display:${showCustomerInfo ? "block" : "none"}">
|
|
259
|
+
|
|
260
|
+
<strong style="display:block; margin: 5px 0; line-height: 1;"> CUSTOMER DATA : </strong>
|
|
261
|
+
<p style="display:${customer.fullName ? "block" : "none"}; margin: 5px 0; line-height: 1;">${customer.fullName}</p>
|
|
262
|
+
<p style="display:${customer.phoneNumber ? "block" : "none"}; margin: 5px 0; line-height: 1;">${PhoneController.formatPhoneNumber(customer.phoneNumber)}</p>
|
|
263
|
+
<p style="display:${address ? "block" : "none"}; font-size: ${customerAddressFontSize + "px"}; margin: 5px 0; line-height: 1;">
|
|
264
|
+
${address !== null ? address[0] : null}
|
|
265
|
+
<br/>
|
|
266
|
+
${address !== null ? address[1] : null}
|
|
267
|
+
</p>
|
|
268
|
+
<p style="display:${customer.email ? "block" : "none"}; margin: 5px 0; line-height: 1;">${customer.email}</p>
|
|
269
|
+
|
|
270
|
+
</div>
|
|
271
|
+
|
|
272
|
+
<strong style="display:block; font-size: ${(fontSize * 1.2).toFixed(0) + "px"}; margin: 10px 0; line-height: 1;">
|
|
273
|
+
${this.sum(this.filterByCategoryList(this.sortProduct(products, sortProducts), printOnlyCertainCategoriesList, printOnlyCertainCategories, printOnlyCertainProductsList, printOnlyCertainProducts).map((row) => row.quantity))} ITEM
|
|
274
|
+
</strong>
|
|
275
|
+
|
|
276
|
+
<p style="display:${textBeforeProducts ? "block" : "none"}; margin: 5px 0; padding-left : 15px; text-align : ${textBeforeProductsCenter ? "center" : "start"}; line-height: 1;"> ${textBeforeProducts} </p>
|
|
277
|
+
|
|
278
|
+
</div>
|
|
279
|
+
|
|
280
|
+
<div style="border-top : 1px solid black;">
|
|
281
|
+
|
|
282
|
+
<div style="padding : 4px 1px; display : flex; flex-direction : row; border-bottom : 1px solid black; font-weight : bold;">
|
|
283
|
+
|
|
284
|
+
<div style="width : 40px; min-width : 40px; max-width : 40px;">#</div>
|
|
285
|
+
<div style="flex-wrap : wrap; word-wrap : break-word;">Products</div>
|
|
286
|
+
<div style="flex-grow : 1; text-align: end;">Price</div>
|
|
287
|
+
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
${this.filterByCategoryList(this.sortProduct(products, sortProducts), printOnlyCertainCategoriesList, printOnlyCertainCategories, printOnlyCertainProductsList, printOnlyCertainProducts).map((row) => (`<div style="border-bottom : 1px solid black; padding : 0 1px; display : flex; flex-direction : row; justify-content : flex-end;">
|
|
292
|
+
|
|
293
|
+
<div style="width : 40px; min-width : 40px; max-width : 40px">${row.quantity}X</div>
|
|
294
|
+
|
|
295
|
+
<div style="flex-wrap : wrap; word-wrap : break-word; text-align : left;">
|
|
296
|
+
|
|
297
|
+
${(showCategoryTitle && row.categoryTitle !== "" && row.categoryTitle !== null) ? "[" + row.categoryTitle + "]" : ""} ${showProductKitchenName && row.kitchenReceiptName !== "" ? row.kitchenReceiptName : row.title}
|
|
298
|
+
${row.extrasNames ? row.extrasNames.split(" , ").map(i => `<div>+${i}</div>`).join("") : ""}
|
|
299
|
+
${row.note ? `<div><span style="font-size: x-large;">🗨</span>{note}</div>` : ""}
|
|
300
|
+
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
<div style="flex-grow : 1; text-align : right;">${this.ccyFormat(row.totalAmount, symbol)}</div>
|
|
304
|
+
</div>`)).join("")}
|
|
305
|
+
|
|
306
|
+
<div style="display : ${showPrices ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
|
|
307
|
+
<div style="min-width : 150px; flex-grow : 1; text-align: end;">Order Amount :</div>
|
|
308
|
+
<div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.orderAmount, symbol)}</div>
|
|
309
|
+
</div>
|
|
310
|
+
|
|
311
|
+
<div style="display : ${order.orderType === 1 && order.deliveryCost > 0 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
|
|
312
|
+
<div style="min-width : 150px; flex-grow : 1; text-align: end;">Delivery costs : </div>
|
|
313
|
+
<div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.deliveryCost, symbol)}</div>
|
|
314
|
+
</div>
|
|
315
|
+
|
|
316
|
+
<div style="display : ${order.discountAmount > 0 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
|
|
317
|
+
<div style="min-width : 150px; flex-grow : 1; text-align: end;">Discount : </div>
|
|
318
|
+
<div style="min-width : 100px; text-align: end;">${(order.discountAmount > 0 ? "- " : "") + this.ccyFormat(order.discountAmount, symbol)}</div>
|
|
319
|
+
</div>
|
|
320
|
+
|
|
321
|
+
<div style="display : flex; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
|
|
322
|
+
<div style="min-width : 150px; flex-grow : 1; text-align: end;">Subtotal : </div>
|
|
323
|
+
<div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.subtotalAmount, symbol)}</div>
|
|
324
|
+
</div>
|
|
325
|
+
|
|
326
|
+
<div style="display : ${order.hstAmount > 0 && order.serviceFee < 1 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
|
|
327
|
+
<div style="min-width : 150px; flex-grow : 1; text-align: end;">HST(${this.ccyFormat(order.hstPercentage)}%) : </div>
|
|
328
|
+
<div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.hstAmount, symbol)}</div>
|
|
329
|
+
</div>
|
|
330
|
+
|
|
331
|
+
<div style="display : ${order.tipAmount > 0 ? "flex" : "none"}; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px dotted black;">
|
|
332
|
+
<div style="min-width : 150px; flex-grow : 1; text-align: end;">Tip : </div>
|
|
333
|
+
<div style="min-width : 100px; text-align: end;">${this.ccyFormat(order.tipAmount, symbol)}</div>
|
|
334
|
+
</div>
|
|
335
|
+
|
|
336
|
+
<div style="display : flex; padding : 1px; flex-direction : row; justify-content : flex-end; border-bottom: 1px solid black;">
|
|
337
|
+
<strong style="min-width : 150px; flex-grow : 1; font-size: larger; text-align: end;">${order.paymentType === 1 ? "Total" : "Total & Still to pay"} : </strong>
|
|
338
|
+
<strong style="min-width : 100px; font-size: larger; text-align: end;">${this.ccyFormat(order.totalAmount, symbol)}</strong>
|
|
339
|
+
</div>
|
|
340
|
+
|
|
341
|
+
</div>
|
|
342
|
+
|
|
343
|
+
<div class="border-top : 1px solid black;">
|
|
344
|
+
<div style="margin : 5px 0; line-height: 1;">
|
|
345
|
+
<strong>Remarks customer:</strong>
|
|
346
|
+
<em style="display : ${!order.remarks ? "initial" : "none"}">There are no remarks</em>
|
|
347
|
+
</div>
|
|
348
|
+
<strong style="display : ${order.remarks ? "block" : "none"};">${order.remarks}</strong>
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
<div style="display : ${order.paymentType === 1 && customerOnlinePaymentAgrementSection ? "block" : "none"}; border-top : 1px solid black; text-align : center;">
|
|
352
|
+
|
|
353
|
+
<p style="margin : 5px 0; line-height: 1;"><strong>CREDIT CARD : </strong>**** **** **** ${order.lastFourDigits}</p>
|
|
354
|
+
|
|
355
|
+
<strong style="margin : 5px 0; line-height: 1;">
|
|
356
|
+
I agree to pay above total amount according to card issuer agreement
|
|
357
|
+
</strong>
|
|
358
|
+
<br/>
|
|
359
|
+
<br/>
|
|
360
|
+
<strong style="margin : 5px 0; line-height: 1;">SIGNATURE</strong>
|
|
361
|
+
</div>
|
|
362
|
+
|
|
363
|
+
<div style="display : ${promotionId ? "block" : "none"}; border-top : 1px solid black; margin : 5px 0; line-height: 1; text-align : ${textEndCenter ? "center" : "start"}">
|
|
364
|
+
${promotionCodeNote}
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
<div style="margin : 0 16px; display : ${(paymentInfo !== null && order.paymentType === 8 && ((_b = paymentInfo === null || paymentInfo === void 0 ? void 0 : paymentInfo.metadata) === null || _b === void 0 ? void 0 : _b.length) > 0) ? "block" : "none"};">
|
|
368
|
+
${paymentInfo === null || paymentInfo === void 0 ? void 0 : paymentInfo.metadata.map((item) => (`<div style="display : flex; flex-direction : row; align-items : center; justify-content : flex-start; margin-bottom : 8px;">
|
|
369
|
+
<strong style="margin : 0 16px 0 0; line-height: 1;"> ${item.text} </strong>
|
|
370
|
+
<strong style="margin : 0 16px 0 0; line-height: 1;" > ${item.value}</strong>
|
|
371
|
+
</div>`))}
|
|
372
|
+
</div>
|
|
373
|
+
|
|
374
|
+
<div style="display : ${qrCodeOrderDetails ? "flex" : "none"}; justify-content: center; align-items: center; border-top : 1px solid black; border-bottom : 1px solid black;">
|
|
375
|
+
<img alt="" style="width: 100px; height: 100px; margin: auto;" src="${order.qrCodeDetailUrl}" />
|
|
376
|
+
</div>
|
|
377
|
+
|
|
378
|
+
<p style="display : ${textEnd ? "block" : "none"}; text-align : ${textEndCenter ? "center" : "start"}; line-height: 1; margin-top: 4px;">${textEnd}</p>
|
|
379
|
+
|
|
380
|
+
<strong style="display: block; font-size : x-small; text-align : center; margin-top: 4px; ">fs-${company.id}-${order.id}-${id}</strong>
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
</div>
|
|
384
384
|
`);
|
|
385
385
|
}
|
|
386
386
|
labelLayout(detail, template) {
|
|
387
387
|
const { products, customer, order } = detail;
|
|
388
388
|
const { orderSummary } = template;
|
|
389
389
|
const { font, fontSize, marginBottom, marginLeft, marginRight, marginTop, showCategoryTitle, showProductKitchenName, width, paper } = template;
|
|
390
|
-
return (`
|
|
391
|
-
<div style="font-family : ${font};font-weight : normal;">
|
|
392
|
-
${products.map((row) => (`<div>
|
|
393
|
-
<div
|
|
394
|
-
style="
|
|
395
|
-
display: block;
|
|
396
|
-
min-width: ${this.calculatePaperSize(paper, width)};
|
|
397
|
-
width: ${this.calculatePaperSize(paper, width)};
|
|
398
|
-
padding : ${marginTop + "mm"} ${marginRight + "mm"} ${marginBottom + "mm"} ${marginLeft + "mm"};">
|
|
399
|
-
|
|
390
|
+
return (`
|
|
391
|
+
<div style="font-family : ${font};font-weight : normal;">
|
|
392
|
+
${products.map((row) => (`<div>
|
|
393
|
+
<div
|
|
394
|
+
style="
|
|
395
|
+
display: block;
|
|
396
|
+
min-width: ${this.calculatePaperSize(paper, width)};
|
|
397
|
+
width: ${this.calculatePaperSize(paper, width)};
|
|
398
|
+
padding : ${marginTop + "mm"} ${marginRight + "mm"} ${marginBottom + "mm"} ${marginLeft + "mm"};">
|
|
399
|
+
|
|
400
400
|
${orderSummary ?
|
|
401
|
-
`<p style="font-size:${fontSize - 2};">
|
|
402
|
-
#${order.orderNumber} -
|
|
403
|
-
${order.orderTypeString}
|
|
404
|
-
</p>` : ""}
|
|
405
|
-
|
|
401
|
+
`<p style="font-size:${fontSize - 2};">
|
|
402
|
+
#${order.orderNumber} -
|
|
403
|
+
${order.orderTypeString}
|
|
404
|
+
</p>` : ""}
|
|
405
|
+
|
|
406
406
|
${orderSummary ?
|
|
407
|
-
`<p style="font-size:${fontSize - 4};">
|
|
408
|
-
${this.weekDayName(order.desiredDate)},
|
|
409
|
-
${this.formatDate(order.desiredDate)}
|
|
410
|
-
|
|
411
|
-
${this.formatAMPMDate(order.desiredDate)}
|
|
412
|
-
</p>` : ""}
|
|
413
|
-
|
|
414
|
-
<p style="font-size:${fontSize - 2}; border-bottom : ${orderSummary ? "2px" : "0px"} dotted black; padding-bottom : 5px margin-bottom : 5px;">
|
|
415
|
-
${customer.fullName}
|
|
416
|
-
</p>
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
<p style="margin-bottom: 5px; padding-bottom: 5px; border-bottom: 2px solid black;">
|
|
420
|
-
${row.quantity}X
|
|
421
|
-
${showCategoryTitle && row.categoryTitle ? "[" + row.categoryTitle.toUpperCase() + "]" : ""}
|
|
422
|
-
${showProductKitchenName && row.kitchenReceiptName !== "" ? row.kitchenReceiptName : row.title}
|
|
423
|
-
${row.extrasNames !== "" && `<div>${row.extrasNames}</div>`}
|
|
424
|
-
</p>
|
|
425
|
-
|
|
426
|
-
|
|
407
|
+
`<p style="font-size:${fontSize - 4};">
|
|
408
|
+
${this.weekDayName(order.desiredDate)},
|
|
409
|
+
${this.formatDate(order.desiredDate)}
|
|
410
|
+
|
|
411
|
+
${this.formatAMPMDate(order.desiredDate)}
|
|
412
|
+
</p>` : ""}
|
|
413
|
+
|
|
414
|
+
<p style="font-size:${fontSize - 2}; border-bottom : ${orderSummary ? "2px" : "0px"} dotted black; padding-bottom : 5px margin-bottom : 5px;">
|
|
415
|
+
${customer.fullName}
|
|
416
|
+
</p>
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
<p style="margin-bottom: 5px; padding-bottom: 5px; border-bottom: 2px solid black;">
|
|
420
|
+
${row.quantity}X
|
|
421
|
+
${showCategoryTitle && row.categoryTitle ? "[" + row.categoryTitle.toUpperCase() + "]" : ""}
|
|
422
|
+
${showProductKitchenName && row.kitchenReceiptName !== "" ? row.kitchenReceiptName : row.title}
|
|
423
|
+
${row.extrasNames !== "" && `<div>${row.extrasNames}</div>`}
|
|
424
|
+
</p>
|
|
425
|
+
|
|
426
|
+
|
|
427
427
|
${row.note !== "" ?
|
|
428
|
-
`<p style="margin-bottom: 5px; padding-bottom: 5px; border-bottom: 2px solid black;">
|
|
429
|
-
${row.note}
|
|
430
|
-
</p>` : ""}
|
|
431
|
-
|
|
432
|
-
</div>
|
|
433
|
-
|
|
434
|
-
<div style="clear: both; page-break-after: always;" ></div>
|
|
435
|
-
</div>
|
|
436
|
-
`)).join("")}
|
|
437
|
-
</div>
|
|
438
|
-
|
|
428
|
+
`<p style="margin-bottom: 5px; padding-bottom: 5px; border-bottom: 2px solid black;">
|
|
429
|
+
${row.note}
|
|
430
|
+
</p>` : ""}
|
|
431
|
+
|
|
432
|
+
</div>
|
|
433
|
+
|
|
434
|
+
<div style="clear: both; page-break-after: always;" ></div>
|
|
435
|
+
</div>
|
|
436
|
+
`)).join("")}
|
|
437
|
+
</div>
|
|
438
|
+
|
|
439
439
|
`);
|
|
440
440
|
}
|
|
441
441
|
paymentFailed(detail, currency) {
|
|
442
442
|
var _a, _b, _c;
|
|
443
|
-
return `<div style="padding-top: 16px; padding-bottom: 16px;">
|
|
444
|
-
<div style="display: flex; flex-direction: row; align-items: center; justify-content: center;">
|
|
445
|
-
<img alt="" src="https://beta.meemup.com/api/shop/logo/${detail.company.id}"
|
|
446
|
-
style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
|
|
447
|
-
</div>
|
|
448
|
-
<div
|
|
449
|
-
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;">
|
|
450
|
-
<strong style="font-size: 18px;">AMOUNT</strong>
|
|
451
|
-
<strong style="font-size: 18px;">${currency} ${detail.order.totalAmount}</strong>
|
|
452
|
-
</div>
|
|
453
|
-
<div
|
|
454
|
-
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;">
|
|
455
|
-
<strong style="font-size: 18px; padding-right: 16px;"></strong>
|
|
456
|
-
<strong style="font-size: 18px;">#0</strong>
|
|
457
|
-
</div>
|
|
458
|
-
<div
|
|
459
|
-
style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 16px 10%; border-bottom: 2px solid black;">
|
|
460
|
-
<strong style="font-size: 18px;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</strong>
|
|
461
|
-
<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>
|
|
462
|
-
</div>
|
|
463
|
-
<div style="margin-left: 16px; margin-right: 16px;">
|
|
464
|
-
${(_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;">
|
|
465
|
-
<strong style="font-size: 12px; margin-right: 16px;">${i.text}</strong>
|
|
466
|
-
<strong style="font-size: 12px;">${i.value}</strong>
|
|
467
|
-
</div>`))}
|
|
468
|
-
|
|
469
|
-
</div>
|
|
443
|
+
return `<div style="padding-top: 16px; padding-bottom: 16px;">
|
|
444
|
+
<div style="display: flex; flex-direction: row; align-items: center; justify-content: center;">
|
|
445
|
+
<img alt="" src="https://beta.meemup.com/api/shop/logo/${detail.company.id}"
|
|
446
|
+
style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
|
|
447
|
+
</div>
|
|
448
|
+
<div
|
|
449
|
+
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;">
|
|
450
|
+
<strong style="font-size: 18px;">AMOUNT</strong>
|
|
451
|
+
<strong style="font-size: 18px;">${currency} ${detail.order.totalAmount}</strong>
|
|
452
|
+
</div>
|
|
453
|
+
<div
|
|
454
|
+
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;">
|
|
455
|
+
<strong style="font-size: 18px; padding-right: 16px;"></strong>
|
|
456
|
+
<strong style="font-size: 18px;">#0</strong>
|
|
457
|
+
</div>
|
|
458
|
+
<div
|
|
459
|
+
style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 16px 10%; border-bottom: 2px solid black;">
|
|
460
|
+
<strong style="font-size: 18px;">${(_a = detail.paymentInfo) === null || _a === void 0 ? void 0 : _a.state}</strong>
|
|
461
|
+
<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>
|
|
462
|
+
</div>
|
|
463
|
+
<div style="margin-left: 16px; margin-right: 16px;">
|
|
464
|
+
${(_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;">
|
|
465
|
+
<strong style="font-size: 12px; margin-right: 16px;">${i.text}</strong>
|
|
466
|
+
<strong style="font-size: 12px;">${i.value}</strong>
|
|
467
|
+
</div>`))}
|
|
468
|
+
|
|
469
|
+
</div>
|
|
470
470
|
</div>`;
|
|
471
471
|
}
|
|
472
472
|
packageLabel(detail) {
|
|
473
|
-
return `<div style="padding: 16px;">
|
|
474
|
-
<div
|
|
475
|
-
style="display: flex; flex-direction: row; align-items: center; justify-content: space-between; border-bottom: 2px solid black;">
|
|
476
|
-
<strong style="font-size: 22px;">${detail.order.orderTypeString}</strong>
|
|
477
|
-
<strong style="font-size: 22px;">${detail.order.orderNumber}</strong>
|
|
478
|
-
</div>
|
|
479
|
-
<div style="border-bottom: 2px solid black; padding-top: 8px; padding-bottom: 8px;">
|
|
480
|
-
${detail.products.map((i) => (`<strong style="font-size: 16px; padding-top: 2px; padding-bottom: 2px;">${i.quantity}X ${i.title}</strong>`))}
|
|
481
|
-
</div>
|
|
482
|
-
<div
|
|
483
|
-
style="margin-top: 16px; margin-bottom: 16px; padding-bottom: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-bottom: 2px solid black;">
|
|
484
|
-
<strong style="font-size: 22px;">${detail.order.orderTypeString}</strong>
|
|
485
|
-
<strong style="font-size: 42px;">${detail.order.orderNumber}</strong>
|
|
486
|
-
<strong style="font-size: 16px;">${detail.customer.fullName}</strong>
|
|
487
|
-
</div>
|
|
488
|
-
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 16px; margin-left: 10%; margin-right: 10%;">
|
|
489
|
-
<strong style="font-size: 16px;">${detail.order.desiredDate}</strong>
|
|
490
|
-
<div style="display: flex; flex-direction: row; align-items: center; justify-content: center; margin-top: 16px;">
|
|
491
|
-
<img alt="" src="https://beta.meemup.com/api/ordering/${detail.order.id}/${detail.company.id}/QR"
|
|
492
|
-
style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
|
|
493
|
-
</div>
|
|
494
|
-
</div>
|
|
473
|
+
return `<div style="padding: 16px;">
|
|
474
|
+
<div
|
|
475
|
+
style="display: flex; flex-direction: row; align-items: center; justify-content: space-between; border-bottom: 2px solid black;">
|
|
476
|
+
<strong style="font-size: 22px;">${detail.order.orderTypeString}</strong>
|
|
477
|
+
<strong style="font-size: 22px;">${detail.order.orderNumber}</strong>
|
|
478
|
+
</div>
|
|
479
|
+
<div style="border-bottom: 2px solid black; padding-top: 8px; padding-bottom: 8px;">
|
|
480
|
+
${detail.products.map((i) => (`<strong style="font-size: 16px; padding-top: 2px; padding-bottom: 2px;">${i.quantity}X ${i.title}</strong>`))}
|
|
481
|
+
</div>
|
|
482
|
+
<div
|
|
483
|
+
style="margin-top: 16px; margin-bottom: 16px; padding-bottom: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-bottom: 2px solid black;">
|
|
484
|
+
<strong style="font-size: 22px;">${detail.order.orderTypeString}</strong>
|
|
485
|
+
<strong style="font-size: 42px;">${detail.order.orderNumber}</strong>
|
|
486
|
+
<strong style="font-size: 16px;">${detail.customer.fullName}</strong>
|
|
487
|
+
</div>
|
|
488
|
+
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 16px; margin-left: 10%; margin-right: 10%;">
|
|
489
|
+
<strong style="font-size: 16px;">${detail.order.desiredDate}</strong>
|
|
490
|
+
<div style="display: flex; flex-direction: row; align-items: center; justify-content: center; margin-top: 16px;">
|
|
491
|
+
<img alt="" src="https://beta.meemup.com/api/ordering/${detail.order.id}/${detail.company.id}/QR"
|
|
492
|
+
style="width: 100px; min-width: 100px; max-width: 100px; aspect-ratio: auto;">
|
|
493
|
+
</div>
|
|
494
|
+
</div>
|
|
495
495
|
</div>`;
|
|
496
496
|
}
|
|
497
497
|
preview(account, detail, template, symbol = "$") {
|
|
@@ -3,34 +3,32 @@ import IExtra from "../interfaces/IExtra";
|
|
|
3
3
|
import ISelectedExtraItem from "../interfaces/ISelectedExtraItem";
|
|
4
4
|
import ISelectedProductExtra from "../interfaces/ISelectedProductExtra";
|
|
5
5
|
import ITextValue from "../interfaces/ITextValue";
|
|
6
|
-
import IDExtraItem from "../interfaces/database/IDExtraItem";
|
|
7
|
-
import IDExtra from "../interfaces/database/IDExtra";
|
|
8
6
|
import TBaseExtra from "../types/TBaseExtra";
|
|
9
7
|
import IOrderItem from "../interfaces/order/IOrderItem";
|
|
10
|
-
import IDProduct from "../interfaces/database/IDProduct";
|
|
11
8
|
import IProduct from "../interfaces/IProduct";
|
|
12
9
|
import IDProductExtra from "../interfaces/database/IDProductExtra";
|
|
10
|
+
import IExtraItem from "../interfaces/IExtraItem";
|
|
13
11
|
declare const _default: {
|
|
14
12
|
getExtraSelectedItems(list: ISelectedProductExtra[], extraId: number): ISelectedExtraItem[];
|
|
15
|
-
canAddToBasket(product:
|
|
16
|
-
productModalToBasketItem(product:
|
|
17
|
-
productName(product:
|
|
18
|
-
productImage(product:
|
|
19
|
-
productPrice(product:
|
|
20
|
-
baseItem(list: ISelectedProductExtra[], extraList:
|
|
21
|
-
defaultExtraOfProductToSelectedExtras(product:
|
|
22
|
-
defaultExtraOfProductToBasketItem(product:
|
|
23
|
-
singleSelectExtraItemPrice: (extra: IExtra, base: TBaseExtra, item:
|
|
24
|
-
multiSelectExtraPrice: (extra:
|
|
25
|
-
multiSelectExtraItemOptions(item:
|
|
13
|
+
canAddToBasket(product: IProduct, selected: ISelectedProductExtra[], extras: IExtra[]): boolean;
|
|
14
|
+
productModalToBasketItem(product: IProduct, selectedExtraList: ISelectedProductExtra[], extras: IExtra[], count: number, price: number, note: string): IOrderItem;
|
|
15
|
+
productName(product: IProduct | IProduct): string;
|
|
16
|
+
productImage(product: IProduct | IProduct): string;
|
|
17
|
+
productPrice(product: IProduct | IProduct, orderType: EnumOrderType): number;
|
|
18
|
+
baseItem(list: ISelectedProductExtra[], extraList: IExtra[]): TBaseExtra;
|
|
19
|
+
defaultExtraOfProductToSelectedExtras(product: IProduct, extras: IExtra[]): ISelectedProductExtra[];
|
|
20
|
+
defaultExtraOfProductToBasketItem(product: IProduct, extras: IExtra[], orderType: EnumOrderType): IOrderItem;
|
|
21
|
+
singleSelectExtraItemPrice: (extra: IExtra, base: TBaseExtra, item: IExtraItem) => number;
|
|
22
|
+
multiSelectExtraPrice: (extra: IExtra, base: TBaseExtra, item: IExtraItem, selectedList?: ISelectedExtraItem[]) => number;
|
|
23
|
+
multiSelectExtraItemOptions(item: IExtraItem, max: number, selectedList: ISelectedExtraItem[]): ITextValue[];
|
|
26
24
|
scaleSum(array?: ISelectedExtraItem[]): number;
|
|
27
|
-
calculatePrice(orderType: EnumOrderType, product: any, list: ISelectedProductExtra[], base: TBaseExtra, extraList:
|
|
25
|
+
calculatePrice(orderType: EnumOrderType, product: any, list: ISelectedProductExtra[], base: TBaseExtra, extraList: IExtra[]): number;
|
|
28
26
|
plusString(first: string, second: string): string;
|
|
29
27
|
getValidateExtras(extras: IDProductExtra[], extraSelected: ISelectedProductExtra[]): IDProductExtra[];
|
|
30
|
-
getProductExtras(pExtras: IDProductExtra[], sExtras: ISelectedProductExtra[], extras:
|
|
28
|
+
getProductExtras(pExtras: IDProductExtra[], sExtras: ISelectedProductExtra[], extras: IExtra[]): IExtra[];
|
|
31
29
|
quantitySum(array?: ISelectedExtraItem[]): number;
|
|
32
|
-
productMinAndMaxOptions(product:
|
|
30
|
+
productMinAndMaxOptions(product: IProduct): ITextValue[];
|
|
33
31
|
sortByKey(array: any[], key: string, conditionForSort?: boolean): any[];
|
|
34
|
-
extraItemsSortAction: (a:
|
|
32
|
+
extraItemsSortAction: (a: IExtraItem, b: IExtraItem) => 0 | 1 | -1;
|
|
35
33
|
};
|
|
36
34
|
export default _default;
|
|
@@ -205,7 +205,9 @@ export default new class ProductModalController {
|
|
|
205
205
|
receiptTitle: extraItemModel.receiptTitle,
|
|
206
206
|
increasingAmount: extraItemModel.increasingAmount,
|
|
207
207
|
increasingPercentage: extraItemModel.increasingPercentage,
|
|
208
|
-
tags: extraItemModel.tags
|
|
208
|
+
tags: extraItemModel.tags,
|
|
209
|
+
extraId: extraItemModel.extraId,
|
|
210
|
+
increasingValue: extraItemModel.increasingValue
|
|
209
211
|
});
|
|
210
212
|
}
|
|
211
213
|
});
|
|
@@ -246,7 +248,7 @@ export default new class ProductModalController {
|
|
|
246
248
|
}
|
|
247
249
|
return list;
|
|
248
250
|
}
|
|
249
|
-
// pizzaSelectExtraPrice = (extra:
|
|
251
|
+
// pizzaSelectExtraPrice = (extra: IExtra, base: TBaseExtra, item: IExtraItem, selectedList: ISelectedExtraItem[] = []) => {
|
|
250
252
|
//
|
|
251
253
|
// let _item: ISelectedExtraItem | undefined = selectedList.find(i => i.id === item.id);
|
|
252
254
|
//
|
|
@@ -393,7 +395,7 @@ export default new class ProductModalController {
|
|
|
393
395
|
let se = this.sortByKey(sExtras, "priority", true);
|
|
394
396
|
let pe = this.sortByKey(pExtras, "priority", true);
|
|
395
397
|
let itemsIdList = this.getValidateExtras(pe, se).map(i => i.extraId);
|
|
396
|
-
// let list:
|
|
398
|
+
// let list: IExtra[] = extras.filter(i => itemsIdList.includes(+i.id));
|
|
397
399
|
let result = [];
|
|
398
400
|
itemsIdList.forEach((id) => {
|
|
399
401
|
let ext = extras.find(i => i.id === id);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import ILocation from "../interfaces/ILocation";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
* Performs the even-odd-rule Algorithm (a raycasting algorithm) to find out whether a point is in a given polygon.
|
|
5
|
+
* This runs in O(n) where n is the number of edges of the polygon.
|
|
6
|
+
*
|
|
7
|
+
* @param {ILocation[]} polygon - An array representation of the polygon where polygon[i][0] is the x Value of the i-th point and polygon[i][1] is the y Value.
|
|
8
|
+
* @param {ILocation} point - An array representation of the point where point[0] is its x Value and point[1] is its y Value.
|
|
9
|
+
* @returns {boolean} - Whether the point is in the polygon (not on the edge, just turn < into <= and > into >= for that).
|
|
10
|
+
*/
|
|
11
11
|
pointInPolygon(polygon: ILocation[], point: ILocation): boolean;
|
|
12
12
|
rad(x: number): number;
|
|
13
13
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import MoneyController from "./MoneyController";
|
|
2
2
|
export default new class ZoneController {
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
* Performs the even-odd-rule Algorithm (a raycasting algorithm) to find out whether a point is in a given polygon.
|
|
5
|
+
* This runs in O(n) where n is the number of edges of the polygon.
|
|
6
|
+
*
|
|
7
|
+
* @param {ILocation[]} polygon - An array representation of the polygon where polygon[i][0] is the x Value of the i-th point and polygon[i][1] is the y Value.
|
|
8
|
+
* @param {ILocation} point - An array representation of the point where point[0] is its x Value and point[1] is its y Value.
|
|
9
|
+
* @returns {boolean} - Whether the point is in the polygon (not on the edge, just turn < into <= and > into >= for that).
|
|
10
|
+
*/
|
|
11
11
|
pointInPolygon(polygon, point) {
|
|
12
12
|
let odd = false;
|
|
13
13
|
for (let i = 0, j = polygon.length - 1; i < polygon.length; i++) {
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ export * from "./controllers/PrintContentController";
|
|
|
10
10
|
export * from "./controllers/ProductModalController";
|
|
11
11
|
export * from "./controllers/ToolController";
|
|
12
12
|
export * from "./controllers/ZoneController";
|
|
13
|
+
export * from "./controllers/KitchenController";
|
|
14
|
+
export * from "./controllers/CustomerFacingDisplayPacketController";
|
|
15
|
+
export * from "./controllers/ColorController";
|
|
16
|
+
export * from "./controllers/ErrorController";
|
|
13
17
|
export * from "./enums/EnumBasketStep";
|
|
14
18
|
export * from "./enums/EnumCategoryAvailableIn";
|
|
15
19
|
export * from "./enums/EnumChannels";
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,10 @@ export * from "./controllers/PrintContentController";
|
|
|
10
10
|
export * from "./controllers/ProductModalController";
|
|
11
11
|
export * from "./controllers/ToolController";
|
|
12
12
|
export * from "./controllers/ZoneController";
|
|
13
|
+
export * from "./controllers/KitchenController";
|
|
14
|
+
export * from "./controllers/CustomerFacingDisplayPacketController";
|
|
15
|
+
export * from "./controllers/ColorController";
|
|
16
|
+
export * from "./controllers/ErrorController";
|
|
13
17
|
export * from "./enums/EnumBasketStep";
|
|
14
18
|
export * from "./enums/EnumCategoryAvailableIn";
|
|
15
19
|
export * from "./enums/EnumChannels";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import IExtraItem from "./IExtraItem";
|
|
2
|
-
interface IExtra {
|
|
2
|
+
export default interface IExtra {
|
|
3
3
|
id: number;
|
|
4
4
|
name: string;
|
|
5
5
|
title: string;
|
|
@@ -15,4 +15,4 @@ interface IExtra {
|
|
|
15
15
|
categoriesCount: number;
|
|
16
16
|
displayingMode: number;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export declare const initExtra: IExtra;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export const initExtra = {
|
|
2
|
+
id: -1,
|
|
3
|
+
name: "",
|
|
4
|
+
title: "",
|
|
5
|
+
maxAllowedItems: 99,
|
|
6
|
+
required: false,
|
|
7
|
+
available: true,
|
|
8
|
+
increasingOtherExtraItemsPrice: false,
|
|
9
|
+
choosablePizzaToppingsSides: false,
|
|
10
|
+
numberOfFreeItems: 0,
|
|
11
|
+
items: [],
|
|
12
|
+
products: [],
|
|
13
|
+
productsCount: 0,
|
|
14
|
+
categoriesCount: 0,
|
|
15
|
+
displayingMode: 1
|
|
16
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { INIT_TERMINAL } from "../statics";
|
|
1
|
+
import { INIT_TERMINAL, UDP_CUSTOMER_MONITOR_PRE_NAME } from "../statics";
|
|
2
2
|
import EnumNewOrderWarning from "../enums/EnumNewOrderWarning";
|
|
3
|
-
import { UDP_CUSTOMER_MONITOR_PRE_NAME } from "../statics";
|
|
4
3
|
import EnumPaymentState from "../enums/EnumPaymentState";
|
|
5
4
|
import EnumNotifyOnlineStoreNewOrder from "../enums/EnumNotifyOnlineStoreNewOrder";
|
|
6
5
|
import EnumPointOfSaleDefaultSaveState from "../enums/EnumPointOfSaleDefaultSaveState";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import EnumShowCategoryExtras from "../enums/EnumShowCategoryExtras";
|
|
2
2
|
import IAllergicStuffs from "./IAllergicStuffs";
|
|
3
3
|
import IProductExtra from "./IProductExtra";
|
|
4
|
+
import IProductDefaultExtra from "./database/IProductDefaultExtra";
|
|
4
5
|
export default interface IProduct {
|
|
5
6
|
id: number;
|
|
6
7
|
available: boolean;
|
|
@@ -45,7 +46,7 @@ export default interface IProduct {
|
|
|
45
46
|
points: number;
|
|
46
47
|
chosenExtraItemsMode: number;
|
|
47
48
|
extras: IProductExtra[];
|
|
48
|
-
defaultExtraItems:
|
|
49
|
+
defaultExtraItems: IProductDefaultExtra[];
|
|
49
50
|
customizable: boolean;
|
|
50
51
|
displayOnKitchenDisplay: boolean;
|
|
51
52
|
menuId: number;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import IExtra from "./IExtra";
|
|
2
|
-
|
|
2
|
+
import IDProductExtra from "./database/IDProductExtra";
|
|
3
|
+
interface IProductExtra extends IDProductExtra {
|
|
3
4
|
productId: number;
|
|
4
5
|
id: number;
|
|
5
6
|
title: string;
|
|
6
|
-
extraId: number;
|
|
7
|
-
availableType: number;
|
|
8
|
-
showType: number;
|
|
9
|
-
availableTypeText: string;
|
|
10
|
-
showTypeText: string;
|
|
11
|
-
secondExtraId: number | null;
|
|
12
|
-
secondExtraItemId: number | null;
|
|
13
|
-
priority: number;
|
|
14
7
|
extra: IExtra;
|
|
15
8
|
}
|
|
16
9
|
export default IProductExtra;
|
|
10
|
+
export declare const initProductExtra: IProductExtra;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import EnumPizzaSide from "../enums/EnumPizzaSide";
|
|
2
|
-
import
|
|
3
|
-
interface ISelectedExtraItem extends
|
|
2
|
+
import IExtraItem from "./IExtraItem";
|
|
3
|
+
interface ISelectedExtraItem extends IExtraItem {
|
|
4
4
|
quantity: number;
|
|
5
5
|
pizzaSide: EnumPizzaSide;
|
|
6
6
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { initDProductExtra } from "./database/IDProductExtra";
|
|
2
|
-
export const initSelectedProductExtra = Object.assign(Object.assign({}, initDProductExtra), {
|
|
3
|
-
// subtitle: "",
|
|
4
|
-
selected: [] });
|
|
2
|
+
export const initSelectedProductExtra = Object.assign(Object.assign({}, initDProductExtra), { selected: [] });
|
|
@@ -5,9 +5,7 @@ import ISystem from "./ISystem";
|
|
|
5
5
|
import ISetting from "./ISetting";
|
|
6
6
|
import IOrder from "./order/IOrder";
|
|
7
7
|
import IOnlineOrderItem from "./IOnlineOrderItem";
|
|
8
|
-
import IDProduct from "./database/IDProduct";
|
|
9
8
|
import ICategory from "./ICategory";
|
|
10
|
-
import IDExtra from "./database/IDExtra";
|
|
11
9
|
import ICustomer from "./ICustomer";
|
|
12
10
|
import ITextValue from "./ITextValue";
|
|
13
11
|
import ICheckoutOption from "./ICheckoutOption";
|
|
@@ -21,6 +19,8 @@ import IOrderState from "./IOrderState";
|
|
|
21
19
|
import IPaymentStatusChanged from "./IPaymentStatusChanged";
|
|
22
20
|
import IWorkScreen from "./IWorkScreen";
|
|
23
21
|
import IStarMicronicPrinter from "./IStarMicronicPrinter";
|
|
22
|
+
import IExtra from "./IExtra";
|
|
23
|
+
import IProduct from "./IProduct";
|
|
24
24
|
interface IStore {
|
|
25
25
|
account: IAccount;
|
|
26
26
|
orderScreen: IOrderScreenState;
|
|
@@ -30,9 +30,9 @@ interface IStore {
|
|
|
30
30
|
setting: ISetting;
|
|
31
31
|
onlineOrders: IOnlineOrderItem[];
|
|
32
32
|
localOrders: IOrder[];
|
|
33
|
-
products:
|
|
33
|
+
products: IProduct[];
|
|
34
34
|
categories: ICategory[];
|
|
35
|
-
extras:
|
|
35
|
+
extras: IExtra[];
|
|
36
36
|
orders: IOrder[];
|
|
37
37
|
customers: ICustomer[];
|
|
38
38
|
isConnected: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import IDProductDefaultExtraItem from "./IDProductDefaultExtraItem";
|
|
2
|
-
interface
|
|
2
|
+
interface IProductDefaultExtra {
|
|
3
3
|
extraId: number;
|
|
4
4
|
items: IDProductDefaultExtraItem[];
|
|
5
5
|
}
|
|
6
|
-
export default
|
|
6
|
+
export default IProductDefaultExtra;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import IExtra from "../interfaces/IExtra";
|
|
1
2
|
import ISelectedProductExtra from "../interfaces/ISelectedProductExtra";
|
|
2
|
-
|
|
3
|
-
type TBaseExtra = [ISelectedProductExtra | undefined, IDExtra | undefined];
|
|
3
|
+
type TBaseExtra = [ISelectedProductExtra | undefined, IExtra | undefined];
|
|
4
4
|
export default TBaseExtra;
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "meemup-library",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "yarn remove:one && yarn remove:two && yarn build:esm && yarn build:cjs",
|
|
9
|
-
"build:esm": "tsc",
|
|
10
|
-
"build:cjs": "tsc --module commonjs --outDir src/dist",
|
|
11
|
-
"remove:one": "rimraf dist",
|
|
12
|
-
"remove:two": "rimraf ./src/dist",
|
|
13
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
-
"commit": "git add . && git commit -m \"version.1.2.
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"/dist"
|
|
18
|
-
],
|
|
19
|
-
"keywords": [],
|
|
20
|
-
"author": "",
|
|
21
|
-
"license": "ISC",
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"rimraf": "^5.0.5",
|
|
24
|
-
"typescript": "^5.2.2"
|
|
25
|
-
},
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"axios": "^1.7.2"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "meemup-library",
|
|
3
|
+
"version": "1.2.8",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "yarn remove:one && yarn remove:two && yarn build:esm && yarn build:cjs",
|
|
9
|
+
"build:esm": "tsc",
|
|
10
|
+
"build:cjs": "tsc --module commonjs --outDir src/dist",
|
|
11
|
+
"remove:one": "rimraf dist",
|
|
12
|
+
"remove:two": "rimraf ./src/dist",
|
|
13
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
+
"commit": "git add . && git commit -m \"version.1.2.8\" && git push origin "
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"/dist"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"author": "",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"rimraf": "^5.0.5",
|
|
24
|
+
"typescript": "^5.2.2"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"axios": "^1.7.2"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import IDExtraItem from "./IDExtraItem";
|
|
2
|
-
interface IDExtra {
|
|
3
|
-
id: number;
|
|
4
|
-
name: string;
|
|
5
|
-
title: string;
|
|
6
|
-
maxAllowedItems: number;
|
|
7
|
-
required: boolean;
|
|
8
|
-
available: boolean;
|
|
9
|
-
increasingOtherExtraItemsPrice: boolean;
|
|
10
|
-
choosablePizzaToppingsSides: boolean;
|
|
11
|
-
numberOfFreeItems: number;
|
|
12
|
-
items: IDExtraItem[];
|
|
13
|
-
}
|
|
14
|
-
export default IDExtra;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface IDExtraItem {
|
|
2
|
-
id: number;
|
|
3
|
-
title: string;
|
|
4
|
-
available: boolean;
|
|
5
|
-
receiptTitle: string;
|
|
6
|
-
price: number;
|
|
7
|
-
priority: number;
|
|
8
|
-
min: number;
|
|
9
|
-
max: number;
|
|
10
|
-
calories: number;
|
|
11
|
-
increasingPriceType: number;
|
|
12
|
-
scale: number;
|
|
13
|
-
isDefaultSelected: boolean;
|
|
14
|
-
increasingAmount: number;
|
|
15
|
-
increasingPercentage: number;
|
|
16
|
-
tags: string[] | null;
|
|
17
|
-
}
|
|
18
|
-
export default IDExtraItem;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import IDProductExtra from "./IDProductExtra";
|
|
2
|
-
import IDProductDefaultExtra from "./IDProductDefaultExtra";
|
|
3
|
-
interface IDProduct {
|
|
4
|
-
id: number;
|
|
5
|
-
available: boolean;
|
|
6
|
-
notAvailableToDate: string | null;
|
|
7
|
-
displayWhenNotAvailable: boolean;
|
|
8
|
-
name: string;
|
|
9
|
-
posName: string;
|
|
10
|
-
kitchenReceiptName: string;
|
|
11
|
-
description: string;
|
|
12
|
-
extrasDescription: string;
|
|
13
|
-
minOrderQuantity: number;
|
|
14
|
-
maxOrderQuantity: number;
|
|
15
|
-
deliveryPrice: number;
|
|
16
|
-
pickupPrice: number;
|
|
17
|
-
color: string | null;
|
|
18
|
-
eanBarcode: string;
|
|
19
|
-
imageFullPath: string;
|
|
20
|
-
preperationTime: string;
|
|
21
|
-
showFromDate: string | null;
|
|
22
|
-
showFromTime: string | null;
|
|
23
|
-
showToDate: string | null;
|
|
24
|
-
showToTime: string | null;
|
|
25
|
-
vegetarian: boolean;
|
|
26
|
-
organic: boolean;
|
|
27
|
-
halal: boolean;
|
|
28
|
-
spiciness: number;
|
|
29
|
-
showCategoryExtras: boolean;
|
|
30
|
-
mainCategoryId: number;
|
|
31
|
-
allergicStuffs: number[];
|
|
32
|
-
extras: IDProductExtra[];
|
|
33
|
-
inMultipleCategories: boolean;
|
|
34
|
-
categories: number[];
|
|
35
|
-
containsAlcohol: boolean;
|
|
36
|
-
vegan: boolean;
|
|
37
|
-
calories: number;
|
|
38
|
-
availableIn: number;
|
|
39
|
-
points: number;
|
|
40
|
-
chosenExtraItemsMode: number;
|
|
41
|
-
customizable: boolean;
|
|
42
|
-
defaultExtraItems: IDProductDefaultExtra[];
|
|
43
|
-
diningPrice: number;
|
|
44
|
-
availableForOrdering: number;
|
|
45
|
-
imageName: string | null;
|
|
46
|
-
onlyOnWeekDays: number | null;
|
|
47
|
-
displayOnKitchenDisplay: boolean;
|
|
48
|
-
menuId: number | null;
|
|
49
|
-
availableForOrderingType: number;
|
|
50
|
-
deleted: boolean;
|
|
51
|
-
allergicStuffsId: number[];
|
|
52
|
-
showExtrasCategory: number;
|
|
53
|
-
packagingCosts: number;
|
|
54
|
-
depositCost: number;
|
|
55
|
-
thumbnailImage: string | null;
|
|
56
|
-
}
|
|
57
|
-
export default IDProduct;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|