use a list of lot occupant types
parent
81855c83a7
commit
1753ff36e1
|
|
@ -1,10 +1,26 @@
|
||||||
<%
|
<%
|
||||||
const purchaserLotOccupantType = "Purchaser";
|
const purchaserLotOccupantTypes = ["Purchaser", "Preneed Owner"];
|
||||||
const purchaserOccupants = lotOccupancyFunctions.filterOccupantsByLotOccupantType(lotOccupancy, purchaserLotOccupantType);
|
|
||||||
|
let purchaserOccupants = [];
|
||||||
|
for (const purchaserLotOccupantType of purchaserLotOccupantTypes) {
|
||||||
|
purchaserOccupants = lotOccupancyFunctions.filterOccupantsByLotOccupantType(lotOccupancy, purchaserLotOccupantType);
|
||||||
|
if (purchaserOccupants.length > 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const purchaser = purchaserOccupants.length > 0 ? purchaserOccupants[0] : undefined;
|
const purchaser = purchaserOccupants.length > 0 ? purchaserOccupants[0] : undefined;
|
||||||
|
|
||||||
const recipientLotOccupantType = "Preneed Owner";
|
const recipientLotOccupantTypes = ["Deceased", "Preneed Owner"];
|
||||||
const recipientOccupants = lotOccupancyFunctions.filterOccupantsByLotOccupantType(lotOccupancy, recipientLotOccupantType);
|
|
||||||
|
let recipientOccupants = [];
|
||||||
|
for (const recipientLotOccupantType of recipientLotOccupantTypes) {
|
||||||
|
recipientOccupants = lotOccupancyFunctions.filterOccupantsByLotOccupantType(lotOccupancy, recipientLotOccupantType);
|
||||||
|
if (recipientOccupants.length > 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const recipient = recipientOccupants.length > 0 ? recipientOccupants[0] : undefined;
|
const recipient = recipientOccupants.length > 0 ? recipientOccupants[0] : undefined;
|
||||||
|
|
||||||
const deathDateOccupantTypeField = "Death Date";
|
const deathDateOccupantTypeField = "Death Date";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue