meemup-library 1.4.52 → 1.4.54
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.
|
@@ -8,6 +8,9 @@ import IPointOfSalePrintParts from "../interfaces/pos/IPointOfSalePrintParts";
|
|
|
8
8
|
import IPointOfSaleActionFormCashDrawer from "../interfaces/pos/IPointOfSaleActionFormCashDrawer";
|
|
9
9
|
import IPointOfSaleTeamMember from "../interfaces/pos/IPointOfSaleTeamMember";
|
|
10
10
|
import IPointOfSaleApiClosingWorkDay from "../interfaces/pos/IPointOfSaleApiClosingWorkDay";
|
|
11
|
+
import IPointOfSaleCashDrawer from "../interfaces/pos/IPointOfSaleCashDrawer";
|
|
12
|
+
import IPointOfSaleCashDrawerReportForm from "../interfaces/pos/IPointOfSaleCashDrawerReportForm";
|
|
13
|
+
import IPointOfSaleCashDrawerReportRecord from "../interfaces/pos/IPointOfSaleCashDrawerReportRecord";
|
|
11
14
|
declare const _default: {
|
|
12
15
|
calculatePaperSize: (paper: number, width: string | number) => string;
|
|
13
16
|
sortProduct: (products: IOrderDetailProduct[], sortType: number) => IOrderDetailProduct[];
|
|
@@ -25,6 +28,8 @@ declare const _default: {
|
|
|
25
28
|
createPrintFromTurnoverDetail(data: ITurnover, currency: string, printParts: IPointOfSalePrintParts): Promise<string>;
|
|
26
29
|
createCashDrawerPaidInOutMarkup(device: IPointOfSaleActionFormCashDrawer, setting: IPointOfSaleSetting, member: IPointOfSaleTeamMember): Promise<string>;
|
|
27
30
|
openCashDrawerMarkup(label?: string): Promise<string>;
|
|
31
|
+
standardHtmlContainer(strHtml: string): string;
|
|
28
32
|
createClosingWorkDay(data: IPointOfSaleApiClosingWorkDay, companyTitle: string): Promise<string>;
|
|
33
|
+
createCashDrawerReport(device: IPointOfSaleCashDrawer, form: IPointOfSaleCashDrawerReportForm, records: IPointOfSaleCashDrawerReportRecord[], company: string, currency: string, member: IPointOfSaleTeamMember, formatDate: (value: string) => string): Promise<string>;
|
|
29
34
|
};
|
|
30
35
|
export default _default;
|
|
@@ -346,50 +346,7 @@ export default new class PreviewContentController {
|
|
|
346
346
|
content = `<div> template.layout : ${template.layout}</div>`;
|
|
347
347
|
break;
|
|
348
348
|
}
|
|
349
|
-
return
|
|
350
|
-
<html>
|
|
351
|
-
<head>
|
|
352
|
-
<meta charset="UTF-8">
|
|
353
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
354
|
-
<style>
|
|
355
|
-
|
|
356
|
-
html {
|
|
357
|
-
font-size: 14px;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
* {
|
|
361
|
-
padding: 0;
|
|
362
|
-
margin: 0;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
p,strong {
|
|
366
|
-
line-height: 1.5rem;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
td{
|
|
370
|
-
padding-top: 2px;
|
|
371
|
-
padding-bottom: 2px;
|
|
372
|
-
line-height: 1.6rem;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
body {
|
|
376
|
-
width : 100%;
|
|
377
|
-
margin: 0;
|
|
378
|
-
padding: 0;
|
|
379
|
-
background-color: #ffffff;
|
|
380
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Arial', "Arial Black", "Comic Sans MS", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", 'Segoe UI', 'Roboto', 'Oxygen',
|
|
381
|
-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
382
|
-
sans-serif;
|
|
383
|
-
-webkit-font-smoothing: antialiased;
|
|
384
|
-
-moz-osx-font-smoothing: grayscale;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
</style>
|
|
388
|
-
</head>
|
|
389
|
-
<body>
|
|
390
|
-
${content}
|
|
391
|
-
</body>
|
|
392
|
-
</html>`;
|
|
349
|
+
return this.standardHtmlContainer(content);
|
|
393
350
|
}
|
|
394
351
|
createPrintFromTurnoverDetail(data, currency, printParts) {
|
|
395
352
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -593,7 +550,7 @@ export default new class PreviewContentController {
|
|
|
593
550
|
${printPoweredBy}
|
|
594
551
|
</div>`;
|
|
595
552
|
content += `</div>`;
|
|
596
|
-
return (
|
|
553
|
+
return this.standardHtmlContainer(content);
|
|
597
554
|
}
|
|
598
555
|
catch (e) {
|
|
599
556
|
console.log(e);
|
|
@@ -617,8 +574,8 @@ export default new class PreviewContentController {
|
|
|
617
574
|
content += SimplePreviewController.printSolidLine();
|
|
618
575
|
content += SimplePreviewController.createText(`Reason: ${device.reason}`);
|
|
619
576
|
content += SimplePreviewController.footer();
|
|
577
|
+
return this.standardHtmlContainer(content);
|
|
620
578
|
}
|
|
621
|
-
return content;
|
|
622
579
|
}
|
|
623
580
|
catch (error) {
|
|
624
581
|
console.log(`Error: ${String(error)}`);
|
|
@@ -631,6 +588,52 @@ export default new class PreviewContentController {
|
|
|
631
588
|
return `<div>${label}</div>`;
|
|
632
589
|
});
|
|
633
590
|
}
|
|
591
|
+
standardHtmlContainer(strHtml) {
|
|
592
|
+
return `<!DOCTYPE html>
|
|
593
|
+
<html>
|
|
594
|
+
<head>
|
|
595
|
+
<meta charset="UTF-8">
|
|
596
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
597
|
+
<style>
|
|
598
|
+
|
|
599
|
+
html {
|
|
600
|
+
font-size: 14px;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
* {
|
|
604
|
+
padding: 0;
|
|
605
|
+
margin: 0;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
p,strong {
|
|
609
|
+
line-height: 1.5rem;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
td{
|
|
613
|
+
padding-top: 2px;
|
|
614
|
+
padding-bottom: 2px;
|
|
615
|
+
line-height: 1.6rem;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
body {
|
|
619
|
+
width : 100%;
|
|
620
|
+
margin: 0;
|
|
621
|
+
padding: 0;
|
|
622
|
+
background-color: #ffffff;
|
|
623
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Arial', "Arial Black", "Comic Sans MS", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", 'Segoe UI', 'Roboto', 'Oxygen',
|
|
624
|
+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
625
|
+
sans-serif;
|
|
626
|
+
-webkit-font-smoothing: antialiased;
|
|
627
|
+
-moz-osx-font-smoothing: grayscale;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
</style>
|
|
631
|
+
</head>
|
|
632
|
+
<body>
|
|
633
|
+
${strHtml}
|
|
634
|
+
</body>
|
|
635
|
+
</html>`;
|
|
636
|
+
}
|
|
634
637
|
createClosingWorkDay(data, companyTitle) {
|
|
635
638
|
return __awaiter(this, void 0, void 0, function* () {
|
|
636
639
|
let content = "";
|
|
@@ -659,31 +662,35 @@ export default new class PreviewContentController {
|
|
|
659
662
|
}
|
|
660
663
|
}
|
|
661
664
|
if (summaryList.length > 0) {
|
|
665
|
+
content += SimplePreviewController.printSpace(20);
|
|
662
666
|
content += SimplePreviewController.createTitle("Summaries");
|
|
663
667
|
for (let index = 0; index < summaryList.length; index++) {
|
|
664
668
|
content += SimplePreviewController.createTextValueSpaceBetween(summaryList[index].text, summaryList[index].value);
|
|
665
669
|
}
|
|
666
670
|
}
|
|
667
671
|
if (detailList.length > 0) {
|
|
672
|
+
content += SimplePreviewController.printSpace(20);
|
|
668
673
|
content += SimplePreviewController.createTitle("Details");
|
|
669
674
|
for (let index = 0; index < detailList.length; index++) {
|
|
670
675
|
content += SimplePreviewController.createTextValueSpaceBetween(detailList[index].text, detailList[index].value);
|
|
671
676
|
}
|
|
672
677
|
}
|
|
673
678
|
if (paymentMethodList.length > 0) {
|
|
679
|
+
content += SimplePreviewController.printSpace(20);
|
|
674
680
|
content += SimplePreviewController.createTitle("Payments");
|
|
675
681
|
for (let index = 0; index < paymentMethodList.length; index++) {
|
|
676
682
|
content += SimplePreviewController.createTextValueSpaceBetween(paymentMethodList[index].text, paymentMethodList[index].value);
|
|
677
683
|
}
|
|
678
684
|
}
|
|
679
685
|
if (categoryList.length > 0) {
|
|
686
|
+
content += SimplePreviewController.printSpace(20);
|
|
680
687
|
content += SimplePreviewController.createTitle("Categories");
|
|
681
688
|
for (let index = 0; index < categoryList.length; index++) {
|
|
682
689
|
content += SimplePreviewController.createTextValueSpaceBetween(categoryList[index].text, categoryList[index].value);
|
|
683
690
|
}
|
|
684
691
|
}
|
|
685
692
|
content += SimplePreviewController.footer();
|
|
686
|
-
return content;
|
|
693
|
+
return this.standardHtmlContainer(content);
|
|
687
694
|
}
|
|
688
695
|
catch (e) {
|
|
689
696
|
console.log(e);
|
|
@@ -691,4 +698,35 @@ export default new class PreviewContentController {
|
|
|
691
698
|
return '';
|
|
692
699
|
});
|
|
693
700
|
}
|
|
701
|
+
createCashDrawerReport(device, form, records, company, currency, member, formatDate) {
|
|
702
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
703
|
+
let content = '';
|
|
704
|
+
try {
|
|
705
|
+
const sum = MoneyController.sumField(records, 'amount');
|
|
706
|
+
content += SimplePreviewController.createHeader('Cash drawer report', 'center');
|
|
707
|
+
content += SimplePreviewController.createText(company, 'center', true);
|
|
708
|
+
content += SimplePreviewController.createTextValueSpaceBetween('Cash drawer:', `#${form.cashDrawerId} - ${device.name}`);
|
|
709
|
+
content += SimplePreviewController.createTextValueSpaceBetween('Since:', `#${form.cashDrawerId} - ${device.name}`);
|
|
710
|
+
content += SimplePreviewController.createTextValueSpaceBetween('Until:', `#${form.cashDrawerId} - ${device.name}`);
|
|
711
|
+
if (member.id > initPointOfSaleTeamMember.id) {
|
|
712
|
+
content += SimplePreviewController.createTextValueSpaceBetween('Member ID:', `#${member.id}`);
|
|
713
|
+
content += SimplePreviewController.createTextValueSpaceBetween('Member:', `${member.firstName} ${member.lastName}`);
|
|
714
|
+
}
|
|
715
|
+
content += SimplePreviewController.printSolidLine();
|
|
716
|
+
records.map(record => {
|
|
717
|
+
//moment(record.dateTime).format(Formats.printedAt)
|
|
718
|
+
content += SimplePreviewController.createTextValueSpaceBetween(formatDate(record.dateTime), MoneyController.format(record.amount, currency));
|
|
719
|
+
content += SimplePreviewController.createText(record.reason);
|
|
720
|
+
content += SimplePreviewController.printSolidLine();
|
|
721
|
+
});
|
|
722
|
+
content += SimplePreviewController.createTextValueSpaceBetween('Total:', MoneyController.format(sum, currency));
|
|
723
|
+
content += SimplePreviewController.footer();
|
|
724
|
+
return this.standardHtmlContainer(content);
|
|
725
|
+
}
|
|
726
|
+
catch (error) {
|
|
727
|
+
console.log(`Error: ${String(error)}`);
|
|
728
|
+
}
|
|
729
|
+
return '';
|
|
730
|
+
});
|
|
731
|
+
}
|
|
694
732
|
}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meemup-library",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.54",
|
|
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.4.
|
|
14
|
+
"commit": "git add . && git commit -m \"version.1.4.54\" && git push origin "
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"/dist"
|