meemup-library 1.4.52 → 1.4.53
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[];
|
|
@@ -26,5 +29,6 @@ declare const _default: {
|
|
|
26
29
|
createCashDrawerPaidInOutMarkup(device: IPointOfSaleActionFormCashDrawer, setting: IPointOfSaleSetting, member: IPointOfSaleTeamMember): Promise<string>;
|
|
27
30
|
openCashDrawerMarkup(label?: string): Promise<string>;
|
|
28
31
|
createClosingWorkDay(data: IPointOfSaleApiClosingWorkDay, companyTitle: string): Promise<string>;
|
|
32
|
+
createCashDrawerReport(device: IPointOfSaleCashDrawer, form: IPointOfSaleCashDrawerReportForm, records: IPointOfSaleCashDrawerReportRecord[], company: string, currency: string, member: IPointOfSaleTeamMember, formatDate: (value: string) => string): Promise<string>;
|
|
29
33
|
};
|
|
30
34
|
export default _default;
|
|
@@ -691,4 +691,35 @@ export default new class PreviewContentController {
|
|
|
691
691
|
return '';
|
|
692
692
|
});
|
|
693
693
|
}
|
|
694
|
+
createCashDrawerReport(device, form, records, company, currency, member, formatDate) {
|
|
695
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
696
|
+
let content = '';
|
|
697
|
+
try {
|
|
698
|
+
const sum = MoneyController.sumField(records, 'amount');
|
|
699
|
+
content += SimplePreviewController.createHeader('Cash drawer report', 'center');
|
|
700
|
+
content += SimplePreviewController.createText(company, 'center', true);
|
|
701
|
+
content += SimplePreviewController.createTextValueSpaceBetween('Cash drawer:', `#${form.cashDrawerId} - ${device.name}`);
|
|
702
|
+
content += SimplePreviewController.createTextValueSpaceBetween('Since:', `#${form.cashDrawerId} - ${device.name}`);
|
|
703
|
+
content += SimplePreviewController.createTextValueSpaceBetween('Until:', `#${form.cashDrawerId} - ${device.name}`);
|
|
704
|
+
if (member.id > initPointOfSaleTeamMember.id) {
|
|
705
|
+
content += SimplePreviewController.createTextValueSpaceBetween('Member ID:', `#${member.id}`);
|
|
706
|
+
content += SimplePreviewController.createTextValueSpaceBetween('Member:', `${member.firstName} ${member.lastName}`);
|
|
707
|
+
}
|
|
708
|
+
content += SimplePreviewController.printSolidLine();
|
|
709
|
+
records.map(record => {
|
|
710
|
+
//moment(record.dateTime).format(Formats.printedAt)
|
|
711
|
+
content += SimplePreviewController.createTextValueSpaceBetween(formatDate(record.dateTime), MoneyController.format(record.amount, currency));
|
|
712
|
+
content += SimplePreviewController.createText(record.reason);
|
|
713
|
+
content += SimplePreviewController.printSolidLine();
|
|
714
|
+
});
|
|
715
|
+
content += SimplePreviewController.createTextValueSpaceBetween('Total:', MoneyController.format(sum, currency));
|
|
716
|
+
content += SimplePreviewController.footer();
|
|
717
|
+
return content;
|
|
718
|
+
}
|
|
719
|
+
catch (error) {
|
|
720
|
+
console.log(`Error: ${String(error)}`);
|
|
721
|
+
}
|
|
722
|
+
return '';
|
|
723
|
+
});
|
|
724
|
+
}
|
|
694
725
|
}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meemup-library",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.53",
|
|
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.53\" && git push origin "
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"/dist"
|