Merge branch 'develop' of ssh://bitbucket.arbetsformedlingen.se:7999/tea/mina-sidor-fa-web into develop
This commit is contained in:
@@ -71,18 +71,18 @@ export class SlutredovisningFormComponent implements OnDestroy {
|
|||||||
this.shouldValidate$.next(true);
|
this.shouldValidate$.next(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _isAfterStartDate(startDate: Date): boolean {
|
private _isAfterEndDate(date: Date): boolean {
|
||||||
return new Date() > startDate;
|
return new Date() > date;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _isBeforeLastPossibleReportDay(endDate: Date): boolean {
|
private _isBeforeLastPossibleReportDay(date: Date): boolean {
|
||||||
const lastPossibleReportDay = addDays(endDate, 5); // Reporting is allowed at latest 5 days past avrop end date.
|
const lastPossibleReportDay = addDays(date, 60); // Reporting is allowed at latest 60 days past avrop end date.
|
||||||
return lastPossibleReportDay > new Date();
|
return lastPossibleReportDay > new Date();
|
||||||
}
|
}
|
||||||
|
|
||||||
isAllowedToReport(avrop: DeltagareAvrop): boolean {
|
isAllowedToReport(avrop: DeltagareAvrop): boolean {
|
||||||
return (
|
return (
|
||||||
this._isAfterStartDate(avrop.startDate) &&
|
this._isAfterEndDate(avrop.endDate) &&
|
||||||
this._isBeforeLastPossibleReportDay(avrop.endDate) &&
|
this._isBeforeLastPossibleReportDay(avrop.endDate) &&
|
||||||
avrop.hasGemensamPlanering
|
avrop.hasGemensamPlanering
|
||||||
);
|
);
|
||||||
@@ -90,10 +90,10 @@ export class SlutredovisningFormComponent implements OnDestroy {
|
|||||||
|
|
||||||
notAllowedToReportWarning(avrop: DeltagareAvrop): string {
|
notAllowedToReportWarning(avrop: DeltagareAvrop): string {
|
||||||
if (!this._isBeforeLastPossibleReportDay(avrop.endDate)) {
|
if (!this._isBeforeLastPossibleReportDay(avrop.endDate)) {
|
||||||
return 'Det går inte att göra en Slutredovisning eftersom tjänsten har avslutats.';
|
return 'Det går inte att göra en Slutredovisning eftersom ärendet är avslutat.';
|
||||||
}
|
}
|
||||||
if (!this._isAfterStartDate(avrop.startDate)) {
|
if (!this._isAfterEndDate(avrop.endDate)) {
|
||||||
return 'Det går inte att göra en Slutredovisning eftersom tjänsten inte har startat ännu.';
|
return 'Det går inte att göra en Slutredovisning eftersom tjänsten inte har avslutats ännu.';
|
||||||
}
|
}
|
||||||
if (!avrop.hasGemensamPlanering) {
|
if (!avrop.hasGemensamPlanering) {
|
||||||
return 'Det går inte att göra en Slutredovisning eftersom en Gemensam planering inte har skickats in ännu.';
|
return 'Det går inte att göra en Slutredovisning eftersom en Gemensam planering inte har skickats in ännu.';
|
||||||
|
|||||||
Reference in New Issue
Block a user