diff --git a/views/print/pdf/ssm.cemetery.contract.ejs b/views/print/pdf/ssm.cemetery.contract.ejs index 7689487e..e0212e86 100644 --- a/views/print/pdf/ssm.cemetery.contract.ejs +++ b/views/print/pdf/ssm.cemetery.contract.ejs @@ -23,8 +23,7 @@ const recipient = recipientOccupants.length > 0 ? recipientOccupants[0] : undefined; - const deathDateOccupantTypeField = "Death Date"; - const deathPlaceOccupantTypeField = "Death Place"; + const recipientFields = ["Birth Date", "Birth Place"] %> @@ -167,13 +166,22 @@ E-mail: <%= recipient ? recipient.occupantEmailAddress : "" %>  - - Date of birth: -   - - Place of birth: -   + <% + for (const fieldName of recipientFields) { + %> + + <%= fieldName %>: + <% + const field = lotOccupancy.lotOccupancyFields.find((possibleField) => { + return possibleField.occupancyTypeField === fieldName; + }); + %> + <%= field?.lotOccupancyFieldValue ?? "" %>  + + <% + } + %> @@ -216,7 +224,7 @@ <% for (const field of lotOccupancy.lotOccupancyFields) { - if (field.lotOccupancyFieldValue) { + if (!recipientFields.includes(field.occupancyTypeField) && field.lotOccupancyFieldValue) { %> <%= field.occupancyTypeField %>