scheduler-node-models 1.0.108 → 1.0.110
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
CHANGED
@@ -54,7 +54,7 @@ export declare class ChargeStatusReport extends Report {
|
|
54
54
|
* @param compare A map of workcode array, used to determine leaves and other non-work
|
55
55
|
* periods.
|
56
56
|
*/
|
57
|
-
employeeRow(sheet: Worksheet, lCode: LaborCode, row: number, emp: Employee, report: Forecast, current: boolean, compare: Map<string, Workcode
|
57
|
+
employeeRow(sheet: Worksheet, lCode: LaborCode, row: number, emp: Employee, report: Forecast, current: boolean, compare: Map<string, Workcode>, lastWorked: Date): number;
|
58
58
|
/**
|
59
59
|
* This function will create the statistics page for the cover of the workbook, which
|
60
60
|
* will hold all the formulas for overall labor usage.
|
@@ -288,16 +288,18 @@ class ChargeStatusReport extends general_1.Report {
|
|
288
288
|
report.laborCodes.forEach(lCode => {
|
289
289
|
// step through the employees to see if they have hours for this labor code
|
290
290
|
let lastWorked = new Date(0);
|
291
|
+
employees.forEach(emp => {
|
292
|
+
if (emp.getLastWorkday().getTime() > lastWorked.getTime()) {
|
293
|
+
lastWorked = new Date(emp.getLastWorkday());
|
294
|
+
}
|
295
|
+
});
|
291
296
|
employees.forEach(emp => {
|
292
297
|
// employee has used this labor code, if they have some actual or forecast hours.
|
293
298
|
const actual = emp.getWorkedHours(report.startDate, report.endDate, lCode.chargeNumber, lCode.extension);
|
294
299
|
const forecast = emp.getForecastHours(lCode, report.startDate, report.endDate, this.workcodes);
|
295
300
|
if (actual > 0 || forecast > 0) {
|
296
301
|
row++;
|
297
|
-
|
298
|
-
lastWorked = new Date(emp.getLastWorkday());
|
299
|
-
}
|
300
|
-
const col = this.employeeRow(sheet, lCode, row, emp, report, current, this.workcodes);
|
302
|
+
const col = this.employeeRow(sheet, lCode, row, emp, report, current, this.workcodes, lastWorked);
|
301
303
|
if (col > column) {
|
302
304
|
column = col;
|
303
305
|
}
|
@@ -432,8 +434,7 @@ class ChargeStatusReport extends general_1.Report {
|
|
432
434
|
* @param compare A map of workcode array, used to determine leaves and other non-work
|
433
435
|
* periods.
|
434
436
|
*/
|
435
|
-
employeeRow(sheet, lCode, row, emp, report, current, compare) {
|
436
|
-
const lastWorked = emp.getLastWorkday();
|
437
|
+
employeeRow(sheet, lCode, row, emp, report, current, compare, lastWorked) {
|
437
438
|
// create two style objects for filling in the employee's employment information as
|
438
439
|
// pertains to the object
|
439
440
|
let style = {
|
@@ -503,7 +504,7 @@ class ChargeStatusReport extends general_1.Report {
|
|
503
504
|
period.periods.forEach(prd => {
|
504
505
|
column++;
|
505
506
|
let last = new Date(prd);
|
506
|
-
let first = new Date(last.getTime() - (
|
507
|
+
let first = new Date(last.getTime() - (6 * 24 * 3600000));
|
507
508
|
if (first.getTime() < report.startDate.getTime()) {
|
508
509
|
first = new Date(Date.UTC(report.startDate.getFullYear(), report.startDate.getMonth(), report.startDate.getDate()));
|
509
510
|
}
|