shareneus 1.0.5
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/aggregation/aggregation.js +60 -0
- package/dist/enums/cache-enums.js +37 -0
- package/dist/enums/code-enums.js +288 -0
- package/dist/enums/enums.js +362 -0
- package/dist/enums/industry-enums.js +24 -0
- package/dist/excel-files/GSTR-RO-excel.service.js +935 -0
- package/dist/excel-files/GSTR1-excel.service.js +295 -0
- package/dist/excel-files/GSTR2-excel.service.js +295 -0
- package/dist/excel-files/analysis-excel.service.js +297 -0
- package/dist/excel-files/category-wise-item-excel.service.js +274 -0
- package/dist/excel-files/cust-balance-excel.service.js +287 -0
- package/dist/excel-files/cust-wise-sales-details.js +320 -0
- package/dist/excel-files/cust-wise-sales-summary-excel.service.js +302 -0
- package/dist/excel-files/expiring-drugs-excel.service.js +292 -0
- package/dist/excel-files/insurance-expire-excel.service.js +301 -0
- package/dist/excel-files/invoice-wise-excel.service.js +857 -0
- package/dist/excel-files/item-wise-doctor-sale-excel.service.js +258 -0
- package/dist/excel-files/item-wise-mout-details.js +292 -0
- package/dist/excel-files/item-wise-mout-summary.js +286 -0
- package/dist/excel-files/items-wise-sales-excel.service.js +314 -0
- package/dist/excel-files/manf-wise-sales-excel.service.js +276 -0
- package/dist/excel-files/operator-wise-details.js +265 -0
- package/dist/excel-files/operator-wise-summary.js +266 -0
- package/dist/excel-files/payment-receive-excel.service.js +225 -0
- package/dist/excel-files/payments-made-excel.service.js +302 -0
- package/dist/excel-files/repair-orders-excel.service.js +255 -0
- package/dist/excel-files/sa-wise-labor-sales-excel.service.js +232 -0
- package/dist/excel-files/sa-wise-part-sales-excel.service.js +232 -0
- package/dist/excel-files/sale-summary-excel.service.js +326 -0
- package/dist/excel-files/sales-by-service-details-excel.service.js +1 -0
- package/dist/excel-files/sales-by-service-summary-excel.service.js +422 -0
- package/dist/excel-files/scheduled-drug-summary-excel.service.js +367 -0
- package/dist/excel-files/scheduled-drugs-excel.service.js +366 -0
- package/dist/excel-files/spares-issue-excel.service.js +492 -0
- package/dist/excel-files/stock-excel.service.js +283 -0
- package/dist/excel-files/tally-sales-import.service.js +765 -0
- package/dist/excel-files/ven-balance-excel.service.js +293 -0
- package/dist/index.js +237 -0
- package/dist/services/analysis-pdf.service.js +105 -0
- package/dist/services/appointment-total.service.js +253 -0
- package/dist/services/auto-sales-receipt-pdf.service.js +539 -0
- package/dist/services/category-wise-item-pdf.service.js +98 -0
- package/dist/services/checklist-pdf.js +140 -0
- package/dist/services/checklists-pdf.js +124 -0
- package/dist/services/cn-print.service.js +211 -0
- package/dist/services/consultation-fee-receipt.service.js +378 -0
- package/dist/services/consultation-full-pdf.service.js +220 -0
- package/dist/services/consultation-pdf.service.js +360 -0
- package/dist/services/credit-note-pdf.service.js +578 -0
- package/dist/services/credit-note-totals.service.js +328 -0
- package/dist/services/cust-wise-sales-details-pdf.service.js +118 -0
- package/dist/services/cust-wise-sales-summary-pdf.service.js +111 -0
- package/dist/services/customer-balances-pdf.service.js +169 -0
- package/dist/services/dc-landscape-pdf.service.js +903 -0
- package/dist/services/dc-landscape-without-price-pdf.service.js +853 -0
- package/dist/services/dc-without-price-pdf.service.js +489 -0
- package/dist/services/debit-note-pdf.service.js +673 -0
- package/dist/services/debit-note-print.service.js +234 -0
- package/dist/services/debit-note-totals.service.js +293 -0
- package/dist/services/delivery-challan-pdf.service.js +434 -0
- package/dist/services/delivery-challan-print.service.js +177 -0
- package/dist/services/delivery-challan-totals.js +339 -0
- package/dist/services/equipment-design-pdf.service.js +144 -0
- package/dist/services/est.print-service.js +1053 -0
- package/dist/services/expiring-drugs-pdf.service.js +156 -0
- package/dist/services/hc-inv-pdf.service.js +837 -0
- package/dist/services/insurance-expire-pdf.service.js +99 -0
- package/dist/services/inv-pdf.service.js +785 -0
- package/dist/services/inv-print.service.js +415 -0
- package/dist/services/invoice-landscape-pdf.service.js +909 -0
- package/dist/services/invoice-total.service.js +659 -0
- package/dist/services/issue-parts-pdf.service.js +763 -0
- package/dist/services/item-detais-pdf.js +136 -0
- package/dist/services/item-wise-doctor-sale-pdf.service.js +164 -0
- package/dist/services/item-wise-mout-details-pdf.js +107 -0
- package/dist/services/item-wise-mout-summary-pdf.js +99 -0
- package/dist/services/item-wise-sales-pdf.service.js +178 -0
- package/dist/services/manf-wise-sales-pdf.service.js +173 -0
- package/dist/services/meeting-pdf.js +369 -0
- package/dist/services/mout-pdf.service.js +503 -0
- package/dist/services/operator-wise-details-pdf.service.js +103 -0
- package/dist/services/operator-wise-summary-pdf.js +101 -0
- package/dist/services/pack-ship-pdf.service.js +105 -0
- package/dist/services/pack-ship-print.service.js +167 -0
- package/dist/services/payment-pdf.service.js +373 -0
- package/dist/services/payment-report-pdf.service.js +106 -0
- package/dist/services/po-totals.service.js +279 -0
- package/dist/services/pos-receipt-pdf.js +438 -0
- package/dist/services/purchase-order-pdf.service.js +924 -0
- package/dist/services/purchase-order-print.service.js +150 -0
- package/dist/services/purchase-order-totals.service.js +280 -0
- package/dist/services/receipt-print.service.js +50 -0
- package/dist/services/reorder-point-pdf.service.js +151 -0
- package/dist/services/repair-orders-pdf.service.js +172 -0
- package/dist/services/ro-pdf.service.js +1764 -0
- package/dist/services/ro-print-service.js +737 -0
- package/dist/services/ro-totals.service.js +1241 -0
- package/dist/services/sales-by-service-pdf.service.js +116 -0
- package/dist/services/sales-pdf.service.js +630 -0
- package/dist/services/sales-print.service.js +305 -0
- package/dist/services/sales-receipt-pdf.service.js +611 -0
- package/dist/services/sales-receipt-print.service.js +425 -0
- package/dist/services/sales-totals.service.js +339 -0
- package/dist/services/scheduled-drug-pdf.service.js +176 -0
- package/dist/services/scheduled-drug-summary-pdf.service.js +188 -0
- package/dist/services/separate-wo-print.service.js +351 -0
- package/dist/services/shared-inv-pdf.service.js +763 -0
- package/dist/services/shared-pdf.service.js +2569 -0
- package/dist/services/shared-print.service.js +885 -0
- package/dist/services/task-pdf.service.js +220 -0
- package/dist/services/task-reports-pdf.service.js +296 -0
- package/dist/services/technician-pdf.service.js +238 -0
- package/dist/services/technician-print.service.js +87 -0
- package/dist/services/transfer-order-pdf.service.js +139 -0
- package/dist/services/vendor-balances-pdf.service.js +101 -0
- package/dist/services/vendor-credit-note-pdf.service.js +1007 -0
- package/dist/services/vendor-credit-note-print.service.js +104 -0
- package/dist/services/vendor-credit-note-totals.service.js +327 -0
- package/dist/services/vendor-debit-note-pdf.service.js +561 -0
- package/dist/services/vendor-debit-note-print.service.js +245 -0
- package/dist/services/vendor-debit-note-totals.service.js +305 -0
- package/dist/utils/my-date.js +652 -0
- package/dist/utils/tr-utils.js +354 -0
- package/package.json +24 -0
- package/tsconfig.json +109 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TrUtils = void 0;
|
|
4
|
+
// import { HttpClient } from '@angular/common/http';
|
|
5
|
+
const enums_1 = require("../enums/enums");
|
|
6
|
+
var deepEqual = require('deep-equal');
|
|
7
|
+
// import { LaborStatusEnum } from '../enums/enums';
|
|
8
|
+
class TrUtils {
|
|
9
|
+
static IsNull(Value) {
|
|
10
|
+
return Value === null || typeof Value === 'undefined';
|
|
11
|
+
}
|
|
12
|
+
static IsEmpty(Value) {
|
|
13
|
+
return Value === null || typeof Value === 'undefined' || Value === '';
|
|
14
|
+
}
|
|
15
|
+
static IsZero(Value) {
|
|
16
|
+
return Value === null || typeof Value === 'undefined' || Value === 0;
|
|
17
|
+
}
|
|
18
|
+
static IsFixedZero(Value) {
|
|
19
|
+
return Value === null || typeof Value === 'undefined' || Value === '0.00';
|
|
20
|
+
}
|
|
21
|
+
static Stringify(RecordData) {
|
|
22
|
+
if (this.IsNull(RecordData)) {
|
|
23
|
+
return RecordData;
|
|
24
|
+
}
|
|
25
|
+
let StringifiedResult = JSON.parse(JSON.stringify(RecordData));
|
|
26
|
+
return StringifiedResult;
|
|
27
|
+
}
|
|
28
|
+
static CombineProductDetails(product) {
|
|
29
|
+
return product.Model + ' ' + product.Year + ' ' + product.Var;
|
|
30
|
+
}
|
|
31
|
+
static GetProductRegistrationNo(product) {
|
|
32
|
+
if (!this.IsNull(product)) {
|
|
33
|
+
return product.RegNo;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
static GetEquipmentModel(product) {
|
|
40
|
+
return product.Make + ' ' + product.Model;
|
|
41
|
+
}
|
|
42
|
+
static GetEquipmentSerialNo(equipment) {
|
|
43
|
+
if (!this.IsNull(equipment)) {
|
|
44
|
+
return equipment.SNo;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
static ConcatObjects(obj1, obj2) {
|
|
51
|
+
// tslint:disable-next-line:forin
|
|
52
|
+
for (let key in obj2) {
|
|
53
|
+
obj1[key] = obj2[key];
|
|
54
|
+
}
|
|
55
|
+
return obj1;
|
|
56
|
+
}
|
|
57
|
+
static ConvertPercToVal(Discount, Total) {
|
|
58
|
+
if (this.IsNull(Total)) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
if (this.IsNull(Discount)) {
|
|
63
|
+
Discount = 0;
|
|
64
|
+
}
|
|
65
|
+
if (this.IsNull(Total)) {
|
|
66
|
+
Total = 0;
|
|
67
|
+
}
|
|
68
|
+
let value = this.FixedTo(((Total * Discount) / 100));
|
|
69
|
+
if (isNaN(value)) {
|
|
70
|
+
value = 0;
|
|
71
|
+
}
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
static ConvertMinsToHour(Mins) {
|
|
76
|
+
let Num;
|
|
77
|
+
Mins = Number(Mins);
|
|
78
|
+
let Hrs = Mins / 60;
|
|
79
|
+
Num = this.FixedTo(Hrs);
|
|
80
|
+
return Num;
|
|
81
|
+
}
|
|
82
|
+
static ConvertHourToMin(HrsData) {
|
|
83
|
+
let Time = {};
|
|
84
|
+
if (!TrUtils.IsNull(HrsData)) {
|
|
85
|
+
// tslint:disable-next-line:radix
|
|
86
|
+
Time['Hrs'] = parseInt(HrsData.toString().split('.')[0]);
|
|
87
|
+
Time['Mins'] = (HrsData * 60) % 60;
|
|
88
|
+
}
|
|
89
|
+
return Time;
|
|
90
|
+
}
|
|
91
|
+
static FixedTo(value) {
|
|
92
|
+
if (this.IsNull(value)) {
|
|
93
|
+
value = 0;
|
|
94
|
+
}
|
|
95
|
+
value = Number(value);
|
|
96
|
+
let Result = value.toFixed(this.DecimalsNumber);
|
|
97
|
+
return Number(Result);
|
|
98
|
+
}
|
|
99
|
+
static FixPriceValue(Value) {
|
|
100
|
+
if (this.IsNull(Value)) {
|
|
101
|
+
Value = 0;
|
|
102
|
+
}
|
|
103
|
+
if (typeof Value === 'string') {
|
|
104
|
+
Value = Number(Value);
|
|
105
|
+
}
|
|
106
|
+
let Result = Value.toFixed(this.DecimalsNumber);
|
|
107
|
+
return Result;
|
|
108
|
+
}
|
|
109
|
+
static ConvertValToPerc(Discount, Total) {
|
|
110
|
+
if (this.IsNull(Total)) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
if (this.IsNull(Discount)) {
|
|
115
|
+
Discount = 0;
|
|
116
|
+
}
|
|
117
|
+
if (this.IsNull(Total)) {
|
|
118
|
+
Total = 0;
|
|
119
|
+
}
|
|
120
|
+
let value = this.FixedTo(((Discount * 100) / Total));
|
|
121
|
+
if (isNaN(value)) {
|
|
122
|
+
value = 0;
|
|
123
|
+
}
|
|
124
|
+
return value;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
static CheckARIndividualStatusValid(Part, Field) {
|
|
128
|
+
if (Part.Ind[Field] === enums_1.LaborStatusEnum.Cancelled || Part.Ind[Field] === enums_1.LaborStatusEnum.Declined) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
static CheckARIndividualStatusApproved(Part, Field) {
|
|
136
|
+
if (Part.Ind[Field] !== enums_1.LaborStatusEnum.New && Part.Ind[Field] !== enums_1.LaborStatusEnum.WtngForAppr &&
|
|
137
|
+
this.CheckARIndividualStatusValid(Part, Field)) {
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
static CheckARIndividualStatusCompleted(Part, Field) {
|
|
145
|
+
if (Part.Ind[Field] === enums_1.LaborStatusEnum.Completed) {
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
static CheckAndUnsubscribeSubject(Subject) {
|
|
153
|
+
if (!this.IsNull(Subject)) {
|
|
154
|
+
Subject.unsubscribe();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
static SetValueToZeroIfNull(Value) {
|
|
158
|
+
if (this.IsNull(Value)) {
|
|
159
|
+
Value = 0;
|
|
160
|
+
}
|
|
161
|
+
return Value;
|
|
162
|
+
}
|
|
163
|
+
static SetPercToStringIfNull(Value) {
|
|
164
|
+
if (this.IsNull(Value)) {
|
|
165
|
+
Value = '';
|
|
166
|
+
}
|
|
167
|
+
return Value;
|
|
168
|
+
}
|
|
169
|
+
static SetPercToTrueIfNull(Value) {
|
|
170
|
+
if (this.IsNull(Value)) {
|
|
171
|
+
Value = true;
|
|
172
|
+
}
|
|
173
|
+
return Value;
|
|
174
|
+
}
|
|
175
|
+
static CheckInvalidSelect(Value) {
|
|
176
|
+
return Value === null || typeof Value === 'undefined' || Value === '' || Value === -1 || Value === '-1';
|
|
177
|
+
}
|
|
178
|
+
static DateSorting(date1, date2) {
|
|
179
|
+
if (TrUtils.IsEmpty(date1) && TrUtils.IsEmpty(date2)) {
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
if (TrUtils.IsEmpty(date1)) {
|
|
183
|
+
return -1;
|
|
184
|
+
}
|
|
185
|
+
if (TrUtils.IsEmpty(date2)) {
|
|
186
|
+
return 1;
|
|
187
|
+
}
|
|
188
|
+
let Date1 = date1.split('-');
|
|
189
|
+
let Date2 = date2.split('-');
|
|
190
|
+
let year1 = Number(Date1[2]);
|
|
191
|
+
let day1 = Number(Date1[0]);
|
|
192
|
+
let months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'];
|
|
193
|
+
let month1 = months.indexOf(Date1[1]);
|
|
194
|
+
let year2 = Number(Date2[2]);
|
|
195
|
+
let day2 = Number(Date2[0]);
|
|
196
|
+
let month2 = months.indexOf(Date2[1]);
|
|
197
|
+
let result1 = (year1 * 10000) + (month1 * 100) + day1;
|
|
198
|
+
let result2 = (year2 * 10000) + (month2 * 100) + day2;
|
|
199
|
+
let result = result1 - result2;
|
|
200
|
+
return result;
|
|
201
|
+
}
|
|
202
|
+
static DateSortingMonthandYear(date1, date2) {
|
|
203
|
+
if (TrUtils.IsEmpty(date1) && TrUtils.IsEmpty(date2)) {
|
|
204
|
+
return 0;
|
|
205
|
+
}
|
|
206
|
+
if (TrUtils.IsEmpty(date1)) {
|
|
207
|
+
return -1;
|
|
208
|
+
}
|
|
209
|
+
if (TrUtils.IsEmpty(date2)) {
|
|
210
|
+
return 1;
|
|
211
|
+
}
|
|
212
|
+
let Date1 = date1.split('/');
|
|
213
|
+
let Date2 = date2.split('/');
|
|
214
|
+
let year1 = Number(Date1[1]);
|
|
215
|
+
// let day1 = Number(Date1[0]);
|
|
216
|
+
let months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'];
|
|
217
|
+
let month1 = months.indexOf(Date1[0]);
|
|
218
|
+
let year2 = Number(Date2[1]);
|
|
219
|
+
// let day2 = Number(Date2[0]);
|
|
220
|
+
let month2 = months.indexOf(Date2[0]);
|
|
221
|
+
let result1 = (year1 * 10000) + (month1 * 100);
|
|
222
|
+
let result2 = (year2 * 10000) + (month2 * 100);
|
|
223
|
+
let result = result1 - result2;
|
|
224
|
+
return result;
|
|
225
|
+
}
|
|
226
|
+
static InvoiceIdSorting(data1, data2) {
|
|
227
|
+
if (!this.IsEmpty(data1) && !this.IsEmpty(data2)) {
|
|
228
|
+
let Data1 = data1.split('I');
|
|
229
|
+
let Data2 = data2.split('I');
|
|
230
|
+
return this.GridNumberSorting(Data1[1], Data2[1]);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
return 0;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
static IdSorting(id, data1, data2) {
|
|
237
|
+
if (!this.IsEmpty(data1) && !this.IsEmpty(data2) && data1.includes(id) && data2.includes(id)) {
|
|
238
|
+
let Data1 = data1.split(id);
|
|
239
|
+
let Data2 = data2.split(id);
|
|
240
|
+
return this.GridNumberSorting(Data1[1], Data2[1]);
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
return this.GridNumberSorting(data1, data2);
|
|
244
|
+
;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
static GridNumberSorting(num1, num2) {
|
|
248
|
+
let result = Number(num1) - Number(num2);
|
|
249
|
+
return result;
|
|
250
|
+
}
|
|
251
|
+
static AlphabetSorter(argDatalist, Identifier) {
|
|
252
|
+
let argList = TrUtils.Stringify(argDatalist);
|
|
253
|
+
argList.sort(function (a, b) {
|
|
254
|
+
var _a, _b, _c, _d;
|
|
255
|
+
// tslint:disable-next-line:curly
|
|
256
|
+
if (TrUtils.IsNull(a[Identifier])) {
|
|
257
|
+
a[Identifier] = '';
|
|
258
|
+
}
|
|
259
|
+
if (TrUtils.IsNull(b[Identifier])) {
|
|
260
|
+
b[Identifier] = '';
|
|
261
|
+
}
|
|
262
|
+
if (((_a = a[Identifier]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) < ((_b = b[Identifier]) === null || _b === void 0 ? void 0 : _b.toLowerCase()))
|
|
263
|
+
return -1;
|
|
264
|
+
// tslint:disable-next-line:curly
|
|
265
|
+
if (((_c = a[Identifier]) === null || _c === void 0 ? void 0 : _c.toLowerCase()) > ((_d = b[Identifier]) === null || _d === void 0 ? void 0 : _d.toLowerCase()))
|
|
266
|
+
return 1;
|
|
267
|
+
return 0;
|
|
268
|
+
});
|
|
269
|
+
return argList;
|
|
270
|
+
}
|
|
271
|
+
static ArrayAlphabetSorting(SortingList) {
|
|
272
|
+
SortingList.sort((a, b) => {
|
|
273
|
+
let fa = a.Name.toLowerCase(), fb = b.Name.toLowerCase();
|
|
274
|
+
if (fa < fb) {
|
|
275
|
+
return -1;
|
|
276
|
+
}
|
|
277
|
+
if (fa > fb) {
|
|
278
|
+
return 1;
|
|
279
|
+
}
|
|
280
|
+
return 0;
|
|
281
|
+
});
|
|
282
|
+
return SortingList;
|
|
283
|
+
}
|
|
284
|
+
static GetHours(hour, isPM) {
|
|
285
|
+
if (isPM === 'PM') {
|
|
286
|
+
let Amhours = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'];
|
|
287
|
+
let Pmhours = ['13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'];
|
|
288
|
+
if (hour >= 12) {
|
|
289
|
+
let Index = Pmhours.findIndex((val) => {
|
|
290
|
+
return val === hour.toString();
|
|
291
|
+
});
|
|
292
|
+
return (Index === -1) ? '12' : Amhours[Index];
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
let Index = Amhours.findIndex((val) => {
|
|
296
|
+
return val === hour.toString();
|
|
297
|
+
});
|
|
298
|
+
return (Index === -1) ? '12' : Pmhours[Index];
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
return hour === '12' ? '0' : hour.toString();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
static isTaxable(tax) {
|
|
306
|
+
return (tax === 'TI') ? true : false;
|
|
307
|
+
}
|
|
308
|
+
static IsItemFromEstimate(ItemId) {
|
|
309
|
+
return !TrUtils.IsNull(ItemId) && (ItemId.split('E').length === 2);
|
|
310
|
+
}
|
|
311
|
+
static IsItemInsurance(PayBy) {
|
|
312
|
+
return PayBy === enums_1.PayTypeEnum.Insurance || PayBy === enums_1.PayTypeEnum.Shared;
|
|
313
|
+
}
|
|
314
|
+
static GetMonthsArray() {
|
|
315
|
+
let MonthName = new Array();
|
|
316
|
+
MonthName[0] = 'Jan';
|
|
317
|
+
MonthName[1] = 'Feb';
|
|
318
|
+
MonthName[2] = 'Mar';
|
|
319
|
+
MonthName[3] = 'Apr';
|
|
320
|
+
MonthName[4] = 'May';
|
|
321
|
+
MonthName[5] = 'Jun';
|
|
322
|
+
MonthName[6] = 'Jul';
|
|
323
|
+
MonthName[7] = 'Aug';
|
|
324
|
+
MonthName[8] = 'Sept';
|
|
325
|
+
MonthName[9] = 'Oct';
|
|
326
|
+
MonthName[10] = 'Nov';
|
|
327
|
+
MonthName[11] = 'Dec';
|
|
328
|
+
return MonthName;
|
|
329
|
+
}
|
|
330
|
+
static IsEqual(arg1, arg2) {
|
|
331
|
+
return deepEqual(arg1, arg2, true);
|
|
332
|
+
}
|
|
333
|
+
static GetDurationInHrsAndMins(duration) {
|
|
334
|
+
let Durationhr = Math.floor(duration / 60);
|
|
335
|
+
let Durationmin = duration % 60;
|
|
336
|
+
if (Durationhr === 0 && Durationmin === 0) {
|
|
337
|
+
return '-';
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
let DurationInfo = '';
|
|
341
|
+
if (Durationhr !== 0) {
|
|
342
|
+
DurationInfo = Durationhr + ' hrs';
|
|
343
|
+
}
|
|
344
|
+
if (Durationmin !== 0) {
|
|
345
|
+
DurationInfo = DurationInfo + ' ' + Durationmin + ' mins';
|
|
346
|
+
}
|
|
347
|
+
return DurationInfo;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
exports.TrUtils = TrUtils;
|
|
352
|
+
// static laborEndPointAddress: string = 'https://b4721cf2655e.ngrok.io/';
|
|
353
|
+
// static laborEndPointAddress: string = 'http://localhost:9000/';
|
|
354
|
+
TrUtils.DecimalsNumber = 2;
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "shareneus",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"author": "",
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@types/node": "^20.14.11",
|
|
15
|
+
"typescript": "^5.5.4"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"big.js": "^6.2.1",
|
|
19
|
+
"date-fns": "^2.30.0",
|
|
20
|
+
"date-fns-tz": "^2.0.0",
|
|
21
|
+
"jsbarcode": "^3.11.6",
|
|
22
|
+
"xlsx": "^0.18.5"
|
|
23
|
+
}
|
|
24
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "./dist",
|
|
4
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
5
|
+
|
|
6
|
+
/* Projects */
|
|
7
|
+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
8
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
9
|
+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
10
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
11
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
12
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
13
|
+
|
|
14
|
+
/* Language and Environment */
|
|
15
|
+
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
16
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
17
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
18
|
+
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
19
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
20
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
21
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
22
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
23
|
+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
24
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
25
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
26
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
27
|
+
|
|
28
|
+
/* Modules */
|
|
29
|
+
"module": "commonjs", /* Specify what module code is generated. */
|
|
30
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
31
|
+
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
32
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
33
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
34
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
35
|
+
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
36
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
37
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
38
|
+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
39
|
+
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
40
|
+
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
41
|
+
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
42
|
+
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
43
|
+
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
44
|
+
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
45
|
+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
46
|
+
|
|
47
|
+
/* JavaScript Support */
|
|
48
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
49
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
50
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
51
|
+
|
|
52
|
+
/* Emit */
|
|
53
|
+
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
54
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
55
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
56
|
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
57
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
58
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
59
|
+
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
60
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
61
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
62
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
63
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
64
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
65
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
66
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
67
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
68
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
69
|
+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
70
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
71
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
72
|
+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
73
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
74
|
+
|
|
75
|
+
/* Interop Constraints */
|
|
76
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
77
|
+
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
78
|
+
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
|
|
79
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
80
|
+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
81
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
82
|
+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
83
|
+
|
|
84
|
+
/* Type Checking */
|
|
85
|
+
"strict": true, /* Enable all strict type-checking options. */
|
|
86
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
87
|
+
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
88
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
89
|
+
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
90
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
91
|
+
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
92
|
+
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
93
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
94
|
+
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
95
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
96
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
97
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
98
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
99
|
+
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
100
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
101
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
102
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
103
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
104
|
+
|
|
105
|
+
/* Completeness */
|
|
106
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
107
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
108
|
+
}
|
|
109
|
+
}
|