scheduler-node-models 1.0.100 → 1.0.101

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.100",
3
+ "version": "1.0.101",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "files": [
@@ -730,9 +730,6 @@ class Employee {
730
730
  end = new Date(Date.UTC(end.getFullYear(), end.getMonth(), end.getDate()));
731
731
  // Check for assignment during period
732
732
  let found = false;
733
- if (this.name.lastname.toLowerCase() === 'erne') {
734
- console.log(`${start} - ${end} - ${JSON.stringify(labor)}`);
735
- }
736
733
  this.assignments.forEach(asgmt => {
737
734
  if (asgmt.useAssignment(start, end, labor)) {
738
735
  found = true;
@@ -741,18 +738,12 @@ class Employee {
741
738
  if (!found) {
742
739
  return 0.0;
743
740
  }
744
- if (this.name.lastname.toLowerCase() === 'erne') {
745
- console.log('use assignment');
746
- }
747
741
  // check if labor code is applicable during period
748
742
  if (!labor.startDate || !labor.endDate
749
743
  || labor.endDate.getTime() < start.getTime()
750
744
  || labor.startDate.getTime() > end.getTime()) {
751
745
  return 0.0;
752
746
  }
753
- if (this.name.lastname.toLowerCase() === 'erne') {
754
- console.log('labor code');
755
- }
756
747
  // determine last worked day from work records
757
748
  let lastWorked = new Date(0);
758
749
  if (this.work && this.work.length > 0) {
@@ -766,9 +757,6 @@ class Employee {
766
757
  lastWorked = new Date(lv.leavedate);
767
758
  }
768
759
  });
769
- if (this.name.lastname.toLowerCase() === 'erne') {
770
- console.log('lastWorked');
771
- }
772
760
  // now step through the days of the period to:
773
761
  // 1) see if they had worked any charge numbers during
774
762
  // the period, if working add 0 hours
@@ -785,7 +773,6 @@ class Employee {
785
773
  if (current.getTime() >= labor.startDate.getTime()
786
774
  && current.getTime() <= labor.endDate.getTime()) {
787
775
  const wd = this.getWorkday(current);
788
- console.log(JSON.stringify(wd));
789
776
  if (wd && wd.code !== '') {
790
777
  codes.forEach(code => {
791
778
  if (code.id.toLowerCase() === wd.code.toLowerCase() && !code.isLeave) {
@@ -800,6 +787,7 @@ class Employee {
800
787
  }
801
788
  }
802
789
  }
790
+ current = new Date(current.getTime() + (24 * 3600000));
803
791
  }
804
792
  return answer;
805
793
  }