@managesome/eposmatic-toolkit 0.2.771 → 0.2.773
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/lib/constants/ENUMS.d.ts +17 -0
- package/lib/constants/ENUMS.js +21 -1
- package/lib/helpers/utils/receipt-engine.d.ts +7 -1
- package/lib/helpers/utils/receipt-engine.js +38 -29
- package/lib/schemas/models/index.d.ts +1 -0
- package/lib/schemas/models/index.js +1 -0
- package/lib/schemas/models/tenant_hr_employees.d.ts +7 -1
- package/lib/schemas/models/tenant_hr_employees.js +11 -2
- package/lib/schemas/models/tenant_hr_payrolls.d.ts +105 -0
- package/lib/schemas/models/tenant_hr_payrolls.js +134 -0
- package/lib/schemas/models/tenants.d.ts +9 -0
- package/lib/schemas/models/tenants.js +16 -0
- package/lib/schemas/types/index.d.ts +1 -0
- package/lib/schemas/types/index.js +1 -0
- package/lib/schemas/types/tenant_hr_employees.d.ts +4 -2
- package/lib/schemas/types/tenant_hr_payrolls.d.ts +30 -0
- package/lib/schemas/types/tenant_hr_payrolls.js +2 -0
- package/lib/schemas/types/tenants.d.ts +3 -0
- package/lib/tests/receipt-engine.test.js +65 -3
- package/package.json +1 -1
package/lib/constants/ENUMS.d.ts
CHANGED
|
@@ -1201,3 +1201,20 @@ export declare enum HR_EMPLOYEE_DOCUMENT_TYPE_ENUM {
|
|
|
1201
1201
|
OTHER = "OTHER"
|
|
1202
1202
|
}
|
|
1203
1203
|
export declare const ALL_HR_EMPLOYEE_DOCUMENT_TYPES: HR_EMPLOYEE_DOCUMENT_TYPE_ENUM[];
|
|
1204
|
+
export declare enum HR_PAY_TYPE_ENUM {
|
|
1205
|
+
HOURLY = "HOURLY",
|
|
1206
|
+
MONTHLY = "MONTHLY"
|
|
1207
|
+
}
|
|
1208
|
+
export declare const ALL_HR_PAY_TYPE_NAMES: HR_PAY_TYPE_ENUM[];
|
|
1209
|
+
export declare enum HR_PAYROLL_STATUS_ENUM {
|
|
1210
|
+
PENDING = "PENDING",
|
|
1211
|
+
PROCESSED = "PROCESSED",
|
|
1212
|
+
PAID = "PAID"
|
|
1213
|
+
}
|
|
1214
|
+
export declare const ALL_HR_PAYROLL_STATUS_NAMES: HR_PAYROLL_STATUS_ENUM[];
|
|
1215
|
+
export declare enum HR_PAYMENT_METHOD_ENUM {
|
|
1216
|
+
BANK_TRANSFER = "BANK_TRANSFER",
|
|
1217
|
+
CASH = "CASH",
|
|
1218
|
+
CHEQUE = "CHEQUE"
|
|
1219
|
+
}
|
|
1220
|
+
export declare const ALL_HR_PAYMENT_METHOD_NAMES: HR_PAYMENT_METHOD_ENUM[];
|
package/lib/constants/ENUMS.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.ALL_EMAIL_DOCUMENT_KINDS = exports.EMAIL_DOCUMENT_KIND_ENUM = exports.AL
|
|
|
5
5
|
exports.PRINTER_INTERFACE_ENUM = exports.RECEIPT_WIDTHS = exports.ALL_NUM_OF_COLUMNS = exports.NUM_OF_COLUMNS_ENUM = exports.SPLIT_SYNC_SOURCE_ENUM = exports.ALL_SPLIT_BILL_TYPES = exports.SPLIT_BILL_TYPE_ENUM = exports.ALL_RIDER_FEE_TYPES = exports.RIDER_FEE_TYPE_ENUM = exports.ALL_DELIVERY_AREAS_SEARCH_TYPES = exports.DELIVERY_AREAS_SEARCH_TYPE_ENUM = exports.ALL_WEB_AUTH_TYPES = exports.WEB_AUTH_TYPE_ENUM = exports.KITCHEN_RECEIPT_TYPE_ENUM = exports.PRINTER_EVENT_TYPE_ENUM = exports.SORT_TYPE_ENUM = exports.WHITELISTED_API_SMS_COUNTRY_CODES = exports.BLACKLISTED_SMS_COUNTRY_CODES = exports.ALL_OTP_TYPES = exports.OTP_TYPE_ENUM = exports.ALL_TAX_INVOICE_PROVIDERS = exports.TAX_INVOICE_PROVIDER_ENUM = exports.ALL_RESERVATION_STATUS_TYPES = exports.RESERVATION_STATUS_ENUM = exports.TENANT_AMOUNT_DUE_TYPE_ENUM = exports.ALL_KITCHEN_DOCKET_FONT_TYPES = exports.KITCHEN_DOCKET_FONT_TYPE_ENUM = exports.ALL_SORT_ORDER_BY_TYPES = exports.SORT_ORDER_BY_ENUM = exports.RECEIPT_IMAGE_TYPE_ENUM = exports.ALL_RECEIPT_TYPES = exports.RECEIPT_TYPE_ENUM = exports.ALL_PRINTING_PREFERENCES = exports.PRINTING_PREFERENCE_ENUM = exports.ALL_PRINTER_BRAND_TYPES = exports.PRINTER_BRAND_TYPE_ENUM = exports.ALL_ORDER_ITEM_TYPES = exports.ORDER_ITEM_TYPE_ENUM = exports.ALL_PLATFORM_PROVIDER_IDS = exports.PLATFORM_PROVIDER_IDS_ENUM = exports.ALL_MARKETING_RECEIPIENT_TYPES = exports.MARKETING_RECEIPIENT_ENUM = exports.ALL_MARKETING_TYPES = exports.MARKETING_TYPE_ENUM = exports.ALL_TOKEN_TYPES = exports.TOKEN_TYPE_ENUM = exports.ALL_EMAIL_STATUS = exports.EMAIL_STATUS_ENUM = exports.ALL_COMMUNICATION_CHANNELS = exports.COMMUNICATION_CHANNEL_ENUM = void 0;
|
|
6
6
|
exports.ALL_ONLINE_ORDERING_DESIGN_TYPES = exports.ONLINE_ORDERING_DESIGN_TYPE_ENUM = exports.ALL_NOTIFICATION_PROVIDERS = exports.NOTIFICATION_PROVIDER_ENUM = exports.ALL_ORDER_COMPLETION_TYPES = exports.ORDER_COMPLETION_TYPE_ENUM = exports.ITEM_COMPARISON_FIELD_ENUM = exports.VOID_ITEM_STAFF_REPORT_ENUM = exports.ALL_DISCOUNT_APPLICABILITY_TYPES = exports.DISCOUNT_APPLICABILITY_ENUM = exports.ALL_DISCOUNT_TYPES = exports.DISCOUNT_TYPE_ENUM = exports.EMAIL_TEMPLATES_TYPE_ENUM = exports.ALL_ALERT_NOTIFICATIONS_TYPES = exports.ALERT_NOTIFICATIONS_TYPE_ENUM = exports.ALL_WALLET_TRANSACTION_STATUS = exports.WALLET_TRANSACTION_STATUS_ENUM = exports.ALL_WALLET_TRANSACTION_CATEGORIES = exports.WALLET_TRANSACTION_CATEGORY_ENUM = exports.ALL_WALLET_TRANSACTION_TYPES = exports.WALLET_TRANSACTION_TYPE_ENUM = exports.ALL_DELIVERY_STATUS = exports.DELIVERY_STATUS_ENUM = exports.ALL_INVENTORY_ITEM_TYPES = exports.INVENTORY_ITEM_TYPE_ENUM = exports.ALL_RATING_TYPES = exports.RATING_TYPE_ENUM = exports.ALL_SUBSCRIPTION_STATUS = exports.SUBSCRIPTION_STATUS_ENUM = exports.ALL_VOID_PURCHASE_ORDER_ITEM_TYPES = exports.VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM = exports.ALL_VOID_ORDER_ITEM_TYPES = exports.VOID_ORDER_ITEM_TYPE_ENUM = exports.COMPARISON_REPORT_TYPE_ENUM = exports.ALL_MULTI_TENANT_WEBSITE_TYPES = exports.MULTI_TENANT_WEBSITE_TYPE_ENUM = exports.ALL_ITEM_TRANSACTION_TYPES = exports.ITEM_TRANSACTION_TYPE_ENUM = exports.INVENTORY_OUTBOUND_TRANSACTIONS = exports.INVENTORY_INBOUND_TRANSACTIONS = exports.ALL_INVENTORY_TRANSACTION_CATEGORIES = exports.INVENTORY_TRANSACTION_CATEGORY_ENUM = exports.ALL_INVENTORY_TRANSACTION_TYPES = exports.INVENTORY_TRANSACTION_TYPE_ENUM = exports.ALL_GST_TYPES = exports.GST_TYPE_ENUM = exports.ALL_EXPENSE_REACCURING_TYPES = exports.EXPENSE_REACCURING_TYPE_ENUM = exports.PAYMENT_EXTENSION_ENUM = exports.ALL_PRINTER_INTERFACES = void 0;
|
|
7
7
|
exports.ALL_HR_CHECK_IN_METHOD_NAMES = exports.HR_CHECK_IN_METHOD_ENUM = exports.ALL_HR_ATTENDANCE_STATUS_NAMES = exports.HR_ATTENDANCE_STATUS_ENUM = exports.ALL_HR_EMPLOYMENT_STATUS_NAMES = exports.HR_EMPLOYMENT_STATUS_ENUM = exports.ALL_INTERNAL_CUSTOMER_PAYMENT_METHOD_NAMES = exports.INTERNAL_CUSTOMER_PAYMENT_METHOD_ENUM = exports.ALL_INTERNAL_CUSTOMER_SUBSCRIPTION_SERVICE_NAMES = exports.INTERNAL_CUSTOMER_SUBSCRIPTION_SERVICE_ENUM = exports.ALL_INTERNAL_CUSTOMER_SUBSCRIPTION_PLAN_NAMES = exports.INTERNAL_CUSTOMER_SUBSCRIPTION_PLAN_ENUM = exports.ALL_INTERNAL_CUSTOMER_BILLING_CYCLE_NAMES = exports.INTERNAL_CUSTOMER_BILLING_CYCLE_ENUM = exports.ALL_INTERNAL_CUSTOMER_TYPE_NAMES = exports.INTERNAL_CUSTOMER_TYPE_ENUM = exports.ALL_INTERNAL_INVOICE_TYPE_NAMES = exports.INTERNAL_INVOICE_TYPE_ENUM = exports.ALL_INTERNAL_INVOICE_STATUS_NAMES = exports.INTERNAL_INVOICE_STATUS_ENUM = exports.ALL_SUBSCRIPTION_HARDWARE_NAMES = exports.SUBSCRIPTION_HARDWARE_ENUM = exports.ALL_CUSTOMER_TARGET_MODES = exports.CUSTOMER_TARGET_MODE_ENUM = exports.ALL_WALLET_ASSIGNMENT_BEHAVIORS = exports.WALLET_ASSIGNMENT_BEHAVIOR_ENUM = exports.ALL_WALLET_ASSET_TYPES = exports.WALLET_ASSET_TYPE_ENUM = exports.ALL_RECEIPT_QR_CODE_TYPES = exports.RECEIPT_QR_CODE_TYPE_ENUM = exports.ALL_INTERNAL_LEAD_STATUS = exports.INTERNAL_LEAD_STATUS_ENUM = exports.ALL_INTERNAL_LEAD_SOURCES = exports.INTERNAL_LEAD_SOURCE_ENUM = exports.ALL_CASH_DRAWER_STATUS = exports.CASH_DRAWER_STATUS_ENUM = exports.ALL_CASH_IN_HAND_TRANSACTION_CATEGORIES = exports.CASH_IN_HAND_TRANSACTION_CATEGORY_ENUM = exports.ALL_CASH_IN_HAND_TRANSACTION_TYPES = exports.CASH_IN_HAND_TRANSACTION_TYPE_ENUM = exports.ALL_CASH_IN_OUT_REFS = exports.CASH_IN_OUT_REF_ENUM = exports.ALL_CASH_IN_OUT_TYPES = exports.CASH_IN_OUT_TYPE_ENUM = exports.ALL_POS_SHIFT_STATUS = exports.POS_SHIFT_STATUS_ENUM = exports.ALL_POS_DAY_STATUS = exports.POS_DAY_STATUS_ENUM = exports.ALL_MODIFIER_OPTION_REF_TYPES = exports.MODIFIER_OPTION_REF_TYPE_ENUM = void 0;
|
|
8
|
-
exports.ALL_HR_EMPLOYEE_DOCUMENT_TYPES = exports.HR_EMPLOYEE_DOCUMENT_TYPE_ENUM = exports.ALL_HR_SHIFT_STATUS_NAMES = exports.HR_SHIFT_STATUS_ENUM = exports.ALL_HR_SHIFT_TYPE_NAMES = exports.HR_SHIFT_TYPE_ENUM = exports.ALL_HR_BIOMETRIC_ENROLLMENT_TYPE_NAMES = exports.HR_BIOMETRIC_ENROLLMENT_TYPE_ENUM = void 0;
|
|
8
|
+
exports.ALL_HR_PAYMENT_METHOD_NAMES = exports.HR_PAYMENT_METHOD_ENUM = exports.ALL_HR_PAYROLL_STATUS_NAMES = exports.HR_PAYROLL_STATUS_ENUM = exports.ALL_HR_PAY_TYPE_NAMES = exports.HR_PAY_TYPE_ENUM = exports.ALL_HR_EMPLOYEE_DOCUMENT_TYPES = exports.HR_EMPLOYEE_DOCUMENT_TYPE_ENUM = exports.ALL_HR_SHIFT_STATUS_NAMES = exports.HR_SHIFT_STATUS_ENUM = exports.ALL_HR_SHIFT_TYPE_NAMES = exports.HR_SHIFT_TYPE_ENUM = exports.ALL_HR_BIOMETRIC_ENROLLMENT_TYPE_NAMES = exports.HR_BIOMETRIC_ENROLLMENT_TYPE_ENUM = void 0;
|
|
9
9
|
var ORDER_FROM_ENUM;
|
|
10
10
|
(function (ORDER_FROM_ENUM) {
|
|
11
11
|
ORDER_FROM_ENUM["WEB"] = "WEB";
|
|
@@ -1898,3 +1898,23 @@ var HR_EMPLOYEE_DOCUMENT_TYPE_ENUM;
|
|
|
1898
1898
|
HR_EMPLOYEE_DOCUMENT_TYPE_ENUM["OTHER"] = "OTHER";
|
|
1899
1899
|
})(HR_EMPLOYEE_DOCUMENT_TYPE_ENUM || (exports.HR_EMPLOYEE_DOCUMENT_TYPE_ENUM = HR_EMPLOYEE_DOCUMENT_TYPE_ENUM = {}));
|
|
1900
1900
|
exports.ALL_HR_EMPLOYEE_DOCUMENT_TYPES = Object.values(HR_EMPLOYEE_DOCUMENT_TYPE_ENUM);
|
|
1901
|
+
var HR_PAY_TYPE_ENUM;
|
|
1902
|
+
(function (HR_PAY_TYPE_ENUM) {
|
|
1903
|
+
HR_PAY_TYPE_ENUM["HOURLY"] = "HOURLY";
|
|
1904
|
+
HR_PAY_TYPE_ENUM["MONTHLY"] = "MONTHLY";
|
|
1905
|
+
})(HR_PAY_TYPE_ENUM || (exports.HR_PAY_TYPE_ENUM = HR_PAY_TYPE_ENUM = {}));
|
|
1906
|
+
exports.ALL_HR_PAY_TYPE_NAMES = Object.values(HR_PAY_TYPE_ENUM);
|
|
1907
|
+
var HR_PAYROLL_STATUS_ENUM;
|
|
1908
|
+
(function (HR_PAYROLL_STATUS_ENUM) {
|
|
1909
|
+
HR_PAYROLL_STATUS_ENUM["PENDING"] = "PENDING";
|
|
1910
|
+
HR_PAYROLL_STATUS_ENUM["PROCESSED"] = "PROCESSED";
|
|
1911
|
+
HR_PAYROLL_STATUS_ENUM["PAID"] = "PAID";
|
|
1912
|
+
})(HR_PAYROLL_STATUS_ENUM || (exports.HR_PAYROLL_STATUS_ENUM = HR_PAYROLL_STATUS_ENUM = {}));
|
|
1913
|
+
exports.ALL_HR_PAYROLL_STATUS_NAMES = Object.values(HR_PAYROLL_STATUS_ENUM);
|
|
1914
|
+
var HR_PAYMENT_METHOD_ENUM;
|
|
1915
|
+
(function (HR_PAYMENT_METHOD_ENUM) {
|
|
1916
|
+
HR_PAYMENT_METHOD_ENUM["BANK_TRANSFER"] = "BANK_TRANSFER";
|
|
1917
|
+
HR_PAYMENT_METHOD_ENUM["CASH"] = "CASH";
|
|
1918
|
+
HR_PAYMENT_METHOD_ENUM["CHEQUE"] = "CHEQUE";
|
|
1919
|
+
})(HR_PAYMENT_METHOD_ENUM || (exports.HR_PAYMENT_METHOD_ENUM = HR_PAYMENT_METHOD_ENUM = {}));
|
|
1920
|
+
exports.ALL_HR_PAYMENT_METHOD_NAMES = Object.values(HR_PAYMENT_METHOD_ENUM);
|
|
@@ -136,7 +136,13 @@ export declare function getReceiptEngineFooterDetails(order: Partial<IOrder>, se
|
|
|
136
136
|
export declare const plusSymbolModifierTitles: string[];
|
|
137
137
|
export declare const minusSymbolModifierTitles: string[];
|
|
138
138
|
export declare function getItemModifierTitle(name: string): string;
|
|
139
|
-
|
|
139
|
+
/**
|
|
140
|
+
* The modifier title with the option name removed, so the line does not print
|
|
141
|
+
* the overlap twice. A + / - marker (added by `getItemModifierTitle`) is always
|
|
142
|
+
* kept, and a title the option name already covers is dropped entirely.
|
|
143
|
+
* Matching is case-insensitive and treats whitespace runs as equivalent.
|
|
144
|
+
*/
|
|
145
|
+
export declare function getStrippedModifierTitle(modifierTitle: string, optionName: string): string;
|
|
140
146
|
/**
|
|
141
147
|
* Mutates the options array by adding modifier options to it.
|
|
142
148
|
*
|
|
@@ -7,7 +7,7 @@ exports.getPartialItems = exports.minusSymbolModifierTitles = exports.plusSymbol
|
|
|
7
7
|
exports.getDiscountLabel = getDiscountLabel;
|
|
8
8
|
exports.getReceiptEngineFooterDetails = getReceiptEngineFooterDetails;
|
|
9
9
|
exports.getItemModifierTitle = getItemModifierTitle;
|
|
10
|
-
exports.
|
|
10
|
+
exports.getStrippedModifierTitle = getStrippedModifierTitle;
|
|
11
11
|
exports.getReceiptItemModifiers = getReceiptItemModifiers;
|
|
12
12
|
exports.getOrderItemReceiptBody = getOrderItemReceiptBody;
|
|
13
13
|
exports.getReceiptBody = getReceiptBody;
|
|
@@ -302,11 +302,28 @@ function getItemModifierTitle(name) {
|
|
|
302
302
|
}
|
|
303
303
|
return modifierName;
|
|
304
304
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
305
|
+
/**
|
|
306
|
+
* The modifier title with the option name removed, so the line does not print
|
|
307
|
+
* the overlap twice. A + / - marker (added by `getItemModifierTitle`) is always
|
|
308
|
+
* kept, and a title the option name already covers is dropped entirely.
|
|
309
|
+
* Matching is case-insensitive and treats whitespace runs as equivalent.
|
|
310
|
+
*/
|
|
311
|
+
function getStrippedModifierTitle(modifierTitle, optionName) {
|
|
312
|
+
const marker = modifierTitle.match(/^[+-]/)?.[0] ?? '';
|
|
313
|
+
const title = modifierTitle.replace(/^[+-]\s*/, '');
|
|
314
|
+
const normalizedTitle = title.trim().toLowerCase().replace(/\s+/g, ' ');
|
|
315
|
+
const normalizedOption = optionName.trim().toLowerCase().replace(/\s+/g, ' ');
|
|
316
|
+
// The option name already says everything the title says - keep only the marker.
|
|
317
|
+
if (normalizedTitle !== '' && normalizedOption.includes(normalizedTitle)) {
|
|
318
|
+
return marker;
|
|
319
|
+
}
|
|
320
|
+
const pattern = optionName
|
|
321
|
+
.trim()
|
|
322
|
+
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
323
|
+
.split(/\s+/)
|
|
324
|
+
.join('\\s+');
|
|
325
|
+
const strippedTitle = title.replace(new RegExp(pattern, 'gi'), '').trim();
|
|
326
|
+
return `${marker}${strippedTitle !== '' ? ` ${strippedTitle}` : ''}`.trim();
|
|
310
327
|
}
|
|
311
328
|
/**
|
|
312
329
|
* Mutates the options array by adding modifier options to it.
|
|
@@ -351,25 +368,19 @@ function getReceiptItemModifiers(itemModifiers, options = [], display_modifiers_
|
|
|
351
368
|
modifierOptions.push(option);
|
|
352
369
|
}
|
|
353
370
|
}
|
|
354
|
-
else {
|
|
355
|
-
modifierOptions = modifierOptions.map((option) => ({
|
|
356
|
-
...option,
|
|
357
|
-
// With hide_modifier_name on, the modifier name is not printed, so
|
|
358
|
-
// the option name must not be merged with it - keep it as-is.
|
|
359
|
-
name: hide_modifier_name
|
|
360
|
-
? (0, common_1.titleCase)(option.name)
|
|
361
|
-
: (0, common_1.titleCase)(getItemModifierOptionTitle(modifierName, option.name)),
|
|
362
|
-
}));
|
|
363
|
-
}
|
|
364
371
|
for (let j = 0; j < modifierOptions.length; j++) {
|
|
365
372
|
const option = modifierOptions[j];
|
|
366
373
|
const optionQuantity = option.quantity > 1 ? `${option.quantity}x ` : '';
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
374
|
+
// The option name is what survives; the modifier title only prints its
|
|
375
|
+
// non-overlapping remainder, so identical names collapse into the option
|
|
376
|
+
// name alone.
|
|
377
|
+
const strippedModifierName = hide_modifier_name ? '' : getStrippedModifierTitle(modifierName, option.name);
|
|
378
|
+
const optionDescription = strippedModifierName !== ''
|
|
379
|
+
? `${space}${optionQuantity}${strippedModifierName} `
|
|
380
|
+
: `${space}${optionQuantity}`;
|
|
370
381
|
options.push({
|
|
371
382
|
left: (0, emoji_strip_1.default)(optionDescription),
|
|
372
|
-
option_name: (0, emoji_strip_1.default)(option.name),
|
|
383
|
+
option_name: (0, emoji_strip_1.default)((0, common_1.titleCase)(option.name)),
|
|
373
384
|
});
|
|
374
385
|
if (option.modifiers != null && option.modifiers.length > 0) {
|
|
375
386
|
getReceiptItemModifiers(option.modifiers, options, display_modifiers_on_separate_lines, space, hide_modifier_name);
|
|
@@ -383,18 +394,16 @@ function getReceiptItemModifiers(itemModifiers, options = [], display_modifiers_
|
|
|
383
394
|
const modifierName = getItemModifierTitle(modifier.name);
|
|
384
395
|
for (let j = 0; j < modifier.options.length; j++) {
|
|
385
396
|
const option = modifier.options[j];
|
|
386
|
-
// With hide_modifier_name on, the modifier name is not printed, so
|
|
387
|
-
// the option name must not be merged with it - keep it as-is.
|
|
388
|
-
const optionName = hide_modifier_name
|
|
389
|
-
? (0, common_1.sentenceCase)(option.name)
|
|
390
|
-
: (0, common_1.sentenceCase)(getItemModifierOptionTitle(modifierName, option.name));
|
|
391
397
|
const optionQuantity = option.quantity > 1 ? `${option.quantity}x ` : '';
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
398
|
+
// Mirrors the flat mode: the option name is what survives, and the
|
|
399
|
+
// modifier title only prints its non-overlapping remainder.
|
|
400
|
+
const strippedModifierName = hide_modifier_name ? '' : getStrippedModifierTitle(modifierName, option.name);
|
|
401
|
+
const optionDescription = strippedModifierName !== ''
|
|
402
|
+
? `${space}${optionQuantity}${strippedModifierName} `
|
|
403
|
+
: `${space}${optionQuantity}`;
|
|
395
404
|
options.push({
|
|
396
405
|
left: (0, emoji_strip_1.default)(optionDescription),
|
|
397
|
-
option_name: (0, emoji_strip_1.default)(
|
|
406
|
+
option_name: (0, emoji_strip_1.default)((0, common_1.sentenceCase)(option.name)),
|
|
398
407
|
});
|
|
399
408
|
if (option.modifiers) {
|
|
400
409
|
getReceiptItemModifiers(option.modifiers, options, display_modifiers_on_separate_lines, space, hide_modifier_name);
|
|
@@ -55,6 +55,7 @@ export * from './tenant_hr_attendance_records';
|
|
|
55
55
|
export * from './tenant_hr_biometric_enrollments';
|
|
56
56
|
export * from './tenant_hr_departments';
|
|
57
57
|
export * from './tenant_hr_employees';
|
|
58
|
+
export * from './tenant_hr_payrolls';
|
|
58
59
|
export * from './tenant_hr_positions';
|
|
59
60
|
export * from './tenant_hr_shift_schedules';
|
|
60
61
|
export * from './tenant_hr_shifts';
|
|
@@ -71,6 +71,7 @@ __exportStar(require("./tenant_hr_attendance_records"), exports);
|
|
|
71
71
|
__exportStar(require("./tenant_hr_biometric_enrollments"), exports);
|
|
72
72
|
__exportStar(require("./tenant_hr_departments"), exports);
|
|
73
73
|
__exportStar(require("./tenant_hr_employees"), exports);
|
|
74
|
+
__exportStar(require("./tenant_hr_payrolls"), exports);
|
|
74
75
|
__exportStar(require("./tenant_hr_positions"), exports);
|
|
75
76
|
__exportStar(require("./tenant_hr_shift_schedules"), exports);
|
|
76
77
|
__exportStar(require("./tenant_hr_shifts"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema } from 'mongoose';
|
|
2
|
-
import { HR_EMPLOYMENT_STATUS_ENUM } from '../../constants';
|
|
2
|
+
import { HR_EMPLOYMENT_STATUS_ENUM, HR_PAY_TYPE_ENUM } from '../../constants';
|
|
3
3
|
export declare const TenantHrEmployeeSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
4
4
|
timestamps: true;
|
|
5
5
|
versionKey: false;
|
|
@@ -32,7 +32,9 @@ export declare const TenantHrEmployeeSchema: Schema<any, import("mongoose").Mode
|
|
|
32
32
|
position_id: string;
|
|
33
33
|
join_date: NativeDate;
|
|
34
34
|
employment_status: HR_EMPLOYMENT_STATUS_ENUM;
|
|
35
|
+
pay_type: HR_PAY_TYPE_ENUM;
|
|
35
36
|
salary_per_hour: number;
|
|
37
|
+
monthly_salary: number;
|
|
36
38
|
docs: Map<string, {
|
|
37
39
|
doc_url: string;
|
|
38
40
|
doc_name: string;
|
|
@@ -352,7 +354,9 @@ export declare const TenantHrEmployeeSchema: Schema<any, import("mongoose").Mode
|
|
|
352
354
|
position_id: string;
|
|
353
355
|
join_date: NativeDate;
|
|
354
356
|
employment_status: HR_EMPLOYMENT_STATUS_ENUM;
|
|
357
|
+
pay_type: HR_PAY_TYPE_ENUM;
|
|
355
358
|
salary_per_hour: number;
|
|
359
|
+
monthly_salary: number;
|
|
356
360
|
docs: Map<string, {
|
|
357
361
|
doc_url: string;
|
|
358
362
|
doc_name: string;
|
|
@@ -672,7 +676,9 @@ export declare const TenantHrEmployeeSchema: Schema<any, import("mongoose").Mode
|
|
|
672
676
|
position_id: string;
|
|
673
677
|
join_date: NativeDate;
|
|
674
678
|
employment_status: HR_EMPLOYMENT_STATUS_ENUM;
|
|
679
|
+
pay_type: HR_PAY_TYPE_ENUM;
|
|
675
680
|
salary_per_hour: number;
|
|
681
|
+
monthly_salary: number;
|
|
676
682
|
docs: Map<string, {
|
|
677
683
|
doc_url: string;
|
|
678
684
|
doc_name: string;
|
|
@@ -113,10 +113,19 @@ exports.TenantHrEmployeeSchema = new mongoose_1.Schema({
|
|
|
113
113
|
enum: constants_1.ALL_HR_EMPLOYMENT_STATUS_NAMES,
|
|
114
114
|
default: constants_1.HR_EMPLOYMENT_STATUS_ENUM.ACTIVE,
|
|
115
115
|
},
|
|
116
|
+
pay_type: {
|
|
117
|
+
type: String,
|
|
118
|
+
required: true,
|
|
119
|
+
enum: constants_1.ALL_HR_PAY_TYPE_NAMES,
|
|
120
|
+
default: constants_1.HR_PAY_TYPE_ENUM.MONTHLY,
|
|
121
|
+
},
|
|
116
122
|
salary_per_hour: {
|
|
117
123
|
type: Number,
|
|
118
|
-
|
|
119
|
-
|
|
124
|
+
default: null,
|
|
125
|
+
},
|
|
126
|
+
monthly_salary: {
|
|
127
|
+
type: Number,
|
|
128
|
+
default: null,
|
|
120
129
|
},
|
|
121
130
|
docs: {
|
|
122
131
|
type: Map,
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { HR_PAYMENT_METHOD_ENUM, HR_PAYROLL_STATUS_ENUM, HR_PAY_TYPE_ENUM } from '../../constants';
|
|
3
|
+
export declare const TenantHrPayrollSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
4
|
+
timestamps: true;
|
|
5
|
+
versionKey: false;
|
|
6
|
+
minimize: false;
|
|
7
|
+
}, {
|
|
8
|
+
createdAt: NativeDate;
|
|
9
|
+
updatedAt: NativeDate;
|
|
10
|
+
} & {
|
|
11
|
+
_id: import("mongoose").Types.ObjectId;
|
|
12
|
+
tenant_id: string;
|
|
13
|
+
createdAt: NativeDate;
|
|
14
|
+
updatedAt: NativeDate;
|
|
15
|
+
status: HR_PAYROLL_STATUS_ENUM;
|
|
16
|
+
payment_method: HR_PAYMENT_METHOD_ENUM;
|
|
17
|
+
notes: string;
|
|
18
|
+
employee_id: string;
|
|
19
|
+
pay_type: HR_PAY_TYPE_ENUM;
|
|
20
|
+
salary_per_hour: number;
|
|
21
|
+
monthly_salary: number;
|
|
22
|
+
pay_period_start: NativeDate;
|
|
23
|
+
pay_period_end: NativeDate;
|
|
24
|
+
working_days_per_month: number;
|
|
25
|
+
hours_per_working_day: number;
|
|
26
|
+
overtime_multiplier: number;
|
|
27
|
+
regular_hours: number;
|
|
28
|
+
overtime_hours: number;
|
|
29
|
+
unpaid_leave_days: number;
|
|
30
|
+
regular_pay: number;
|
|
31
|
+
overtime_pay: number;
|
|
32
|
+
gross_salary: number;
|
|
33
|
+
unpaid_leave_deduction: number;
|
|
34
|
+
other_deductions: number;
|
|
35
|
+
total_deductions: number;
|
|
36
|
+
net_salary: number;
|
|
37
|
+
payment_date: NativeDate;
|
|
38
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
39
|
+
createdAt: NativeDate;
|
|
40
|
+
updatedAt: NativeDate;
|
|
41
|
+
} & {
|
|
42
|
+
_id: import("mongoose").Types.ObjectId;
|
|
43
|
+
tenant_id: string;
|
|
44
|
+
createdAt: NativeDate;
|
|
45
|
+
updatedAt: NativeDate;
|
|
46
|
+
status: HR_PAYROLL_STATUS_ENUM;
|
|
47
|
+
payment_method: HR_PAYMENT_METHOD_ENUM;
|
|
48
|
+
notes: string;
|
|
49
|
+
employee_id: string;
|
|
50
|
+
pay_type: HR_PAY_TYPE_ENUM;
|
|
51
|
+
salary_per_hour: number;
|
|
52
|
+
monthly_salary: number;
|
|
53
|
+
pay_period_start: NativeDate;
|
|
54
|
+
pay_period_end: NativeDate;
|
|
55
|
+
working_days_per_month: number;
|
|
56
|
+
hours_per_working_day: number;
|
|
57
|
+
overtime_multiplier: number;
|
|
58
|
+
regular_hours: number;
|
|
59
|
+
overtime_hours: number;
|
|
60
|
+
unpaid_leave_days: number;
|
|
61
|
+
regular_pay: number;
|
|
62
|
+
overtime_pay: number;
|
|
63
|
+
gross_salary: number;
|
|
64
|
+
unpaid_leave_deduction: number;
|
|
65
|
+
other_deductions: number;
|
|
66
|
+
total_deductions: number;
|
|
67
|
+
net_salary: number;
|
|
68
|
+
payment_date: NativeDate;
|
|
69
|
+
}>> & import("mongoose").FlatRecord<{
|
|
70
|
+
createdAt: NativeDate;
|
|
71
|
+
updatedAt: NativeDate;
|
|
72
|
+
} & {
|
|
73
|
+
_id: import("mongoose").Types.ObjectId;
|
|
74
|
+
tenant_id: string;
|
|
75
|
+
createdAt: NativeDate;
|
|
76
|
+
updatedAt: NativeDate;
|
|
77
|
+
status: HR_PAYROLL_STATUS_ENUM;
|
|
78
|
+
payment_method: HR_PAYMENT_METHOD_ENUM;
|
|
79
|
+
notes: string;
|
|
80
|
+
employee_id: string;
|
|
81
|
+
pay_type: HR_PAY_TYPE_ENUM;
|
|
82
|
+
salary_per_hour: number;
|
|
83
|
+
monthly_salary: number;
|
|
84
|
+
pay_period_start: NativeDate;
|
|
85
|
+
pay_period_end: NativeDate;
|
|
86
|
+
working_days_per_month: number;
|
|
87
|
+
hours_per_working_day: number;
|
|
88
|
+
overtime_multiplier: number;
|
|
89
|
+
regular_hours: number;
|
|
90
|
+
overtime_hours: number;
|
|
91
|
+
unpaid_leave_days: number;
|
|
92
|
+
regular_pay: number;
|
|
93
|
+
overtime_pay: number;
|
|
94
|
+
gross_salary: number;
|
|
95
|
+
unpaid_leave_deduction: number;
|
|
96
|
+
other_deductions: number;
|
|
97
|
+
total_deductions: number;
|
|
98
|
+
net_salary: number;
|
|
99
|
+
payment_date: NativeDate;
|
|
100
|
+
}> & Required<{
|
|
101
|
+
_id: import("mongoose").Types.ObjectId;
|
|
102
|
+
}> & {
|
|
103
|
+
__v: number;
|
|
104
|
+
}>;
|
|
105
|
+
export declare const TENANT_HR_PAYROLLS_COLLECTION_NAME = "tenant_hr_payrolls";
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TENANT_HR_PAYROLLS_COLLECTION_NAME = exports.TenantHrPayrollSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
exports.TenantHrPayrollSchema = new mongoose_1.Schema({
|
|
7
|
+
_id: {
|
|
8
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
9
|
+
required: true,
|
|
10
|
+
immutable: true,
|
|
11
|
+
},
|
|
12
|
+
tenant_id: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
immutable: true,
|
|
16
|
+
ref: 'tenants',
|
|
17
|
+
},
|
|
18
|
+
employee_id: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
immutable: true,
|
|
22
|
+
ref: 'tenant_hr_employees',
|
|
23
|
+
},
|
|
24
|
+
pay_type: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true,
|
|
27
|
+
enum: constants_1.ALL_HR_PAY_TYPE_NAMES,
|
|
28
|
+
default: constants_1.HR_PAY_TYPE_ENUM.MONTHLY,
|
|
29
|
+
},
|
|
30
|
+
salary_per_hour: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: null,
|
|
33
|
+
},
|
|
34
|
+
monthly_salary: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: null,
|
|
37
|
+
},
|
|
38
|
+
pay_period_start: {
|
|
39
|
+
type: mongoose_1.Schema.Types.Date,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
pay_period_end: {
|
|
43
|
+
type: mongoose_1.Schema.Types.Date,
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
working_days_per_month: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: 30,
|
|
49
|
+
},
|
|
50
|
+
hours_per_working_day: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: 8,
|
|
53
|
+
},
|
|
54
|
+
overtime_multiplier: {
|
|
55
|
+
type: Number,
|
|
56
|
+
default: 1.5,
|
|
57
|
+
},
|
|
58
|
+
regular_hours: {
|
|
59
|
+
type: Number,
|
|
60
|
+
default: null,
|
|
61
|
+
},
|
|
62
|
+
overtime_hours: {
|
|
63
|
+
type: Number,
|
|
64
|
+
default: null,
|
|
65
|
+
},
|
|
66
|
+
unpaid_leave_days: {
|
|
67
|
+
type: Number,
|
|
68
|
+
default: null,
|
|
69
|
+
},
|
|
70
|
+
regular_pay: {
|
|
71
|
+
type: Number,
|
|
72
|
+
default: 0,
|
|
73
|
+
},
|
|
74
|
+
overtime_pay: {
|
|
75
|
+
type: Number,
|
|
76
|
+
default: 0,
|
|
77
|
+
},
|
|
78
|
+
gross_salary: {
|
|
79
|
+
type: Number,
|
|
80
|
+
default: 0,
|
|
81
|
+
},
|
|
82
|
+
unpaid_leave_deduction: {
|
|
83
|
+
type: Number,
|
|
84
|
+
default: 0,
|
|
85
|
+
},
|
|
86
|
+
other_deductions: {
|
|
87
|
+
type: Number,
|
|
88
|
+
default: 0,
|
|
89
|
+
},
|
|
90
|
+
total_deductions: {
|
|
91
|
+
type: Number,
|
|
92
|
+
default: 0,
|
|
93
|
+
},
|
|
94
|
+
net_salary: {
|
|
95
|
+
type: Number,
|
|
96
|
+
default: 0,
|
|
97
|
+
},
|
|
98
|
+
status: {
|
|
99
|
+
type: String,
|
|
100
|
+
required: true,
|
|
101
|
+
enum: constants_1.ALL_HR_PAYROLL_STATUS_NAMES,
|
|
102
|
+
default: constants_1.HR_PAYROLL_STATUS_ENUM.PENDING,
|
|
103
|
+
},
|
|
104
|
+
payment_method: {
|
|
105
|
+
type: String,
|
|
106
|
+
required: true,
|
|
107
|
+
enum: constants_1.ALL_HR_PAYMENT_METHOD_NAMES,
|
|
108
|
+
default: constants_1.HR_PAYMENT_METHOD_ENUM.BANK_TRANSFER,
|
|
109
|
+
},
|
|
110
|
+
payment_date: {
|
|
111
|
+
type: Date,
|
|
112
|
+
default: null,
|
|
113
|
+
},
|
|
114
|
+
notes: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: null,
|
|
117
|
+
},
|
|
118
|
+
createdAt: {
|
|
119
|
+
type: mongoose_1.Schema.Types.Date,
|
|
120
|
+
required: true,
|
|
121
|
+
default: () => new Date(),
|
|
122
|
+
immutable: true,
|
|
123
|
+
},
|
|
124
|
+
updatedAt: {
|
|
125
|
+
type: mongoose_1.Schema.Types.Date,
|
|
126
|
+
required: true,
|
|
127
|
+
default: () => new Date(),
|
|
128
|
+
},
|
|
129
|
+
}, {
|
|
130
|
+
timestamps: true,
|
|
131
|
+
versionKey: false,
|
|
132
|
+
minimize: false,
|
|
133
|
+
});
|
|
134
|
+
exports.TENANT_HR_PAYROLLS_COLLECTION_NAME = 'tenant_hr_payrolls';
|
|
@@ -185,6 +185,9 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
|
|
|
185
185
|
menu_source?: string | null | undefined;
|
|
186
186
|
app_version?: string | null | undefined;
|
|
187
187
|
force_isolated_printing?: boolean | null | undefined;
|
|
188
|
+
hr_working_days_per_month?: number | null | undefined;
|
|
189
|
+
hr_hours_per_working_day?: number | null | undefined;
|
|
190
|
+
hr_overtime_multiplier?: number | null | undefined;
|
|
188
191
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
189
192
|
createdAt: NativeDate;
|
|
190
193
|
updatedAt: NativeDate;
|
|
@@ -366,6 +369,9 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
|
|
|
366
369
|
menu_source?: string | null | undefined;
|
|
367
370
|
app_version?: string | null | undefined;
|
|
368
371
|
force_isolated_printing?: boolean | null | undefined;
|
|
372
|
+
hr_working_days_per_month?: number | null | undefined;
|
|
373
|
+
hr_hours_per_working_day?: number | null | undefined;
|
|
374
|
+
hr_overtime_multiplier?: number | null | undefined;
|
|
369
375
|
}>> & import("mongoose").FlatRecord<{
|
|
370
376
|
createdAt: NativeDate;
|
|
371
377
|
updatedAt: NativeDate;
|
|
@@ -547,6 +553,9 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
|
|
|
547
553
|
menu_source?: string | null | undefined;
|
|
548
554
|
app_version?: string | null | undefined;
|
|
549
555
|
force_isolated_printing?: boolean | null | undefined;
|
|
556
|
+
hr_working_days_per_month?: number | null | undefined;
|
|
557
|
+
hr_hours_per_working_day?: number | null | undefined;
|
|
558
|
+
hr_overtime_multiplier?: number | null | undefined;
|
|
550
559
|
}> & Required<{
|
|
551
560
|
_id: string;
|
|
552
561
|
}> & {
|
|
@@ -773,6 +773,22 @@ exports.TenantSchema = new mongoose_1.Schema({
|
|
|
773
773
|
type: Boolean,
|
|
774
774
|
required: false,
|
|
775
775
|
},
|
|
776
|
+
// ==========>>><<<==========
|
|
777
|
+
hr_working_days_per_month: {
|
|
778
|
+
type: Number,
|
|
779
|
+
required: false,
|
|
780
|
+
default: 30,
|
|
781
|
+
},
|
|
782
|
+
hr_hours_per_working_day: {
|
|
783
|
+
type: Number,
|
|
784
|
+
required: false,
|
|
785
|
+
default: 8,
|
|
786
|
+
},
|
|
787
|
+
hr_overtime_multiplier: {
|
|
788
|
+
type: Number,
|
|
789
|
+
required: false,
|
|
790
|
+
default: 1.5,
|
|
791
|
+
},
|
|
776
792
|
// ====><====
|
|
777
793
|
createdAt: {
|
|
778
794
|
type: mongoose_1.Schema.Types.Date,
|
|
@@ -62,6 +62,7 @@ export * from './tenant_hr_attendance_records';
|
|
|
62
62
|
export * from './tenant_hr_biometric_enrollments';
|
|
63
63
|
export * from './tenant_hr_departments';
|
|
64
64
|
export * from './tenant_hr_employees';
|
|
65
|
+
export * from './tenant_hr_payrolls';
|
|
65
66
|
export * from './tenant_hr_positions';
|
|
66
67
|
export * from './tenant_hr_shift_schedules';
|
|
67
68
|
export * from './tenant_hr_shifts';
|
|
@@ -78,6 +78,7 @@ __exportStar(require("./tenant_hr_attendance_records"), exports);
|
|
|
78
78
|
__exportStar(require("./tenant_hr_biometric_enrollments"), exports);
|
|
79
79
|
__exportStar(require("./tenant_hr_departments"), exports);
|
|
80
80
|
__exportStar(require("./tenant_hr_employees"), exports);
|
|
81
|
+
__exportStar(require("./tenant_hr_payrolls"), exports);
|
|
81
82
|
__exportStar(require("./tenant_hr_positions"), exports);
|
|
82
83
|
__exportStar(require("./tenant_hr_shift_schedules"), exports);
|
|
83
84
|
__exportStar(require("./tenant_hr_shifts"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HR_EMPLOYEE_DOCUMENT_TYPE_ENUM, HR_EMPLOYMENT_STATUS_ENUM } from '../../constants';
|
|
1
|
+
import { HR_EMPLOYEE_DOCUMENT_TYPE_ENUM, HR_EMPLOYMENT_STATUS_ENUM, HR_PAY_TYPE_ENUM } from '../../constants';
|
|
2
2
|
import { IItemSpecialHour } from './common';
|
|
3
3
|
export interface ITenantHrEmergencyContact {
|
|
4
4
|
name: string;
|
|
@@ -29,7 +29,9 @@ export interface ITenantHrEmployee {
|
|
|
29
29
|
position_id: string | null;
|
|
30
30
|
join_date: Date;
|
|
31
31
|
employment_status: HR_EMPLOYMENT_STATUS_ENUM;
|
|
32
|
-
|
|
32
|
+
pay_type: HR_PAY_TYPE_ENUM;
|
|
33
|
+
salary_per_hour?: number | null;
|
|
34
|
+
monthly_salary?: number | null;
|
|
33
35
|
docs: Record<HR_EMPLOYEE_DOCUMENT_TYPE_ENUM, ITenantHrEmployeeDocument>;
|
|
34
36
|
notes?: string | null;
|
|
35
37
|
createdAt: Date;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HR_PAYMENT_METHOD_ENUM, HR_PAYROLL_STATUS_ENUM, HR_PAY_TYPE_ENUM } from '../../constants';
|
|
2
|
+
export interface ITenantHrPayroll {
|
|
3
|
+
_id: string;
|
|
4
|
+
tenant_id: string;
|
|
5
|
+
employee_id: string;
|
|
6
|
+
pay_type: HR_PAY_TYPE_ENUM;
|
|
7
|
+
salary_per_hour?: number | null;
|
|
8
|
+
monthly_salary?: number | null;
|
|
9
|
+
pay_period_start: Date;
|
|
10
|
+
pay_period_end: Date;
|
|
11
|
+
working_days_per_month: number;
|
|
12
|
+
hours_per_working_day: number;
|
|
13
|
+
overtime_multiplier: number;
|
|
14
|
+
regular_hours?: number | null;
|
|
15
|
+
overtime_hours?: number | null;
|
|
16
|
+
unpaid_leave_days?: number | null;
|
|
17
|
+
regular_pay: number;
|
|
18
|
+
overtime_pay: number;
|
|
19
|
+
gross_salary: number;
|
|
20
|
+
unpaid_leave_deduction: number;
|
|
21
|
+
other_deductions: number;
|
|
22
|
+
total_deductions: number;
|
|
23
|
+
net_salary: number;
|
|
24
|
+
status: HR_PAYROLL_STATUS_ENUM;
|
|
25
|
+
payment_method: HR_PAYMENT_METHOD_ENUM;
|
|
26
|
+
payment_date?: Date | null;
|
|
27
|
+
notes?: string | null;
|
|
28
|
+
createdAt: Date;
|
|
29
|
+
updatedAt: Date | null;
|
|
30
|
+
}
|
|
@@ -177,6 +177,9 @@ export interface ITenant {
|
|
|
177
177
|
menu_source?: string | null;
|
|
178
178
|
app_version?: string | null;
|
|
179
179
|
force_isolated_printing?: boolean;
|
|
180
|
+
hr_working_days_per_month: number;
|
|
181
|
+
hr_hours_per_working_day: number;
|
|
182
|
+
hr_overtime_multiplier: number;
|
|
180
183
|
createdAt: Date;
|
|
181
184
|
updatedAt: Date;
|
|
182
185
|
}
|
|
@@ -254,7 +254,7 @@ describe('getPartialItems - composite items on partial KOTs (ref_type)', () => {
|
|
|
254
254
|
});
|
|
255
255
|
// =========================><=========================
|
|
256
256
|
describe('getReceiptItemModifiers - hide_modifier_name', () => {
|
|
257
|
-
it('
|
|
257
|
+
it('collapses identical modifier and option names into the option name', () => {
|
|
258
258
|
const options = [];
|
|
259
259
|
(0, receipt_engine_1.getReceiptItemModifiers)([
|
|
260
260
|
makeModifier('mod-pizza', 'modref-pizza', 'Tikka Pizza', [
|
|
@@ -262,8 +262,8 @@ describe('getReceiptItemModifiers - hide_modifier_name', () => {
|
|
|
262
262
|
]),
|
|
263
263
|
], options, false, '', false);
|
|
264
264
|
expect(options).toHaveLength(1);
|
|
265
|
-
expect(options[0].left).toBe('
|
|
266
|
-
expect(options[0].option_name).toBe('');
|
|
265
|
+
expect(options[0].left).toBe(' ');
|
|
266
|
+
expect(options[0].option_name).toBe('Tikka pizza');
|
|
267
267
|
});
|
|
268
268
|
it('prints the full option name when hide_modifier_name is on (no merge)', () => {
|
|
269
269
|
const options = [];
|
|
@@ -330,4 +330,66 @@ describe('getReceiptItemModifiers - hide_modifier_name', () => {
|
|
|
330
330
|
expect(options[0].left).toBe(' ');
|
|
331
331
|
expect(options[0].option_name).toBe('Tikka Pizza Large');
|
|
332
332
|
});
|
|
333
|
+
it('collapses identical names into the option name in separate-lines mode too', () => {
|
|
334
|
+
const options = [];
|
|
335
|
+
(0, receipt_engine_1.getReceiptItemModifiers)([
|
|
336
|
+
makeModifier('mod-pizza', 'modref-pizza', 'Tikka Pizza', [
|
|
337
|
+
makeOption('opt-tikka', 'pizza-tikka', 'Tikka Pizza'),
|
|
338
|
+
]),
|
|
339
|
+
], options, true, '', false);
|
|
340
|
+
expect(options).toHaveLength(1);
|
|
341
|
+
expect(options[0].left).toBe(' ');
|
|
342
|
+
expect(options[0].option_name).toBe('Tikka Pizza');
|
|
343
|
+
});
|
|
344
|
+
it('keeps the modifier title when the option name does not overlap it', () => {
|
|
345
|
+
const options = [];
|
|
346
|
+
(0, receipt_engine_1.getReceiptItemModifiers)([makeModifier('mod-size', 'modref-size', 'SIZE', [makeOption('opt-large', 'size-large', 'Large')])], options, false, '', false);
|
|
347
|
+
expect(options).toHaveLength(1);
|
|
348
|
+
expect(options[0].left).toBe(' SIZE ');
|
|
349
|
+
expect(options[0].option_name).toBe('Large');
|
|
350
|
+
});
|
|
351
|
+
it('keeps the + marker when a keyword-styled title collapses', () => {
|
|
352
|
+
const options = [];
|
|
353
|
+
(0, receipt_engine_1.getReceiptItemModifiers)([
|
|
354
|
+
makeModifier('mod-wings', 'modref-wings', 'Extra Hot Wings', [
|
|
355
|
+
makeOption('opt-wings', 'wings-extra', 'Extra Hot Wings'),
|
|
356
|
+
]),
|
|
357
|
+
], options, false, '', false);
|
|
358
|
+
expect(options).toHaveLength(1);
|
|
359
|
+
expect(options[0].left).toBe(' + ');
|
|
360
|
+
expect(options[0].option_name).toBe('Extra hot wings');
|
|
361
|
+
});
|
|
362
|
+
it('keeps the - marker for removal-style titles', () => {
|
|
363
|
+
const options = [];
|
|
364
|
+
(0, receipt_engine_1.getReceiptItemModifiers)([
|
|
365
|
+
makeModifier('mod-onion', 'modref-onion', 'Without Onion', [
|
|
366
|
+
makeOption('opt-onion', 'onion-remove', 'Without Onion'),
|
|
367
|
+
]),
|
|
368
|
+
], options, false, '', false);
|
|
369
|
+
expect(options).toHaveLength(1);
|
|
370
|
+
expect(options[0].left).toBe(' - ');
|
|
371
|
+
expect(options[0].option_name).toBe('Without onion');
|
|
372
|
+
});
|
|
373
|
+
it('drops the title when the option name fully covers it', () => {
|
|
374
|
+
const options = [];
|
|
375
|
+
(0, receipt_engine_1.getReceiptItemModifiers)([
|
|
376
|
+
makeModifier('mod-pizza', 'modref-pizza', 'Tikka Pizza', [
|
|
377
|
+
makeOption('opt-tikka', 'pizza-tikka', 'Tikka Pizza Large'),
|
|
378
|
+
]),
|
|
379
|
+
], options, false, '', false);
|
|
380
|
+
expect(options).toHaveLength(1);
|
|
381
|
+
expect(options[0].left).toBe(' ');
|
|
382
|
+
expect(options[0].option_name).toBe('Tikka pizza large');
|
|
383
|
+
});
|
|
384
|
+
it('collapses names that only differ in whitespace', () => {
|
|
385
|
+
const options = [];
|
|
386
|
+
(0, receipt_engine_1.getReceiptItemModifiers)([
|
|
387
|
+
makeModifier('mod-pizza', 'modref-pizza', 'Tikka Pizza', [
|
|
388
|
+
makeOption('opt-tikka', 'pizza-tikka', 'Tikka Pizza'),
|
|
389
|
+
]),
|
|
390
|
+
], options, false, '', false);
|
|
391
|
+
expect(options).toHaveLength(1);
|
|
392
|
+
expect(options[0].left).toBe(' ');
|
|
393
|
+
expect(options[0].option_name).toBe('Tikka pizza');
|
|
394
|
+
});
|
|
333
395
|
});
|