scheduler-node-models 1.0.7 → 1.0.9
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/general/report.js
CHANGED
package/package.json
CHANGED
@@ -51,7 +51,7 @@ class ScheduleReport extends general_1.Report {
|
|
51
51
|
this.styles.set(wc.id, style);
|
52
52
|
}
|
53
53
|
});
|
54
|
-
|
54
|
+
let style = {
|
55
55
|
fill: { type: 'pattern', pattern: 'solid', fgColor: { argb: `ffc0c0c0` } },
|
56
56
|
font: { bold: true, size: 11, color: { argb: `ff000000` } },
|
57
57
|
alignment: { horizontal: 'center', vertical: 'middle', wrapText: true },
|
@@ -61,7 +61,8 @@ class ScheduleReport extends general_1.Report {
|
|
61
61
|
bottom: { style: 'thin', color: { argb: 'ff000000' } },
|
62
62
|
right: { style: 'thin', color: { argb: 'ff000000' } }
|
63
63
|
}
|
64
|
-
}
|
64
|
+
};
|
65
|
+
this.styles.set('evenday', style);
|
65
66
|
this.styles.set('oddday', {
|
66
67
|
fill: { type: 'pattern', pattern: 'solid', fgColor: { argb: `ffffffff` } },
|
67
68
|
font: { bold: true, size: 11, color: { argb: `ff000000` } },
|
@@ -201,7 +202,7 @@ class ScheduleReport extends general_1.Report {
|
|
201
202
|
let style = this.styles.get('month');
|
202
203
|
sheet.getRow(1).height = 20;
|
203
204
|
sheet.getRow(2).height = 20;
|
204
|
-
this.setCell(sheet, this.getCellID(
|
205
|
+
this.setCell(sheet, this.getCellID(0, 1), this.getCellID(0, 1), style, months[startDate.getMonth()]);
|
205
206
|
const formatter = new Intl.DateTimeFormat('en-US', {
|
206
207
|
month: '2-digit',
|
207
208
|
day: '2-digit',
|
@@ -215,11 +216,12 @@ class ScheduleReport extends general_1.Report {
|
|
215
216
|
styleID = 'evenend';
|
216
217
|
}
|
217
218
|
style = this.styles.get(styleID);
|
218
|
-
let cellID = this.getCellID(current.getDate()
|
219
|
+
let cellID = this.getCellID(current.getDate(), 1);
|
219
220
|
this.setCell(sheet, cellID, cellID, style, weekdays[current.getDay()]);
|
220
|
-
cellID = this.getCellID(current.getDate()
|
221
|
+
cellID = this.getCellID(current.getDate(), 2);
|
221
222
|
this.setCell(sheet, cellID, cellID, style, current.getDate());
|
222
223
|
current = new Date(current.getTime() + (24 * 3600000));
|
224
|
+
console.log(current);
|
223
225
|
}
|
224
226
|
// now add row for workcenter header, then the employees under that workcenter
|
225
227
|
let row = 2;
|
@@ -227,7 +229,7 @@ class ScheduleReport extends general_1.Report {
|
|
227
229
|
row++;
|
228
230
|
style = this.styles.get('wkctr');
|
229
231
|
sheet.getRow(row).height = 20.0;
|
230
|
-
this.setCell(sheet, this.getCellID(0, row), this.getCellID(endofMonth
|
232
|
+
this.setCell(sheet, this.getCellID(0, row), this.getCellID(endofMonth, row), style, wkctr.name);
|
231
233
|
// sort positions, then add a row for each employee for the positions.
|
232
234
|
if (wkctr.positions && wkctr.positions.length > 0) {
|
233
235
|
wkctr.positions.sort((a, b) => a.compareTo(b));
|
@@ -263,7 +265,7 @@ class ScheduleReport extends general_1.Report {
|
|
263
265
|
let style = this.styles.get(styleID);
|
264
266
|
sheet.getRow(row).height = 20;
|
265
267
|
const name = `${emp.name.lastname}, ${emp.name.firstname.substring(0, 1)}`;
|
266
|
-
this.setCell(sheet, this.getCellID(
|
268
|
+
this.setCell(sheet, this.getCellID(0, row), this.getCellID(0, row), style, name);
|
267
269
|
let current = new Date(start);
|
268
270
|
while (current.getTime() < end.getTime()) {
|
269
271
|
let stID = styleID;
|
@@ -281,7 +283,7 @@ class ScheduleReport extends general_1.Report {
|
|
281
283
|
}
|
282
284
|
}
|
283
285
|
style = this.styles.get(stID);
|
284
|
-
const cellID = this.getCellID(current.getDate()
|
286
|
+
const cellID = this.getCellID(current.getDate(), row);
|
285
287
|
this.setCell(sheet, cellID, cellID, style, code);
|
286
288
|
current = new Date(current.getTime() + (24 * 3600000));
|
287
289
|
}
|