gunsmith-common 2.3.22 → 2.3.24

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.
@@ -1959,7 +1959,7 @@ class FinishDateHelperService {
1959
1959
  }
1960
1960
  return finishDate;
1961
1961
  }
1962
- calculateFinishDate(receivedDate, workOrderType) {
1962
+ calculateFinishDate(receivedDate, workOrderType, hasRefinish = false) {
1963
1963
  let finishDate = DateTime.fromJSDate(receivedDate).startOf("day");
1964
1964
  if (workOrderType === WorkOrderType.Warranty) {
1965
1965
  finishDate = finishDate.plus({ weeks: this.configs.warrantyWeeks });
@@ -1968,10 +1968,14 @@ class FinishDateHelperService {
1968
1968
  finishDate = finishDate.plus({ weeks: this.configs.expeditedWeeks });
1969
1969
  }
1970
1970
  else if (workOrderType === WorkOrderType.NewInBox) {
1971
- finishDate = finishDate.plus({ weeks: this.configs.newInBoxWeeks });
1971
+ finishDate = hasRefinish
1972
+ ? finishDate.plus({ weeks: this.configs.refinishWeeks })
1973
+ : finishDate.plus({ weeks: this.configs.newInBoxWeeks });
1972
1974
  }
1973
1975
  else {
1974
- finishDate = finishDate.plus({ weeks: this.configs.standardWeeks });
1976
+ finishDate = hasRefinish
1977
+ ? finishDate.plus({ weeks: this.configs.refinishWeeks })
1978
+ : finishDate.plus({ weeks: this.configs.standardWeeks });
1975
1979
  }
1976
1980
  return this.adjustHoliday(finishDate.toJSDate());
1977
1981
  }