add preneed owner to deceased record

deepsource-autofix-76c6eb20
Dan Gowans 2022-11-22 15:54:58 -05:00
parent a06186ede0
commit 9c840b0e9e
2 changed files with 33 additions and 33 deletions

View File

@ -281,7 +281,7 @@ function importFromMasterCSV() {
} }
let preneedOccupancyStartDateString; let preneedOccupancyStartDateString;
let preneedLotOccupancyId; let preneedLotOccupancyId;
if (masterRow.CM_PRENEED_ORDER || masterRow.CM_STATUS === "P") { if (masterRow.CM_PRENEED_OWNER || masterRow.CM_STATUS === "P") {
preneedOccupancyStartDateString = formatDateString(masterRow.CM_PURCHASE_YR, masterRow.CM_PURCHASE_MON, masterRow.CM_PURCHASE_DAY); preneedOccupancyStartDateString = formatDateString(masterRow.CM_PURCHASE_YR, masterRow.CM_PURCHASE_MON, masterRow.CM_PURCHASE_DAY);
let occupancyEndDateString = ""; let occupancyEndDateString = "";
if (masterRow.CM_INTERMENT_YR !== "" && masterRow.CM_INTERMENT_YR !== "0") { if (masterRow.CM_INTERMENT_YR !== "" && masterRow.CM_INTERMENT_YR !== "0") {
@ -474,20 +474,20 @@ function importFromMasterCSV() {
}, user); }, user);
} }
updateLotStatus(lotId, takenLotStatus.lotStatusId, user); updateLotStatus(lotId, takenLotStatus.lotStatusId, user);
} if (masterRow.CM_PRENEED_OWNER) {
if (masterRow.CM_PRENEED_OWNER) { addLotOccupancyOccupant({
addLotOccupancyOccupant({ lotOccupancyId: deceasedLotOccupancyId,
lotOccupancyId: deceasedLotOccupancyId, lotOccupantTypeId: preneedOwnerLotOccupantType.lotOccupantTypeId,
lotOccupantTypeId: preneedOwnerLotOccupantType.lotOccupantTypeId, occupantName: masterRow.CM_PRENEED_OWNER,
occupantName: masterRow.CM_PRENEED_OWNER, occupantAddress1: "",
occupantAddress1: "", occupantAddress2: "",
occupantAddress2: "", occupantCity: "",
occupantCity: "", occupantProvince: "",
occupantProvince: "", occupantPostalCode: "",
occupantPostalCode: "", occupantPhoneNumber: "",
occupantPhoneNumber: "", occupantEmailAddress: ""
occupantEmailAddress: "" }, user);
}, user); }
} }
} }
} }

View File

@ -540,7 +540,7 @@ function importFromMasterCSV() {
let preneedOccupancyStartDateString: string; let preneedOccupancyStartDateString: string;
let preneedLotOccupancyId: number; let preneedLotOccupancyId: number;
if (masterRow.CM_PRENEED_ORDER || masterRow.CM_STATUS === "P") { if (masterRow.CM_PRENEED_OWNER || masterRow.CM_STATUS === "P") {
preneedOccupancyStartDateString = formatDateString( preneedOccupancyStartDateString = formatDateString(
masterRow.CM_PURCHASE_YR, masterRow.CM_PURCHASE_YR,
masterRow.CM_PURCHASE_MON, masterRow.CM_PURCHASE_MON,
@ -890,24 +890,24 @@ function importFromMasterCSV() {
} }
updateLotStatus(lotId, takenLotStatus.lotStatusId, user); updateLotStatus(lotId, takenLotStatus.lotStatusId, user);
}
if (masterRow.CM_PRENEED_OWNER) { if (masterRow.CM_PRENEED_OWNER) {
addLotOccupancyOccupant( addLotOccupancyOccupant(
{ {
lotOccupancyId: deceasedLotOccupancyId, lotOccupancyId: deceasedLotOccupancyId,
lotOccupantTypeId: preneedOwnerLotOccupantType.lotOccupantTypeId, lotOccupantTypeId: preneedOwnerLotOccupantType.lotOccupantTypeId,
occupantName: masterRow.CM_PRENEED_OWNER, occupantName: masterRow.CM_PRENEED_OWNER,
occupantAddress1: "", occupantAddress1: "",
occupantAddress2: "", occupantAddress2: "",
occupantCity: "", occupantCity: "",
occupantProvince: "", occupantProvince: "",
occupantPostalCode: "", occupantPostalCode: "",
occupantPhoneNumber: "", occupantPhoneNumber: "",
occupantEmailAddress: "" occupantEmailAddress: ""
}, },
user user
); );
}
} }
} }
} catch (error) { } catch (error) {