fix more test errors
parent
dce2f75a52
commit
0aa050dbae
|
|
@ -1,4 +1,5 @@
|
||||||
import { type DateString } from '@cityssm/utils-datetime';
|
import { type DateString } from '@cityssm/utils-datetime';
|
||||||
|
import type { PoolConnection } from 'better-sqlite-pool';
|
||||||
export interface AddForm {
|
export interface AddForm {
|
||||||
contractId: string | number;
|
contractId: string | number;
|
||||||
deceasedName: string;
|
deceasedName: string;
|
||||||
|
|
@ -11,8 +12,8 @@ export interface AddForm {
|
||||||
birthPlace: string;
|
birthPlace: string;
|
||||||
deathDateString: DateString | '';
|
deathDateString: DateString | '';
|
||||||
deathPlace: string;
|
deathPlace: string;
|
||||||
deathAge: string;
|
deathAge: string | number;
|
||||||
deathAgePeriod: string;
|
deathAgePeriod: string;
|
||||||
intermentContainerTypeId: string | number;
|
intermentContainerTypeId: string | number;
|
||||||
}
|
}
|
||||||
export default function addContractInterment(contractForm: AddForm, user: User): Promise<number>;
|
export default function addContractInterment(contractForm: AddForm, user: User, connectedDatabase?: PoolConnection): Promise<number>;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { dateStringToInteger } from '@cityssm/utils-datetime';
|
import { dateStringToInteger } from '@cityssm/utils-datetime';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export default async function addContractInterment(contractForm, user) {
|
export default async function addContractInterment(contractForm, user, connectedDatabase) {
|
||||||
const database = await acquireConnection();
|
const database = connectedDatabase ?? (await acquireConnection());
|
||||||
const maxIntermentNumber = (database
|
const maxIntermentNumber = (database
|
||||||
.prepare(`select max(intermentNumber) as maxIntermentNumber
|
.prepare(`select max(intermentNumber) as maxIntermentNumber
|
||||||
from ContractInterments
|
from ContractInterments
|
||||||
|
|
@ -25,6 +25,8 @@ export default async function addContractInterment(contractForm, user) {
|
||||||
: dateStringToInteger(contractForm.deathDateString), contractForm.deathPlace, contractForm.intermentContainerTypeId === ''
|
: dateStringToInteger(contractForm.deathDateString), contractForm.deathPlace, contractForm.intermentContainerTypeId === ''
|
||||||
? undefined
|
? undefined
|
||||||
: contractForm.intermentContainerTypeId, user.userName, rightNowMillis, user.userName, rightNowMillis);
|
: contractForm.intermentContainerTypeId, user.userName, rightNowMillis, user.userName, rightNowMillis);
|
||||||
database.release();
|
if (connectedDatabase === undefined) {
|
||||||
|
database.release();
|
||||||
|
}
|
||||||
return newIntermentNumber;
|
return newIntermentNumber;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { type DateString, dateStringToInteger } from '@cityssm/utils-datetime'
|
import { type DateString, dateStringToInteger } from '@cityssm/utils-datetime'
|
||||||
|
import type { PoolConnection } from 'better-sqlite-pool'
|
||||||
|
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
|
|
@ -14,16 +15,17 @@ export interface AddForm {
|
||||||
birthPlace: string
|
birthPlace: string
|
||||||
deathDateString: DateString | ''
|
deathDateString: DateString | ''
|
||||||
deathPlace: string
|
deathPlace: string
|
||||||
deathAge: string
|
deathAge: string | number
|
||||||
deathAgePeriod: string
|
deathAgePeriod: string
|
||||||
intermentContainerTypeId: string | number
|
intermentContainerTypeId: string | number
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function addContractInterment(
|
export default async function addContractInterment(
|
||||||
contractForm: AddForm,
|
contractForm: AddForm,
|
||||||
user: User
|
user: User,
|
||||||
|
connectedDatabase?: PoolConnection
|
||||||
): Promise<number> {
|
): Promise<number> {
|
||||||
const database = await acquireConnection()
|
const database = connectedDatabase ?? (await acquireConnection())
|
||||||
|
|
||||||
const maxIntermentNumber = (database
|
const maxIntermentNumber = (database
|
||||||
.prepare(
|
.prepare(
|
||||||
|
|
@ -73,7 +75,9 @@ export default async function addContractInterment(
|
||||||
rightNowMillis
|
rightNowMillis
|
||||||
)
|
)
|
||||||
|
|
||||||
database.release()
|
if (connectedDatabase === undefined) {
|
||||||
|
database.release()
|
||||||
|
}
|
||||||
|
|
||||||
return newIntermentNumber
|
return newIntermentNumber
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { dateToString } from '@cityssm/utils-datetime';
|
import { dateToString } from '@cityssm/utils-datetime';
|
||||||
import addContract from './addContract.js';
|
import addContract from './addContract.js';
|
||||||
import addContractComment from './addContractComment.js';
|
import addContractComment from './addContractComment.js';
|
||||||
// import addContractOccupant from './addContractOccupant.js'
|
import addContractInterment from './addContractInterment.js';
|
||||||
import getContract from './getContract.js';
|
import getContract from './getContract.js';
|
||||||
import { acquireConnection } from './pool.js';
|
import { acquireConnection } from './pool.js';
|
||||||
export default async function copyContract(oldContractId, user) {
|
export default async function copyContract(oldContractId, user) {
|
||||||
|
|
@ -11,7 +11,20 @@ export default async function copyContract(oldContractId, user) {
|
||||||
burialSiteId: oldContract.burialSiteId ?? '',
|
burialSiteId: oldContract.burialSiteId ?? '',
|
||||||
contractTypeId: oldContract.contractTypeId,
|
contractTypeId: oldContract.contractTypeId,
|
||||||
contractStartDateString: dateToString(new Date()),
|
contractStartDateString: dateToString(new Date()),
|
||||||
contractEndDateString: ''
|
contractEndDateString: '',
|
||||||
|
purchaserName: oldContract.purchaserName,
|
||||||
|
purchaserAddress1: oldContract.purchaserAddress1,
|
||||||
|
purchaserAddress2: oldContract.purchaserAddress2,
|
||||||
|
purchaserCity: oldContract.purchaserCity,
|
||||||
|
purchaserProvince: oldContract.purchaserProvince,
|
||||||
|
purchaserPostalCode: oldContract.purchaserPostalCode,
|
||||||
|
purchaserPhoneNumber: oldContract.purchaserPhoneNumber,
|
||||||
|
purchaserEmail: oldContract.purchaserEmail,
|
||||||
|
purchaserRelationship: oldContract.purchaserRelationship,
|
||||||
|
funeralHomeId: oldContract.funeralHomeId,
|
||||||
|
funeralDirectorName: oldContract.funeralDirectorName,
|
||||||
|
funeralDateString: oldContract.funeralDateString ?? '',
|
||||||
|
funeralTimeString: oldContract.funeralTimeString ?? ''
|
||||||
}, user, database);
|
}, user, database);
|
||||||
/*
|
/*
|
||||||
* Copy Fields
|
* Copy Fields
|
||||||
|
|
@ -27,29 +40,26 @@ export default async function copyContract(oldContractId, user) {
|
||||||
.run(newContractId, field.contractTypeFieldId, field.fieldValue, user.userName, rightNowMillis, user.userName, rightNowMillis);
|
.run(newContractId, field.contractTypeFieldId, field.fieldValue, user.userName, rightNowMillis, user.userName, rightNowMillis);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Copy Occupants
|
* Copy Interments
|
||||||
*/
|
*/
|
||||||
/*
|
for (const interment of oldContract.contractInterments ?? []) {
|
||||||
for (const occupant of oldContract.contractOccupants ?? []) {
|
await addContractInterment({
|
||||||
await addContractOccupant(
|
contractId: newContractId,
|
||||||
{
|
deceasedName: interment.deceasedName ?? '',
|
||||||
contractId: newContractId,
|
deceasedAddress1: interment.deceasedAddress1 ?? '',
|
||||||
lotOccupantTypeId: occupant.lotOccupantTypeId!,
|
deceasedAddress2: interment.deceasedAddress2 ?? '',
|
||||||
occupantName: occupant.occupantName!,
|
deceasedCity: interment.deceasedCity ?? '',
|
||||||
occupantFamilyName: occupant.occupantFamilyName!,
|
deceasedProvince: interment.deceasedProvince ?? '',
|
||||||
occupantAddress1: occupant.occupantAddress1!,
|
deceasedPostalCode: interment.deceasedPostalCode ?? '',
|
||||||
occupantAddress2: occupant.occupantAddress2!,
|
birthDateString: interment.birthDateString ?? '',
|
||||||
occupantCity: occupant.occupantCity!,
|
birthPlace: interment.birthPlace ?? '',
|
||||||
occupantProvince: occupant.occupantProvince!,
|
deathDateString: interment.deathDateString ?? '',
|
||||||
occupantPostalCode: occupant.occupantPostalCode!,
|
deathPlace: interment.deathPlace ?? '',
|
||||||
occupantPhoneNumber: occupant.occupantPhoneNumber!,
|
deathAge: interment.deathAge ?? '',
|
||||||
occupantEmailAddress: occupant.occupantEmailAddress!
|
deathAgePeriod: interment.deathAgePeriod ?? '',
|
||||||
},
|
intermentContainerTypeId: interment.intermentContainerTypeId ?? ''
|
||||||
user,
|
}, user, database);
|
||||||
database
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
/*
|
/*
|
||||||
* Add Comment
|
* Add Comment
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import type { Contract } from '../types/recordTypes.js'
|
||||||
|
|
||||||
import addContract from './addContract.js'
|
import addContract from './addContract.js'
|
||||||
import addContractComment from './addContractComment.js'
|
import addContractComment from './addContractComment.js'
|
||||||
// import addContractOccupant from './addContractOccupant.js'
|
import addContractInterment from './addContractInterment.js'
|
||||||
import getContract from './getContract.js'
|
import getContract from './getContract.js'
|
||||||
import { acquireConnection } from './pool.js'
|
import { acquireConnection } from './pool.js'
|
||||||
|
|
||||||
|
|
@ -14,17 +14,29 @@ export default async function copyContract(
|
||||||
): Promise<number> {
|
): Promise<number> {
|
||||||
const database = await acquireConnection()
|
const database = await acquireConnection()
|
||||||
|
|
||||||
const oldContract = (await getContract(
|
const oldContract = (await getContract(oldContractId, database)) as Contract
|
||||||
oldContractId,
|
|
||||||
database
|
|
||||||
)) as Contract
|
|
||||||
|
|
||||||
const newContractId = await addContract(
|
const newContractId = await addContract(
|
||||||
{
|
{
|
||||||
burialSiteId: oldContract.burialSiteId ?? '',
|
burialSiteId: oldContract.burialSiteId ?? '',
|
||||||
contractTypeId: oldContract.contractTypeId,
|
contractTypeId: oldContract.contractTypeId,
|
||||||
contractStartDateString: dateToString(new Date()),
|
contractStartDateString: dateToString(new Date()),
|
||||||
contractEndDateString: ''
|
contractEndDateString: '',
|
||||||
|
|
||||||
|
purchaserName: oldContract.purchaserName,
|
||||||
|
purchaserAddress1: oldContract.purchaserAddress1,
|
||||||
|
purchaserAddress2: oldContract.purchaserAddress2,
|
||||||
|
purchaserCity: oldContract.purchaserCity,
|
||||||
|
purchaserProvince: oldContract.purchaserProvince,
|
||||||
|
purchaserPostalCode: oldContract.purchaserPostalCode,
|
||||||
|
purchaserPhoneNumber: oldContract.purchaserPhoneNumber,
|
||||||
|
purchaserEmail: oldContract.purchaserEmail,
|
||||||
|
purchaserRelationship: oldContract.purchaserRelationship,
|
||||||
|
|
||||||
|
funeralHomeId: oldContract.funeralHomeId,
|
||||||
|
funeralDirectorName: oldContract.funeralDirectorName,
|
||||||
|
funeralDateString: oldContract.funeralDateString ?? '',
|
||||||
|
funeralTimeString: oldContract.funeralTimeString ?? ''
|
||||||
},
|
},
|
||||||
user,
|
user,
|
||||||
database
|
database
|
||||||
|
|
@ -57,30 +69,33 @@ export default async function copyContract(
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy Occupants
|
* Copy Interments
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
for (const interment of oldContract.contractInterments ?? []) {
|
||||||
for (const occupant of oldContract.contractOccupants ?? []) {
|
await addContractInterment(
|
||||||
await addContractOccupant(
|
|
||||||
{
|
{
|
||||||
contractId: newContractId,
|
contractId: newContractId,
|
||||||
lotOccupantTypeId: occupant.lotOccupantTypeId!,
|
deceasedName: interment.deceasedName ?? '',
|
||||||
occupantName: occupant.occupantName!,
|
deceasedAddress1: interment.deceasedAddress1 ?? '',
|
||||||
occupantFamilyName: occupant.occupantFamilyName!,
|
deceasedAddress2: interment.deceasedAddress2 ?? '',
|
||||||
occupantAddress1: occupant.occupantAddress1!,
|
deceasedCity: interment.deceasedCity ?? '',
|
||||||
occupantAddress2: occupant.occupantAddress2!,
|
deceasedProvince: interment.deceasedProvince ?? '',
|
||||||
occupantCity: occupant.occupantCity!,
|
deceasedPostalCode: interment.deceasedPostalCode ?? '',
|
||||||
occupantProvince: occupant.occupantProvince!,
|
|
||||||
occupantPostalCode: occupant.occupantPostalCode!,
|
birthDateString: interment.birthDateString ?? '',
|
||||||
occupantPhoneNumber: occupant.occupantPhoneNumber!,
|
birthPlace: interment.birthPlace ?? '',
|
||||||
occupantEmailAddress: occupant.occupantEmailAddress!
|
deathDateString: interment.deathDateString ?? '',
|
||||||
|
deathPlace: interment.deathPlace ?? '',
|
||||||
|
|
||||||
|
deathAge: interment.deathAge ?? '',
|
||||||
|
deathAgePeriod: interment.deathAgePeriod ?? '',
|
||||||
|
intermentContainerTypeId: interment.intermentContainerTypeId ?? ''
|
||||||
},
|
},
|
||||||
user,
|
user,
|
||||||
database
|
database
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add Comment
|
* Add Comment
|
||||||
|
|
|
||||||
|
|
@ -22,20 +22,20 @@ function buildEventSummary(milestone) {
|
||||||
((milestone.workOrderMilestoneTypeId ?? -1) === -1
|
((milestone.workOrderMilestoneTypeId ?? -1) === -1
|
||||||
? milestone.workOrderMilestoneDescription ?? ''
|
? milestone.workOrderMilestoneDescription ?? ''
|
||||||
: milestone.workOrderMilestoneType ?? '').trim();
|
: milestone.workOrderMilestoneType ?? '').trim();
|
||||||
let occupantCount = 0;
|
let intermentCount = 0;
|
||||||
for (const contract of milestone.workOrderContracts ?? []) {
|
for (const contract of milestone.workOrderContracts ?? []) {
|
||||||
for (const occupant of contract.contractOccupants ?? []) {
|
for (const interment of contract.contractInterments ?? []) {
|
||||||
occupantCount += 1;
|
intermentCount += 1;
|
||||||
if (occupantCount === 1) {
|
if (intermentCount === 1) {
|
||||||
if (summary !== '') {
|
if (summary !== '') {
|
||||||
summary += ': ';
|
summary += ': ';
|
||||||
}
|
}
|
||||||
summary += `${occupant.occupantName ?? ''} ${occupant.occupantFamilyName ?? ''}`;
|
summary += interment.deceasedName ?? '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (occupantCount > 1) {
|
if (intermentCount > 1) {
|
||||||
summary += ` plus ${(occupantCount - 1).toString()}`;
|
summary += ` plus ${(intermentCount - 1).toString()}`;
|
||||||
}
|
}
|
||||||
return summary;
|
return summary;
|
||||||
}
|
}
|
||||||
|
|
@ -53,30 +53,30 @@ function buildEventDescriptionHTML_occupancies(request, milestone) {
|
||||||
<th>Burial Site</th>
|
<th>Burial Site</th>
|
||||||
<th>Start Date</th>
|
<th>Start Date</th>
|
||||||
<th>End Date</th>
|
<th>End Date</th>
|
||||||
<th>${escapeHTML(getConfigProperty('aliases.occupants'))}</th>
|
<th>Interments</th>
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
<tbody>`;
|
<tbody>`;
|
||||||
for (const occupancy of milestone.workOrderContracts ?? []) {
|
for (const contract of milestone.workOrderContracts ?? []) {
|
||||||
descriptionHTML += `<tr>
|
descriptionHTML += `<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="${urlRoot}/contracts/${occupancy.contractId}">
|
<a href="${urlRoot}/contracts/${contract.contractId}">
|
||||||
${escapeHTML(occupancy.contractType ?? '')}
|
${escapeHTML(contract.contractType ?? '')}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
${occupancy.burialSiteName ? escapeHTML(occupancy.burialSiteName) : '(Not Set)'}
|
${contract.burialSiteName ? escapeHTML(contract.burialSiteName) : '(Not Set)'}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
${occupancy.contractStartDateString}
|
${contract.contractStartDateString}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
${occupancy.contractEndDate
|
${contract.contractEndDate
|
||||||
? occupancy.contractEndDateString
|
? contract.contractEndDateString
|
||||||
: '(No End Date)'}
|
: '(No End Date)'}
|
||||||
</td>
|
</td>
|
||||||
<td>`;
|
<td>`;
|
||||||
for (const occupant of occupancy.contractOccupants ?? []) {
|
for (const interment of contract.contractInterments ?? []) {
|
||||||
descriptionHTML += `${escapeHTML(occupant.lotOccupantType ?? '')}: ${escapeHTML(occupant.occupantName ?? '')} ${escapeHTML(occupant.occupantFamilyName ?? '')}<br />`;
|
descriptionHTML += `${escapeHTML(interment.deceasedName ?? '')}<br />`;
|
||||||
}
|
}
|
||||||
descriptionHTML += '</td></tr>';
|
descriptionHTML += '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
@ -165,6 +165,7 @@ function buildEventLocation(milestone) {
|
||||||
}
|
}
|
||||||
return burialSiteNames.join(', ');
|
return burialSiteNames.join(', ');
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line complexity
|
||||||
export default async function handler(request, response) {
|
export default async function handler(request, response) {
|
||||||
const urlRoot = getUrlRoot(request);
|
const urlRoot = getUrlRoot(request);
|
||||||
/*
|
/*
|
||||||
|
|
@ -194,7 +195,7 @@ export default async function handler(request, response) {
|
||||||
});
|
});
|
||||||
if (request.query.workOrderId && workOrderMilestones.length > 0) {
|
if (request.query.workOrderId && workOrderMilestones.length > 0) {
|
||||||
calendar.name(`Work Order #${workOrderMilestones[0].workOrderNumber}`);
|
calendar.name(`Work Order #${workOrderMilestones[0].workOrderNumber}`);
|
||||||
calendar.url(`${urlRoot}/workOrders/${workOrderMilestones[0].workOrderId?.toString()}`);
|
calendar.url(`${urlRoot}/workOrders/${workOrderMilestones[0].workOrderId.toString()}`);
|
||||||
}
|
}
|
||||||
calendar.prodId({
|
calendar.prodId({
|
||||||
company: calendarCompany,
|
company: calendarCompany,
|
||||||
|
|
@ -206,7 +207,7 @@ export default async function handler(request, response) {
|
||||||
for (const milestone of workOrderMilestones) {
|
for (const milestone of workOrderMilestones) {
|
||||||
const milestoneTimePieces = `${milestone.workOrderMilestoneDateString} ${milestone.workOrderMilestoneTimeString}`.split(timeStringSplitRegex);
|
const milestoneTimePieces = `${milestone.workOrderMilestoneDateString} ${milestone.workOrderMilestoneTimeString}`.split(timeStringSplitRegex);
|
||||||
const milestoneDate = new Date(Number.parseInt(milestoneTimePieces[0], 10), Number.parseInt(milestoneTimePieces[1], 10) - 1, Number.parseInt(milestoneTimePieces[2], 10), Number.parseInt(milestoneTimePieces[3], 10), Number.parseInt(milestoneTimePieces[4], 10));
|
const milestoneDate = new Date(Number.parseInt(milestoneTimePieces[0], 10), Number.parseInt(milestoneTimePieces[1], 10) - 1, Number.parseInt(milestoneTimePieces[2], 10), Number.parseInt(milestoneTimePieces[3], 10), Number.parseInt(milestoneTimePieces[4], 10));
|
||||||
const milestoneEndDate = new Date(milestoneDate.getTime());
|
const milestoneEndDate = new Date(milestoneDate);
|
||||||
milestoneEndDate.setHours(milestoneEndDate.getHours() + 1);
|
milestoneEndDate.setHours(milestoneEndDate.getHours() + 1);
|
||||||
// Build summary (title in Outlook)
|
// Build summary (title in Outlook)
|
||||||
const summary = buildEventSummary(milestone);
|
const summary = buildEventSummary(milestone);
|
||||||
|
|
@ -250,16 +251,16 @@ export default async function handler(request, response) {
|
||||||
if (milestone.workOrderContracts.length > 0) {
|
if (milestone.workOrderContracts.length > 0) {
|
||||||
let organizerSet = false;
|
let organizerSet = false;
|
||||||
for (const contract of milestone.workOrderContracts ?? []) {
|
for (const contract of milestone.workOrderContracts ?? []) {
|
||||||
for (const occupant of contract.contractOccupants ?? []) {
|
for (const interment of contract.contractInterments ?? []) {
|
||||||
if (organizerSet) {
|
if (organizerSet) {
|
||||||
calendarEvent.createAttendee({
|
calendarEvent.createAttendee({
|
||||||
name: `${occupant.occupantName ?? ''} ${occupant.occupantFamilyName ?? ''}`,
|
name: interment.deceasedName ?? '',
|
||||||
email: getConfigProperty('settings.workOrders.calendarEmailAddress')
|
email: getConfigProperty('settings.workOrders.calendarEmailAddress')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
calendarEvent.organizer({
|
calendarEvent.organizer({
|
||||||
name: `${occupant.occupantName ?? ''} ${occupant.occupantFamilyName ?? ''}`,
|
name: interment.deceasedName ?? '',
|
||||||
email: getConfigProperty('settings.workOrders.calendarEmailAddress')
|
email: getConfigProperty('settings.workOrders.calendarEmailAddress')
|
||||||
});
|
});
|
||||||
organizerSet = true;
|
organizerSet = true;
|
||||||
|
|
|
||||||
|
|
@ -45,24 +45,24 @@ function buildEventSummary(milestone: WorkOrderMilestone): string {
|
||||||
: milestone.workOrderMilestoneType ?? ''
|
: milestone.workOrderMilestoneType ?? ''
|
||||||
).trim()
|
).trim()
|
||||||
|
|
||||||
let occupantCount = 0
|
let intermentCount = 0
|
||||||
|
|
||||||
for (const contract of milestone.workOrderContracts ?? []) {
|
for (const contract of milestone.workOrderContracts ?? []) {
|
||||||
for (const occupant of contract.contractOccupants ?? []) {
|
for (const interment of contract.contractInterments ?? []) {
|
||||||
occupantCount += 1
|
intermentCount += 1
|
||||||
|
|
||||||
if (occupantCount === 1) {
|
if (intermentCount === 1) {
|
||||||
if (summary !== '') {
|
if (summary !== '') {
|
||||||
summary += ': '
|
summary += ': '
|
||||||
}
|
}
|
||||||
|
|
||||||
summary += `${occupant.occupantName ?? ''} ${occupant.occupantFamilyName ?? ''}`
|
summary += interment.deceasedName ?? ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (occupantCount > 1) {
|
if (intermentCount > 1) {
|
||||||
summary += ` plus ${(occupantCount - 1).toString()}`
|
summary += ` plus ${(intermentCount - 1).toString()}`
|
||||||
}
|
}
|
||||||
|
|
||||||
return summary
|
return summary
|
||||||
|
|
@ -87,38 +87,34 @@ function buildEventDescriptionHTML_occupancies(
|
||||||
<th>Burial Site</th>
|
<th>Burial Site</th>
|
||||||
<th>Start Date</th>
|
<th>Start Date</th>
|
||||||
<th>End Date</th>
|
<th>End Date</th>
|
||||||
<th>${escapeHTML(getConfigProperty('aliases.occupants'))}</th>
|
<th>Interments</th>
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
<tbody>`
|
<tbody>`
|
||||||
|
|
||||||
for (const occupancy of milestone.workOrderContracts ?? []) {
|
for (const contract of milestone.workOrderContracts ?? []) {
|
||||||
descriptionHTML += `<tr>
|
descriptionHTML += `<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="${urlRoot}/contracts/${occupancy.contractId}">
|
<a href="${urlRoot}/contracts/${contract.contractId}">
|
||||||
${escapeHTML(occupancy.contractType ?? '')}
|
${escapeHTML(contract.contractType ?? '')}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
${occupancy.burialSiteName ? escapeHTML(occupancy.burialSiteName) : '(Not Set)'}
|
${contract.burialSiteName ? escapeHTML(contract.burialSiteName) : '(Not Set)'}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
${occupancy.contractStartDateString}
|
${contract.contractStartDateString}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
${
|
${
|
||||||
occupancy.contractEndDate
|
contract.contractEndDate
|
||||||
? occupancy.contractEndDateString
|
? contract.contractEndDateString
|
||||||
: '(No End Date)'
|
: '(No End Date)'
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
<td>`
|
<td>`
|
||||||
|
|
||||||
for (const occupant of occupancy.contractOccupants ?? []) {
|
for (const interment of contract.contractInterments ?? []) {
|
||||||
descriptionHTML += `${escapeHTML(
|
descriptionHTML += `${escapeHTML(interment.deceasedName ?? '')}<br />`
|
||||||
occupant.lotOccupantType ?? ''
|
|
||||||
)}: ${escapeHTML(occupant.occupantName ?? '')} ${escapeHTML(
|
|
||||||
occupant.occupantFamilyName ?? ''
|
|
||||||
)}<br />`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
descriptionHTML += '</td></tr>'
|
descriptionHTML += '</td></tr>'
|
||||||
|
|
@ -246,6 +242,7 @@ function buildEventLocation(milestone: WorkOrderMilestone): string {
|
||||||
return burialSiteNames.join(', ')
|
return burialSiteNames.join(', ')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line complexity
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
request: Request,
|
request: Request,
|
||||||
response: Response
|
response: Response
|
||||||
|
|
@ -286,7 +283,7 @@ export default async function handler(
|
||||||
if (request.query.workOrderId && workOrderMilestones.length > 0) {
|
if (request.query.workOrderId && workOrderMilestones.length > 0) {
|
||||||
calendar.name(`Work Order #${workOrderMilestones[0].workOrderNumber}`)
|
calendar.name(`Work Order #${workOrderMilestones[0].workOrderNumber}`)
|
||||||
calendar.url(
|
calendar.url(
|
||||||
`${urlRoot}/workOrders/${workOrderMilestones[0].workOrderId?.toString()}`
|
`${urlRoot}/workOrders/${workOrderMilestones[0].workOrderId.toString()}`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -312,7 +309,7 @@ export default async function handler(
|
||||||
Number.parseInt(milestoneTimePieces[4], 10)
|
Number.parseInt(milestoneTimePieces[4], 10)
|
||||||
)
|
)
|
||||||
|
|
||||||
const milestoneEndDate = new Date(milestoneDate.getTime())
|
const milestoneEndDate = new Date(milestoneDate)
|
||||||
milestoneEndDate.setHours(milestoneEndDate.getHours() + 1)
|
milestoneEndDate.setHours(milestoneEndDate.getHours() + 1)
|
||||||
|
|
||||||
// Build summary (title in Outlook)
|
// Build summary (title in Outlook)
|
||||||
|
|
@ -372,21 +369,17 @@ export default async function handler(
|
||||||
if (milestone.workOrderContracts!.length > 0) {
|
if (milestone.workOrderContracts!.length > 0) {
|
||||||
let organizerSet = false
|
let organizerSet = false
|
||||||
for (const contract of milestone.workOrderContracts ?? []) {
|
for (const contract of milestone.workOrderContracts ?? []) {
|
||||||
for (const occupant of contract.contractOccupants ?? []) {
|
for (const interment of contract.contractInterments ?? []) {
|
||||||
if (organizerSet) {
|
if (organizerSet) {
|
||||||
calendarEvent.createAttendee({
|
calendarEvent.createAttendee({
|
||||||
name: `${occupant.occupantName ?? ''} ${
|
name: interment.deceasedName ?? '',
|
||||||
occupant.occupantFamilyName ?? ''
|
|
||||||
}`,
|
|
||||||
email: getConfigProperty(
|
email: getConfigProperty(
|
||||||
'settings.workOrders.calendarEmailAddress'
|
'settings.workOrders.calendarEmailAddress'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
calendarEvent.organizer({
|
calendarEvent.organizer({
|
||||||
name: `${occupant.occupantName ?? ''} ${
|
name: interment.deceasedName ?? '',
|
||||||
occupant.occupantFamilyName ?? ''
|
|
||||||
}`,
|
|
||||||
email: getConfigProperty(
|
email: getConfigProperty(
|
||||||
'settings.workOrders.calendarEmailAddress'
|
'settings.workOrders.calendarEmailAddress'
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const workOrderMilestoneDateFilterElement = workOrderSearchFiltersFormElement.querySelector('#searchFilter--workOrderMilestoneDateFilter');
|
const workOrderMilestoneDateFilterElement = workOrderSearchFiltersFormElement.querySelector('#searchFilter--workOrderMilestoneDateFilter');
|
||||||
const workOrderMilestoneDateStringElement = workOrderSearchFiltersFormElement.querySelector('#searchFilter--workOrderMilestoneDateString');
|
const workOrderMilestoneDateStringElement = workOrderSearchFiltersFormElement.querySelector('#searchFilter--workOrderMilestoneDateString');
|
||||||
const milestoneCalendarContainerElement = document.querySelector('#container--milestoneCalendar');
|
const milestoneCalendarContainerElement = document.querySelector('#container--milestoneCalendar');
|
||||||
|
// eslint-disable-next-line complexity
|
||||||
function renderMilestones(workOrderMilestones) {
|
function renderMilestones(workOrderMilestones) {
|
||||||
if (workOrderMilestones.length === 0) {
|
if (workOrderMilestones.length === 0) {
|
||||||
milestoneCalendarContainerElement.innerHTML = `<div class="message is-info">
|
milestoneCalendarContainerElement.innerHTML = `<div class="message is-info">
|
||||||
|
|
@ -41,26 +42,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
panelBlockElement.classList.add('has-background-warning-light');
|
panelBlockElement.classList.add('has-background-warning-light');
|
||||||
}
|
}
|
||||||
let contractHTML = '';
|
let contractHTML = '';
|
||||||
for (const lot of milestone.workOrderLots ?? []) {
|
for (const burialSite of milestone.workOrderBurialSites ?? []) {
|
||||||
contractHTML += `<li class="has-tooltip-left"
|
contractHTML += `<li class="has-tooltip-left"
|
||||||
data-tooltip="${cityssm.escapeHTML(lot.cemeteryName ?? '')}">
|
data-tooltip="${cityssm.escapeHTML(burialSite.cemeteryName ?? '')}">
|
||||||
<span class="fa-li">
|
<span class="fa-li">
|
||||||
<i class="fas fa-vector-square"
|
<i class="fas fa-vector-square"
|
||||||
aria-label="${sunrise.escapedAliases.Lot}"></i>
|
aria-label="Burial Site"></i>
|
||||||
</span>
|
</span>
|
||||||
${cityssm.escapeHTML(lot.burialSiteName ?? '')}
|
${cityssm.escapeHTML(burialSite.burialSiteName ?? '')}
|
||||||
</li>`;
|
</li>`;
|
||||||
}
|
}
|
||||||
for (const contract of milestone.workOrderContracts ?? []) {
|
for (const contract of milestone.workOrderContracts ?? []) {
|
||||||
for (const occupant of contract.contractOccupants ?? []) {
|
for (const interment of contract.contractInterments ?? []) {
|
||||||
contractHTML += `<li class="has-tooltip-left"
|
contractHTML += `<li class="has-tooltip-left"
|
||||||
data-tooltip="${cityssm.escapeHTML(occupant.lotOccupantType ?? '')}">
|
data-tooltip="Interment">
|
||||||
<span class="fa-li">
|
<span class="fa-li">
|
||||||
<i class="fas fa-user"
|
<i class="fas fa-user"
|
||||||
aria-label="${sunrise.escapedAliases.Occupancy}"></i>
|
aria-label="Interment"></i>
|
||||||
</span>
|
</span>
|
||||||
${cityssm.escapeHTML(occupant.occupantName ?? '')}
|
${cityssm.escapeHTML(interment.deceasedName ?? '')}
|
||||||
${cityssm.escapeHTML(occupant.occupantFamilyName ?? '')}
|
|
||||||
</li>`;
|
</li>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ declare const exports: Record<string, unknown>
|
||||||
'#container--milestoneCalendar'
|
'#container--milestoneCalendar'
|
||||||
) as HTMLElement
|
) as HTMLElement
|
||||||
|
|
||||||
|
// eslint-disable-next-line complexity
|
||||||
function renderMilestones(workOrderMilestones: WorkOrderMilestone[]): void {
|
function renderMilestones(workOrderMilestones: WorkOrderMilestone[]): void {
|
||||||
if (workOrderMilestones.length === 0) {
|
if (workOrderMilestones.length === 0) {
|
||||||
milestoneCalendarContainerElement.innerHTML = `<div class="message is-info">
|
milestoneCalendarContainerElement.innerHTML = `<div class="message is-info">
|
||||||
|
|
@ -80,29 +81,26 @@ declare const exports: Record<string, unknown>
|
||||||
|
|
||||||
let contractHTML = ''
|
let contractHTML = ''
|
||||||
|
|
||||||
for (const lot of milestone.workOrderLots ?? []) {
|
for (const burialSite of milestone.workOrderBurialSites ?? []) {
|
||||||
contractHTML += `<li class="has-tooltip-left"
|
contractHTML += `<li class="has-tooltip-left"
|
||||||
data-tooltip="${cityssm.escapeHTML(lot.cemeteryName ?? '')}">
|
data-tooltip="${cityssm.escapeHTML(burialSite.cemeteryName ?? '')}">
|
||||||
<span class="fa-li">
|
<span class="fa-li">
|
||||||
<i class="fas fa-vector-square"
|
<i class="fas fa-vector-square"
|
||||||
aria-label="${sunrise.escapedAliases.Lot}"></i>
|
aria-label="Burial Site"></i>
|
||||||
</span>
|
</span>
|
||||||
${cityssm.escapeHTML(lot.burialSiteName ?? '')}
|
${cityssm.escapeHTML(burialSite.burialSiteName ?? '')}
|
||||||
</li>`
|
</li>`
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const contract of milestone.workOrderContracts ?? []) {
|
for (const contract of milestone.workOrderContracts ?? []) {
|
||||||
for (const occupant of contract.contractOccupants ?? []) {
|
for (const interment of contract.contractInterments ?? []) {
|
||||||
contractHTML += `<li class="has-tooltip-left"
|
contractHTML += `<li class="has-tooltip-left"
|
||||||
data-tooltip="${cityssm.escapeHTML(
|
data-tooltip="Interment">
|
||||||
occupant.lotOccupantType ?? ''
|
|
||||||
)}">
|
|
||||||
<span class="fa-li">
|
<span class="fa-li">
|
||||||
<i class="fas fa-user"
|
<i class="fas fa-user"
|
||||||
aria-label="${sunrise.escapedAliases.Occupancy}"></i>
|
aria-label="Interment"></i>
|
||||||
</span>
|
</span>
|
||||||
${cityssm.escapeHTML(occupant.occupantName ?? '')}
|
${cityssm.escapeHTML(interment.deceasedName ?? '')}
|
||||||
${cityssm.escapeHTML(occupant.occupantFamilyName ?? '')}
|
|
||||||
</li>`
|
</li>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ describe('functions.cache', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('functions.sqlFilters', () => {
|
describe('functions.sqlFilters', () => {
|
||||||
describe('LotName filter', () => {
|
describe('BurialSiteName filter', () => {
|
||||||
it('returns startsWith filter', () => {
|
it('returns startsWith filter', () => {
|
||||||
const filter = sqlFilterFunctions.getBurialSiteNameWhereClause('TEST1 TEST2', 'startsWith', 'l');
|
const filter = sqlFilterFunctions.getBurialSiteNameWhereClause('TEST1 TEST2', 'startsWith', 'l');
|
||||||
assert.strictEqual(filter.sqlWhereClause, " and l.burialSiteName like ? || '%'");
|
assert.strictEqual(filter.sqlWhereClause, " and l.burialSiteName like ? || '%'");
|
||||||
|
|
@ -167,11 +167,11 @@ describe('functions.sqlFilters', () => {
|
||||||
assert.strictEqual(filter.sqlParameters.length, 0);
|
assert.strictEqual(filter.sqlParameters.length, 0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('OccupantName filter', () => {
|
describe('DeceasedName filter', () => {
|
||||||
it('returns filter', () => {
|
it('returns filter', () => {
|
||||||
const filter = sqlFilterFunctions.getDeceasedNameWhereClause('TEST1 TEST2', 'o');
|
const filter = sqlFilterFunctions.getDeceasedNameWhereClause('TEST1 TEST2', 'o');
|
||||||
assert.strictEqual(filter.sqlWhereClause, ' and (instr(lower(o.occupantName), ?) or instr(lower(o.occupantFamilyName), ?)) and (instr(lower(o.occupantName), ?) or instr(lower(o.occupantFamilyName), ?))');
|
assert.strictEqual(filter.sqlWhereClause, ' and instr(lower(o.deceasedName), ?) and instr(lower(o.deceasedName), ?)');
|
||||||
assert.ok(filter.sqlParameters.length === 4);
|
assert.ok(filter.sqlParameters.length === 2);
|
||||||
assert.ok(filter.sqlParameters.includes('test1'));
|
assert.ok(filter.sqlParameters.includes('test1'));
|
||||||
assert.ok(filter.sqlParameters.includes('test2'));
|
assert.ok(filter.sqlParameters.includes('test2'));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ describe('functions.cache', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('functions.sqlFilters', () => {
|
describe('functions.sqlFilters', () => {
|
||||||
describe('LotName filter', () => {
|
describe('BurialSiteName filter', () => {
|
||||||
it('returns startsWith filter', () => {
|
it('returns startsWith filter', () => {
|
||||||
const filter = sqlFilterFunctions.getBurialSiteNameWhereClause(
|
const filter = sqlFilterFunctions.getBurialSiteNameWhereClause(
|
||||||
'TEST1 TEST2',
|
'TEST1 TEST2',
|
||||||
|
|
@ -282,7 +282,7 @@ describe('functions.sqlFilters', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('OccupantName filter', () => {
|
describe('DeceasedName filter', () => {
|
||||||
it('returns filter', () => {
|
it('returns filter', () => {
|
||||||
const filter = sqlFilterFunctions.getDeceasedNameWhereClause(
|
const filter = sqlFilterFunctions.getDeceasedNameWhereClause(
|
||||||
'TEST1 TEST2',
|
'TEST1 TEST2',
|
||||||
|
|
@ -291,10 +291,10 @@ describe('functions.sqlFilters', () => {
|
||||||
|
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
filter.sqlWhereClause,
|
filter.sqlWhereClause,
|
||||||
' and (instr(lower(o.occupantName), ?) or instr(lower(o.occupantFamilyName), ?)) and (instr(lower(o.occupantName), ?) or instr(lower(o.occupantFamilyName), ?))'
|
' and instr(lower(o.deceasedName), ?) and instr(lower(o.deceasedName), ?)'
|
||||||
)
|
)
|
||||||
|
|
||||||
assert.ok(filter.sqlParameters.length === 4)
|
assert.ok(filter.sqlParameters.length === 2)
|
||||||
|
|
||||||
assert.ok(filter.sqlParameters.includes('test1'))
|
assert.ok(filter.sqlParameters.includes('test1'))
|
||||||
assert.ok(filter.sqlParameters.includes('test2'))
|
assert.ok(filter.sqlParameters.includes('test2'))
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { DateString, TimeString } from "@cityssm/utils-datetime";
|
||||||
export interface Record {
|
export interface Record {
|
||||||
recordCreate_userName?: string;
|
recordCreate_userName?: string;
|
||||||
recordCreate_timeMillis?: number;
|
recordCreate_timeMillis?: number;
|
||||||
|
|
@ -193,10 +194,10 @@ export interface ContractInterment extends Record {
|
||||||
deceasedProvince?: string;
|
deceasedProvince?: string;
|
||||||
deceasedPostalCode?: string;
|
deceasedPostalCode?: string;
|
||||||
birthDate?: number;
|
birthDate?: number;
|
||||||
birthDateString?: string;
|
birthDateString?: DateString;
|
||||||
birthPlace?: string;
|
birthPlace?: string;
|
||||||
deathDate?: number;
|
deathDate?: number;
|
||||||
deathDateString?: string;
|
deathDateString?: DateString;
|
||||||
deathPlace?: string;
|
deathPlace?: string;
|
||||||
deathAge?: number;
|
deathAge?: number;
|
||||||
deathAgePeriod?: string;
|
deathAgePeriod?: string;
|
||||||
|
|
@ -256,9 +257,9 @@ export interface Contract extends Record {
|
||||||
funeralHomeProvince?: string;
|
funeralHomeProvince?: string;
|
||||||
funeralHomePostalCode?: string;
|
funeralHomePostalCode?: string;
|
||||||
funeralDate?: number;
|
funeralDate?: number;
|
||||||
funeralDateString?: string;
|
funeralDateString?: DateString;
|
||||||
funeralTime?: number;
|
funeralTime?: number;
|
||||||
funeralTimeString?: string;
|
funeralTimeString?: TimeString;
|
||||||
committalTypeId?: number;
|
committalTypeId?: number;
|
||||||
committalType?: string;
|
committalType?: string;
|
||||||
contractFields?: ContractField[];
|
contractFields?: ContractField[];
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { DateString, TimeString } from "@cityssm/utils-datetime"
|
||||||
|
|
||||||
export interface Record {
|
export interface Record {
|
||||||
recordCreate_userName?: string
|
recordCreate_userName?: string
|
||||||
recordCreate_timeMillis?: number
|
recordCreate_timeMillis?: number
|
||||||
|
|
@ -247,11 +249,11 @@ export interface ContractInterment extends Record {
|
||||||
deceasedPostalCode?: string
|
deceasedPostalCode?: string
|
||||||
|
|
||||||
birthDate?: number
|
birthDate?: number
|
||||||
birthDateString?: string
|
birthDateString?: DateString
|
||||||
birthPlace?: string
|
birthPlace?: string
|
||||||
|
|
||||||
deathDate?: number
|
deathDate?: number
|
||||||
deathDateString?: string
|
deathDateString?: DateString
|
||||||
deathPlace?: string
|
deathPlace?: string
|
||||||
deathAge?: number
|
deathAge?: number
|
||||||
deathAgePeriod?: string
|
deathAgePeriod?: string
|
||||||
|
|
@ -328,9 +330,9 @@ export interface Contract extends Record {
|
||||||
funeralHomePostalCode?: string
|
funeralHomePostalCode?: string
|
||||||
|
|
||||||
funeralDate?: number
|
funeralDate?: number
|
||||||
funeralDateString?: string
|
funeralDateString?: DateString
|
||||||
funeralTime?: number
|
funeralTime?: number
|
||||||
funeralTimeString?: string
|
funeralTimeString?: TimeString
|
||||||
committalTypeId?: number
|
committalTypeId?: number
|
||||||
committalType?: string
|
committalType?: string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,34 +65,28 @@
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<table class="table is-fullwidth">
|
<table class="table is-fullwidth">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= configFunctions.getConfigProperty("aliases.occupant") %> Type</th>
|
<th>Interment</th>
|
||||||
<th><%= configFunctions.getConfigProperty("aliases.occupant") %></th>
|
<th>Address</th>
|
||||||
<th>Address</th>
|
</tr>
|
||||||
<th>Phone Number</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% for (const contractOccupant of contract.contractOccupants) { %>
|
<% for (const contractInterment of contract.contractInterments) { %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= contractOccupant.lotOccupantType %></td>
|
<td><%= contractInterment.deceasedName %></td>
|
||||||
<td><%= contractOccupant.occupantName %> <%= contractOccupant.occupantFamilyName %></td>
|
<td>
|
||||||
<td>
|
<%= contractInterment.deceasedAddress1 %><br />
|
||||||
<%= contractOccupant.occupantAddress1 %><br />
|
<% if (contractInterment.deceasedAddress2 && contractInterment.deceasedAddress2 !== "") { %>
|
||||||
<% if (contractOccupant.occupantAddress2 && contractOccupant.occupantAddress2 !== "") { %>
|
<%= contractInterment.deceasedAddress2 %><br />
|
||||||
<%= contractOccupant.occupantAddress2 %><br />
|
<% } %>
|
||||||
<% } %>
|
<% if (contractInterment.deceasedCity) { %>
|
||||||
<% if (contractOccupant.occupantCity) { %>
|
<%= contractInterment.deceasedCity %>,
|
||||||
<%= contractOccupant.occupantCity %>,
|
<% } %>
|
||||||
<% } %>
|
<%= contractInterment.deceasedProvince %><br />
|
||||||
<%= contractOccupant.occupantProvince %><br />
|
<%= contractInterment.deceasedPostalCode %>
|
||||||
<%= contractOccupant.occupantPostalCode %>
|
</td>
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<%= contractOccupant.occupantPhoneNumber %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% } %>
|
<% } %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
@ -105,9 +99,9 @@
|
||||||
<table class="table is-fullwidth">
|
<table class="table is-fullwidth">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Commentor</th>
|
<th>Commentor</th>
|
||||||
<th>Comment Date</th>
|
<th>Comment Date</th>
|
||||||
<th>Comment</th>
|
<th>Comment</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue