@freedom_sky/feige-lib 4.21.0 → 4.24.0
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/const/const.js
CHANGED
|
@@ -98,7 +98,7 @@ var Const = /** @class */ (function () {
|
|
|
98
98
|
this.UPPER_LIMIT = {
|
|
99
99
|
WAITER_NUM: 10,
|
|
100
100
|
CHEF_NUM: 5,
|
|
101
|
-
DISH_PRICE:
|
|
101
|
+
DISH_PRICE: 9999999,
|
|
102
102
|
DISH_NAME_MAX_LENGTH: 60,
|
|
103
103
|
SPECIFICATION_NAME_MAX_LENGTH: 60,
|
|
104
104
|
SPECIFICATION_DESCRIPTION_MAX_LENGTH: 60,
|
|
@@ -1379,6 +1379,17 @@ var Const = /** @class */ (function () {
|
|
|
1379
1379
|
zh: '西班牙',
|
|
1380
1380
|
phoneCode: '34',
|
|
1381
1381
|
zhHead: 'X',
|
|
1382
|
+
setting: {
|
|
1383
|
+
defaultCurrency: '€',
|
|
1384
|
+
timeZoneNum: 1,
|
|
1385
|
+
agent: {
|
|
1386
|
+
instruction: undefined,
|
|
1387
|
+
showPriceInStore: false,
|
|
1388
|
+
qrCode: '',
|
|
1389
|
+
phone: '624871896 / 642726636',
|
|
1390
|
+
email: 'tecnopaloma.com',
|
|
1391
|
+
},
|
|
1392
|
+
},
|
|
1382
1393
|
},
|
|
1383
1394
|
{
|
|
1384
1395
|
en: 'Sri Lanka',
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,8 @@ export * from './interfaces/member/member-transaction.interface';
|
|
|
26
26
|
export * from './interfaces/store/store.interface';
|
|
27
27
|
export { PayCompanyEnum } from './enum/pay-company.enum';
|
|
28
28
|
import * as moment from 'moment';
|
|
29
|
-
|
|
29
|
+
import Big from 'big.js';
|
|
30
|
+
export { Order, Process, Content, Checkout, CONST, DishSnapshot, User, UserSafe, CertificatePath, Task, VisitTask, moment, PrintStatusEnum, PrinterDeviceTypeEnum, PrinterWidthEnum, Big, };
|
|
30
31
|
/**
|
|
31
32
|
* 小数转化为金额,去除分位之后的尾数
|
|
32
33
|
*
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,8 @@ var pay_company_enum_1 = require("./enum/pay-company.enum");
|
|
|
30
30
|
exports.PayCompanyEnum = pay_company_enum_1.PayCompanyEnum;
|
|
31
31
|
var moment = require("moment");
|
|
32
32
|
exports.moment = moment;
|
|
33
|
+
var big_js_1 = require("big.js");
|
|
34
|
+
exports.Big = big_js_1.default;
|
|
33
35
|
var tax_enum_1 = require("./enum/tax.enum");
|
|
34
36
|
/**
|
|
35
37
|
* 小数转化为金额,去除分位之后的尾数
|
|
@@ -172,7 +174,7 @@ function calcReceivablePrice(order, processArr, noTax) {
|
|
|
172
174
|
var sharedMarkDown = (totalMarkDown * dishTotalPrice) / receivablePriceAfterDiscount;
|
|
173
175
|
orderContentItem.dishSnapshot.taxes.forEach(function (tax) {
|
|
174
176
|
var taxFare = (dishTotalPrice - sharedMarkDown) * tax.rate;
|
|
175
|
-
var taxKey = tax.name + "(" + tax.rate
|
|
177
|
+
var taxKey = tax.name + "(" + big_js_1.default(tax.rate).times(100) + "%)";
|
|
176
178
|
taxObj[taxKey] = (taxObj[taxKey] || 0) + parseMoney(taxFare);
|
|
177
179
|
});
|
|
178
180
|
});
|
|
@@ -185,7 +187,7 @@ function calcReceivablePrice(order, processArr, noTax) {
|
|
|
185
187
|
var totalTaxFare_1 = receivablePrice - receivablePrice / (totalTaxRate_1 + 1);
|
|
186
188
|
order.priceHaveTaxBindOrderTaxes.forEach(function (item) {
|
|
187
189
|
var taxFare = (item.rate / totalTaxRate_1) * totalTaxFare_1;
|
|
188
|
-
var taxKey = item.name + "(" + item.rate
|
|
190
|
+
var taxKey = item.name + "(" + big_js_1.default(item.rate).times(100) + "%)";
|
|
189
191
|
taxObj[taxKey] = (taxObj[taxKey] || 0) + parseMoney(taxFare);
|
|
190
192
|
});
|
|
191
193
|
}
|
|
@@ -152,7 +152,6 @@ export interface ReceptionPrinter {
|
|
|
152
152
|
showWaiterName?: boolean;
|
|
153
153
|
showSalesmanName?: boolean;
|
|
154
154
|
showUnitPrice?: boolean;
|
|
155
|
-
edgeSpace?: number;
|
|
156
155
|
}
|
|
157
156
|
export interface ChefPrinter {
|
|
158
157
|
name: string;
|
|
@@ -175,7 +174,6 @@ export interface ChefPrinter {
|
|
|
175
174
|
countFront?: boolean;
|
|
176
175
|
showWaiterName?: boolean;
|
|
177
176
|
showSalesmanName?: boolean;
|
|
178
|
-
edgeSpace?: number;
|
|
179
177
|
}
|
|
180
178
|
export interface LabelPrinter {
|
|
181
179
|
name: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@freedom_sky/feige-lib",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.24.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/freedom-git/feige-lib#readme",
|
|
33
33
|
"devDependencies": {
|
|
34
|
+
"@types/big.js": "^6.1.2",
|
|
34
35
|
"@types/jest": "^25.2.1",
|
|
35
36
|
"@types/node": "^13.13.2",
|
|
36
37
|
"@typescript-eslint/eslint-plugin": "^2.29.0",
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
"typescript": "^3.8.3"
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
52
|
+
"big.js": "^6.1.1",
|
|
51
53
|
"moment": "^2.29.1"
|
|
52
54
|
}
|
|
53
55
|
}
|
package/src/const/const.ts
CHANGED
|
@@ -95,7 +95,7 @@ class Const {
|
|
|
95
95
|
UPPER_LIMIT = {
|
|
96
96
|
WAITER_NUM: 10,
|
|
97
97
|
CHEF_NUM: 5,
|
|
98
|
-
DISH_PRICE:
|
|
98
|
+
DISH_PRICE: 9999999,
|
|
99
99
|
DISH_NAME_MAX_LENGTH: 60,
|
|
100
100
|
SPECIFICATION_NAME_MAX_LENGTH: 60,
|
|
101
101
|
SPECIFICATION_DESCRIPTION_MAX_LENGTH: 60,
|
|
@@ -1376,6 +1376,17 @@ class Const {
|
|
|
1376
1376
|
zh: '西班牙',
|
|
1377
1377
|
phoneCode: '34',
|
|
1378
1378
|
zhHead: 'X',
|
|
1379
|
+
setting: {
|
|
1380
|
+
defaultCurrency: '€',
|
|
1381
|
+
timeZoneNum: 1,
|
|
1382
|
+
agent: {
|
|
1383
|
+
instruction: undefined,
|
|
1384
|
+
showPriceInStore: false,
|
|
1385
|
+
qrCode: '',
|
|
1386
|
+
phone: '624871896 / 642726636',
|
|
1387
|
+
email: 'tecnopaloma.com',
|
|
1388
|
+
},
|
|
1389
|
+
},
|
|
1379
1390
|
},
|
|
1380
1391
|
{
|
|
1381
1392
|
en: 'Sri Lanka',
|
package/src/index.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from './interfaces/member/member-transaction.interface';
|
|
|
27
27
|
export * from './interfaces/store/store.interface';
|
|
28
28
|
export { PayCompanyEnum } from './enum/pay-company.enum';
|
|
29
29
|
import * as moment from 'moment';
|
|
30
|
+
import Big from 'big.js';
|
|
30
31
|
import { TaxTypeEnum } from './enum/tax.enum';
|
|
31
32
|
export {
|
|
32
33
|
Order,
|
|
@@ -44,6 +45,7 @@ export {
|
|
|
44
45
|
PrintStatusEnum,
|
|
45
46
|
PrinterDeviceTypeEnum,
|
|
46
47
|
PrinterWidthEnum,
|
|
48
|
+
Big,
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
/**
|
|
@@ -200,7 +202,7 @@ export function calcReceivablePrice(
|
|
|
200
202
|
const sharedMarkDown = (totalMarkDown * dishTotalPrice) / receivablePriceAfterDiscount;
|
|
201
203
|
orderContentItem.dishSnapshot.taxes.forEach((tax) => {
|
|
202
204
|
const taxFare = (dishTotalPrice - sharedMarkDown) * tax.rate;
|
|
203
|
-
const taxKey = `${tax.name}(${tax.rate
|
|
205
|
+
const taxKey = `${tax.name}(${Big(tax.rate).times(100)}%)`;
|
|
204
206
|
taxObj[taxKey] = (taxObj[taxKey] || 0) + parseMoney(taxFare);
|
|
205
207
|
});
|
|
206
208
|
});
|
|
@@ -212,7 +214,7 @@ export function calcReceivablePrice(
|
|
|
212
214
|
const totalTaxFare = receivablePrice - receivablePrice / (totalTaxRate + 1);
|
|
213
215
|
order.priceHaveTaxBindOrderTaxes.forEach((item) => {
|
|
214
216
|
const taxFare = (item.rate / totalTaxRate) * totalTaxFare;
|
|
215
|
-
const taxKey = `${item.name}(${item.rate
|
|
217
|
+
const taxKey = `${item.name}(${Big(item.rate).times(100)}%)`;
|
|
216
218
|
taxObj[taxKey] = (taxObj[taxKey] || 0) + parseMoney(taxFare);
|
|
217
219
|
});
|
|
218
220
|
}
|
|
@@ -154,7 +154,6 @@ export interface ReceptionPrinter {
|
|
|
154
154
|
showWaiterName?: boolean;
|
|
155
155
|
showSalesmanName?: boolean;
|
|
156
156
|
showUnitPrice?: boolean;
|
|
157
|
-
edgeSpace?:number;
|
|
158
157
|
}
|
|
159
158
|
|
|
160
159
|
export interface ChefPrinter {
|
|
@@ -178,7 +177,6 @@ export interface ChefPrinter {
|
|
|
178
177
|
countFront?: boolean;
|
|
179
178
|
showWaiterName?: boolean;
|
|
180
179
|
showSalesmanName?: boolean;
|
|
181
|
-
edgeSpace?:number;
|
|
182
180
|
}
|
|
183
181
|
|
|
184
182
|
export interface LabelPrinter {
|