Skip to content

Commit

Permalink
fix: [DHIS2-15983] Enrollment date not assigned on form init (#3475)
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikhaugstulen authored Dec 5, 2023
1 parent a47e429 commit a13a766
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const openDataEntryForNewEnrollmentBatchAsync = async ({
const formId = getDataEntryKey(dataEntryId, itemId);
const addFormDataActions = addFormData(`${dataEntryId}-${itemId}`, formValues);
const firstStageDataEntryPropsToInclude = firstStage && getDataEntryPropsToInclude(firstStage.stageForm);
const defaultDataEntryValues = { enrolledAt: convertDateObjectToDateFormatString(new Date()) };
const dataEntryPropsToInclude = [
...enrollmentDataEntryPropsToInclude,
...extraDataEntryProps,
Expand All @@ -88,14 +89,15 @@ export const openDataEntryForNewEnrollmentBatchAsync = async ({
dataEntryId,
itemId,
dataEntryPropsToInclude,
{ enrolledAt: convertDateObjectToDateFormatString(new Date()) },
defaultDataEntryValues,
);

const effects = getApplicableRuleEffectsForTrackerProgram({
program,
orgUnit,
stage: firstStage,
attributeValues: clientValues,
enrollmentData: defaultDataEntryValues,
formFoundation,
});

Expand Down

0 comments on commit a13a766

Please sign in to comment.