scheduler-node-models 1.0.78 → 1.0.79
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/package.json +22 -4
- package/general/emailer.d.ts +0 -1
- package/general/emailer.js +0 -31
- package/general/general.d.ts +0 -12
- package/general/general.js +0 -2
- package/general/index.d.ts +0 -4
- package/general/index.js +0 -20
- package/general/report.d.ts +0 -12
- package/general/report.js +0 -70
- package/general/reportStyle.d.ts +0 -0
- package/general/reportStyle.js +0 -1
- package/general/viewstate.d.ts +0 -5
- package/general/viewstate.js +0 -9
- package/index.d.ts +0 -0
- package/metrics/images.d.ts +0 -22
- package/metrics/images.js +0 -33
- package/metrics/index.d.ts +0 -5
- package/metrics/index.js +0 -21
- package/metrics/mission.d.ts +0 -47
- package/metrics/mission.js +0 -81
- package/metrics/missionSensorOutage.d.ts +0 -11
- package/metrics/missionSensorOutage.js +0 -14
- package/metrics/missionsensor.d.ts +0 -67
- package/metrics/missionsensor.js +0 -128
- package/metrics/outage.d.ts +0 -43
- package/metrics/outage.js +0 -55
- package/metrics/reports/drawSummary.d.ts +0 -24
- package/metrics/reports/drawSummary.js +0 -311
- package/metrics/reports/index.d.ts +0 -5
- package/metrics/reports/index.js +0 -21
- package/metrics/reports/missionDay.d.ts +0 -8
- package/metrics/reports/missionDay.js +0 -23
- package/metrics/reports/missionSummary.d.ts +0 -25
- package/metrics/reports/missionSummary.js +0 -421
- package/metrics/reports/missionType.d.ts +0 -20
- package/metrics/reports/missionType.js +0 -314
- package/metrics/reports/outageDay.d.ts +0 -8
- package/metrics/reports/outageDay.js +0 -23
- package/metrics/systemdata/classifications.d.ts +0 -18
- package/metrics/systemdata/classifications.js +0 -23
- package/metrics/systemdata/communications.d.ts +0 -21
- package/metrics/systemdata/communications.js +0 -40
- package/metrics/systemdata/dcgs.d.ts +0 -19
- package/metrics/systemdata/dcgs.js +0 -29
- package/metrics/systemdata/exploitations.d.ts +0 -18
- package/metrics/systemdata/exploitations.js +0 -23
- package/metrics/systemdata/groundSystems.d.ts +0 -86
- package/metrics/systemdata/groundSystems.js +0 -143
- package/metrics/systemdata/index.d.ts +0 -7
- package/metrics/systemdata/index.js +0 -23
- package/metrics/systemdata/platform.d.ts +0 -124
- package/metrics/systemdata/platform.js +0 -176
- package/metrics/systemdata/systeminfo.d.ts +0 -28
- package/metrics/systemdata/systeminfo.js +0 -64
- package/scheduler/employees/assignment.d.ts +0 -139
- package/scheduler/employees/assignment.js +0 -304
- package/scheduler/employees/balance.d.ts +0 -35
- package/scheduler/employees/balance.js +0 -39
- package/scheduler/employees/companyinfo.d.ts +0 -16
- package/scheduler/employees/companyinfo.js +0 -6
- package/scheduler/employees/contact.d.ts +0 -36
- package/scheduler/employees/contact.js +0 -40
- package/scheduler/employees/employee.d.ts +0 -420
- package/scheduler/employees/employee.js +0 -1862
- package/scheduler/employees/employeename.d.ts +0 -48
- package/scheduler/employees/employeename.js +0 -97
- package/scheduler/employees/index.d.ts +0 -14
- package/scheduler/employees/index.js +0 -30
- package/scheduler/employees/labor.d.ts +0 -31
- package/scheduler/employees/labor.js +0 -39
- package/scheduler/employees/leave.d.ts +0 -58
- package/scheduler/employees/leave.js +0 -73
- package/scheduler/employees/leaverequest.d.ts +0 -105
- package/scheduler/employees/leaverequest.js +0 -226
- package/scheduler/employees/specialty.d.ts +0 -35
- package/scheduler/employees/specialty.js +0 -40
- package/scheduler/employees/variation.d.ts +0 -80
- package/scheduler/employees/variation.js +0 -132
- package/scheduler/employees/web.d.ts +0 -6
- package/scheduler/employees/web.js +0 -2
- package/scheduler/employees/work.d.ts +0 -96
- package/scheduler/employees/work.js +0 -133
- package/scheduler/employees/workday.d.ts +0 -91
- package/scheduler/employees/workday.js +0 -170
- package/scheduler/labor/index.d.ts +0 -2
- package/scheduler/labor/index.js +0 -18
- package/scheduler/labor/laborcode.d.ts +0 -33
- package/scheduler/labor/laborcode.js +0 -55
- package/scheduler/labor/workcode.d.ts +0 -28
- package/scheduler/labor/workcode.js +0 -35
- package/scheduler/reports/chargeStatus.d.ts +0 -66
- package/scheduler/reports/chargeStatus.js +0 -702
- package/scheduler/reports/cofsReports.d.ts +0 -11
- package/scheduler/reports/cofsReports.js +0 -36
- package/scheduler/reports/enterpriseSchedule.d.ts +0 -18
- package/scheduler/reports/enterpriseSchedule.js +0 -159
- package/scheduler/reports/index.d.ts +0 -4
- package/scheduler/reports/index.js +0 -20
- package/scheduler/reports/scheduleReport.d.ts +0 -17
- package/scheduler/reports/scheduleReport.js +0 -311
- package/scheduler/sites/index.d.ts +0 -1
- package/scheduler/sites/index.js +0 -17
- package/scheduler/sites/reports/cofsReport.d.ts +0 -41
- package/scheduler/sites/reports/cofsReport.js +0 -104
- package/scheduler/sites/reports/forecast.d.ts +0 -57
- package/scheduler/sites/reports/forecast.js +0 -205
- package/scheduler/sites/reports/index.d.ts +0 -4
- package/scheduler/sites/reports/index.js +0 -20
- package/scheduler/sites/reports/period.d.ts +0 -11
- package/scheduler/sites/reports/period.js +0 -27
- package/scheduler/sites/reports/section.d.ts +0 -63
- package/scheduler/sites/reports/section.js +0 -174
- package/scheduler/sites/site.d.ts +0 -39
- package/scheduler/sites/site.js +0 -61
- package/scheduler/sites/workcenters/index.d.ts +0 -3
- package/scheduler/sites/workcenters/index.js +0 -19
- package/scheduler/sites/workcenters/position.d.ts +0 -27
- package/scheduler/sites/workcenters/position.js +0 -36
- package/scheduler/sites/workcenters/shift.d.ts +0 -32
- package/scheduler/sites/workcenters/shift.js +0 -47
- package/scheduler/sites/workcenters/workcenter.d.ts +0 -43
- package/scheduler/sites/workcenters/workcenter.js +0 -123
- package/scheduler/teams/company/company.d.ts +0 -99
- package/scheduler/teams/company/company.js +0 -256
- package/scheduler/teams/company/holiday.d.ts +0 -55
- package/scheduler/teams/company/holiday.js +0 -108
- package/scheduler/teams/company/index.d.ts +0 -3
- package/scheduler/teams/company/index.js +0 -19
- package/scheduler/teams/company/modperiod.d.ts +0 -21
- package/scheduler/teams/company/modperiod.js +0 -24
- package/scheduler/teams/contact.d.ts +0 -18
- package/scheduler/teams/contact.js +0 -23
- package/scheduler/teams/index.d.ts +0 -3
- package/scheduler/teams/index.js +0 -19
- package/scheduler/teams/specialty.d.ts +0 -18
- package/scheduler/teams/specialty.js +0 -23
- package/scheduler/teams/team.d.ts +0 -95
- package/scheduler/teams/team.js +0 -351
- package/users/index.d.ts +0 -2
- package/users/index.js +0 -18
- package/users/user.d.ts +0 -130
- package/users/user.js +0 -254
- package/users/web.d.ts +0 -22
- package/users/web.js +0 -2
@@ -1,133 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.WorkRecord = exports.Work = void 0;
|
4
|
-
/**
|
5
|
-
* This class description for a work object. The data members are:
|
6
|
-
* date worked (date object for the date the work record),
|
7
|
-
* charge number (string value for the labor code's charge number),
|
8
|
-
* extension (string value for the labor code's extension),
|
9
|
-
* paycode (numeric value for the pay code used by the company),
|
10
|
-
* modtime (boolean value to indicate if the recorded information is for modified time),
|
11
|
-
* hours (numeric value for the number of hours worked for the labor code)
|
12
|
-
*/
|
13
|
-
class Work {
|
14
|
-
dateworked;
|
15
|
-
chargenumber;
|
16
|
-
extension;
|
17
|
-
paycode;
|
18
|
-
modtime;
|
19
|
-
hours;
|
20
|
-
constructor(wk) {
|
21
|
-
this.dateworked = (wk) ? new Date(wk.dateworked) : new Date(0);
|
22
|
-
this.chargenumber = (wk) ? wk.chargenumber : '';
|
23
|
-
this.extension = (wk) ? wk.extension : '';
|
24
|
-
this.paycode = (wk) ? wk.paycode : 1;
|
25
|
-
this.modtime = (wk && wk.modtime) ? wk.modtime : false;
|
26
|
-
this.hours = (wk) ? wk.hours : 0.0;
|
27
|
-
}
|
28
|
-
/**
|
29
|
-
* This function is used in sorting work objects. Based on date worked and the labor
|
30
|
-
* code.
|
31
|
-
* @param other The work object to use in comparison
|
32
|
-
* @returns A numeric value to indicate whether this object is before or after the other
|
33
|
-
* object. -1 is before or 1 for after.
|
34
|
-
*/
|
35
|
-
compareTo(other) {
|
36
|
-
if (other) {
|
37
|
-
if (this.dateworked.getTime() === other.dateworked.getTime()) {
|
38
|
-
if (this.chargenumber === other.chargenumber) {
|
39
|
-
return this.extension < other.extension ? -1 : 1;
|
40
|
-
}
|
41
|
-
return this.chargenumber < other.chargenumber ? -1 : 1;
|
42
|
-
}
|
43
|
-
return this.dateworked.getTime() < other.dateworked.getTime() ? -1 : 1;
|
44
|
-
}
|
45
|
-
return -1;
|
46
|
-
}
|
47
|
-
/**
|
48
|
-
* This function is used to compare this object's date worked with a date provided.
|
49
|
-
* @param date A date object used for comparison.
|
50
|
-
* @returns A boolean value to indicate whether the work object is on the date provided.
|
51
|
-
*/
|
52
|
-
useWork(date) {
|
53
|
-
return this.dateworked.getUTCFullYear() === date.getUTCFullYear()
|
54
|
-
&& this.dateworked.getUTCMonth() === date.getUTCMonth()
|
55
|
-
&& this.dateworked.getUTCDate() === date.getUTCDate();
|
56
|
-
}
|
57
|
-
}
|
58
|
-
exports.Work = Work;
|
59
|
-
/**
|
60
|
-
* This class description for the employee's yearly work record. The data members are:
|
61
|
-
* id (string value representing the database's _id value - primary key)
|
62
|
-
* empID (string value for the associated employee's identifier)
|
63
|
-
* year (numeric value for the year associated with the work records)
|
64
|
-
* work (an array of work objects containing all the actual work performed)
|
65
|
-
*/
|
66
|
-
class WorkRecord {
|
67
|
-
id;
|
68
|
-
empID;
|
69
|
-
year;
|
70
|
-
work;
|
71
|
-
constructor(wr) {
|
72
|
-
this.id = (wr && wr.id) ? wr.id : '';
|
73
|
-
if (this.id === '') {
|
74
|
-
this.id = (wr && wr._id) ? wr._id.toString() : '';
|
75
|
-
}
|
76
|
-
this.empID = (wr && wr.empID) ? wr.empID : '';
|
77
|
-
if (this.empID === '') {
|
78
|
-
this.empID = (wr && wr.employeeID) ? wr.employeeID.toString() : '';
|
79
|
-
}
|
80
|
-
this.year = (wr) ? wr.year : (new Date()).getFullYear();
|
81
|
-
this.work = [];
|
82
|
-
if (wr && wr.work && wr.work.length > 0) {
|
83
|
-
wr.work.forEach(wk => {
|
84
|
-
this.work.push(new Work(wk));
|
85
|
-
});
|
86
|
-
this.work.sort((a, b) => a.compareTo(b));
|
87
|
-
}
|
88
|
-
}
|
89
|
-
/**
|
90
|
-
* This function is used in sorting these annual work records. Based on employee
|
91
|
-
* identifier and year.
|
92
|
-
* @param other The annual work record used for comparison.
|
93
|
-
* @returns A numeric value to indicate whether this object is before or after the other
|
94
|
-
* object. -1 is before or 1 for after.
|
95
|
-
*/
|
96
|
-
compareTo(other) {
|
97
|
-
if (other) {
|
98
|
-
if (this.empID === other.empID) {
|
99
|
-
return (this.year < other.year) ? -1 : 1;
|
100
|
-
}
|
101
|
-
return (this.empID < other.empID) ? -1 : 1;
|
102
|
-
}
|
103
|
-
return -1;
|
104
|
-
}
|
105
|
-
/**
|
106
|
-
* This function will remove work objects from this object's work array based on the
|
107
|
-
* period defined by the start and end dates.
|
108
|
-
* @param start The date object for the start of the removal period
|
109
|
-
* @param end The date object for the end of the removal period
|
110
|
-
*/
|
111
|
-
removeWork(start, end) {
|
112
|
-
for (let w = this.work.length - 1; w >= 0; w--) {
|
113
|
-
if (this.work[w].dateworked.getTime() >= start.getTime()
|
114
|
-
&& this.work[w].dateworked.getTime() <= end.getTime()) {
|
115
|
-
this.work.splice(w, 1);
|
116
|
-
}
|
117
|
-
}
|
118
|
-
}
|
119
|
-
/**
|
120
|
-
* This function will remove work objects from this object's work array
|
121
|
-
* @param purgeDate The date object to remove all data before it.
|
122
|
-
* @returns A boolean value to indicate whether or not the work array is empty.
|
123
|
-
*/
|
124
|
-
purge(purgeDate) {
|
125
|
-
for (let w = this.work.length - 1; w >= 0; w--) {
|
126
|
-
if (this.work[w].dateworked.getTime() < purgeDate.getTime()) {
|
127
|
-
this.work.splice(w, 1);
|
128
|
-
}
|
129
|
-
}
|
130
|
-
return this.work.length === 0;
|
131
|
-
}
|
132
|
-
}
|
133
|
-
exports.WorkRecord = WorkRecord;
|
@@ -1,91 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Workday interface and class descriptions
|
3
|
-
*/
|
4
|
-
/**
|
5
|
-
* This interface describes the data members to describe a workday object.
|
6
|
-
*/
|
7
|
-
export interface IWorkday {
|
8
|
-
id: number;
|
9
|
-
workcenter: string;
|
10
|
-
code: string;
|
11
|
-
hours: number;
|
12
|
-
}
|
13
|
-
/**
|
14
|
-
* This class provide the data members and the action a workday can complete. It will be
|
15
|
-
* used a children of a schedule class object in an assignment or variation.
|
16
|
-
*/
|
17
|
-
export declare class Workday implements IWorkday {
|
18
|
-
id: number;
|
19
|
-
workcenter: string;
|
20
|
-
code: string;
|
21
|
-
hours: number;
|
22
|
-
constructor(wd?: IWorkday);
|
23
|
-
/**
|
24
|
-
* This function is used to sort two workday objects based on the workday's identifier.
|
25
|
-
* @param other The workday object used for the comparison
|
26
|
-
* @returns A number value to signify this object is before or after the other. -1
|
27
|
-
* represents before and 1 for after.
|
28
|
-
*/
|
29
|
-
compareTo(other?: Workday): number;
|
30
|
-
}
|
31
|
-
/**
|
32
|
-
* The schedule class and interface is for holding workdays within an assignment
|
33
|
-
* and variation.
|
34
|
-
*/
|
35
|
-
/**
|
36
|
-
* This interface describes the data members to describe a schedule object.
|
37
|
-
*/
|
38
|
-
export interface ISchedule {
|
39
|
-
id: number;
|
40
|
-
workdays: IWorkday[];
|
41
|
-
showdates?: boolean;
|
42
|
-
}
|
43
|
-
/**
|
44
|
-
* This class provide the data members and the action a schedule can complete. It will be
|
45
|
-
* used a children of an assignment or variation.
|
46
|
-
*/
|
47
|
-
export declare class Schedule implements ISchedule {
|
48
|
-
id: number;
|
49
|
-
workdays: Workday[];
|
50
|
-
showdates: boolean;
|
51
|
-
constructor(sch?: ISchedule);
|
52
|
-
/**
|
53
|
-
* This function will be used to sort multiple schedules based on the schedules' id.
|
54
|
-
* @param other A schedule object used for comparison
|
55
|
-
* @returns A numeric value to indicate whether the schedule is before or after the
|
56
|
-
* other schedule in a list. -1 for before and 1 for after.
|
57
|
-
*/
|
58
|
-
compareTo(other?: Schedule): number;
|
59
|
-
/**
|
60
|
-
* This function will retrieve a workday from the list based on the identifier provided.
|
61
|
-
* @param id A numeric value for the identifier
|
62
|
-
* @returns A workday object representing the requested workday.
|
63
|
-
*/
|
64
|
-
getWorkday(id: number): Workday;
|
65
|
-
/**
|
66
|
-
* This function allows the caller to update a schedule's workday with the values
|
67
|
-
* provided.
|
68
|
-
* @param id A numeric value to identify which workday to update.
|
69
|
-
* @param wkctr A string value representing the workcenter.
|
70
|
-
* @param code A string value representing the work code (shift) to assign.
|
71
|
-
* @param hours A numeric value (float) for the number of hours to work.
|
72
|
-
*/
|
73
|
-
changeWorkday(id: number, wkctr: string, code: string, hours: number): void;
|
74
|
-
/**
|
75
|
-
* This function will update a field on a particular workday, based on the field and
|
76
|
-
* value.
|
77
|
-
* @param id The numeric value to identify which workday object to change.
|
78
|
-
* @param field The string value used to identify which data member to update.
|
79
|
-
* @param value The string value representing the new value, either string or numeric
|
80
|
-
* value given as a string.
|
81
|
-
*/
|
82
|
-
updateWorkday(id: number, field: string, value: string): void;
|
83
|
-
/**
|
84
|
-
* This function will either add or subtract workdays from the list to ensure
|
85
|
-
* that there was a certain number of days in the schedule. All schedules must
|
86
|
-
* contain a multiple of 7 workdays.
|
87
|
-
* @param days A numeric value, greater than zero (0) and a multiple of 7.
|
88
|
-
* @throws An error indicating the provided parameter is zero or not a multiple of 7.
|
89
|
-
*/
|
90
|
-
setScheduleDays(days: number): void;
|
91
|
-
}
|
@@ -1,170 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
/**
|
3
|
-
* Workday interface and class descriptions
|
4
|
-
*/
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.Schedule = exports.Workday = void 0;
|
7
|
-
/**
|
8
|
-
* This class provide the data members and the action a workday can complete. It will be
|
9
|
-
* used a children of a schedule class object in an assignment or variation.
|
10
|
-
*/
|
11
|
-
class Workday {
|
12
|
-
id;
|
13
|
-
workcenter;
|
14
|
-
code;
|
15
|
-
hours;
|
16
|
-
constructor(wd) {
|
17
|
-
this.id = (wd) ? wd.id : 0;
|
18
|
-
this.workcenter = (wd) ? wd.workcenter : '';
|
19
|
-
this.code = (wd) ? wd.code : '';
|
20
|
-
this.hours = (wd) ? wd.hours : 0;
|
21
|
-
}
|
22
|
-
/**
|
23
|
-
* This function is used to sort two workday objects based on the workday's identifier.
|
24
|
-
* @param other The workday object used for the comparison
|
25
|
-
* @returns A number value to signify this object is before or after the other. -1
|
26
|
-
* represents before and 1 for after.
|
27
|
-
*/
|
28
|
-
compareTo(other) {
|
29
|
-
if (other) {
|
30
|
-
return (this.id < other.id) ? -1 : 1;
|
31
|
-
}
|
32
|
-
return 0;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
exports.Workday = Workday;
|
36
|
-
/**
|
37
|
-
* This class provide the data members and the action a schedule can complete. It will be
|
38
|
-
* used a children of an assignment or variation.
|
39
|
-
*/
|
40
|
-
class Schedule {
|
41
|
-
id;
|
42
|
-
workdays;
|
43
|
-
showdates;
|
44
|
-
constructor(sch) {
|
45
|
-
this.id = (sch) ? sch.id : 0;
|
46
|
-
this.workdays = [];
|
47
|
-
if (sch && sch.workdays.length > 0) {
|
48
|
-
sch.workdays.forEach(wd => {
|
49
|
-
this.workdays.push(new Workday(wd));
|
50
|
-
});
|
51
|
-
this.workdays.sort((a, b) => a.compareTo(b));
|
52
|
-
}
|
53
|
-
this.showdates = (sch && sch.showdates) ? sch.showdates : false;
|
54
|
-
}
|
55
|
-
/**
|
56
|
-
* This function will be used to sort multiple schedules based on the schedules' id.
|
57
|
-
* @param other A schedule object used for comparison
|
58
|
-
* @returns A numeric value to indicate whether the schedule is before or after the
|
59
|
-
* other schedule in a list. -1 for before and 1 for after.
|
60
|
-
*/
|
61
|
-
compareTo(other) {
|
62
|
-
if (other) {
|
63
|
-
return (this.id < other.id) ? -1 : 1;
|
64
|
-
}
|
65
|
-
return -1;
|
66
|
-
}
|
67
|
-
/**
|
68
|
-
* This function will retrieve a workday from the list based on the identifier provided.
|
69
|
-
* @param id A numeric value for the identifier
|
70
|
-
* @returns A workday object representing the requested workday.
|
71
|
-
*/
|
72
|
-
getWorkday(id) {
|
73
|
-
let result = new Workday();
|
74
|
-
this.workdays.forEach(wd => {
|
75
|
-
if (wd.id === id) {
|
76
|
-
result = new Workday(wd);
|
77
|
-
}
|
78
|
-
});
|
79
|
-
return result;
|
80
|
-
}
|
81
|
-
/**
|
82
|
-
* This function allows the caller to update a schedule's workday with the values
|
83
|
-
* provided.
|
84
|
-
* @param id A numeric value to identify which workday to update.
|
85
|
-
* @param wkctr A string value representing the workcenter.
|
86
|
-
* @param code A string value representing the work code (shift) to assign.
|
87
|
-
* @param hours A numeric value (float) for the number of hours to work.
|
88
|
-
*/
|
89
|
-
changeWorkday(id, wkctr, code, hours) {
|
90
|
-
let found = false;
|
91
|
-
for (let w = 0; w < this.workdays.length && !found; w++) {
|
92
|
-
const wd = this.workdays[w];
|
93
|
-
if (wd.id === id) {
|
94
|
-
found = true;
|
95
|
-
wd.hours = hours;
|
96
|
-
wd.code = code;
|
97
|
-
wd.workcenter = wkctr;
|
98
|
-
this.workdays[w] = wd;
|
99
|
-
}
|
100
|
-
}
|
101
|
-
if (!found) {
|
102
|
-
const wd = new Workday({
|
103
|
-
id: id,
|
104
|
-
workcenter: wkctr,
|
105
|
-
code: code,
|
106
|
-
hours: hours
|
107
|
-
});
|
108
|
-
this.workdays.push(wd);
|
109
|
-
this.workdays.sort((a, b) => a.compareTo(b));
|
110
|
-
}
|
111
|
-
}
|
112
|
-
/**
|
113
|
-
* This function will update a field on a particular workday, based on the field and
|
114
|
-
* value.
|
115
|
-
* @param id The numeric value to identify which workday object to change.
|
116
|
-
* @param field The string value used to identify which data member to update.
|
117
|
-
* @param value The string value representing the new value, either string or numeric
|
118
|
-
* value given as a string.
|
119
|
-
*/
|
120
|
-
updateWorkday(id, field, value) {
|
121
|
-
let found = false;
|
122
|
-
for (let w = 0; w < this.workdays.length && !found; w++) {
|
123
|
-
const wd = this.workdays[w];
|
124
|
-
if (wd.id === id) {
|
125
|
-
found = true;
|
126
|
-
switch (field.toLowerCase()) {
|
127
|
-
case "workcenter":
|
128
|
-
wd.workcenter = value;
|
129
|
-
break;
|
130
|
-
case "code":
|
131
|
-
wd.code = value;
|
132
|
-
break;
|
133
|
-
case 'hours':
|
134
|
-
wd.hours = Number(value);
|
135
|
-
break;
|
136
|
-
}
|
137
|
-
this.workdays[w] = wd;
|
138
|
-
}
|
139
|
-
}
|
140
|
-
}
|
141
|
-
/**
|
142
|
-
* This function will either add or subtract workdays from the list to ensure
|
143
|
-
* that there was a certain number of days in the schedule. All schedules must
|
144
|
-
* contain a multiple of 7 workdays.
|
145
|
-
* @param days A numeric value, greater than zero (0) and a multiple of 7.
|
146
|
-
* @throws An error indicating the provided parameter is zero or not a multiple of 7.
|
147
|
-
*/
|
148
|
-
setScheduleDays(days) {
|
149
|
-
if (days <= 0 || days % 7 !== 0) {
|
150
|
-
throw new Error('New days value must be greater than zero and a multiple of seven');
|
151
|
-
}
|
152
|
-
this.workdays.sort((a, b) => a.compareTo(b));
|
153
|
-
if (days > this.workdays.length) {
|
154
|
-
for (let w = this.workdays.length; w < days; w++) {
|
155
|
-
const wd = new Workday();
|
156
|
-
wd.id = w;
|
157
|
-
this.workdays.push(wd);
|
158
|
-
}
|
159
|
-
}
|
160
|
-
else if (days < this.workdays.length) {
|
161
|
-
while (this.workdays.length > days) {
|
162
|
-
this.workdays.pop();
|
163
|
-
}
|
164
|
-
}
|
165
|
-
for (let w = 0; w < this.workdays.length; w++) {
|
166
|
-
this.workdays[w].id = w;
|
167
|
-
}
|
168
|
-
}
|
169
|
-
}
|
170
|
-
exports.Schedule = Schedule;
|
package/scheduler/labor/index.js
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./workcode"), exports);
|
18
|
-
__exportStar(require("./laborcode"), exports);
|
@@ -1,33 +0,0 @@
|
|
1
|
-
export interface ILaborCode {
|
2
|
-
chargeNumber: string;
|
3
|
-
extension: string;
|
4
|
-
clin?: string;
|
5
|
-
slin?: string;
|
6
|
-
location?: string;
|
7
|
-
wbs?: string;
|
8
|
-
minimumEmployees?: number;
|
9
|
-
notAssignedName?: string;
|
10
|
-
hoursPerEmployee?: number;
|
11
|
-
exercise?: boolean;
|
12
|
-
startDate?: Date;
|
13
|
-
endDate?: Date;
|
14
|
-
sort?: number;
|
15
|
-
}
|
16
|
-
export declare class LaborCode implements ILaborCode {
|
17
|
-
chargeNumber: string;
|
18
|
-
extension: string;
|
19
|
-
clin?: string;
|
20
|
-
slin?: string;
|
21
|
-
location?: string;
|
22
|
-
wbs?: string;
|
23
|
-
minimumEmployees?: number;
|
24
|
-
notAssignedName?: string;
|
25
|
-
hoursPerEmployee?: number;
|
26
|
-
exercise?: boolean;
|
27
|
-
startDate?: Date;
|
28
|
-
endDate?: Date;
|
29
|
-
sort: number;
|
30
|
-
constructor(lc?: ILaborCode);
|
31
|
-
compareTo(other?: LaborCode): 1 | -1;
|
32
|
-
inTimePeriod(start: Date, end: Date): boolean;
|
33
|
-
}
|
@@ -1,55 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.LaborCode = void 0;
|
4
|
-
class LaborCode {
|
5
|
-
chargeNumber;
|
6
|
-
extension;
|
7
|
-
clin;
|
8
|
-
slin;
|
9
|
-
location;
|
10
|
-
wbs;
|
11
|
-
minimumEmployees;
|
12
|
-
notAssignedName;
|
13
|
-
hoursPerEmployee;
|
14
|
-
exercise;
|
15
|
-
startDate;
|
16
|
-
endDate;
|
17
|
-
sort;
|
18
|
-
constructor(lc) {
|
19
|
-
this.chargeNumber = (lc) ? lc.chargeNumber : '';
|
20
|
-
this.extension = (lc) ? lc.extension : '';
|
21
|
-
this.clin = (lc && lc.clin) ? lc.clin : undefined;
|
22
|
-
this.slin = (lc && lc.slin) ? lc.slin : undefined;
|
23
|
-
this.location = (lc && lc.location) ? lc.location : undefined;
|
24
|
-
this.wbs = (lc && lc.wbs) ? lc.wbs : undefined;
|
25
|
-
this.minimumEmployees = (lc && lc.minimumEmployees) ? lc.minimumEmployees : undefined;
|
26
|
-
this.notAssignedName = (lc && lc.notAssignedName) ? lc.notAssignedName : undefined;
|
27
|
-
this.hoursPerEmployee = (lc && lc.hoursPerEmployee) ? lc.hoursPerEmployee : undefined;
|
28
|
-
this.exercise = (lc && lc.exercise) ? lc.exercise : undefined;
|
29
|
-
this.startDate = (lc && lc.startDate) ? lc.startDate : undefined;
|
30
|
-
this.endDate = (lc && lc.endDate) ? lc.endDate : undefined;
|
31
|
-
this.sort = (lc && lc.sort) ? lc.sort : 0;
|
32
|
-
}
|
33
|
-
compareTo(other) {
|
34
|
-
if (other) {
|
35
|
-
if (this.sort === other.sort) {
|
36
|
-
if (this.chargeNumber.toLowerCase() === other.chargeNumber.toLowerCase()) {
|
37
|
-
return (this.extension.toLowerCase() < other.extension.toLowerCase()) ? -1 : 1;
|
38
|
-
}
|
39
|
-
return (this.chargeNumber.toLowerCase() < other.chargeNumber.toLowerCase()) ? -1 : 1;
|
40
|
-
}
|
41
|
-
return (this.sort < other.sort) ? -1 : 1;
|
42
|
-
}
|
43
|
-
return -1;
|
44
|
-
}
|
45
|
-
inTimePeriod(start, end) {
|
46
|
-
if (this.startDate && this.endDate) {
|
47
|
-
return ((start.getTime() >= this.startDate.getTime()
|
48
|
-
&& start.getTime() <= this.endDate.getTime())
|
49
|
-
|| (end.getTime() >= this.startDate.getTime()
|
50
|
-
&& end.getTime() <= this.endDate.getTime()));
|
51
|
-
}
|
52
|
-
return true;
|
53
|
-
}
|
54
|
-
}
|
55
|
-
exports.LaborCode = LaborCode;
|
@@ -1,28 +0,0 @@
|
|
1
|
-
export interface IWorkcode {
|
2
|
-
id: string;
|
3
|
-
title: string;
|
4
|
-
start: number;
|
5
|
-
shiftCode: string;
|
6
|
-
altcode?: string;
|
7
|
-
search?: string;
|
8
|
-
isLeave: boolean;
|
9
|
-
textcolor: string;
|
10
|
-
backcolor: string;
|
11
|
-
}
|
12
|
-
export declare class Workcode implements IWorkcode {
|
13
|
-
id: string;
|
14
|
-
title: string;
|
15
|
-
start: number;
|
16
|
-
shiftCode: string;
|
17
|
-
altcode?: string;
|
18
|
-
search?: string;
|
19
|
-
isLeave: boolean;
|
20
|
-
textcolor: string;
|
21
|
-
backcolor: string;
|
22
|
-
constructor(wc?: IWorkcode);
|
23
|
-
compareTo(other?: Workcode): number;
|
24
|
-
}
|
25
|
-
export interface CompareWorkCode {
|
26
|
-
code: string;
|
27
|
-
isLeave: boolean;
|
28
|
-
}
|
@@ -1,35 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Workcode = void 0;
|
4
|
-
class Workcode {
|
5
|
-
id;
|
6
|
-
title;
|
7
|
-
start;
|
8
|
-
shiftCode;
|
9
|
-
altcode;
|
10
|
-
search;
|
11
|
-
isLeave;
|
12
|
-
textcolor;
|
13
|
-
backcolor;
|
14
|
-
constructor(wc) {
|
15
|
-
this.id = (wc) ? wc.id : '';
|
16
|
-
this.title = (wc) ? wc.title : '';
|
17
|
-
this.start = (wc) ? wc.start : 7;
|
18
|
-
this.shiftCode = (wc) ? wc.shiftCode : '';
|
19
|
-
this.altcode = (wc && wc.altcode) ? wc.altcode : undefined;
|
20
|
-
this.search = (wc && wc.search) ? wc.search : undefined;
|
21
|
-
this.isLeave = (wc) ? wc.isLeave : false;
|
22
|
-
this.textcolor = (wc) ? wc.textcolor : '000000';
|
23
|
-
this.backcolor = (wc) ? wc.backcolor : 'ffffff';
|
24
|
-
}
|
25
|
-
compareTo(other) {
|
26
|
-
if (other) {
|
27
|
-
if (this.isLeave === other.isLeave) {
|
28
|
-
return (this.id < other.id) ? -1 : 1;
|
29
|
-
}
|
30
|
-
return (this.isLeave && !other.isLeave) ? -1 : 1;
|
31
|
-
}
|
32
|
-
return -1;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
exports.Workcode = Workcode;
|
@@ -1,66 +0,0 @@
|
|
1
|
-
import { Workbook, Worksheet } from "exceljs";
|
2
|
-
import { Report } from "../../general";
|
3
|
-
import { ISite } from "../sites";
|
4
|
-
import { CompareWorkCode, IWorkcode, LaborCode } from "../labor";
|
5
|
-
import { Employee, IEmployee } from "../employees";
|
6
|
-
import { User } from "../../users";
|
7
|
-
import { Forecast } from "../sites/reports";
|
8
|
-
export declare class ChargeStatusReport extends Report {
|
9
|
-
private site;
|
10
|
-
private workcodes;
|
11
|
-
private lastWorked;
|
12
|
-
private fonts;
|
13
|
-
private fills;
|
14
|
-
private borders;
|
15
|
-
private alignments;
|
16
|
-
private numformats;
|
17
|
-
constructor(isite: ISite, workcodes: IWorkcode[]);
|
18
|
-
create(user: User, iEmps: IEmployee[], companyID: string, reqDate: Date): Workbook;
|
19
|
-
/**
|
20
|
-
* This function will create the basic style information to be used within the sheet
|
21
|
-
* cells, which consists for font styles, cell fill styles, borders, and alignments for
|
22
|
-
* the text within the cell. Plus a late addition of the various number formats to
|
23
|
-
* present.
|
24
|
-
*/
|
25
|
-
createStyles(): void;
|
26
|
-
/**
|
27
|
-
* This function will create the various pages of the workbook which hold the actual
|
28
|
-
* data for the workbook. They will consist of a header section, then list the
|
29
|
-
* employee's work/forecast work hours by labor code. lastly, if the stats worksheet
|
30
|
-
* is provided, it will add the statistics formulas to the rows of data on this sheet,
|
31
|
-
* by report type (current or forecast);
|
32
|
-
* @param workbook A reference to the workbook object so worksheet creation is possible
|
33
|
-
* @param type A string value to indicate if the report is for current or forecast data
|
34
|
-
* @param report The forecast object used to define the period and labor codes for use
|
35
|
-
* @param employees The list of site employees used for the report.
|
36
|
-
* @param stats A reference to the statistics worksheet to allow this to add the
|
37
|
-
* correct formulas to it.
|
38
|
-
* @param statsRow The numeric value for the last row used in the statistics worksheet.
|
39
|
-
* @return The numeric value for the last row used in the statistics worksheet.
|
40
|
-
*/
|
41
|
-
addReport(workbook: Workbook, type: string, report: Forecast, employees: Employee[], stats?: Worksheet, statsRow?: number): number | undefined;
|
42
|
-
/**
|
43
|
-
* This function focuses on an employee, who has hours in the labor code provided. This
|
44
|
-
* will create a row of data on the worksheet for this employee's work in this
|
45
|
-
* category
|
46
|
-
* @param sheet The reference to the worksheet to add a row of data to.
|
47
|
-
* @param lCode The labor code object, which allows the work to focus on a single code.
|
48
|
-
* @param row The numeric value for the worksheet row to use in filling in the data
|
49
|
-
* @param emp The employee object to pull the work data.
|
50
|
-
* @param report The forecast report object which provides the periods and other data
|
51
|
-
* used in constructing the employee's row.
|
52
|
-
* @param current The boolean value which signifies whether only actual work performed
|
53
|
-
* or add in forecast work hours in this report sheet.
|
54
|
-
* @param compare A short workcode array, used to determine leaves and other non-work
|
55
|
-
* periods.
|
56
|
-
*/
|
57
|
-
employeeRow(sheet: Worksheet, lCode: LaborCode, row: number, emp: Employee, report: Forecast, current: boolean, compare: CompareWorkCode[]): number;
|
58
|
-
/**
|
59
|
-
* This function will create the statistics page for the cover of the workbook, which
|
60
|
-
* will hold all the formulas for overall labor usage.
|
61
|
-
* @param workbook The excel workbook object use for creating worksheets within it.
|
62
|
-
* @returns The reference to the statistics worksheet to allow other functions to fill
|
63
|
-
* in the formulas to use.
|
64
|
-
*/
|
65
|
-
createStatisticsSheet(workbook: Workbook): Worksheet;
|
66
|
-
}
|