meemup-library 1.5.75 → 1.5.77
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/PreviewContentController.d.ts +2 -0
- package/dist/controllers/PreviewContentController.js +40 -0
- package/dist/controllers/SimplePreviewController.d.ts +1 -1
- package/dist/interfaces/pos/IPointOfSaleApiShop.d.ts +1 -0
- package/dist/interfaces/pos/IPointOfSaleApiShop.js +2 -1
- package/package.json +2 -2
|
@@ -11,7 +11,9 @@ import IPointOfSalePrintParts from "../interfaces/pos/IPointOfSalePrintParts";
|
|
|
11
11
|
import IPointOfSaleSetting from "../interfaces/pos/IPointOfSaleSetting";
|
|
12
12
|
import IPointOfSaleActionFormCashDrawer from "../interfaces/pos/IPointOfSaleActionFormCashDrawer";
|
|
13
13
|
import IPointOfSaleApiClosingWorkDay from "../interfaces/pos/IPointOfSaleApiClosingWorkDay";
|
|
14
|
+
import IReservationTableRow from "../interfaces/reservation/IReservationTableRow";
|
|
14
15
|
declare class _PreviewContentController {
|
|
16
|
+
createReservationMarkup(reservation: IReservationTableRow | undefined, template: IPrintTemplate): string;
|
|
15
17
|
calculatePaperSize: (paper: number, width: string | number) => string;
|
|
16
18
|
sortProduct: (products: IOrderDetailProduct[], sortType: number) => IOrderDetailProduct[];
|
|
17
19
|
filterByCategoryList: (products: IOrderDetailProduct[], catList: number[], onlyListCategory: boolean, productList: number[], onlyListProduct: boolean) => IOrderDetailProduct[];
|
|
@@ -96,6 +96,46 @@ class _PreviewContentController {
|
|
|
96
96
|
return new_product;
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
+
createReservationMarkup(reservation, template) {
|
|
100
|
+
if (!reservation)
|
|
101
|
+
return '';
|
|
102
|
+
try {
|
|
103
|
+
const { font, width, paper, paddingTop, paddingBottom, } = template;
|
|
104
|
+
const fontFamily = (font === "Font A" || font === "Font B") ? "arial" : font;
|
|
105
|
+
let content = `<div style="font-family : ${fontFamily}; font-weight : normal; padding : ${paddingTop}px 0 ${paddingBottom}px 0; width: ${this.calculatePaperSize(paper, width)};"> `;
|
|
106
|
+
content += SimplePreviewController.createHeader(` ${reservation.statusText} Reservation `, "center");
|
|
107
|
+
content += SimplePreviewController.printSpace(24);
|
|
108
|
+
content += SimplePreviewController.createText("Customer:", "left", true);
|
|
109
|
+
content += SimplePreviewController.createTitle(reservation.customer, "left");
|
|
110
|
+
content += SimplePreviewController.printSpace(24);
|
|
111
|
+
content += SimplePreviewController.createText("Due date:", "left", true);
|
|
112
|
+
content += SimplePreviewController.createTitle(dayjs(reservation.startDateTime).format(Formats.displayDateTime), "left");
|
|
113
|
+
content += SimplePreviewController.printSpace(24);
|
|
114
|
+
content += SimplePreviewController.createText("Meet type:", "left", true);
|
|
115
|
+
content += SimplePreviewController.createTitle(reservation.meetTypeText, "left");
|
|
116
|
+
content += SimplePreviewController.printSpace(24);
|
|
117
|
+
content += SimplePreviewController.createText("Party size:", "left", true);
|
|
118
|
+
content += SimplePreviewController.createTitle(`${reservation.numberOfPersons} person`, "left");
|
|
119
|
+
content += SimplePreviewController.printSpace(24);
|
|
120
|
+
content += SimplePreviewController.createText("Reg. date:", "left", true);
|
|
121
|
+
content += SimplePreviewController.createText(dayjs(reservation.dateTime).format(Formats.displayDateTime), "left", false);
|
|
122
|
+
content += SimplePreviewController.printSpace(24);
|
|
123
|
+
content += SimplePreviewController.createText("Note:", "left", true);
|
|
124
|
+
content += SimplePreviewController.createText(reservation.description, "left", false);
|
|
125
|
+
content += SimplePreviewController.printSpace(24);
|
|
126
|
+
const fs = template.fontSize - 4 <= 0 ? template.fontSize : template.fontSize - 4;
|
|
127
|
+
content += SimplePreviewController.createDivContainer(template);
|
|
128
|
+
// content += `<p style="display: block; font-size: ${fs}px; text-align: center; line-height: 1rem; margin-top: 8px;">FS.${detail.company.id}.${detail.order.id}.${template.id}</p>`;
|
|
129
|
+
content += `<p style="display: block; font-size: ${fs}px; text-align: center; line-height: 1rem;">Printed on ${new Date().toDateString()} ${new Date().toTimeString().substring(0, 8)}</p>`;
|
|
130
|
+
content += `<strong style="display: block; font-size: ${fs}px; text-align: center; line-height: 1rem;">Powered by Meemup.com</strong>`;
|
|
131
|
+
content += `</div>`;
|
|
132
|
+
content += `</div>`;
|
|
133
|
+
return (`<div style="display: flex;"><div style="width : auto;">${content}</div></div>`);
|
|
134
|
+
}
|
|
135
|
+
catch ( /* empty */_a) { /* empty */
|
|
136
|
+
}
|
|
137
|
+
return '';
|
|
138
|
+
}
|
|
99
139
|
convertTimeStringToDateByT(data = null) {
|
|
100
140
|
if (data instanceof Date) {
|
|
101
141
|
return data;
|
|
@@ -37,7 +37,7 @@ declare class SimplePreviewController {
|
|
|
37
37
|
createTextForEmptyList(text?: string): string;
|
|
38
38
|
printSpace(height: number): string;
|
|
39
39
|
footer(): string;
|
|
40
|
-
|
|
40
|
+
createDivContainer(template: IPrintTemplate, pt?: number, pb?: number): string;
|
|
41
41
|
private filterByCategoryList;
|
|
42
42
|
private sortProduct;
|
|
43
43
|
private pizzaSideText;
|
|
@@ -46,6 +46,7 @@ interface IPointOfSaleApiShop {
|
|
|
46
46
|
emergencyBrake: IEmergencyBrake;
|
|
47
47
|
bundleProducts: IBundleProduct[];
|
|
48
48
|
driverNoteSuggestions: string[];
|
|
49
|
+
todayReservationCount: number;
|
|
49
50
|
}
|
|
50
51
|
export default IPointOfSaleApiShop;
|
|
51
52
|
export declare const initApiShop: IPointOfSaleApiShop;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meemup-library",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.77",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"remove:one": "rimraf dist",
|
|
12
12
|
"remove:two": "rimraf ./src/dist",
|
|
13
13
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
-
"commit": "git add . && git commit -m \"version.1.5.
|
|
14
|
+
"commit": "git add . && git commit -m \"version.1.5.77\" && git push origin "
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"/dist"
|