From 773d13c1dd418d99684949090b2268d1dab07b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manu=20Mu=C3=B1oz?= Date: Mon, 29 Apr 2024 07:23:12 +0200 Subject: [PATCH] fix: [ANDROAPP-5883] periods when orgunit is closed (#3613) --- .../org/dhis2/utils/customviews/PeriodDialogInputPeriod.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/dhis2/utils/customviews/PeriodDialogInputPeriod.java b/app/src/main/java/org/dhis2/utils/customviews/PeriodDialogInputPeriod.java index 6dbe31968a..00749b359b 100644 --- a/app/src/main/java/org/dhis2/utils/customviews/PeriodDialogInputPeriod.java +++ b/app/src/main/java/org/dhis2/utils/customviews/PeriodDialogInputPeriod.java @@ -68,11 +68,11 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c if ((inputPeriodModel.openingDate() == null || (inputPeriodModel.openingDate() != null && (DateUtils.getInstance().getToday().after(inputPeriodModel.openingDate()))) || DateUtils.getInstance().getToday().equals(inputPeriodModel.openingDate())) && (inputPeriodModel.closingDate() == null || (inputPeriodModel.closingDate() != null && DateUtils.getInstance().getToday().before(inputPeriodModel.closingDate()))) && (organisationUnit == null || (organisationUnit.openingDate() == null || getCurrentDate().after(organisationUnit.openingDate())) && (organisationUnit.closedDate() == null || getCurrentDate().before(organisationUnit.closedDate()))) - ) + ) { if (getCurrentDate().before(inputPeriodModel.endPeriodDate())) { isAllowed = true; } - else if (getCurrentDate().before(inputPeriod.get(inputPeriod.size() - 1).initialPeriodDate()) || + } else if (getCurrentDate().before(inputPeriod.get(inputPeriod.size() - 1).initialPeriodDate()) || getCurrentDate().before(inputPeriodModel.initialPeriodDate())) break; else