scheduler-node-models 1.0.113 → 1.0.115

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scheduler-node-models",
3
- "version": "1.0.113",
3
+ "version": "1.0.115",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "files": [
@@ -283,11 +283,11 @@ class ChargeStatusReport extends general_1.Report {
283
283
  // create list of leave and work codes for comparison to determine working or
284
284
  // not working criteria
285
285
  let row = 4;
286
+ let lastWorked = new Date(0);
286
287
  let column = 0;
287
288
  // this report is listed by labor code, then employees with hours
288
289
  report.laborCodes.forEach(lCode => {
289
290
  // step through the employees to see if they have hours for this labor code
290
- let lastWorked = new Date(0);
291
291
  employees.forEach(emp => {
292
292
  if (emp.getLastWorkday().getTime() > lastWorked.getTime()) {
293
293
  lastWorked = new Date(emp.getLastWorkday());
@@ -305,13 +305,16 @@ class ChargeStatusReport extends general_1.Report {
305
305
  }
306
306
  }
307
307
  });
308
- if (stats && statsRow) {
309
- // this is used to create the dates in the statistics labor rows
310
- const dFormat = new Intl.DateTimeFormat('en-US', {
311
- month: '2-digit',
312
- day: '2-digit',
313
- year: 'numeric'
314
- });
308
+ });
309
+ if (stats && statsRow) {
310
+ // this is used to create the dates in the statistics labor rows
311
+ const dFormat = new Intl.DateTimeFormat('en-US', {
312
+ month: '2-digit',
313
+ day: '2-digit',
314
+ year: 'numeric'
315
+ });
316
+ for (let l = 0; l < report.laborCodes.length; l++) {
317
+ const lCode = report.laborCodes[l];
315
318
  const codeText = `${lCode.chargeNumber} ${lCode.extension}`;
316
319
  // determine the period to date total hours that should have been used based
317
320
  // upon an even spread of hours throughout the period.
@@ -383,16 +386,16 @@ class ChargeStatusReport extends general_1.Report {
383
386
  // this branch will add only the forecast data formulas to the statistics. It
384
387
  // will first find the correct row based on the labor code, then determine the
385
388
  // fill style to use, then add the formula. Columns H to K
386
- let row = 0;
387
- for (let r = 3; r <= statsRow && row === 0; r++) {
389
+ let srow = 0;
390
+ for (let r = 3; r <= statsRow && srow === 0; r++) {
388
391
  const cell = stats.getCell(r, 1);
389
392
  if (cell.text.toLowerCase() === codeText.toLowerCase()) {
390
- row = r;
393
+ srow = r;
391
394
  }
392
395
  }
393
396
  // row greater than zero means the labor code was found and
394
- if (row > 0) {
395
- const bLight = (row % 2) === 0;
397
+ if (srow > 0) {
398
+ const bLight = (srow % 2) === 0;
396
399
  // forecast information next four columns, total hours, total forecasted
397
400
  // hours, +/- hours, percentage of hours to date.
398
401
  if (bLight) {
@@ -402,21 +405,21 @@ class ChargeStatusReport extends general_1.Report {
402
405
  style.fill = this.fills.get('ltgreen');
403
406
  }
404
407
  style.numFmt = this.numformats.get('sum');
405
- this.setCell(stats, this.getCellID(7, row), this.getCellID(7, row), style, totalHours);
408
+ this.setCell(stats, this.getCellID(7, srow), this.getCellID(7, srow), style, totalHours);
406
409
  let formula = `SUMIF(${sheetLabel}!${this.getCellID(5, 5)}:`
407
410
  + `${this.getCellID(5, row)}, "*${codeText}*", ${sheetLabel}!`
408
411
  + `${this.getCellID(column, 5)}:${this.getCellID(column, row)})`;
409
- this.setCell(stats, this.getCellID(8, row), this.getCellID(8, row), style, new general_1.Formula(formula));
412
+ this.setCell(stats, this.getCellID(8, srow), this.getCellID(8, srow), style, new general_1.Formula(formula));
410
413
  formula = `${this.getCellID(7, row)} - ${this.getCellID(8, row)}`;
411
- this.setCell(stats, this.getCellID(9, row), this.getCellID(9, row), style, new general_1.Formula(formula));
414
+ this.setCell(stats, this.getCellID(9, srow), this.getCellID(9, srow), style, new general_1.Formula(formula));
412
415
  style.numFmt = this.numformats.get('pct');
413
416
  const oformula = new general_1.Formula(`IFERROR(${this.getCellID(8, row)}/`
414
417
  + `${this.getCellID(7, row)},"N/A")`);
415
- this.setCell(stats, this.getCellID(10, row), this.getCellID(10, row), style, oformula);
418
+ this.setCell(stats, this.getCellID(10, srow), this.getCellID(10, srow), style, oformula);
416
419
  }
417
420
  }
418
421
  }
419
- });
422
+ }
420
423
  return statsRow;
421
424
  }
422
425
  /**