occupant family name field

deepsource-autofix-76c6eb20
Dan Gowans 2023-02-02 10:51:40 -05:00
parent fc234b9dd6
commit ca853c64b7
59 changed files with 767 additions and 612 deletions

View File

@ -21,9 +21,9 @@ function getWorkOrderUrl(request, milestone) {
} }
function buildEventSummary(milestone) { function buildEventSummary(milestone) {
let summary = (milestone.workOrderMilestoneCompletionDate ? '✔ ' : '') + let summary = (milestone.workOrderMilestoneCompletionDate ? '✔ ' : '') +
(milestone.workOrderMilestoneTypeId ((milestone.workOrderMilestoneTypeId ?? -1) === -1
? milestone.workOrderMilestoneType ? (milestone.workOrderMilestoneDescription ?? '')
: milestone.workOrderMilestoneDescription).trim(); : (milestone.workOrderMilestoneType ?? '')).trim();
let occupantCount = 0; let occupantCount = 0;
for (const lotOccupancy of milestone.workOrderLotOccupancies) { for (const lotOccupancy of milestone.workOrderLotOccupancies) {
for (const occupant of lotOccupancy.lotOccupancyOccupants) { for (const occupant of lotOccupancy.lotOccupancyOccupants) {
@ -32,7 +32,7 @@ function buildEventSummary(milestone) {
if (summary !== '') { if (summary !== '') {
summary += ': '; summary += ': ';
} }
summary += occupant.occupantName ?? ''; summary += (occupant.occupantName ?? '') + ' ' + (occupant.occupantFamilyName ?? '');
} }
} }
} }
@ -81,6 +81,8 @@ function buildEventDescriptionHTML_occupancies(request, milestone) {
escapeHTML(occupant.lotOccupantType) + escapeHTML(occupant.lotOccupantType) +
': ' + ': ' +
escapeHTML(occupant.occupantName) + escapeHTML(occupant.occupantName) +
' ' +
escapeHTML(occupant.occupantFamilyName) +
'<br />'; '<br />';
} }
descriptionHTML += '</td></tr>'; descriptionHTML += '</td></tr>';
@ -257,13 +259,13 @@ export async function handler(request, response) {
for (const occupant of lotOccupancy.lotOccupancyOccupants) { for (const occupant of lotOccupancy.lotOccupancyOccupants) {
if (organizerSet) { if (organizerSet) {
calendarEvent.createAttendee({ calendarEvent.createAttendee({
name: occupant.occupantName, name: occupant.occupantName + ' ' + occupant.occupantFamilyName,
email: configFunctions.getProperty('settings.workOrders.calendarEmailAddress') email: configFunctions.getProperty('settings.workOrders.calendarEmailAddress')
}); });
} }
else { else {
calendarEvent.organizer({ calendarEvent.organizer({
name: occupant.occupantName, name: occupant.occupantName + ' ' + occupant.occupantFamilyName,
email: configFunctions.getProperty('settings.workOrders.calendarEmailAddress') email: configFunctions.getProperty('settings.workOrders.calendarEmailAddress')
}); });
organizerSet = true; organizerSet = true;

View File

@ -49,9 +49,9 @@ function getWorkOrderUrl(
function buildEventSummary(milestone: recordTypes.WorkOrderMilestone): string { function buildEventSummary(milestone: recordTypes.WorkOrderMilestone): string {
let summary = let summary =
(milestone.workOrderMilestoneCompletionDate ? '✔ ' : '') + (milestone.workOrderMilestoneCompletionDate ? '✔ ' : '') +
(milestone.workOrderMilestoneTypeId ((milestone.workOrderMilestoneTypeId ?? -1) === -1
? milestone.workOrderMilestoneType ? (milestone.workOrderMilestoneDescription ?? '')
: milestone.workOrderMilestoneDescription : (milestone.workOrderMilestoneType ?? '')
).trim() ).trim()
let occupantCount = 0 let occupantCount = 0
@ -65,7 +65,7 @@ function buildEventSummary(milestone: recordTypes.WorkOrderMilestone): string {
summary += ': ' summary += ': '
} }
summary += occupant.occupantName ?? '' summary += (occupant.occupantName ?? '') + ' ' + (occupant.occupantFamilyName ?? '')
} }
} }
} }
@ -129,6 +129,8 @@ function buildEventDescriptionHTML_occupancies(
escapeHTML(occupant.lotOccupantType!) + escapeHTML(occupant.lotOccupantType!) +
': ' + ': ' +
escapeHTML(occupant.occupantName!) + escapeHTML(occupant.occupantName!) +
' ' +
escapeHTML(occupant.occupantFamilyName!) +
'<br />' '<br />'
} }
@ -403,14 +405,14 @@ export async function handler(
for (const occupant of lotOccupancy.lotOccupancyOccupants!) { for (const occupant of lotOccupancy.lotOccupancyOccupants!) {
if (organizerSet) { if (organizerSet) {
calendarEvent.createAttendee({ calendarEvent.createAttendee({
name: occupant.occupantName, name: occupant.occupantName + ' ' + occupant.occupantFamilyName,
email: configFunctions.getProperty( email: configFunctions.getProperty(
'settings.workOrders.calendarEmailAddress' 'settings.workOrders.calendarEmailAddress'
) )
}) })
} else { } else {
calendarEvent.organizer({ calendarEvent.organizer({
name: occupant.occupantName, name: occupant.occupantName + ' ' + occupant.occupantFamilyName,
email: configFunctions.getProperty( email: configFunctions.getProperty(
'settings.workOrders.calendarEmailAddress' 'settings.workOrders.calendarEmailAddress'
) )

View File

@ -26,6 +26,7 @@ export async function handler(request, response, next) {
return; return;
} }
const reportData = await getReportData(printConfig, request.query); const reportData = await getReportData(printConfig, request.query);
console.log(reportData);
const reportPath = path.join('views', 'print', 'pdf', printName + '.ejs'); const reportPath = path.join('views', 'print', 'pdf', printName + '.ejs');
function pdfCallbackFunction(pdf) { function pdfCallbackFunction(pdf) {
response.setHeader('Content-Disposition', `${attachmentOrInline}; filename=${camelcase(printConfig.title)}.pdf`); response.setHeader('Content-Disposition', `${attachmentOrInline}; filename=${camelcase(printConfig.title)}.pdf`);

View File

@ -53,6 +53,8 @@ export async function handler(
const reportData = await getReportData(printConfig, request.query) const reportData = await getReportData(printConfig, request.query)
console.log(reportData)
const reportPath = path.join('views', 'print', 'pdf', printName + '.ejs') const reportPath = path.join('views', 'print', 'pdf', printName + '.ejs')
function pdfCallbackFunction(pdf: Buffer): void { function pdfCallbackFunction(pdf: Buffer): void {

View File

@ -2,7 +2,7 @@ import type { Request, Response } from 'express'
import { import {
getReportData, getReportData,
ReportParameters type ReportParameters
} from '../../helpers/lotOccupancyDB/getReportData.js' } from '../../helpers/lotOccupancyDB/getReportData.js'
import papaparse from 'papaparse' import papaparse from 'papaparse'

View File

@ -58,7 +58,7 @@ export async function getReportData(printConfig, requestQuery) {
} }
if (printConfig.params.includes('workOrderId') && if (printConfig.params.includes('workOrderId') &&
typeof requestQuery.workOrderId === 'string') { typeof requestQuery.workOrderId === 'string') {
reportData.workOrder = getWorkOrder(requestQuery.workOrderId, { reportData.workOrder = await getWorkOrder(requestQuery.workOrderId, {
includeLotsAndLotOccupancies: true, includeLotsAndLotOccupancies: true,
includeComments: true, includeComments: true,
includeMilestones: true includeMilestones: true

View File

@ -91,7 +91,7 @@ export async function getReportData(
printConfig.params.includes('workOrderId') && printConfig.params.includes('workOrderId') &&
typeof requestQuery.workOrderId === 'string' typeof requestQuery.workOrderId === 'string'
) { ) {
reportData.workOrder = getWorkOrder(requestQuery.workOrderId, { reportData.workOrder = await getWorkOrder(requestQuery.workOrderId, {
includeLotsAndLotOccupancies: true, includeLotsAndLotOccupancies: true,
includeComments: true, includeComments: true,
includeMilestones: true includeMilestones: true

View File

@ -76,8 +76,9 @@ export function getOccupantNameWhereClause(occupantName = '', tableAlias = 'o')
if (occupantNamePiece === '') { if (occupantNamePiece === '') {
continue; continue;
} }
sqlWhereClause += ` and instr(lower(${tableAlias}.occupantName), ?)`; sqlWhereClause += ` and (instr(lower(${tableAlias}.occupantName), ?)
sqlParameters.push(occupantNamePiece); or instr(lower(${tableAlias}.occupantFamilyName), ?))`;
sqlParameters.push(occupantNamePiece, occupantNamePiece);
} }
} }
return { return {

View File

@ -108,8 +108,9 @@ export function getOccupantNameWhereClause(
continue continue
} }
sqlWhereClause += ` and instr(lower(${tableAlias}.occupantName), ?)` sqlWhereClause += ` and (instr(lower(${tableAlias}.occupantName), ?)
sqlParameters.push(occupantNamePiece) or instr(lower(${tableAlias}.occupantFamilyName), ?))`
sqlParameters.push(occupantNamePiece, occupantNamePiece)
} }
} }

View File

@ -9,6 +9,7 @@ interface AddLotOccupancyForm {
[lotOccupancyFieldValue_occupancyTypeFieldId: string]: unknown; [lotOccupancyFieldValue_occupancyTypeFieldId: string]: unknown;
lotOccupantTypeId?: string; lotOccupantTypeId?: string;
occupantName?: string; occupantName?: string;
occupantFamilyName?: string;
occupantAddress1?: string; occupantAddress1?: string;
occupantAddress2?: string; occupantAddress2?: string;
occupantCity?: string; occupantCity?: string;

View File

@ -36,6 +36,7 @@ export async function addLotOccupancy(lotOccupancyForm, requestSession, connecte
lotOccupancyId, lotOccupancyId,
lotOccupantTypeId: lotOccupancyForm.lotOccupantTypeId, lotOccupantTypeId: lotOccupancyForm.lotOccupantTypeId,
occupantName: lotOccupancyForm.occupantName, occupantName: lotOccupancyForm.occupantName,
occupantFamilyName: lotOccupancyForm.occupantFamilyName,
occupantAddress1: lotOccupancyForm.occupantAddress1, occupantAddress1: lotOccupancyForm.occupantAddress1,
occupantAddress2: lotOccupancyForm.occupantAddress2, occupantAddress2: lotOccupancyForm.occupantAddress2,
occupantCity: lotOccupancyForm.occupantCity, occupantCity: lotOccupancyForm.occupantCity,

View File

@ -20,6 +20,7 @@ interface AddLotOccupancyForm {
lotOccupantTypeId?: string lotOccupantTypeId?: string
occupantName?: string occupantName?: string
occupantFamilyName?: string
occupantAddress1?: string occupantAddress1?: string
occupantAddress2?: string occupantAddress2?: string
occupantCity?: string occupantCity?: string
@ -102,6 +103,7 @@ export async function addLotOccupancy(
lotOccupancyId, lotOccupancyId,
lotOccupantTypeId: lotOccupancyForm.lotOccupantTypeId!, lotOccupantTypeId: lotOccupancyForm.lotOccupantTypeId!,
occupantName: lotOccupancyForm.occupantName!, occupantName: lotOccupancyForm.occupantName!,
occupantFamilyName: lotOccupancyForm.occupantFamilyName!,
occupantAddress1: lotOccupancyForm.occupantAddress1!, occupantAddress1: lotOccupancyForm.occupantAddress1!,
occupantAddress2: lotOccupancyForm.occupantAddress2!, occupantAddress2: lotOccupancyForm.occupantAddress2!,
occupantCity: lotOccupancyForm.occupantCity!, occupantCity: lotOccupancyForm.occupantCity!,

View File

@ -4,6 +4,7 @@ interface AddLotOccupancyOccupantForm {
lotOccupancyId: string | number; lotOccupancyId: string | number;
lotOccupantTypeId: string | number; lotOccupantTypeId: string | number;
occupantName: string; occupantName: string;
occupantFamilyName: string;
occupantAddress1: string; occupantAddress1: string;
occupantAddress2: string; occupantAddress2: string;
occupantCity: string; occupantCity: string;

View File

@ -16,7 +16,7 @@ export async function addLotOccupancyOccupant(lotOccupancyOccupantForm, requestS
database database
.prepare(`insert into LotOccupancyOccupants ( .prepare(`insert into LotOccupancyOccupants (
lotOccupancyId, lotOccupantIndex, lotOccupancyId, lotOccupantIndex,
occupantName, occupantName, occupantFamilyName,
occupantAddress1, occupantAddress2, occupantAddress1, occupantAddress2,
occupantCity, occupantProvince, occupantPostalCode, occupantCity, occupantProvince, occupantPostalCode,
occupantPhoneNumber, occupantEmailAddress, occupantPhoneNumber, occupantEmailAddress,
@ -24,8 +24,8 @@ export async function addLotOccupancyOccupant(lotOccupancyOccupantForm, requestS
lotOccupantTypeId, lotOccupantTypeId,
recordCreate_userName, recordCreate_timeMillis, recordCreate_userName, recordCreate_timeMillis,
recordUpdate_userName, recordUpdate_timeMillis) recordUpdate_userName, recordUpdate_timeMillis)
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`)
.run(lotOccupancyOccupantForm.lotOccupancyId, lotOccupantIndex, lotOccupancyOccupantForm.occupantName, lotOccupancyOccupantForm.occupantAddress1, lotOccupancyOccupantForm.occupantAddress2, lotOccupancyOccupantForm.occupantCity, lotOccupancyOccupantForm.occupantProvince, lotOccupancyOccupantForm.occupantPostalCode, lotOccupancyOccupantForm.occupantPhoneNumber, lotOccupancyOccupantForm.occupantEmailAddress, lotOccupancyOccupantForm.occupantComment ?? '', lotOccupancyOccupantForm.lotOccupantTypeId, requestSession.user.userName, rightNowMillis, requestSession.user.userName, rightNowMillis); .run(lotOccupancyOccupantForm.lotOccupancyId, lotOccupantIndex, lotOccupancyOccupantForm.occupantName, lotOccupancyOccupantForm.occupantFamilyName, lotOccupancyOccupantForm.occupantAddress1, lotOccupancyOccupantForm.occupantAddress2, lotOccupancyOccupantForm.occupantCity, lotOccupancyOccupantForm.occupantProvince, lotOccupancyOccupantForm.occupantPostalCode, lotOccupancyOccupantForm.occupantPhoneNumber, lotOccupancyOccupantForm.occupantEmailAddress, lotOccupancyOccupantForm.occupantComment ?? '', lotOccupancyOccupantForm.lotOccupantTypeId, requestSession.user.userName, rightNowMillis, requestSession.user.userName, rightNowMillis);
if (connectedDatabase === undefined) { if (connectedDatabase === undefined) {
database.release(); database.release();
} }

View File

@ -7,6 +7,7 @@ interface AddLotOccupancyOccupantForm {
lotOccupancyId: string | number lotOccupancyId: string | number
lotOccupantTypeId: string | number lotOccupantTypeId: string | number
occupantName: string occupantName: string
occupantFamilyName: string
occupantAddress1: string occupantAddress1: string
occupantAddress2: string occupantAddress2: string
occupantCity: string occupantCity: string
@ -46,7 +47,7 @@ export async function addLotOccupancyOccupant(
.prepare( .prepare(
`insert into LotOccupancyOccupants ( `insert into LotOccupancyOccupants (
lotOccupancyId, lotOccupantIndex, lotOccupancyId, lotOccupantIndex,
occupantName, occupantName, occupantFamilyName,
occupantAddress1, occupantAddress2, occupantAddress1, occupantAddress2,
occupantCity, occupantProvince, occupantPostalCode, occupantCity, occupantProvince, occupantPostalCode,
occupantPhoneNumber, occupantEmailAddress, occupantPhoneNumber, occupantEmailAddress,
@ -54,12 +55,13 @@ export async function addLotOccupancyOccupant(
lotOccupantTypeId, lotOccupantTypeId,
recordCreate_userName, recordCreate_timeMillis, recordCreate_userName, recordCreate_timeMillis,
recordUpdate_userName, recordUpdate_timeMillis) recordUpdate_userName, recordUpdate_timeMillis)
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
) )
.run( .run(
lotOccupancyOccupantForm.lotOccupancyId, lotOccupancyOccupantForm.lotOccupancyId,
lotOccupantIndex, lotOccupantIndex,
lotOccupancyOccupantForm.occupantName, lotOccupancyOccupantForm.occupantName,
lotOccupancyOccupantForm.occupantFamilyName,
lotOccupancyOccupantForm.occupantAddress1, lotOccupancyOccupantForm.occupantAddress1,
lotOccupancyOccupantForm.occupantAddress2, lotOccupancyOccupantForm.occupantAddress2,
lotOccupancyOccupantForm.occupantCity, lotOccupancyOccupantForm.occupantCity,

View File

@ -27,6 +27,7 @@ export async function copyLotOccupancy(oldLotOccupancyId, requestSession) {
lotOccupancyId: newLotOccupancyId, lotOccupancyId: newLotOccupancyId,
lotOccupantTypeId: occupant.lotOccupantTypeId, lotOccupantTypeId: occupant.lotOccupantTypeId,
occupantName: occupant.occupantName, occupantName: occupant.occupantName,
occupantFamilyName: occupant.occupantFamilyName,
occupantAddress1: occupant.occupantAddress1, occupantAddress1: occupant.occupantAddress1,
occupantAddress2: occupant.occupantAddress2, occupantAddress2: occupant.occupantAddress2,
occupantCity: occupant.occupantCity, occupantCity: occupant.occupantCity,

View File

@ -63,6 +63,7 @@ export async function copyLotOccupancy(
lotOccupancyId: newLotOccupancyId, lotOccupancyId: newLotOccupancyId,
lotOccupantTypeId: occupant.lotOccupantTypeId!, lotOccupantTypeId: occupant.lotOccupantTypeId!,
occupantName: occupant.occupantName!, occupantName: occupant.occupantName!,
occupantFamilyName: occupant.occupantFamilyName!,
occupantAddress1: occupant.occupantAddress1!, occupantAddress1: occupant.occupantAddress1!,
occupantAddress2: occupant.occupantAddress2!, occupantAddress2: occupant.occupantAddress2!,
occupantCity: occupant.occupantCity!, occupantCity: occupant.occupantCity!,

View File

@ -3,7 +3,7 @@ export async function getLotOccupancyOccupants(lotOccupancyId, connectedDatabase
const database = connectedDatabase ?? (await acquireConnection()); const database = connectedDatabase ?? (await acquireConnection());
const lotOccupancyOccupants = database const lotOccupancyOccupants = database
.prepare(`select o.lotOccupancyId, o.lotOccupantIndex, .prepare(`select o.lotOccupancyId, o.lotOccupantIndex,
o.occupantName, o.occupantName, o.occupantFamilyName,
o.occupantAddress1, o.occupantAddress2, o.occupantAddress1, o.occupantAddress2,
o.occupantCity, o.occupantProvince, o.occupantPostalCode, o.occupantCity, o.occupantProvince, o.occupantPostalCode,
o.occupantPhoneNumber, o.occupantEmailAddress, o.occupantPhoneNumber, o.occupantEmailAddress,

View File

@ -12,7 +12,7 @@ export async function getLotOccupancyOccupants(
const lotOccupancyOccupants: recordTypes.LotOccupancyOccupant[] = database const lotOccupancyOccupants: recordTypes.LotOccupancyOccupant[] = database
.prepare( .prepare(
`select o.lotOccupancyId, o.lotOccupantIndex, `select o.lotOccupancyId, o.lotOccupantIndex,
o.occupantName, o.occupantName, o.occupantFamilyName,
o.occupantAddress1, o.occupantAddress2, o.occupantAddress1, o.occupantAddress2,
o.occupantCity, o.occupantProvince, o.occupantPostalCode, o.occupantCity, o.occupantProvince, o.occupantPostalCode,
o.occupantPhoneNumber, o.occupantEmailAddress, o.occupantPhoneNumber, o.occupantEmailAddress,

View File

@ -11,13 +11,14 @@ export async function getPastLotOccupancyOccupants(filters, options) {
} }
sqlWhereClause += sqlWhereClause +=
" and (o.occupantName like '%' || ? || '%'" + " and (o.occupantName like '%' || ? || '%'" +
" or o.occupantFamilyName like '%' || ? || '%'" +
" or o.occupantAddress1 like '%' || ? || '%'" + " or o.occupantAddress1 like '%' || ? || '%'" +
" or o.occupantAddress2 like '%' || ? || '%'" + " or o.occupantAddress2 like '%' || ? || '%'" +
" or o.occupantCity like '%' || ? || '%')"; " or o.occupantCity like '%' || ? || '%')";
sqlParameters.push(searchFilterPiece, searchFilterPiece, searchFilterPiece, searchFilterPiece); sqlParameters.push(searchFilterPiece, searchFilterPiece, searchFilterPiece, searchFilterPiece, searchFilterPiece);
} }
} }
const sql = `select o.occupantName, const sql = `select o.occupantName, o.occupantFamilyName,
o.occupantAddress1, o.occupantAddress2, o.occupantAddress1, o.occupantAddress2,
o.occupantCity, o.occupantProvince, o.occupantPostalCode, o.occupantCity, o.occupantProvince, o.occupantPostalCode,
o.occupantPhoneNumber, o.occupantEmailAddress, o.occupantPhoneNumber, o.occupantEmailAddress,

View File

@ -31,6 +31,7 @@ export async function getPastLotOccupancyOccupants(
sqlWhereClause += sqlWhereClause +=
" and (o.occupantName like '%' || ? || '%'" + " and (o.occupantName like '%' || ? || '%'" +
" or o.occupantFamilyName like '%' || ? || '%'" +
" or o.occupantAddress1 like '%' || ? || '%'" + " or o.occupantAddress1 like '%' || ? || '%'" +
" or o.occupantAddress2 like '%' || ? || '%'" + " or o.occupantAddress2 like '%' || ? || '%'" +
" or o.occupantCity like '%' || ? || '%')" " or o.occupantCity like '%' || ? || '%')"
@ -39,12 +40,13 @@ export async function getPastLotOccupancyOccupants(
searchFilterPiece, searchFilterPiece,
searchFilterPiece, searchFilterPiece,
searchFilterPiece, searchFilterPiece,
searchFilterPiece,
searchFilterPiece searchFilterPiece
) )
} }
} }
const sql = `select o.occupantName, const sql = `select o.occupantName, o.occupantFamilyName,
o.occupantAddress1, o.occupantAddress2, o.occupantAddress1, o.occupantAddress2,
o.occupantCity, o.occupantProvince, o.occupantPostalCode, o.occupantCity, o.occupantProvince, o.occupantPostalCode,
o.occupantPhoneNumber, o.occupantEmailAddress, o.occupantPhoneNumber, o.occupantEmailAddress,

View File

@ -25,6 +25,7 @@ const occupantCamelCase = camelCase(configFunctions.getProperty('aliases.occupan
const lotOccupantIndexAlias = occupantCamelCase + 'Index'; const lotOccupantIndexAlias = occupantCamelCase + 'Index';
const lotOccupantTypeAlias = occupantCamelCase + 'Type'; const lotOccupantTypeAlias = occupantCamelCase + 'Type';
const occupantNameAlias = occupantCamelCase + 'Name'; const occupantNameAlias = occupantCamelCase + 'Name';
const occupantFamilyNameAlias = occupantCamelCase + 'FamilyName';
const occupantAddress1Alias = occupantCamelCase + 'Address1'; const occupantAddress1Alias = occupantCamelCase + 'Address1';
const occupantAddress2Alias = occupantCamelCase + 'Address2'; const occupantAddress2Alias = occupantCamelCase + 'Address2';
const occupantCityAlias = occupantCamelCase + 'City'; const occupantCityAlias = occupantCamelCase + 'City';
@ -154,6 +155,7 @@ export async function getReportData(reportName, reportParameters = {}) {
sql = `select o.lotOccupantIndex as ${lotOccupantIndexAlias}, sql = `select o.lotOccupantIndex as ${lotOccupantIndexAlias},
t.lotOccupantType as ${lotOccupantTypeAlias}, t.lotOccupantType as ${lotOccupantTypeAlias},
o.occupantName as ${occupantNameAlias}, o.occupantName as ${occupantNameAlias},
o.occupantFamilyName as ${occupantFamilyNameAlias},
o.occupantAddress1 as ${occupantAddress1Alias}, o.occupantAddress1 as ${occupantAddress1Alias},
o.occupantAddress2 as ${occupantAddress2Alias}, o.occupantAddress2 as ${occupantAddress2Alias},
o.occupantCity as ${occupantCityAlias}, o.occupantCity as ${occupantCityAlias},

View File

@ -39,6 +39,7 @@ const occupantCamelCase = camelCase(
const lotOccupantIndexAlias = occupantCamelCase + 'Index' const lotOccupantIndexAlias = occupantCamelCase + 'Index'
const lotOccupantTypeAlias = occupantCamelCase + 'Type' const lotOccupantTypeAlias = occupantCamelCase + 'Type'
const occupantNameAlias = occupantCamelCase + 'Name' const occupantNameAlias = occupantCamelCase + 'Name'
const occupantFamilyNameAlias = occupantCamelCase + 'FamilyName'
const occupantAddress1Alias = occupantCamelCase + 'Address1' const occupantAddress1Alias = occupantCamelCase + 'Address1'
const occupantAddress2Alias = occupantCamelCase + 'Address2' const occupantAddress2Alias = occupantCamelCase + 'Address2'
const occupantCityAlias = occupantCamelCase + 'City' const occupantCityAlias = occupantCamelCase + 'City'
@ -199,6 +200,7 @@ export async function getReportData(
sql = `select o.lotOccupantIndex as ${lotOccupantIndexAlias}, sql = `select o.lotOccupantIndex as ${lotOccupantIndexAlias},
t.lotOccupantType as ${lotOccupantTypeAlias}, t.lotOccupantType as ${lotOccupantTypeAlias},
o.occupantName as ${occupantNameAlias}, o.occupantName as ${occupantNameAlias},
o.occupantFamilyName as ${occupantFamilyNameAlias},
o.occupantAddress1 as ${occupantAddress1Alias}, o.occupantAddress1 as ${occupantAddress1Alias},
o.occupantAddress2 as ${occupantAddress2Alias}, o.occupantAddress2 as ${occupantAddress2Alias},
o.occupantCity as ${occupantCityAlias}, o.occupantCity as ${occupantCityAlias},

View File

@ -4,6 +4,7 @@ interface UpdateLotOccupancyOccupantForm {
lotOccupantIndex: string | number; lotOccupantIndex: string | number;
lotOccupantTypeId: string | number; lotOccupantTypeId: string | number;
occupantName: string; occupantName: string;
occupantFamilyName: string;
occupantAddress1: string; occupantAddress1: string;
occupantAddress2: string; occupantAddress2: string;
occupantCity: string; occupantCity: string;

View File

@ -5,6 +5,7 @@ export async function updateLotOccupancyOccupant(lotOccupancyOccupantForm, reque
const results = database const results = database
.prepare(`update LotOccupancyOccupants .prepare(`update LotOccupancyOccupants
set occupantName = ?, set occupantName = ?,
occupantFamilyName = ?,
occupantAddress1 = ?, occupantAddress1 = ?,
occupantAddress2 = ?, occupantAddress2 = ?,
occupantCity = ?, occupantCity = ?,
@ -19,7 +20,7 @@ export async function updateLotOccupancyOccupant(lotOccupancyOccupantForm, reque
where recordDelete_timeMillis is null where recordDelete_timeMillis is null
and lotOccupancyId = ? and lotOccupancyId = ?
and lotOccupantIndex = ?`) and lotOccupantIndex = ?`)
.run(lotOccupancyOccupantForm.occupantName, lotOccupancyOccupantForm.occupantAddress1, lotOccupancyOccupantForm.occupantAddress2, lotOccupancyOccupantForm.occupantCity, lotOccupancyOccupantForm.occupantProvince, lotOccupancyOccupantForm.occupantPostalCode, lotOccupancyOccupantForm.occupantPhoneNumber, lotOccupancyOccupantForm.occupantEmailAddress, lotOccupancyOccupantForm.occupantComment, lotOccupancyOccupantForm.lotOccupantTypeId, requestSession.user.userName, rightNowMillis, lotOccupancyOccupantForm.lotOccupancyId, lotOccupancyOccupantForm.lotOccupantIndex); .run(lotOccupancyOccupantForm.occupantName, lotOccupancyOccupantForm.occupantFamilyName, lotOccupancyOccupantForm.occupantAddress1, lotOccupancyOccupantForm.occupantAddress2, lotOccupancyOccupantForm.occupantCity, lotOccupancyOccupantForm.occupantProvince, lotOccupancyOccupantForm.occupantPostalCode, lotOccupancyOccupantForm.occupantPhoneNumber, lotOccupancyOccupantForm.occupantEmailAddress, lotOccupancyOccupantForm.occupantComment, lotOccupancyOccupantForm.lotOccupantTypeId, requestSession.user.userName, rightNowMillis, lotOccupancyOccupantForm.lotOccupancyId, lotOccupancyOccupantForm.lotOccupantIndex);
database.release(); database.release();
return results.changes > 0; return results.changes > 0;
} }

View File

@ -7,6 +7,7 @@ interface UpdateLotOccupancyOccupantForm {
lotOccupantIndex: string | number lotOccupantIndex: string | number
lotOccupantTypeId: string | number lotOccupantTypeId: string | number
occupantName: string occupantName: string
occupantFamilyName: string
occupantAddress1: string occupantAddress1: string
occupantAddress2: string occupantAddress2: string
occupantCity: string occupantCity: string
@ -29,6 +30,7 @@ export async function updateLotOccupancyOccupant(
.prepare( .prepare(
`update LotOccupancyOccupants `update LotOccupancyOccupants
set occupantName = ?, set occupantName = ?,
occupantFamilyName = ?,
occupantAddress1 = ?, occupantAddress1 = ?,
occupantAddress2 = ?, occupantAddress2 = ?,
occupantCity = ?, occupantCity = ?,
@ -46,6 +48,7 @@ export async function updateLotOccupancyOccupant(
) )
.run( .run(
lotOccupancyOccupantForm.occupantName, lotOccupancyOccupantForm.occupantName,
lotOccupancyOccupantForm.occupantFamilyName,
lotOccupancyOccupantForm.occupantAddress1, lotOccupancyOccupantForm.occupantAddress1,
lotOccupancyOccupantForm.occupantAddress2, lotOccupancyOccupantForm.occupantAddress2,
lotOccupancyOccupantForm.occupantCity, lotOccupancyOccupantForm.occupantCity,

View File

@ -526,6 +526,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
} }
modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass}" aria-hidden="true"></i>`; modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass}" aria-hidden="true"></i>`;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantName').value = lotOccupancyOccupant.occupantName; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantName').value = lotOccupancyOccupant.occupantName;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantFamilyName').value = lotOccupancyOccupant.occupantFamilyName;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress1').value = lotOccupancyOccupant.occupantAddress1; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress1').value = lotOccupancyOccupant.occupantAddress1;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress2').value = lotOccupancyOccupant.occupantAddress2; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress2').value = lotOccupancyOccupant.occupantAddress2;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantCity').value = lotOccupancyOccupant.occupantCity; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantCity').value = lotOccupancyOccupant.occupantCity;
@ -598,7 +599,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
}); });
} }
function renderLotOccupancyOccupants() { function renderLotOccupancyOccupants() {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants'); const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants');
cityssm.clearElement(occupantsContainer); cityssm.clearElement(occupantsContainer);
if (lotOccupancyOccupants.length === 0) { if (lotOccupancyOccupants.length === 0) {
@ -623,9 +624,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
lotOccupancyOccupant.lotOccupantIndex.toString(); lotOccupancyOccupant.lotOccupantIndex.toString();
tableRowElement.innerHTML = tableRowElement.innerHTML =
'<td>' + '<td>' +
cityssm.escapeHTML(((_a = lotOccupancyOccupant.occupantName) !== null && _a !== void 0 ? _a : '') === '' cityssm.escapeHTML(((_a = lotOccupancyOccupant.occupantName) !== null && _a !== void 0 ? _a : '') === '' && ((_b = lotOccupancyOccupant.occupantFamilyName) !== null && _b !== void 0 ? _b : '') === ''
? '(No Name)' ? '(No Name)'
: lotOccupancyOccupant.occupantName) + : lotOccupancyOccupant.occupantName + ' ' + lotOccupancyOccupant.occupantFamilyName) +
'<br />' + '<br />' +
('<span class="tag">' + ('<span class="tag">' +
'<i class="fas fa-fw fa-' + '<i class="fas fa-fw fa-' +
@ -637,37 +638,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
'</span>') + '</span>') +
'</td>' + '</td>' +
('<td>' + ('<td>' +
(((_b = lotOccupancyOccupant.occupantAddress1) !== null && _b !== void 0 ? _b : '') === '' (((_c = lotOccupancyOccupant.occupantAddress1) !== null && _c !== void 0 ? _c : '') === ''
? '' ? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1) + : cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1) +
'<br />') + '<br />') +
(((_c = lotOccupancyOccupant.occupantAddress2) !== null && _c !== void 0 ? _c : '') === '' (((_d = lotOccupancyOccupant.occupantAddress2) !== null && _d !== void 0 ? _d : '') === ''
? '' ? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2) + : cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2) +
'<br />') + '<br />') +
(((_d = lotOccupancyOccupant.occupantCity) !== null && _d !== void 0 ? _d : '') === '' (((_e = lotOccupancyOccupant.occupantCity) !== null && _e !== void 0 ? _e : '') === ''
? '' ? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', ') + : cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', ') +
cityssm.escapeHTML((_e = lotOccupancyOccupant.occupantProvince) !== null && _e !== void 0 ? _e : '') + cityssm.escapeHTML((_f = lotOccupancyOccupant.occupantProvince) !== null && _f !== void 0 ? _f : '') +
'<br />' + '<br />' +
cityssm.escapeHTML((_f = lotOccupancyOccupant.occupantPostalCode) !== null && _f !== void 0 ? _f : '') + cityssm.escapeHTML((_g = lotOccupancyOccupant.occupantPostalCode) !== null && _g !== void 0 ? _g : '') +
'</td>') + '</td>') +
('<td>' + ('<td>' +
(((_g = lotOccupancyOccupant.occupantPhoneNumber) !== null && _g !== void 0 ? _g : '') === '' (((_h = lotOccupancyOccupant.occupantPhoneNumber) !== null && _h !== void 0 ? _h : '') === ''
? '' ? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber) + : cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber) +
'<br />') + '<br />') +
(((_h = lotOccupancyOccupant.occupantEmailAddress) !== null && _h !== void 0 ? _h : '') === '' (((_j = lotOccupancyOccupant.occupantEmailAddress) !== null && _j !== void 0 ? _j : '') === ''
? '' ? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantEmailAddress)) + : cityssm.escapeHTML(lotOccupancyOccupant.occupantEmailAddress)) +
'</td>') + '</td>') +
('<td>' + ('<td>' +
'<span data-tooltip="' + '<span data-tooltip="' +
cityssm.escapeHTML(((_j = lotOccupancyOccupant.occupantCommentTitle) !== null && _j !== void 0 ? _j : '') === '' cityssm.escapeHTML(((_k = lotOccupancyOccupant.occupantCommentTitle) !== null && _k !== void 0 ? _k : '') === ''
? 'Comment' ? 'Comment'
: lotOccupancyOccupant.occupantCommentTitle) + : lotOccupancyOccupant.occupantCommentTitle) +
'">' + '">' +
cityssm.escapeHTML((_k = lotOccupancyOccupant.occupantComment) !== null && _k !== void 0 ? _k : '') + cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantComment) !== null && _l !== void 0 ? _l : '') +
'</span>' + '</span>' +
'</td>') + '</td>') +
('<td class="is-hidden-print">' + ('<td class="is-hidden-print">' +
@ -773,7 +774,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
searchResultsElement.innerHTML = searchResultsElement.innerHTML =
los.getLoadingParagraphHTML('Searching...'); los.getLoadingParagraphHTML('Searching...');
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (rawResponseJSON) => { cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (rawResponseJSON) => {
var _a, _b, _c, _d, _e, _f, _g, _h; var _a, _b, _c, _d, _e, _f, _g, _h, _j;
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
pastOccupantSearchResults = responseJSON.occupants; pastOccupantSearchResults = responseJSON.occupants;
const panelElement = document.createElement('div'); const panelElement = document.createElement('div');
@ -785,27 +786,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
panelBlockElement.innerHTML = panelBlockElement.innerHTML =
'<strong>' + '<strong>' +
cityssm.escapeHTML((_a = occupant.occupantName) !== null && _a !== void 0 ? _a : '') + cityssm.escapeHTML((_a = occupant.occupantName) !== null && _a !== void 0 ? _a : '') +
' ' +
cityssm.escapeHTML((_b = occupant.occupantFamilyName) !== null && _b !== void 0 ? _b : '') +
'</strong>' + '</strong>' +
'<br />' + '<br />' +
'<div class="columns">' + '<div class="columns">' +
('<div class="column">' + ('<div class="column">' +
cityssm.escapeHTML((_b = occupant.occupantAddress1) !== null && _b !== void 0 ? _b : '') + cityssm.escapeHTML((_c = occupant.occupantAddress1) !== null && _c !== void 0 ? _c : '') +
'<br />' + '<br />' +
(((_c = occupant.occupantAddress2) !== null && _c !== void 0 ? _c : '') === '' (((_d = occupant.occupantAddress2) !== null && _d !== void 0 ? _d : '') === ''
? '' ? ''
: cityssm.escapeHTML(occupant.occupantAddress2) + '<br />') + : cityssm.escapeHTML(occupant.occupantAddress2) + '<br />') +
cityssm.escapeHTML((_d = occupant.occupantCity) !== null && _d !== void 0 ? _d : '') + cityssm.escapeHTML((_e = occupant.occupantCity) !== null && _e !== void 0 ? _e : '') +
', ' + ', ' +
cityssm.escapeHTML((_e = occupant.occupantProvince) !== null && _e !== void 0 ? _e : '') + cityssm.escapeHTML((_f = occupant.occupantProvince) !== null && _f !== void 0 ? _f : '') +
'<br />' + '<br />' +
cityssm.escapeHTML((_f = occupant.occupantPostalCode) !== null && _f !== void 0 ? _f : '') + cityssm.escapeHTML((_g = occupant.occupantPostalCode) !== null && _g !== void 0 ? _g : '') +
'</div>') + '</div>') +
('<div class="column">' + ('<div class="column">' +
(((_g = occupant.occupantPhoneNumber) !== null && _g !== void 0 ? _g : '') === '' (((_h = occupant.occupantPhoneNumber) !== null && _h !== void 0 ? _h : '') === ''
? '' ? ''
: cityssm.escapeHTML(occupant.occupantPhoneNumber) + : cityssm.escapeHTML(occupant.occupantPhoneNumber) +
'<br />') + '<br />') +
cityssm.escapeHTML((_h = occupant.occupantEmailAddress) !== null && _h !== void 0 ? _h : '') + cityssm.escapeHTML((_j = occupant.occupantEmailAddress) !== null && _j !== void 0 ? _j : '') +
'<br />' + '<br />' +
'</div>') + '</div>') +
'</div>'; '</div>';

View File

@ -67,6 +67,7 @@ function openEditLotOccupancyOccupant(clickEvent) {
} }
modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass}" aria-hidden="true"></i>`; modalElement.querySelector('#lotOccupancyOccupantEdit--fontAwesomeIconClass').innerHTML = `<i class="fas fa-fw fa-${lotOccupancyOccupant.fontAwesomeIconClass}" aria-hidden="true"></i>`;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantName').value = lotOccupancyOccupant.occupantName; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantName').value = lotOccupancyOccupant.occupantName;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantFamilyName').value = lotOccupancyOccupant.occupantFamilyName;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress1').value = lotOccupancyOccupant.occupantAddress1; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress1').value = lotOccupancyOccupant.occupantAddress1;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress2').value = lotOccupancyOccupant.occupantAddress2; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantAddress2').value = lotOccupancyOccupant.occupantAddress2;
modalElement.querySelector('#lotOccupancyOccupantEdit--occupantCity').value = lotOccupancyOccupant.occupantCity; modalElement.querySelector('#lotOccupancyOccupantEdit--occupantCity').value = lotOccupancyOccupant.occupantCity;
@ -139,7 +140,7 @@ function deleteLotOccupancyOccupant(clickEvent) {
}); });
} }
function renderLotOccupancyOccupants() { function renderLotOccupancyOccupants() {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants'); const occupantsContainer = document.querySelector('#container--lotOccupancyOccupants');
cityssm.clearElement(occupantsContainer); cityssm.clearElement(occupantsContainer);
if (lotOccupancyOccupants.length === 0) { if (lotOccupancyOccupants.length === 0) {
@ -164,9 +165,9 @@ function renderLotOccupancyOccupants() {
lotOccupancyOccupant.lotOccupantIndex.toString(); lotOccupancyOccupant.lotOccupantIndex.toString();
tableRowElement.innerHTML = tableRowElement.innerHTML =
'<td>' + '<td>' +
cityssm.escapeHTML(((_a = lotOccupancyOccupant.occupantName) !== null && _a !== void 0 ? _a : '') === '' cityssm.escapeHTML(((_a = lotOccupancyOccupant.occupantName) !== null && _a !== void 0 ? _a : '') === '' && ((_b = lotOccupancyOccupant.occupantFamilyName) !== null && _b !== void 0 ? _b : '') === ''
? '(No Name)' ? '(No Name)'
: lotOccupancyOccupant.occupantName) + : lotOccupancyOccupant.occupantName + ' ' + lotOccupancyOccupant.occupantFamilyName) +
'<br />' + '<br />' +
('<span class="tag">' + ('<span class="tag">' +
'<i class="fas fa-fw fa-' + '<i class="fas fa-fw fa-' +
@ -178,37 +179,37 @@ function renderLotOccupancyOccupants() {
'</span>') + '</span>') +
'</td>' + '</td>' +
('<td>' + ('<td>' +
(((_b = lotOccupancyOccupant.occupantAddress1) !== null && _b !== void 0 ? _b : '') === '' (((_c = lotOccupancyOccupant.occupantAddress1) !== null && _c !== void 0 ? _c : '') === ''
? '' ? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1) + : cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1) +
'<br />') + '<br />') +
(((_c = lotOccupancyOccupant.occupantAddress2) !== null && _c !== void 0 ? _c : '') === '' (((_d = lotOccupancyOccupant.occupantAddress2) !== null && _d !== void 0 ? _d : '') === ''
? '' ? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2) + : cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2) +
'<br />') + '<br />') +
(((_d = lotOccupancyOccupant.occupantCity) !== null && _d !== void 0 ? _d : '') === '' (((_e = lotOccupancyOccupant.occupantCity) !== null && _e !== void 0 ? _e : '') === ''
? '' ? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', ') + : cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ', ') +
cityssm.escapeHTML((_e = lotOccupancyOccupant.occupantProvince) !== null && _e !== void 0 ? _e : '') + cityssm.escapeHTML((_f = lotOccupancyOccupant.occupantProvince) !== null && _f !== void 0 ? _f : '') +
'<br />' + '<br />' +
cityssm.escapeHTML((_f = lotOccupancyOccupant.occupantPostalCode) !== null && _f !== void 0 ? _f : '') + cityssm.escapeHTML((_g = lotOccupancyOccupant.occupantPostalCode) !== null && _g !== void 0 ? _g : '') +
'</td>') + '</td>') +
('<td>' + ('<td>' +
(((_g = lotOccupancyOccupant.occupantPhoneNumber) !== null && _g !== void 0 ? _g : '') === '' (((_h = lotOccupancyOccupant.occupantPhoneNumber) !== null && _h !== void 0 ? _h : '') === ''
? '' ? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber) + : cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber) +
'<br />') + '<br />') +
(((_h = lotOccupancyOccupant.occupantEmailAddress) !== null && _h !== void 0 ? _h : '') === '' (((_j = lotOccupancyOccupant.occupantEmailAddress) !== null && _j !== void 0 ? _j : '') === ''
? '' ? ''
: cityssm.escapeHTML(lotOccupancyOccupant.occupantEmailAddress)) + : cityssm.escapeHTML(lotOccupancyOccupant.occupantEmailAddress)) +
'</td>') + '</td>') +
('<td>' + ('<td>' +
'<span data-tooltip="' + '<span data-tooltip="' +
cityssm.escapeHTML(((_j = lotOccupancyOccupant.occupantCommentTitle) !== null && _j !== void 0 ? _j : '') === '' cityssm.escapeHTML(((_k = lotOccupancyOccupant.occupantCommentTitle) !== null && _k !== void 0 ? _k : '') === ''
? 'Comment' ? 'Comment'
: lotOccupancyOccupant.occupantCommentTitle) + : lotOccupancyOccupant.occupantCommentTitle) +
'">' + '">' +
cityssm.escapeHTML((_k = lotOccupancyOccupant.occupantComment) !== null && _k !== void 0 ? _k : '') + cityssm.escapeHTML((_l = lotOccupancyOccupant.occupantComment) !== null && _l !== void 0 ? _l : '') +
'</span>' + '</span>' +
'</td>') + '</td>') +
('<td class="is-hidden-print">' + ('<td class="is-hidden-print">' +
@ -314,7 +315,7 @@ else {
searchResultsElement.innerHTML = searchResultsElement.innerHTML =
los.getLoadingParagraphHTML('Searching...'); los.getLoadingParagraphHTML('Searching...');
cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (rawResponseJSON) => { cityssm.postJSON(los.urlPrefix + '/lotOccupancies/doSearchPastOccupants', searchFormElement, (rawResponseJSON) => {
var _a, _b, _c, _d, _e, _f, _g, _h; var _a, _b, _c, _d, _e, _f, _g, _h, _j;
const responseJSON = rawResponseJSON; const responseJSON = rawResponseJSON;
pastOccupantSearchResults = responseJSON.occupants; pastOccupantSearchResults = responseJSON.occupants;
const panelElement = document.createElement('div'); const panelElement = document.createElement('div');
@ -326,27 +327,29 @@ else {
panelBlockElement.innerHTML = panelBlockElement.innerHTML =
'<strong>' + '<strong>' +
cityssm.escapeHTML((_a = occupant.occupantName) !== null && _a !== void 0 ? _a : '') + cityssm.escapeHTML((_a = occupant.occupantName) !== null && _a !== void 0 ? _a : '') +
' ' +
cityssm.escapeHTML((_b = occupant.occupantFamilyName) !== null && _b !== void 0 ? _b : '') +
'</strong>' + '</strong>' +
'<br />' + '<br />' +
'<div class="columns">' + '<div class="columns">' +
('<div class="column">' + ('<div class="column">' +
cityssm.escapeHTML((_b = occupant.occupantAddress1) !== null && _b !== void 0 ? _b : '') + cityssm.escapeHTML((_c = occupant.occupantAddress1) !== null && _c !== void 0 ? _c : '') +
'<br />' + '<br />' +
(((_c = occupant.occupantAddress2) !== null && _c !== void 0 ? _c : '') === '' (((_d = occupant.occupantAddress2) !== null && _d !== void 0 ? _d : '') === ''
? '' ? ''
: cityssm.escapeHTML(occupant.occupantAddress2) + '<br />') + : cityssm.escapeHTML(occupant.occupantAddress2) + '<br />') +
cityssm.escapeHTML((_d = occupant.occupantCity) !== null && _d !== void 0 ? _d : '') + cityssm.escapeHTML((_e = occupant.occupantCity) !== null && _e !== void 0 ? _e : '') +
', ' + ', ' +
cityssm.escapeHTML((_e = occupant.occupantProvince) !== null && _e !== void 0 ? _e : '') + cityssm.escapeHTML((_f = occupant.occupantProvince) !== null && _f !== void 0 ? _f : '') +
'<br />' + '<br />' +
cityssm.escapeHTML((_f = occupant.occupantPostalCode) !== null && _f !== void 0 ? _f : '') + cityssm.escapeHTML((_g = occupant.occupantPostalCode) !== null && _g !== void 0 ? _g : '') +
'</div>') + '</div>') +
('<div class="column">' + ('<div class="column">' +
(((_g = occupant.occupantPhoneNumber) !== null && _g !== void 0 ? _g : '') === '' (((_h = occupant.occupantPhoneNumber) !== null && _h !== void 0 ? _h : '') === ''
? '' ? ''
: cityssm.escapeHTML(occupant.occupantPhoneNumber) + : cityssm.escapeHTML(occupant.occupantPhoneNumber) +
'<br />') + '<br />') +
cityssm.escapeHTML((_h = occupant.occupantEmailAddress) !== null && _h !== void 0 ? _h : '') + cityssm.escapeHTML((_j = occupant.occupantEmailAddress) !== null && _j !== void 0 ? _j : '') +
'<br />' + '<br />' +
'</div>') + '</div>') +
'</div>'; '</div>';

View File

@ -131,6 +131,11 @@ function openEditLotOccupancyOccupant(clickEvent: Event): void {
'#lotOccupancyOccupantEdit--occupantName' '#lotOccupancyOccupantEdit--occupantName'
) as HTMLInputElement ) as HTMLInputElement
).value = lotOccupancyOccupant.occupantName! ).value = lotOccupancyOccupant.occupantName!
;(
modalElement.querySelector(
'#lotOccupancyOccupantEdit--occupantFamilyName'
) as HTMLInputElement
).value = lotOccupancyOccupant.occupantFamilyName!
;( ;(
modalElement.querySelector( modalElement.querySelector(
'#lotOccupancyOccupantEdit--occupantAddress1' '#lotOccupancyOccupantEdit--occupantAddress1'
@ -302,9 +307,9 @@ function renderLotOccupancyOccupants(): void {
tableRowElement.innerHTML = tableRowElement.innerHTML =
'<td>' + '<td>' +
cityssm.escapeHTML( cityssm.escapeHTML(
(lotOccupancyOccupant.occupantName ?? '') === '' (lotOccupancyOccupant.occupantName ?? '') === '' && (lotOccupancyOccupant.occupantFamilyName ?? '') === ''
? '(No Name)' ? '(No Name)'
: lotOccupancyOccupant.occupantName! : lotOccupancyOccupant.occupantName! + ' ' + lotOccupancyOccupant.occupantFamilyName!
) + ) +
'<br />' + '<br />' +
('<span class="tag">' + ('<span class="tag">' +
@ -526,6 +531,8 @@ document
panelBlockElement.innerHTML = panelBlockElement.innerHTML =
'<strong>' + '<strong>' +
cityssm.escapeHTML(occupant.occupantName ?? '') + cityssm.escapeHTML(occupant.occupantName ?? '') +
' ' +
cityssm.escapeHTML(occupant.occupantFamilyName ?? '') +
'</strong>' + '</strong>' +
'<br />' + '<br />' +
'<div class="columns">' + '<div class="columns">' +

View File

@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const limit = Number.parseInt(document.querySelector('#searchFilter--limit').value, 10); const limit = Number.parseInt(document.querySelector('#searchFilter--limit').value, 10);
const offsetElement = document.querySelector('#searchFilter--offset'); const offsetElement = document.querySelector('#searchFilter--offset');
function renderLotOccupancies(responseJSON) { function renderLotOccupancies(responseJSON) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
if (responseJSON.lotOccupancies.length === 0) { if (responseJSON.lotOccupancies.length === 0) {
searchResultsContainerElement.innerHTML = `<div class="message is-info"> searchResultsContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body"> <p class="message-body">
@ -50,23 +50,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
: occupant.fontAwesomeIconClass) + : occupant.fontAwesomeIconClass) +
'" aria-hidden="true"></i> ') + '" aria-hidden="true"></i> ') +
cityssm.escapeHTML((_c = occupant.occupantName) !== null && _c !== void 0 ? _c : '') + cityssm.escapeHTML((_c = occupant.occupantName) !== null && _c !== void 0 ? _c : '') +
' ' +
cityssm.escapeHTML((_d = occupant.occupantFamilyName) !== null && _d !== void 0 ? _d : '') +
'</span><br />'; '</span><br />';
} }
const feeTotal = ((_e = (_d = lotOccupancy.lotOccupancyFees) === null || _d === void 0 ? void 0 : _d.reduce((soFar, currentFee) => { const feeTotal = ((_f = (_e = lotOccupancy.lotOccupancyFees) === null || _e === void 0 ? void 0 : _e.reduce((soFar, currentFee) => {
var _a, _b, _c; var _a, _b, _c;
return (soFar + return (soFar +
(((_a = currentFee.feeAmount) !== null && _a !== void 0 ? _a : 0) + ((_b = currentFee.taxAmount) !== null && _b !== void 0 ? _b : 0)) * (((_a = currentFee.feeAmount) !== null && _a !== void 0 ? _a : 0) + ((_b = currentFee.taxAmount) !== null && _b !== void 0 ? _b : 0)) *
((_c = currentFee.quantity) !== null && _c !== void 0 ? _c : 0)); ((_c = currentFee.quantity) !== null && _c !== void 0 ? _c : 0));
}, 0)) !== null && _e !== void 0 ? _e : 0).toFixed(2); }, 0)) !== null && _f !== void 0 ? _f : 0).toFixed(2);
const transactionTotal = ((_g = (_f = lotOccupancy.lotOccupancyTransactions) === null || _f === void 0 ? void 0 : _f.reduce((soFar, currentTransaction) => { const transactionTotal = ((_h = (_g = lotOccupancy.lotOccupancyTransactions) === null || _g === void 0 ? void 0 : _g.reduce((soFar, currentTransaction) => {
return soFar + currentTransaction.transactionAmount; return soFar + currentTransaction.transactionAmount;
}, 0)) !== null && _g !== void 0 ? _g : 0).toFixed(2); }, 0)) !== null && _h !== void 0 ? _h : 0).toFixed(2);
let feeIconHTML = ''; let feeIconHTML = '';
if (feeTotal !== '0.00' || transactionTotal !== '0.00') { if (feeTotal !== '0.00' || transactionTotal !== '0.00') {
feeIconHTML = `<span class="icon" feeIconHTML = `<span class="icon"
data-tooltip="Total Fees: $${feeTotal}" data-tooltip="Total Fees: $${feeTotal}"
aria-label="Total Fees: $${feeTotal}"> aria-label="Total Fees: $${feeTotal}">
<i class="fas fa-dollar-sign ${feeTotal === transactionTotal ? 'has-text-success' : 'has-text-danger'}" aria-hidden="true"></i> <i class="fas fa-dollar-sign ${feeTotal === transactionTotal
? 'has-text-success'
: 'has-text-danger'}" aria-hidden="true"></i>
</span>`; </span>`;
} }
resultsTbodyElement.insertAdjacentHTML('beforeend', '<tr>' + resultsTbodyElement.insertAdjacentHTML('beforeend', '<tr>' +
@ -79,12 +83,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
'</a>' + '</a>' +
'</td>') + '</td>') +
('<td>' + ('<td>' +
(((_h = lotOccupancy.lotId) !== null && _h !== void 0 ? _h : -1) === -1 (((_j = lotOccupancy.lotId) !== null && _j !== void 0 ? _j : -1) === -1
? '<span class="has-text-grey">(No ' + ? '<span class="has-text-grey">(No ' +
los.escapedAliases.Lot + los.escapedAliases.Lot +
')</span>' ')</span>'
: '<a class="has-tooltip-right" data-tooltip="' + : '<a class="has-tooltip-right" data-tooltip="' +
cityssm.escapeHTML((_j = lotOccupancy.lotType) !== null && _j !== void 0 ? _j : '') + cityssm.escapeHTML((_k = lotOccupancy.lotType) !== null && _k !== void 0 ? _k : '') +
'" href="' + '" href="' +
los.getLotURL(lotOccupancy.lotId) + los.getLotURL(lotOccupancy.lotId) +
'">' + '">' +
@ -92,7 +96,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
'</a>') + '</a>') +
'<br />' + '<br />' +
('<span class="is-size-7">' + ('<span class="is-size-7">' +
cityssm.escapeHTML((_k = lotOccupancy.mapName) !== null && _k !== void 0 ? _k : '') + cityssm.escapeHTML((_l = lotOccupancy.mapName) !== null && _l !== void 0 ? _l : '') +
'</span>') + '</span>') +
'</td>') + '</td>') +
('<td>' + lotOccupancy.occupancyStartDateString + '</td>') + ('<td>' + lotOccupancy.occupancyStartDateString + '</td>') +
@ -134,10 +138,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
.querySelector('table') .querySelector('table')
.append(resultsTbodyElement); .append(resultsTbodyElement);
searchResultsContainerElement.insertAdjacentHTML('beforeend', los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count)); searchResultsContainerElement.insertAdjacentHTML('beforeend', los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count));
(_l = searchResultsContainerElement
.querySelector("button[data-page='previous']")) === null || _l === void 0 ? void 0 : _l.addEventListener('click', previousAndGetLotOccupancies);
(_m = searchResultsContainerElement (_m = searchResultsContainerElement
.querySelector("button[data-page='next']")) === null || _m === void 0 ? void 0 : _m.addEventListener('click', nextAndGetLotOccupancies); .querySelector("button[data-page='previous']")) === null || _m === void 0 ? void 0 : _m.addEventListener('click', previousAndGetLotOccupancies);
(_o = searchResultsContainerElement
.querySelector("button[data-page='next']")) === null || _o === void 0 ? void 0 : _o.addEventListener('click', nextAndGetLotOccupancies);
} }
function getLotOccupancies() { function getLotOccupancies() {
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(`Loading ${los.escapedAliases.Occupancies}...`); searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML(`Loading ${los.escapedAliases.Occupancies}...`);

View File

@ -81,25 +81,29 @@ declare const cityssm: cityssmGlobal
) + ) +
'" aria-hidden="true"></i> ') + '" aria-hidden="true"></i> ') +
cityssm.escapeHTML(occupant.occupantName ?? '') + cityssm.escapeHTML(occupant.occupantName ?? '') +
' ' +
cityssm.escapeHTML(occupant.occupantFamilyName ?? '') +
'</span><br />' '</span><br />'
} }
const feeTotal = const feeTotal = (
(lotOccupancy.lotOccupancyFees?.reduce((soFar, currentFee): number => { lotOccupancy.lotOccupancyFees?.reduce((soFar, currentFee): number => {
return ( return (
soFar + soFar +
((currentFee.feeAmount ?? 0) + (currentFee.taxAmount ?? 0)) * ((currentFee.feeAmount ?? 0) + (currentFee.taxAmount ?? 0)) *
(currentFee.quantity ?? 0) (currentFee.quantity ?? 0)
) )
}, 0) ?? 0).toFixed(2) }, 0) ?? 0
).toFixed(2)
const transactionTotal = const transactionTotal = (
(lotOccupancy.lotOccupancyTransactions?.reduce( lotOccupancy.lotOccupancyTransactions?.reduce(
(soFar, currentTransaction): number => { (soFar, currentTransaction): number => {
return soFar + currentTransaction.transactionAmount return soFar + currentTransaction.transactionAmount
}, },
0 0
) ?? 0).toFixed(2) ) ?? 0
).toFixed(2)
let feeIconHTML = '' let feeIconHTML = ''
@ -108,7 +112,9 @@ declare const cityssm: cityssmGlobal
data-tooltip="Total Fees: $${feeTotal}" data-tooltip="Total Fees: $${feeTotal}"
aria-label="Total Fees: $${feeTotal}"> aria-label="Total Fees: $${feeTotal}">
<i class="fas fa-dollar-sign ${ <i class="fas fa-dollar-sign ${
feeTotal === transactionTotal ? 'has-text-success' : 'has-text-danger' feeTotal === transactionTotal
? 'has-text-success'
: 'has-text-danger'
}" aria-hidden="true"></i> }" aria-hidden="true"></i>
</span>` </span>`
} }

View File

@ -322,6 +322,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
los.escapedAliases.Occupant + los.escapedAliases.Occupant +
'"></i> ' + '"></i> ' +
cityssm.escapeHTML(occupant.occupantName) + cityssm.escapeHTML(occupant.occupantName) +
' ' +
cityssm.escapeHTML(occupant.occupantFamilyName) +
'</span><br />'); '</span><br />');
}, '')) + }, '')) +
'</td>') + '</td>') +
@ -568,7 +570,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
? '<span class="has-text-grey">(No ' + ? '<span class="has-text-grey">(No ' +
cityssm.escapeHTML(los.escapedAliases.Occupants) + cityssm.escapeHTML(los.escapedAliases.Occupants) +
')</span>' ')</span>'
: cityssm.escapeHTML(lotOccupancy.lotOccupancyOccupants[0].occupantName) + : cityssm.escapeHTML(lotOccupancy.lotOccupancyOccupants[0].occupantName +
' ' +
lotOccupancy.lotOccupancyOccupants[0]
.occupantFamilyName) +
(lotOccupancy.lotOccupancyOccupants.length > 1 (lotOccupancy.lotOccupancyOccupants.length > 1
? ' plus ' + ? ' plus ' +
(lotOccupancy.lotOccupancyOccupants.length - 1) (lotOccupancy.lotOccupancyOccupants.length - 1)

View File

@ -185,6 +185,8 @@ function renderRelatedOccupancies() {
los.escapedAliases.Occupant + los.escapedAliases.Occupant +
'"></i> ' + '"></i> ' +
cityssm.escapeHTML(occupant.occupantName) + cityssm.escapeHTML(occupant.occupantName) +
' ' +
cityssm.escapeHTML(occupant.occupantFamilyName) +
'</span><br />'); '</span><br />');
}, '')) + }, '')) +
'</td>') + '</td>') +
@ -431,7 +433,10 @@ function doAddLotOccupancy(clickEvent) {
? '<span class="has-text-grey">(No ' + ? '<span class="has-text-grey">(No ' +
cityssm.escapeHTML(los.escapedAliases.Occupants) + cityssm.escapeHTML(los.escapedAliases.Occupants) +
')</span>' ')</span>'
: cityssm.escapeHTML(lotOccupancy.lotOccupancyOccupants[0].occupantName) + : cityssm.escapeHTML(lotOccupancy.lotOccupancyOccupants[0].occupantName +
' ' +
lotOccupancy.lotOccupancyOccupants[0]
.occupantFamilyName) +
(lotOccupancy.lotOccupancyOccupants.length > 1 (lotOccupancy.lotOccupancyOccupants.length > 1
? ' plus ' + ? ' plus ' +
(lotOccupancy.lotOccupancyOccupants.length - 1) (lotOccupancy.lotOccupancyOccupants.length - 1)

View File

@ -263,6 +263,8 @@ function renderRelatedOccupancies(): void {
los.escapedAliases.Occupant + los.escapedAliases.Occupant +
'"></i> ' + '"></i> ' +
cityssm.escapeHTML(occupant.occupantName!) + cityssm.escapeHTML(occupant.occupantName!) +
' ' +
cityssm.escapeHTML(occupant.occupantFamilyName!) +
'</span><br />' '</span><br />'
) )
}, '')) + }, '')) +
@ -610,7 +612,10 @@ document
cityssm.escapeHTML(los.escapedAliases.Occupants) + cityssm.escapeHTML(los.escapedAliases.Occupants) +
')</span>' ')</span>'
: cityssm.escapeHTML( : cityssm.escapeHTML(
lotOccupancy.lotOccupancyOccupants![0].occupantName! lotOccupancy.lotOccupancyOccupants![0].occupantName! +
' ' +
lotOccupancy.lotOccupancyOccupants![0]
.occupantFamilyName!
) + ) +
(lotOccupancy.lotOccupancyOccupants!.length > 1 (lotOccupancy.lotOccupancyOccupants!.length > 1
? ' plus ' + ? ' plus ' +
@ -811,7 +816,6 @@ document.querySelector('#button--addLot')?.addEventListener('click', () => {
}, },
onremoved() { onremoved() {
bulmaJS.toggleHtmlClipped() bulmaJS.toggleHtmlClipped()
;(document.querySelector('#button--addLot') as HTMLButtonElement).focus() ;(document.querySelector('#button--addLot') as HTMLButtonElement).focus()
} }
}) })

View File

@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const workOrderMilestoneDateStringElement = workOrderSearchFiltersFormElement.querySelector('#searchFilter--workOrderMilestoneDateString'); const workOrderMilestoneDateStringElement = workOrderSearchFiltersFormElement.querySelector('#searchFilter--workOrderMilestoneDateString');
const milestoneCalendarContainerElement = document.querySelector('#container--milestoneCalendar'); const milestoneCalendarContainerElement = document.querySelector('#container--milestoneCalendar');
function renderMilestones(workOrderMilestones) { function renderMilestones(workOrderMilestones) {
var _a, _b, _c, _d, _e, _f, _g; var _a, _b, _c, _d, _e, _f, _g, _h;
if (workOrderMilestones.length === 0) { if (workOrderMilestones.length === 0) {
milestoneCalendarContainerElement.innerHTML = `<div class="message is-info"> milestoneCalendarContainerElement.innerHTML = `<div class="message is-info">
<p class="message-body">There are no milestones that meet the search criteria.</p> <p class="message-body">There are no milestones that meet the search criteria.</p>
@ -58,6 +58,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
los.escapedAliases.Occupancy + los.escapedAliases.Occupancy +
'"></i> ' + '"></i> ' +
cityssm.escapeHTML((_d = occupant.occupantName) !== null && _d !== void 0 ? _d : '') + cityssm.escapeHTML((_d = occupant.occupantName) !== null && _d !== void 0 ? _d : '') +
' ' +
cityssm.escapeHTML((_e = occupant.occupantFamilyName) !== null && _e !== void 0 ? _e : '') +
'</span>' + '</span>' +
'<br />'; '<br />';
} }
@ -86,15 +88,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
'</div>') + '</div>') +
('<div class="column">' + ('<div class="column">' +
'<i class="fas fa-circle" style="color:' + '<i class="fas fa-circle" style="color:' +
los.getRandomColor((_e = milestone.workOrderNumber) !== null && _e !== void 0 ? _e : '') + los.getRandomColor((_f = milestone.workOrderNumber) !== null && _f !== void 0 ? _f : '') +
'" aria-hidden="true"></i>' + '" aria-hidden="true"></i>' +
' <a class="has-text-weight-bold" href="' + ' <a class="has-text-weight-bold" href="' +
los.getWorkOrderURL(milestone.workOrderId) + los.getWorkOrderURL(milestone.workOrderId) +
'">' + '">' +
cityssm.escapeHTML((_f = milestone.workOrderNumber) !== null && _f !== void 0 ? _f : '') + cityssm.escapeHTML((_g = milestone.workOrderNumber) !== null && _g !== void 0 ? _g : '') +
'</a><br />' + '</a><br />' +
'<span class="is-size-7">' + '<span class="is-size-7">' +
cityssm.escapeHTML((_g = milestone.workOrderDescription) !== null && _g !== void 0 ? _g : '') + cityssm.escapeHTML((_h = milestone.workOrderDescription) !== null && _h !== void 0 ? _h : '') +
'</span>' + '</span>' +
'</div>') + '</div>') +
('<div class="column is-size-7">' + lotOccupancyHTML + '</div>') + ('<div class="column is-size-7">' + lotOccupancyHTML + '</div>') +

View File

@ -93,6 +93,8 @@ declare const cityssm: cityssmGlobal
los.escapedAliases.Occupancy + los.escapedAliases.Occupancy +
'"></i> ' + '"></i> ' +
cityssm.escapeHTML(occupant.occupantName ?? '') + cityssm.escapeHTML(occupant.occupantName ?? '') +
' ' +
cityssm.escapeHTML(occupant.occupantFamilyName ?? '') +
'</span>' + '</span>' +
'<br />' '<br />'
} }

View File

@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const limit = Number.parseInt(document.querySelector('#searchFilter--limit').value, 10); const limit = Number.parseInt(document.querySelector('#searchFilter--limit').value, 10);
const offsetElement = document.querySelector('#searchFilter--offset'); const offsetElement = document.querySelector('#searchFilter--offset');
function renderWorkOrders(responseJSON) { function renderWorkOrders(responseJSON) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
if (responseJSON.workOrders.length === 0) { if (responseJSON.workOrders.length === 0) {
searchResultsContainerElement.innerHTML = searchResultsContainerElement.innerHTML =
'<div class="message is-info">' + '<div class="message is-info">' +
@ -47,9 +47,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
'" aria-label="' + '" aria-label="' +
los.escapedAliases.occupant + los.escapedAliases.occupant +
'"></i> ' + '"></i> ' +
cityssm.escapeHTML(((_e = occupant.occupantName) !== null && _e !== void 0 ? _e : '') === '' cityssm.escapeHTML(((_e = occupant.occupantName) !== null && _e !== void 0 ? _e : '') === '' && ((_f = occupant.occupantFamilyName) !== null && _f !== void 0 ? _f : '') === ''
? '(No Name)' ? '(No Name)'
: occupant.occupantName) + : occupant.occupantName + ' ' + occupant.occupantFamilyName) +
'</span><br />'; '</span><br />';
} }
} }
@ -59,15 +59,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
los.getWorkOrderURL(workOrder.workOrderId) + los.getWorkOrderURL(workOrder.workOrderId) +
'">' + '">' +
(workOrder.workOrderNumber.trim() (workOrder.workOrderNumber.trim()
? cityssm.escapeHTML((_f = workOrder.workOrderNumber) !== null && _f !== void 0 ? _f : '') ? cityssm.escapeHTML((_g = workOrder.workOrderNumber) !== null && _g !== void 0 ? _g : '')
: '(No Number)') + : '(No Number)') +
'</a>' + '</a>' +
'</td>') + '</td>') +
('<td>' + ('<td>' +
cityssm.escapeHTML((_g = workOrder.workOrderType) !== null && _g !== void 0 ? _g : '') + cityssm.escapeHTML((_h = workOrder.workOrderType) !== null && _h !== void 0 ? _h : '') +
'<br />' + '<br />' +
'<span class="is-size-7">' + '<span class="is-size-7">' +
cityssm.escapeHTML((_h = workOrder.workOrderDescription) !== null && _h !== void 0 ? _h : '') + cityssm.escapeHTML((_j = workOrder.workOrderDescription) !== null && _j !== void 0 ? _j : '') +
'</span>' + '</span>' +
'</td>') + '</td>') +
('<td class="is-nowrap"><span class="is-size-7">' + ('<td class="is-nowrap"><span class="is-size-7">' +
@ -132,10 +132,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
searchResultsContainerElement searchResultsContainerElement
.querySelector('table') .querySelector('table')
.append(resultsTbodyElement); .append(resultsTbodyElement);
(_j = searchResultsContainerElement
.querySelector("button[data-page='previous']")) === null || _j === void 0 ? void 0 : _j.addEventListener('click', previousAndGetWorkOrders);
(_k = searchResultsContainerElement (_k = searchResultsContainerElement
.querySelector("button[data-page='next']")) === null || _k === void 0 ? void 0 : _k.addEventListener('click', nextAndGetWorkOrders); .querySelector("button[data-page='previous']")) === null || _k === void 0 ? void 0 : _k.addEventListener('click', previousAndGetWorkOrders);
(_l = searchResultsContainerElement
.querySelector("button[data-page='next']")) === null || _l === void 0 ? void 0 : _l.addEventListener('click', nextAndGetWorkOrders);
} }
function getWorkOrders() { function getWorkOrders() {
searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML('Loading Work Orders...'); searchResultsContainerElement.innerHTML = los.getLoadingParagraphHTML('Loading Work Orders...');

View File

@ -80,9 +80,9 @@ declare const cityssm: cityssmGlobal
los.escapedAliases.occupant + los.escapedAliases.occupant +
'"></i> ' + '"></i> ' +
cityssm.escapeHTML( cityssm.escapeHTML(
(occupant.occupantName ?? '') === '' (occupant.occupantName ?? '') === '' && (occupant.occupantFamilyName ?? '') === ''
? '(No Name)' ? '(No Name)'
: occupant.occupantName! : occupant.occupantName! + ' ' + occupant.occupantFamilyName!
) + ) +
'</span><br />' '</span><br />'
} }

View File

@ -64,22 +64,44 @@
</span> </span>
</div> </div>
</div> </div>
<div class="field"> <div class="columns mt-2 mb-0">
<label class="label" for="lotOccupancyOccupantAdd--occupantName" <div class="column">
><span class="alias" data-alias="Occupant"></span> Name</label <div class="field">
> <label class="label" for="lotOccupancyOccupantAdd--occupantName"
<div class="control"> ><span class="alias" data-alias="Occupant"></span> Name</label
<input >
class="input" <div class="control">
id="lotOccupancyOccupantAdd--occupantName" <input
name="occupantName" class="input"
type="text" id="lotOccupancyOccupantAdd--occupantName"
maxlength="200" name="occupantName"
autocomplete="off" type="text"
required maxlength="200"
/> autocomplete="off"
required
/>
</div>
</div>
</div>
<div class="column">
<div class="field">
<label class="label" for="lotOccupancyOccupantAdd--occupantFamilyName"
>Family Name</label
>
<div class="control">
<input
class="input"
id="lotOccupancyOccupantAdd--occupantFamilyName"
name="occupantFamilyName"
type="text"
maxlength="200"
autocomplete="off"
/>
</div>
</div>
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<label <label
class="label" class="label"

View File

@ -42,20 +42,41 @@
<span class="button is-static" id="lotOccupancyOccupantEdit--fontAwesomeIconClass"></span> <span class="button is-static" id="lotOccupancyOccupantEdit--fontAwesomeIconClass"></span>
</div> </div>
</div> </div>
<div class="field"> <div class="columns mt-2 mb-0">
<label class="label" for="lotOccupancyOccupantEdit--occupantName" <div class="column">
><span class="alias" data-alias="Occupant"></span> Name</label <div class="field">
> <label class="label" for="lotOccupancyOccupantEdit--occupantName"
<div class="control"> ><span class="alias" data-alias="Occupant"></span> Name</label
<input >
class="input" <div class="control">
id="lotOccupancyOccupantEdit--occupantName" <input
name="occupantName" class="input"
type="text" id="lotOccupancyOccupantEdit--occupantName"
maxlength="200" name="occupantName"
autocomplete="off" type="text"
required maxlength="200"
/> autocomplete="off"
required
/>
</div>
</div>
</div>
<div class="column">
<div class="field">
<label class="label" for="lotOccupancyOccupantEdit--occupantFamilyName"
>Family Name</label
>
<div class="control">
<input
class="input"
id="lotOccupancyOccupantEdit--occupantFamilyName"
name="occupantFamilyName"
type="text"
maxlength="200"
autocomplete="off"
/>
</div>
</div>
</div> </div>
</div> </div>
<div class="field"> <div class="field">

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const t=exports.los,a=document.querySelector("#form--searchFilters"),e=document.querySelector("#container--searchResults"),s=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),c=document.querySelector("#searchFilter--offset");function n(a){var c,n,l,i,d,p,u,h,y,f,v,m;if(0===a.lotOccupancies.length)return void(e.innerHTML=`<div class="message is-info">\n <p class="message-body">\n There are no ${t.escapedAliases.occupancy} records that meet the search criteria.\n </p>\n </div>`);const g=document.createElement("tbody"),L=cityssm.dateToString(new Date);for(const e of a.lotOccupancies){let a="";a=e.occupancyStartDateString<=L&&(""===e.occupancyEndDateString||e.occupancyEndDateString>=L)?`<span class="has-tooltip-right" data-tooltip="Current ${t.escapedAliases.Occupancy}">\n <i class="fas fa-play" aria-label="Current ${t.escapedAliases.Occupancy}"></i>\n </span>`:e.occupancyStartDateString>L?`<span class="has-tooltip-right" data-tooltip="Future ${t.escapedAliases.Occupancy}">\n <i class="fas fa-fast-forward" aria-label="Future ${t.escapedAliases.Occupancy}"></i>\n </span>`:`<span class="has-tooltip-right" data-tooltip="Past ${t.escapedAliases.Occupancy}">\n <i class="fas fa-stop" aria-label="Past ${t.escapedAliases.Occupancy}"></i>\n </span>`;let s="";for(const t of e.lotOccupancyOccupants)s+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(null!==(c=t.lotOccupantType)&&void 0!==c?c:"")+'"><i class="fas fa-fw fa-'+cityssm.escapeHTML(""===(null!==(n=t.fontAwesomeIconClass)&&void 0!==n?n:"")?"user":t.fontAwesomeIconClass)+'" aria-hidden="true"></i> '+cityssm.escapeHTML(null!==(l=t.occupantName)&&void 0!==l?l:"")+"</span><br />";const o=(null!==(d=null===(i=e.lotOccupancyFees)||void 0===i?void 0:i.reduce((t,a)=>{var e,s,c;return t+((null!==(e=a.feeAmount)&&void 0!==e?e:0)+(null!==(s=a.taxAmount)&&void 0!==s?s:0))*(null!==(c=a.quantity)&&void 0!==c?c:0)},0))&&void 0!==d?d:0).toFixed(2),r=(null!==(u=null===(p=e.lotOccupancyTransactions)||void 0===p?void 0:p.reduce((t,a)=>t+a.transactionAmount,0))&&void 0!==u?u:0).toFixed(2);let v="";"0.00"===o&&"0.00"===r||(v=`<span class="icon"\n data-tooltip="Total Fees: $${o}"\n aria-label="Total Fees: $${o}">\n <i class="fas fa-dollar-sign ${o===r?"has-text-success":"has-text-danger"}" aria-hidden="true"></i>\n </span>`),g.insertAdjacentHTML("beforeend",'<tr><td class="has-width-1">'+a+'</td><td><a class="has-text-weight-bold" href="'+t.getLotOccupancyURL(e.lotOccupancyId)+'">'+cityssm.escapeHTML(e.occupancyType)+"</a></td><td>"+(-1===(null!==(h=e.lotId)&&void 0!==h?h:-1)?'<span class="has-text-grey">(No '+t.escapedAliases.Lot+")</span>":'<a class="has-tooltip-right" data-tooltip="'+cityssm.escapeHTML(null!==(y=e.lotType)&&void 0!==y?y:"")+'" href="'+t.getLotURL(e.lotId)+'">'+cityssm.escapeHTML(e.lotName)+"</a>")+'<br /><span class="is-size-7">'+cityssm.escapeHTML(null!==(f=e.mapName)&&void 0!==f?f:"")+"</span></td><td>"+e.occupancyStartDateString+"</td><td>"+(e.occupancyEndDate?e.occupancyEndDateString:'<span class="has-text-grey">(No End Date)</span>')+"</td><td>"+s+"</td><td>"+v+"</td><td>"+(e.printEJS?'<a class="button is-small" data-tooltip="Print" href="'+t.urlPrefix+"/print/"+e.printEJS+"/?lotOccupancyId="+e.lotOccupancyId+'" target="_blank"><i class="fas fa-print" aria-label="Print"></i></a>':"")+"</td></tr>")}e.innerHTML=`<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">\n <thead><tr>\n <th class="has-width-1"></th>\n <th>${t.escapedAliases.Occupancy} Type</th>\n <th>${t.escapedAliases.Lot}</th>\n <th>${t.escapedAliases.OccupancyStartDate}</th>\n <th>End Date</th>\n <th>${t.escapedAliases.Occupants}</th>\n <th class="has-width-1"><span class="is-sr-only">Fees and Transactions</span></th>\n <th class="has-width-1"><span class="is-sr-only">Print</span></th>\n </tr></thead>\n <table>`,e.querySelector("table").append(g),e.insertAdjacentHTML("beforeend",t.getSearchResultsPagerHTML(s,a.offset,a.count)),null===(v=e.querySelector("button[data-page='previous']"))||void 0===v||v.addEventListener("click",o),null===(m=e.querySelector("button[data-page='next']"))||void 0===m||m.addEventListener("click",r)}function l(){e.innerHTML=t.getLoadingParagraphHTML(`Loading ${t.escapedAliases.Occupancies}...`),cityssm.postJSON(t.urlPrefix+"/lotOccupancies/doSearchLotOccupancies",a,n)}function i(){c.value="0",l()}function o(){c.value=Math.max(Number.parseInt(c.value,10)-s,0).toString(),l()}function r(){c.value=(Number.parseInt(c.value,10)+s).toString(),l()}const d=a.querySelectorAll("input, select");for(const t of d)t.addEventListener("change",i);a.addEventListener("submit",t=>{t.preventDefault()}),l()})(); "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const t=exports.los,a=document.querySelector("#form--searchFilters"),e=document.querySelector("#container--searchResults"),s=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),c=document.querySelector("#searchFilter--offset");function n(a){var c,n,l,i,d,p,u,h,y,f,m,v,g;if(0===a.lotOccupancies.length)return void(e.innerHTML=`<div class="message is-info">\n <p class="message-body">\n There are no ${t.escapedAliases.occupancy} records that meet the search criteria.\n </p>\n </div>`);const L=document.createElement("tbody"),b=cityssm.dateToString(new Date);for(const e of a.lotOccupancies){let a="";a=e.occupancyStartDateString<=b&&(""===e.occupancyEndDateString||e.occupancyEndDateString>=b)?`<span class="has-tooltip-right" data-tooltip="Current ${t.escapedAliases.Occupancy}">\n <i class="fas fa-play" aria-label="Current ${t.escapedAliases.Occupancy}"></i>\n </span>`:e.occupancyStartDateString>b?`<span class="has-tooltip-right" data-tooltip="Future ${t.escapedAliases.Occupancy}">\n <i class="fas fa-fast-forward" aria-label="Future ${t.escapedAliases.Occupancy}"></i>\n </span>`:`<span class="has-tooltip-right" data-tooltip="Past ${t.escapedAliases.Occupancy}">\n <i class="fas fa-stop" aria-label="Past ${t.escapedAliases.Occupancy}"></i>\n </span>`;let s="";for(const t of e.lotOccupancyOccupants)s+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(null!==(c=t.lotOccupantType)&&void 0!==c?c:"")+'"><i class="fas fa-fw fa-'+cityssm.escapeHTML(""===(null!==(n=t.fontAwesomeIconClass)&&void 0!==n?n:"")?"user":t.fontAwesomeIconClass)+'" aria-hidden="true"></i> '+cityssm.escapeHTML(null!==(l=t.occupantName)&&void 0!==l?l:"")+" "+cityssm.escapeHTML(null!==(i=t.occupantFamilyName)&&void 0!==i?i:"")+"</span><br />";const o=(null!==(p=null===(d=e.lotOccupancyFees)||void 0===d?void 0:d.reduce((t,a)=>{var e,s,c;return t+((null!==(e=a.feeAmount)&&void 0!==e?e:0)+(null!==(s=a.taxAmount)&&void 0!==s?s:0))*(null!==(c=a.quantity)&&void 0!==c?c:0)},0))&&void 0!==p?p:0).toFixed(2),r=(null!==(h=null===(u=e.lotOccupancyTransactions)||void 0===u?void 0:u.reduce((t,a)=>t+a.transactionAmount,0))&&void 0!==h?h:0).toFixed(2);let v="";"0.00"===o&&"0.00"===r||(v=`<span class="icon"\n data-tooltip="Total Fees: $${o}"\n aria-label="Total Fees: $${o}">\n <i class="fas fa-dollar-sign ${o===r?"has-text-success":"has-text-danger"}" aria-hidden="true"></i>\n </span>`),L.insertAdjacentHTML("beforeend",'<tr><td class="has-width-1">'+a+'</td><td><a class="has-text-weight-bold" href="'+t.getLotOccupancyURL(e.lotOccupancyId)+'">'+cityssm.escapeHTML(e.occupancyType)+"</a></td><td>"+(-1===(null!==(y=e.lotId)&&void 0!==y?y:-1)?'<span class="has-text-grey">(No '+t.escapedAliases.Lot+")</span>":'<a class="has-tooltip-right" data-tooltip="'+cityssm.escapeHTML(null!==(f=e.lotType)&&void 0!==f?f:"")+'" href="'+t.getLotURL(e.lotId)+'">'+cityssm.escapeHTML(e.lotName)+"</a>")+'<br /><span class="is-size-7">'+cityssm.escapeHTML(null!==(m=e.mapName)&&void 0!==m?m:"")+"</span></td><td>"+e.occupancyStartDateString+"</td><td>"+(e.occupancyEndDate?e.occupancyEndDateString:'<span class="has-text-grey">(No End Date)</span>')+"</td><td>"+s+"</td><td>"+v+"</td><td>"+(e.printEJS?'<a class="button is-small" data-tooltip="Print" href="'+t.urlPrefix+"/print/"+e.printEJS+"/?lotOccupancyId="+e.lotOccupancyId+'" target="_blank"><i class="fas fa-print" aria-label="Print"></i></a>':"")+"</td></tr>")}e.innerHTML=`<table class="table is-fullwidth is-striped is-hoverable has-sticky-header">\n <thead><tr>\n <th class="has-width-1"></th>\n <th>${t.escapedAliases.Occupancy} Type</th>\n <th>${t.escapedAliases.Lot}</th>\n <th>${t.escapedAliases.OccupancyStartDate}</th>\n <th>End Date</th>\n <th>${t.escapedAliases.Occupants}</th>\n <th class="has-width-1"><span class="is-sr-only">Fees and Transactions</span></th>\n <th class="has-width-1"><span class="is-sr-only">Print</span></th>\n </tr></thead>\n <table>`,e.querySelector("table").append(L),e.insertAdjacentHTML("beforeend",t.getSearchResultsPagerHTML(s,a.offset,a.count)),null===(v=e.querySelector("button[data-page='previous']"))||void 0===v||v.addEventListener("click",o),null===(g=e.querySelector("button[data-page='next']"))||void 0===g||g.addEventListener("click",r)}function l(){e.innerHTML=t.getLoadingParagraphHTML(`Loading ${t.escapedAliases.Occupancies}...`),cityssm.postJSON(t.urlPrefix+"/lotOccupancies/doSearchLotOccupancies",a,n)}function i(){c.value="0",l()}function o(){c.value=Math.max(Number.parseInt(c.value,10)-s,0).toString(),l()}function r(){c.value=(Number.parseInt(c.value,10)+s).toString(),l()}const d=a.querySelectorAll("input, select");for(const t of d)t.addEventListener("change",i);a.addEventListener("submit",t=>{t.preventDefault()}),l()})();

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,s=document.querySelector("#form--searchFilters"),r=s.querySelector("#searchFilter--workOrderMilestoneDateFilter"),a=s.querySelector("#searchFilter--workOrderMilestoneDateString"),t=document.querySelector("#container--milestoneCalendar");function i(r){r&&r.preventDefault(),t.innerHTML=e.getLoadingParagraphHTML("Loading Milestones..."),cityssm.postJSON(e.urlPrefix+"/workOrders/doGetWorkOrderMilestones",s,s=>{!function(s){var r,a,i,o,n,l,c;if(0===s.length)return void(t.innerHTML='<div class="message is-info">\n <p class="message-body">There are no milestones that meet the search criteria.</p>\n </div>');t.innerHTML="";const d=cityssm.dateToString(new Date);let p,m="";for(const u of s){m!==u.workOrderMilestoneDateString&&(p&&t.append(p),(p=document.createElement("div")).className="panel",p.innerHTML=`<h2 class="panel-heading">${u.workOrderMilestoneDateString}</h2>`,m=u.workOrderMilestoneDateString);const s=document.createElement("div");s.className="panel-block is-block",!u.workOrderMilestoneCompletionDate&&u.workOrderMilestoneDateString<d&&s.classList.add("has-background-warning-light");let M="";for(const s of u.workOrderLots)M+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(null!==(r=s.mapName)&&void 0!==r?r:"")+'"><i class="fas fa-vector-square" aria-label="'+e.escapedAliases.Lot+'"></i> '+cityssm.escapeHTML(null!==(a=s.lotName)&&void 0!==a?a:"")+"</span><br />";for(const s of u.workOrderLotOccupancies)for(const r of s.lotOccupancyOccupants)M+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(null!==(i=r.lotOccupantType)&&void 0!==i?i:"")+'"><i class="fas fa-user" aria-label="'+e.escapedAliases.Occupancy+'"></i> '+cityssm.escapeHTML(null!==(o=r.occupantName)&&void 0!==o?o:"")+"</span><br />";s.innerHTML='<div class="columns"><div class="column is-narrow"><span class="icon is-small">'+(u.workOrderMilestoneCompletionDate?'<i class="fas fa-check" aria-label="Completed"></i>':'<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>')+'</span></div><div class="column">'+(0===u.workOrderMilestoneTime?"":u.workOrderMilestoneTimeString+"<br />")+(u.workOrderMilestoneTypeId?"<strong>"+cityssm.escapeHTML(u.workOrderMilestoneType)+"</strong><br />":"")+'<span class="is-size-7">'+cityssm.escapeHTML(u.workOrderMilestoneDescription)+'</span></div><div class="column"><i class="fas fa-circle" style="color:'+e.getRandomColor(null!==(n=u.workOrderNumber)&&void 0!==n?n:"")+'" aria-hidden="true"></i> <a class="has-text-weight-bold" href="'+e.getWorkOrderURL(u.workOrderId)+'">'+cityssm.escapeHTML(null!==(l=u.workOrderNumber)&&void 0!==l?l:"")+'</a><br /><span class="is-size-7">'+cityssm.escapeHTML(null!==(c=u.workOrderDescription)&&void 0!==c?c:"")+'</span></div><div class="column is-size-7">'+M+"</div></div>",p.append(s)}t.append(p)}(s.workOrderMilestones)})}r.addEventListener("change",()=>{a.closest("fieldset").disabled="date"!==r.value,i()}),e.initializeDatePickers(s),a.addEventListener("change",i),s.addEventListener("submit",i),i()})(); "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,s=document.querySelector("#form--searchFilters"),r=s.querySelector("#searchFilter--workOrderMilestoneDateFilter"),a=s.querySelector("#searchFilter--workOrderMilestoneDateString"),t=document.querySelector("#container--milestoneCalendar");function i(r){r&&r.preventDefault(),t.innerHTML=e.getLoadingParagraphHTML("Loading Milestones..."),cityssm.postJSON(e.urlPrefix+"/workOrders/doGetWorkOrderMilestones",s,s=>{!function(s){var r,a,i,o,n,l,c,d;if(0===s.length)return void(t.innerHTML='<div class="message is-info">\n <p class="message-body">There are no milestones that meet the search criteria.</p>\n </div>');t.innerHTML="";const p=cityssm.dateToString(new Date);let m,u="";for(const M of s){u!==M.workOrderMilestoneDateString&&(m&&t.append(m),(m=document.createElement("div")).className="panel",m.innerHTML=`<h2 class="panel-heading">${M.workOrderMilestoneDateString}</h2>`,u=M.workOrderMilestoneDateString);const s=document.createElement("div");s.className="panel-block is-block",!M.workOrderMilestoneCompletionDate&&M.workOrderMilestoneDateString<p&&s.classList.add("has-background-warning-light");let v="";for(const s of M.workOrderLots)v+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(null!==(r=s.mapName)&&void 0!==r?r:"")+'"><i class="fas fa-vector-square" aria-label="'+e.escapedAliases.Lot+'"></i> '+cityssm.escapeHTML(null!==(a=s.lotName)&&void 0!==a?a:"")+"</span><br />";for(const s of M.workOrderLotOccupancies)for(const r of s.lotOccupancyOccupants)v+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(null!==(i=r.lotOccupantType)&&void 0!==i?i:"")+'"><i class="fas fa-user" aria-label="'+e.escapedAliases.Occupancy+'"></i> '+cityssm.escapeHTML(null!==(o=r.occupantName)&&void 0!==o?o:"")+" "+cityssm.escapeHTML(null!==(n=r.occupantFamilyName)&&void 0!==n?n:"")+"</span><br />";s.innerHTML='<div class="columns"><div class="column is-narrow"><span class="icon is-small">'+(M.workOrderMilestoneCompletionDate?'<i class="fas fa-check" aria-label="Completed"></i>':'<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>')+'</span></div><div class="column">'+(0===M.workOrderMilestoneTime?"":M.workOrderMilestoneTimeString+"<br />")+(M.workOrderMilestoneTypeId?"<strong>"+cityssm.escapeHTML(M.workOrderMilestoneType)+"</strong><br />":"")+'<span class="is-size-7">'+cityssm.escapeHTML(M.workOrderMilestoneDescription)+'</span></div><div class="column"><i class="fas fa-circle" style="color:'+e.getRandomColor(null!==(l=M.workOrderNumber)&&void 0!==l?l:"")+'" aria-hidden="true"></i> <a class="has-text-weight-bold" href="'+e.getWorkOrderURL(M.workOrderId)+'">'+cityssm.escapeHTML(null!==(c=M.workOrderNumber)&&void 0!==c?c:"")+'</a><br /><span class="is-size-7">'+cityssm.escapeHTML(null!==(d=M.workOrderDescription)&&void 0!==d?d:"")+'</span></div><div class="column is-size-7">'+v+"</div></div>",m.append(s)}t.append(m)}(s.workOrderMilestones)})}r.addEventListener("change",()=>{a.closest("fieldset").disabled="date"!==r.value,i()}),e.initializeDatePickers(s),a.addEventListener("change",i),s.addEventListener("submit",i),i()})();

View File

@ -1 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=exports.workOrderPrints,s=document.querySelector("#form--searchFilters");e.initializeDatePickers(s);const a=document.querySelector("#container--searchResults"),r=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),o=document.querySelector("#searchFilter--offset");function l(s){var o,l,i,n,p,u,f,h,m,O;if(0===s.workOrders.length)return void(a.innerHTML='<div class="message is-info"><p class="message-body">There are no work orders that meet the search criteria.</p></div>');const k=document.createElement("tbody");for(const a of s.workOrders){let s="";for(const t of a.workOrderLots)s+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(null!==(o=t.mapName)&&void 0!==o?o:"")+'"><i class="fas fa-fw fa-vector-square" aria-label="'+e.escapedAliases.Lot+'"></i> '+cityssm.escapeHTML(""===(null!==(l=t.lotName)&&void 0!==l?l:"")?"(No "+e.escapedAliases.Lot+" Name)":t.lotName)+"</span><br />";for(const t of a.workOrderLotOccupancies)for(const a of t.lotOccupancyOccupants)s+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(null!==(i=a.lotOccupantType)&&void 0!==i?i:"")+'"><i class="fas fa-fw fa-'+cityssm.escapeHTML(""===(null!==(n=a.fontAwesomeIconClass)&&void 0!==n?n:"")?"user":a.fontAwesomeIconClass)+'" aria-label="'+e.escapedAliases.occupant+'"></i> '+cityssm.escapeHTML(""===(null!==(p=a.occupantName)&&void 0!==p?p:"")?"(No Name)":a.occupantName)+"</span><br />";k.insertAdjacentHTML("beforeend",'<tr><td><a class="has-text-weight-bold" href="'+e.getWorkOrderURL(a.workOrderId)+'">'+(a.workOrderNumber.trim()?cityssm.escapeHTML(null!==(u=a.workOrderNumber)&&void 0!==u?u:""):"(No Number)")+"</a></td><td>"+cityssm.escapeHTML(null!==(f=a.workOrderType)&&void 0!==f?f:"")+'<br /><span class="is-size-7">'+cityssm.escapeHTML(null!==(h=a.workOrderDescription)&&void 0!==h?h:"")+'</span></td><td class="is-nowrap"><span class="is-size-7">'+s+'</span></td><td class="is-nowrap"><span class="has-tooltip-left" data-tooltip="'+e.escapedAliases.WorkOrderOpenDate+'"><i class="fas fa-fw fa-play" aria-label="'+e.escapedAliases.WorkOrderOpenDate+'"></i> '+a.workOrderOpenDateString+'</span><br /><span class="has-tooltip-left" data-tooltip="'+e.escapedAliases.WorkOrderCloseDate+'"><i class="fas fa-fw fa-stop" aria-label="'+e.escapedAliases.WorkOrderCloseDate+'"></i> '+(a.workOrderCloseDate?a.workOrderCloseDateString:'<span class="has-text-grey">(No '+e.escapedAliases.WorkOrderCloseDate+")</span>")+"</span></td><td>"+(0===a.workOrderMilestoneCount?"-":a.workOrderMilestoneCompletionCount+" / "+a.workOrderMilestoneCount)+"</td>"+(t.length>0?'<td><a class="button is-small" data-tooltip="Print" href="'+e.urlPrefix+"/print/"+t[0]+"/?workOrderId="+a.workOrderId+'" target="_blank"><i class="fas fa-print" aria-label="Print"></i></a></td>':"")+"</tr>")}a.innerHTML='<table class="table is-fullwidth is-striped is-hoverable has-sticky-header"><thead><tr><th>Work Order Number</th><th>Description</th><th>Related</th><th>Date</th><th class="has-tooltip-bottom" data-tooltip="Completed / Total Milestones">Progress</th>'+(t.length>0?'<th class="has-width-1"></th>':"")+"</tr></thead><table>",a.insertAdjacentHTML("beforeend",e.getSearchResultsPagerHTML(r,s.offset,s.count)),a.querySelector("table").append(k),null===(m=a.querySelector("button[data-page='previous']"))||void 0===m||m.addEventListener("click",c),null===(O=a.querySelector("button[data-page='next']"))||void 0===O||O.addEventListener("click",d)}function i(){a.innerHTML=e.getLoadingParagraphHTML("Loading Work Orders..."),cityssm.postJSON(e.urlPrefix+"/workOrders/doSearchWorkOrders",s,l)}function n(){o.value="0",i()}function c(){o.value=Math.max(Number.parseInt(o.value,10)-r,0).toString(),i()}function d(){o.value=(Number.parseInt(o.value,10)+r).toString(),i()}const p=s.querySelectorAll("input, select");for(const e of p)e.addEventListener("change",n);s.addEventListener("submit",e=>{e.preventDefault()}),i()})(); "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=exports.workOrderPrints,s=document.querySelector("#form--searchFilters");e.initializeDatePickers(s);const a=document.querySelector("#container--searchResults"),r=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),o=document.querySelector("#searchFilter--offset");function l(s){var o,l,i,n,p,u,f,m,h,O,k;if(0===s.workOrders.length)return void(a.innerHTML='<div class="message is-info"><p class="message-body">There are no work orders that meet the search criteria.</p></div>');const b=document.createElement("tbody");for(const a of s.workOrders){let s="";for(const t of a.workOrderLots)s+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(null!==(o=t.mapName)&&void 0!==o?o:"")+'"><i class="fas fa-fw fa-vector-square" aria-label="'+e.escapedAliases.Lot+'"></i> '+cityssm.escapeHTML(""===(null!==(l=t.lotName)&&void 0!==l?l:"")?"(No "+e.escapedAliases.Lot+" Name)":t.lotName)+"</span><br />";for(const t of a.workOrderLotOccupancies)for(const a of t.lotOccupancyOccupants)s+='<span class="has-tooltip-left" data-tooltip="'+cityssm.escapeHTML(null!==(i=a.lotOccupantType)&&void 0!==i?i:"")+'"><i class="fas fa-fw fa-'+cityssm.escapeHTML(""===(null!==(n=a.fontAwesomeIconClass)&&void 0!==n?n:"")?"user":a.fontAwesomeIconClass)+'" aria-label="'+e.escapedAliases.occupant+'"></i> '+cityssm.escapeHTML(""===(null!==(p=a.occupantName)&&void 0!==p?p:"")&&""===(null!==(u=a.occupantFamilyName)&&void 0!==u?u:"")?"(No Name)":a.occupantName+" "+a.occupantFamilyName)+"</span><br />";b.insertAdjacentHTML("beforeend",'<tr><td><a class="has-text-weight-bold" href="'+e.getWorkOrderURL(a.workOrderId)+'">'+(a.workOrderNumber.trim()?cityssm.escapeHTML(null!==(f=a.workOrderNumber)&&void 0!==f?f:""):"(No Number)")+"</a></td><td>"+cityssm.escapeHTML(null!==(m=a.workOrderType)&&void 0!==m?m:"")+'<br /><span class="is-size-7">'+cityssm.escapeHTML(null!==(h=a.workOrderDescription)&&void 0!==h?h:"")+'</span></td><td class="is-nowrap"><span class="is-size-7">'+s+'</span></td><td class="is-nowrap"><span class="has-tooltip-left" data-tooltip="'+e.escapedAliases.WorkOrderOpenDate+'"><i class="fas fa-fw fa-play" aria-label="'+e.escapedAliases.WorkOrderOpenDate+'"></i> '+a.workOrderOpenDateString+'</span><br /><span class="has-tooltip-left" data-tooltip="'+e.escapedAliases.WorkOrderCloseDate+'"><i class="fas fa-fw fa-stop" aria-label="'+e.escapedAliases.WorkOrderCloseDate+'"></i> '+(a.workOrderCloseDate?a.workOrderCloseDateString:'<span class="has-text-grey">(No '+e.escapedAliases.WorkOrderCloseDate+")</span>")+"</span></td><td>"+(0===a.workOrderMilestoneCount?"-":a.workOrderMilestoneCompletionCount+" / "+a.workOrderMilestoneCount)+"</td>"+(t.length>0?'<td><a class="button is-small" data-tooltip="Print" href="'+e.urlPrefix+"/print/"+t[0]+"/?workOrderId="+a.workOrderId+'" target="_blank"><i class="fas fa-print" aria-label="Print"></i></a></td>':"")+"</tr>")}a.innerHTML='<table class="table is-fullwidth is-striped is-hoverable has-sticky-header"><thead><tr><th>Work Order Number</th><th>Description</th><th>Related</th><th>Date</th><th class="has-tooltip-bottom" data-tooltip="Completed / Total Milestones">Progress</th>'+(t.length>0?'<th class="has-width-1"></th>':"")+"</tr></thead><table>",a.insertAdjacentHTML("beforeend",e.getSearchResultsPagerHTML(r,s.offset,s.count)),a.querySelector("table").append(b),null===(O=a.querySelector("button[data-page='previous']"))||void 0===O||O.addEventListener("click",c),null===(k=a.querySelector("button[data-page='next']"))||void 0===k||k.addEventListener("click",d)}function i(){a.innerHTML=e.getLoadingParagraphHTML("Loading Work Orders..."),cityssm.postJSON(e.urlPrefix+"/workOrders/doSearchWorkOrders",s,l)}function n(){o.value="0",i()}function c(){o.value=Math.max(Number.parseInt(o.value,10)-r,0).toString(),i()}function d(){o.value=(Number.parseInt(o.value,10)+r).toString(),i()}const p=s.querySelectorAll("input, select");for(const e of p)e.addEventListener("change",n);s.addEventListener("submit",e=>{e.preventDefault()}),i()})();

View File

@ -206,6 +206,7 @@ async function importFromMasterCSV() {
lotOccupancyId: preneedLotOccupancyId, lotOccupancyId: preneedLotOccupancyId,
lotOccupantTypeId: importIds.preneedOwnerLotOccupantTypeId, lotOccupantTypeId: importIds.preneedOwnerLotOccupantTypeId,
occupantName: masterRow.CM_PRENEED_OWNER, occupantName: masterRow.CM_PRENEED_OWNER,
occupantFamilyName: '',
occupantAddress1: masterRow.CM_ADDRESS, occupantAddress1: masterRow.CM_ADDRESS,
occupantAddress2: '', occupantAddress2: '',
occupantCity: masterRow.CM_CITY, occupantCity: masterRow.CM_CITY,
@ -265,6 +266,7 @@ async function importFromMasterCSV() {
lotOccupancyId: deceasedLotOccupancyId, lotOccupancyId: deceasedLotOccupancyId,
lotOccupantTypeId: importIds.deceasedLotOccupantTypeId, lotOccupantTypeId: importIds.deceasedLotOccupantTypeId,
occupantName: masterRow.CM_DECEASED_NAME, occupantName: masterRow.CM_DECEASED_NAME,
occupantFamilyName: '',
occupantAddress1: masterRow.CM_ADDRESS, occupantAddress1: masterRow.CM_ADDRESS,
occupantAddress2: '', occupantAddress2: '',
occupantCity: masterRow.CM_CITY, occupantCity: masterRow.CM_CITY,
@ -307,6 +309,7 @@ async function importFromMasterCSV() {
lotOccupancyId: deceasedLotOccupancyId, lotOccupancyId: deceasedLotOccupancyId,
lotOccupantTypeId: funeralHomeOccupant.lotOccupantTypeId, lotOccupantTypeId: funeralHomeOccupant.lotOccupantTypeId,
occupantName: funeralHomeOccupant.occupantName, occupantName: funeralHomeOccupant.occupantName,
occupantFamilyName: '',
occupantAddress1: funeralHomeOccupant.occupantAddress1, occupantAddress1: funeralHomeOccupant.occupantAddress1,
occupantAddress2: funeralHomeOccupant.occupantAddress2, occupantAddress2: funeralHomeOccupant.occupantAddress2,
occupantCity: funeralHomeOccupant.occupantCity, occupantCity: funeralHomeOccupant.occupantCity,
@ -372,6 +375,7 @@ async function importFromMasterCSV() {
lotOccupancyId: deceasedLotOccupancyId, lotOccupancyId: deceasedLotOccupancyId,
lotOccupantTypeId: importIds.preneedOwnerLotOccupantTypeId, lotOccupantTypeId: importIds.preneedOwnerLotOccupantTypeId,
occupantName: masterRow.CM_PRENEED_OWNER, occupantName: masterRow.CM_PRENEED_OWNER,
occupantFamilyName: '',
occupantAddress1: '', occupantAddress1: '',
occupantAddress2: '', occupantAddress2: '',
occupantCity: '', occupantCity: '',
@ -479,6 +483,7 @@ async function importFromPrepaidCSV() {
lotOccupancyId, lotOccupancyId,
lotOccupantTypeId: importIds.preneedOwnerLotOccupantTypeId, lotOccupantTypeId: importIds.preneedOwnerLotOccupantTypeId,
occupantName: prepaidRow.CMPP_PREPAID_FOR_NAME, occupantName: prepaidRow.CMPP_PREPAID_FOR_NAME,
occupantFamilyName: '',
occupantAddress1: prepaidRow.CMPP_ADDRESS, occupantAddress1: prepaidRow.CMPP_ADDRESS,
occupantAddress2: '', occupantAddress2: '',
occupantCity: prepaidRow.CMPP_CITY, occupantCity: prepaidRow.CMPP_CITY,
@ -492,6 +497,7 @@ async function importFromPrepaidCSV() {
lotOccupancyId, lotOccupancyId,
lotOccupantTypeId: importIds.purchaserLotOccupantTypeId, lotOccupantTypeId: importIds.purchaserLotOccupantTypeId,
occupantName: prepaidRow.CMPP_ARRANGED_BY_NAME, occupantName: prepaidRow.CMPP_ARRANGED_BY_NAME,
occupantFamilyName: '',
occupantAddress1: '', occupantAddress1: '',
occupantAddress2: '', occupantAddress2: '',
occupantCity: '', occupantCity: '',
@ -726,6 +732,7 @@ async function importFromWorkOrderCSV() {
lotOccupancyId, lotOccupancyId,
lotOccupantTypeId: importIds.deceasedLotOccupantTypeId, lotOccupantTypeId: importIds.deceasedLotOccupantTypeId,
occupantName: workOrderRow.WO_DECEASED_NAME, occupantName: workOrderRow.WO_DECEASED_NAME,
occupantFamilyName: '',
occupantAddress1: workOrderRow.WO_ADDRESS, occupantAddress1: workOrderRow.WO_ADDRESS,
occupantAddress2: '', occupantAddress2: '',
occupantCity: workOrderRow.WO_CITY, occupantCity: workOrderRow.WO_CITY,
@ -777,6 +784,7 @@ async function importFromWorkOrderCSV() {
lotOccupancyId, lotOccupancyId,
lotOccupantTypeId: funeralHomeOccupant.lotOccupantTypeId, lotOccupantTypeId: funeralHomeOccupant.lotOccupantTypeId,
occupantName: funeralHomeOccupant.occupantName, occupantName: funeralHomeOccupant.occupantName,
occupantFamilyName: '',
occupantAddress1: funeralHomeOccupant.occupantAddress1, occupantAddress1: funeralHomeOccupant.occupantAddress1,
occupantAddress2: funeralHomeOccupant.occupantAddress2, occupantAddress2: funeralHomeOccupant.occupantAddress2,
occupantCity: funeralHomeOccupant.occupantCity, occupantCity: funeralHomeOccupant.occupantCity,

View File

@ -471,6 +471,7 @@ async function importFromMasterCSV(): Promise<void> {
lotOccupancyId: preneedLotOccupancyId, lotOccupancyId: preneedLotOccupancyId,
lotOccupantTypeId: importIds.preneedOwnerLotOccupantTypeId, lotOccupantTypeId: importIds.preneedOwnerLotOccupantTypeId,
occupantName: masterRow.CM_PRENEED_OWNER, occupantName: masterRow.CM_PRENEED_OWNER,
occupantFamilyName: '',
occupantAddress1: masterRow.CM_ADDRESS, occupantAddress1: masterRow.CM_ADDRESS,
occupantAddress2: '', occupantAddress2: '',
occupantCity: masterRow.CM_CITY, occupantCity: masterRow.CM_CITY,
@ -568,6 +569,7 @@ async function importFromMasterCSV(): Promise<void> {
lotOccupancyId: deceasedLotOccupancyId, lotOccupancyId: deceasedLotOccupancyId,
lotOccupantTypeId: importIds.deceasedLotOccupantTypeId, lotOccupantTypeId: importIds.deceasedLotOccupantTypeId,
occupantName: masterRow.CM_DECEASED_NAME, occupantName: masterRow.CM_DECEASED_NAME,
occupantFamilyName: '',
occupantAddress1: masterRow.CM_ADDRESS, occupantAddress1: masterRow.CM_ADDRESS,
occupantAddress2: '', occupantAddress2: '',
occupantCity: masterRow.CM_CITY, occupantCity: masterRow.CM_CITY,
@ -643,6 +645,7 @@ async function importFromMasterCSV(): Promise<void> {
lotOccupancyId: deceasedLotOccupancyId, lotOccupancyId: deceasedLotOccupancyId,
lotOccupantTypeId: funeralHomeOccupant.lotOccupantTypeId!, lotOccupantTypeId: funeralHomeOccupant.lotOccupantTypeId!,
occupantName: funeralHomeOccupant.occupantName!, occupantName: funeralHomeOccupant.occupantName!,
occupantFamilyName: '',
occupantAddress1: funeralHomeOccupant.occupantAddress1!, occupantAddress1: funeralHomeOccupant.occupantAddress1!,
occupantAddress2: funeralHomeOccupant.occupantAddress2!, occupantAddress2: funeralHomeOccupant.occupantAddress2!,
occupantCity: funeralHomeOccupant.occupantCity!, occupantCity: funeralHomeOccupant.occupantCity!,
@ -767,6 +770,7 @@ async function importFromMasterCSV(): Promise<void> {
lotOccupancyId: deceasedLotOccupancyId, lotOccupancyId: deceasedLotOccupancyId,
lotOccupantTypeId: importIds.preneedOwnerLotOccupantTypeId, lotOccupantTypeId: importIds.preneedOwnerLotOccupantTypeId,
occupantName: masterRow.CM_PRENEED_OWNER, occupantName: masterRow.CM_PRENEED_OWNER,
occupantFamilyName: '',
occupantAddress1: '', occupantAddress1: '',
occupantAddress2: '', occupantAddress2: '',
occupantCity: '', occupantCity: '',
@ -912,6 +916,7 @@ async function importFromPrepaidCSV(): Promise<void> {
lotOccupancyId, lotOccupancyId,
lotOccupantTypeId: importIds.preneedOwnerLotOccupantTypeId, lotOccupantTypeId: importIds.preneedOwnerLotOccupantTypeId,
occupantName: prepaidRow.CMPP_PREPAID_FOR_NAME, occupantName: prepaidRow.CMPP_PREPAID_FOR_NAME,
occupantFamilyName: '',
occupantAddress1: prepaidRow.CMPP_ADDRESS, occupantAddress1: prepaidRow.CMPP_ADDRESS,
occupantAddress2: '', occupantAddress2: '',
occupantCity: prepaidRow.CMPP_CITY, occupantCity: prepaidRow.CMPP_CITY,
@ -930,6 +935,7 @@ async function importFromPrepaidCSV(): Promise<void> {
lotOccupancyId, lotOccupancyId,
lotOccupantTypeId: importIds.purchaserLotOccupantTypeId, lotOccupantTypeId: importIds.purchaserLotOccupantTypeId,
occupantName: prepaidRow.CMPP_ARRANGED_BY_NAME, occupantName: prepaidRow.CMPP_ARRANGED_BY_NAME,
occupantFamilyName: '',
occupantAddress1: '', occupantAddress1: '',
occupantAddress2: '', occupantAddress2: '',
occupantCity: '', occupantCity: '',
@ -1265,6 +1271,7 @@ async function importFromWorkOrderCSV(): Promise<void> {
lotOccupancyId, lotOccupancyId,
lotOccupantTypeId: importIds.deceasedLotOccupantTypeId, lotOccupantTypeId: importIds.deceasedLotOccupantTypeId,
occupantName: workOrderRow.WO_DECEASED_NAME, occupantName: workOrderRow.WO_DECEASED_NAME,
occupantFamilyName: '',
occupantAddress1: workOrderRow.WO_ADDRESS, occupantAddress1: workOrderRow.WO_ADDRESS,
occupantAddress2: '', occupantAddress2: '',
occupantCity: workOrderRow.WO_CITY, occupantCity: workOrderRow.WO_CITY,
@ -1356,6 +1363,7 @@ async function importFromWorkOrderCSV(): Promise<void> {
lotOccupancyId, lotOccupancyId,
lotOccupantTypeId: funeralHomeOccupant.lotOccupantTypeId!, lotOccupantTypeId: funeralHomeOccupant.lotOccupantTypeId!,
occupantName: funeralHomeOccupant.occupantName!, occupantName: funeralHomeOccupant.occupantName!,
occupantFamilyName: '',
occupantAddress1: funeralHomeOccupant.occupantAddress1!, occupantAddress1: funeralHomeOccupant.occupantAddress1!,
occupantAddress2: funeralHomeOccupant.occupantAddress2!, occupantAddress2: funeralHomeOccupant.occupantAddress2!,
occupantCity: funeralHomeOccupant.occupantCity!, occupantCity: funeralHomeOccupant.occupantCity!,
@ -1460,7 +1468,7 @@ async function importFromWorkOrderCSV(): Promise<void> {
if (importIds.acknowledgedWorkOrderMilestoneTypeId) { if (importIds.acknowledgedWorkOrderMilestoneTypeId) {
await addWorkOrderMilestone( await addWorkOrderMilestone(
{ {
workOrderId: workOrder.workOrderId, workOrderId: workOrder.workOrderId!,
workOrderMilestoneTypeId: workOrderMilestoneTypeId:
importIds.acknowledgedWorkOrderMilestoneTypeId, importIds.acknowledgedWorkOrderMilestoneTypeId,
workOrderMilestoneDateString: workOrderOpenDateString, workOrderMilestoneDateString: workOrderOpenDateString,

View File

@ -154,6 +154,7 @@ export interface LotOccupancyOccupant extends Record {
fontAwesomeIconClass?: string; fontAwesomeIconClass?: string;
occupantCommentTitle?: string; occupantCommentTitle?: string;
occupantName?: string; occupantName?: string;
occupantFamilyName?: string;
occupantAddress1?: string; occupantAddress1?: string;
occupantAddress2?: string; occupantAddress2?: string;
occupantCity?: string; occupantCity?: string;

View File

@ -203,6 +203,7 @@ export interface LotOccupancyOccupant extends Record {
occupantCommentTitle?: string occupantCommentTitle?: string
occupantName?: string occupantName?: string
occupantFamilyName?: string
occupantAddress1?: string occupantAddress1?: string
occupantAddress2?: string occupantAddress2?: string
occupantCity?: string occupantCity?: string

View File

@ -77,6 +77,7 @@
<span class="has-tooltip-right" data-tooltip="<%= occupant.lotOccupantType %>"> <span class="has-tooltip-right" data-tooltip="<%= occupant.lotOccupantType %>">
<i class="fas fa-fw fa-<%= occupant.fontAwesomeIconClass || 'user' %>" aria-label="<%= configFunctions.getProperty("aliases.occupancy") %>"></i> <i class="fas fa-fw fa-<%= occupant.fontAwesomeIconClass || 'user' %>" aria-label="<%= configFunctions.getProperty("aliases.occupancy") %>"></i>
<%= occupant.occupantName %> <%= occupant.occupantName %>
<%= occupant.occupantFamilyName %>
</span><br /> </span><br />
<% <%
} }

View File

@ -257,97 +257,97 @@
</div> </div>
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<div class="panel"> <div class="panel">
<h2 class="panel-heading">Geographic Location</h2> <h2 class="panel-heading">Geographic Location</h2>
<div class="panel-block is-block"> <div class="panel-block is-block">
<div class="field"> <div class="field">
<label class="label" for="lot--lotLatitude">Latitude</label> <label class="label" for="lot--lotLatitude">Latitude</label>
<div class="control"> <div class="control">
<input class="input" id="lot--lotLatitude" name="lotLatitude" type="number" min="-90" max="90" step="0.00000001" value="<%= lot.lotLatitude %>" onwheel="return false" /> <input class="input" id="lot--lotLatitude" name="lotLatitude" type="number" min="-90" max="90" step="0.00000001" value="<%= lot.lotLatitude %>" onwheel="return false" />
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<label class="label" for="lot--lotLongitude">Longitude</label> <label class="label" for="lot--lotLongitude">Longitude</label>
<div class="control"> <div class="control">
<input class="input" id="lot--lotLongitude" name="lotLongitude" type="number" min="-180" max="180" step="0.00000001" value="<%= lot.lotLongitude %>" onwheel="return false" /> <input class="input" id="lot--lotLongitude" name="lotLongitude" type="number" min="-180" max="180" step="0.00000001" value="<%= lot.lotLongitude %>" onwheel="return false" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="column"> <div class="column">
<div class="panel"> <div class="panel">
<h2 class="panel-heading">Image</h2> <h2 class="panel-heading">Image</h2>
<div class="panel-block is-block"> <div class="panel-block is-block">
<label class="label" for="lot--mapId"><%= configFunctions.getProperty("aliases.map") %></label> <label class="label" for="lot--mapId"><%= configFunctions.getProperty("aliases.map") %></label>
<div class="field has-addons"> <div class="field has-addons">
<div class="control is-expanded"> <div class="control is-expanded">
<div class="select is-fullwidth"> <div class="select is-fullwidth">
<select <select
<% if (!isCreate) { %> <% if (!isCreate) { %>
class="is-readonly" class="is-readonly"
<% } %> <% } %>
id="lot--mapId" name="mapId"> id="lot--mapId" name="mapId">
<option value="" <%= (!isCreate && lot.mapId ? " disabled" : "") %>> <option value="" <%= (!isCreate && lot.mapId ? " disabled" : "") %>>
(No <%= configFunctions.getProperty("aliases.map") %> Selected) (No <%= configFunctions.getProperty("aliases.map") %> Selected)
</option> </option>
<% let mapIsFound = false; %> <% let mapIsFound = false; %>
<% for (const map of maps) { %> <% for (const map of maps) { %>
<% <%
if (lot.mapId === map.mapId) { if (lot.mapId === map.mapId) {
mapIsFound = true; mapIsFound = true;
} }
%> %>
<option value="<%= map.mapId %>" <option value="<%= map.mapId %>"
<%= (lot.mapId === map.mapId ? " selected" : "") %> <%= (lot.mapId === map.mapId ? " selected" : "") %>
<%= (!isCreate && lot.mapId !== map.mapId ? " disabled" : "") %>> <%= (!isCreate && lot.mapId !== map.mapId ? " disabled" : "") %>>
<%= map.mapName || "(No Name)" %> <%= map.mapName || "(No Name)" %>
</option> </option>
<% } %> <% } %>
<% if (lot.mapId && !mapIsFound) { %> <% if (lot.mapId && !mapIsFound) { %>
<option value="<%= lot.mapId %>" selected> <option value="<%= lot.mapId %>" selected>
<%= lot.mapName %> <%= lot.mapName %>
</option> </option>
<% } %> <% } %>
</select> </select>
</div> </div>
</div> </div>
<div class="control"> <div class="control">
<button class="button is-unlock-field-button" data-tooltip="Unlock Field" type="button" aria-label="Unlock Field"> <button class="button is-unlock-field-button" data-tooltip="Unlock Field" type="button" aria-label="Unlock Field">
<i class="fas fa-unlock" aria-hidden="true"></i> <i class="fas fa-unlock" aria-hidden="true"></i>
</button> </button>
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<label class="label" for="lot--mapKey"> <label class="label" for="lot--mapKey">
<%= configFunctions.getProperty("aliases.map") %> SVG ID <%= configFunctions.getProperty("aliases.map") %> SVG ID
</label> </label>
<div class="control"> <div class="control">
<input class="input" id="lot--mapKey" name="mapKey" value="<%= lot.mapKey %>" maxlength="100" pattern="^[\d\w-]*$" /> <input class="input" id="lot--mapKey" name="mapKey" value="<%= lot.mapKey %>" maxlength="100" pattern="^[\d\w-]*$" />
</div> </div>
<p class="help"> <p class="help">
<a href="https://cityssm.github.io/lot-occupancy-system/docs/mapImages.html" target="_blank" rel="noreferrer"> <a href="https://cityssm.github.io/lot-occupancy-system/docs/mapImages.html" target="_blank" rel="noreferrer">
<i class="fa fa-question-circle" aria-hidden="true"></i> <i class="fa fa-question-circle" aria-hidden="true"></i>
What is the SVG ID? What is the SVG ID?
</a> </a>
</p> </p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</form> </form>
<% if (isCreate) { %> <% if (isCreate) { %>
<div class="message is-info"> <div class="message is-info">
<p class="message-body"> <p class="message-body">
Additional options will be available after the record has been created. Additional options will be available after the record has been created.
</p> </p>
</div> </div>
<% } else { %> <% } else { %>
<div class="panel"> <div class="panel">
<div class="panel-heading"> <div class="panel-heading">
@ -374,24 +374,24 @@
<div class="panel"> <div class="panel">
<div class="panel-heading"> <div class="panel-heading">
<div class="level is-mobile"> <div class="level is-mobile">
<div class="level-left"> <div class="level-left">
<div class="level-item"> <div class="level-item">
<h2 class="has-text-weight-bold is-size-5"> <h2 class="has-text-weight-bold is-size-5">
<%= configFunctions.getProperty("aliases.occupancies") %> <%= configFunctions.getProperty("aliases.occupancies") %>
<span class="tag"><%= lot.lotOccupancies.length %></span> <span class="tag"><%= lot.lotOccupancies.length %></span>
</h2> </h2>
</div> </div>
</div>
<div class="level-right">
<div class="level-item">
<a class="button is-success is-small has-text-weight-normal" href="<%= urlPrefix %>/lotOccupancies/new?lotId=<%= lot.lotId %>">
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
<span>Create New <%= configFunctions.getProperty("aliases.occupancy") %></span>
</a>
</div>
</div>
</div> </div>
<div class="level-right">
<div class="level-item">
<a class="button is-success is-small has-text-weight-normal" href="<%= urlPrefix %>/lotOccupancies/new?lotId=<%= lot.lotId %>">
<span class="icon is-small"><i class="fas fa-plus" aria-hidden="true"></i></span>
<span>Create New <%= configFunctions.getProperty("aliases.occupancy") %></span>
</a>
</div>
</div>
</div>
</div> </div>
<div class="panel-block is-block"> <div class="panel-block is-block">
<% if (lot.lotOccupancies.length === 0) { %> <% if (lot.lotOccupancies.length === 0) { %>
@ -435,16 +435,16 @@
<% } %> <% } %>
</td> </td>
<td> <td>
<% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %> <% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %>
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.occupants") %>)</span> <span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.occupants") %>)</span>
<% } else { %> <% } else { %>
<% for (const occupant of lotOccupancy.lotOccupancyOccupants) { %> <% for (const occupant of lotOccupancy.lotOccupancyOccupants) { %>
<span class="has-tooltip-left" data-tooltip="<%= occupant.lotOccupantType %>"> <span class="has-tooltip-left" data-tooltip="<%= occupant.lotOccupantType %>">
<i class="fas fa-fw fa-<%= occupant.fontAwesomeIconClass || 'user' %>" aria-hidden="true"></i> <i class="fas fa-fw fa-<%= occupant.fontAwesomeIconClass || 'user' %>" aria-hidden="true"></i>
<%= occupant.occupantName %> <%= occupant.occupantName + ' ' + occupant.occupantFamilyName %>
</span><br /> </span><br />
<% } %>
<% } %> <% } %>
<% } %>
</td> </td>
</tr> </tr>
<% } %> <% } %>

View File

@ -4,10 +4,10 @@
<ul> <ul>
<li><a href="<%= urlPrefix %>/dashboard">Home</a></li> <li><a href="<%= urlPrefix %>/dashboard">Home</a></li>
<li> <li>
<a href="<%= urlPrefix %>/lots"> <a href="<%= urlPrefix %>/lots">
<span class="icon is-small"><i class="fas fa-vector-square" aria-hidden="true"></i></span> <span class="icon is-small"><i class="fas fa-vector-square" aria-hidden="true"></i></span>
<span><%= configFunctions.getProperty("aliases.lots") %></span> <span><%= configFunctions.getProperty("aliases.lots") %></span>
</a> </a>
</li> </li>
<li class="is-active"> <li class="is-active">
<a href="#" aria-current="page"> <a href="#" aria-current="page">
@ -198,7 +198,7 @@
<% for (const occupant of lotOccupancy.lotOccupancyOccupants) { %> <% for (const occupant of lotOccupancy.lotOccupancyOccupants) { %>
<span class="has-tooltip-left" data-tooltip="<%= occupant.lotOccupantType %>"> <span class="has-tooltip-left" data-tooltip="<%= occupant.lotOccupantType %>">
<i class="fas fa-fw fa-<%= occupant.fontAwesomeIconClass || 'user' %>" aria-hidden="true"></i> <i class="fas fa-fw fa-<%= occupant.fontAwesomeIconClass || 'user' %>" aria-hidden="true"></i>
<%= occupant.occupantName %> <%= occupant.occupantName + ' ' + occupant.occupantFamilyName %>
</span><br /> </span><br />
<% } %> <% } %>
<% } %> <% } %>

View File

@ -332,13 +332,27 @@
</div> </div>
</div> </div>
</div> </div>
<div class="field"> <div class="columns">
<label class="label" for="lotOccupancy--occupantName"> <div class="column">
<div class="field">
<label class="label" for="lotOccupancy--occupantName">
<%= configFunctions.getProperty("aliases.occupant") %> Name <%= configFunctions.getProperty("aliases.occupant") %> Name
</label> </label>
<div class="control"> <div class="control">
<input class="input" id="lotOccupancy--occupantName" data-table="LotOccupancyOccupant" name="occupantName" type="text" maxlength="200" autocomplete="off" required disabled /> <input class="input" id="lotOccupancy--occupantName" data-table="LotOccupancyOccupant" name="occupantName" type="text" maxlength="200" autocomplete="off" required disabled />
</div>
</div> </div>
</div>
<div class="column">
<div class="field">
<label class="label" for="lotOccupancy--occupantFamilyName">
Family Name
</label>
<div class="control">
<input class="input" id="lotOccupancy--occupantFamilyName" data-table="LotOccupancyOccupant" name="occupantFamilyName" type="text" maxlength="200" autocomplete="off" disabled />
</div>
</div>
</div>
</div> </div>
<div class="field"> <div class="field">
<label class="label" for="lotOccupancy--occupantAddress1">Address</label> <label class="label" for="lotOccupancy--occupantAddress1">Address</label>

View File

@ -86,60 +86,60 @@
<div class="panel"> <div class="panel">
<div class="panel-block is-block"> <div class="panel-block is-block">
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<p> <p>
<strong><%= configFunctions.getProperty("aliases.occupancy") %> Type</strong><br /> <strong><%= configFunctions.getProperty("aliases.occupancy") %> Type</strong><br />
<%= lotOccupancy.occupancyType %> <%= lotOccupancy.occupancyType %>
</p> </p>
</div>
<div class="column">
<p class="mb-2">
<strong><%= configFunctions.getProperty("aliases.lot") %></strong><br />
<% if (lotOccupancy.lotId) { %>
<a href="<%= urlPrefix %>/lots/<%= lotOccupancy.lotId %>"><%= lotOccupancy.lotName %></a>
<% } else { %>
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.lot") %>)</span>
<% } %>
</p>
<p>
<strong><%= configFunctions.getProperty("aliases.map") %></strong><br />
<% if (lotOccupancy.mapId) { %>
<a href="<%= urlPrefix %>/maps/<%= lotOccupancy.mapId %>"><%= lotOccupancy.mapName %></a>
<% } else { %>
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.map") %>)</span>
<% } %>
</p>
</div>
<div class="column">
<p class="mb-2">
<strong><%= configFunctions.getProperty("aliases.occupancyStartDate") %></strong><br />
<%= lotOccupancy.occupancyStartDateString %>
</p>
<p>
<strong>End Date</strong><br />
<% if (lotOccupancy.occupancyEndDateString === "") { %>
<span class="has-text-grey">(No End Date)</span>
<% } else { %>
<%= lotOccupancy.occupancyEndDateString %>
<% } %>
</p>
</div>
<% if (lotOccupancy.lotOccupancyFields.length > 0) { %>
<div class="column">
<% for (const lotOccupancyField of lotOccupancy.lotOccupancyFields) { %>
<p class="mb-2">
<strong><%= lotOccupancyField.occupancyTypeField %></strong><br />
<% if (lotOccupancyField.lotOccupancyFieldValue) { %>
<%= lotOccupancyField.lotOccupancyFieldValue %>
<% } else { %>
<span class="has-text-grey">(No Value)</span>
<% } %>
</p>
<% } %>
</div>
<% } %>
</div> </div>
<div class="column">
<p class="mb-2">
<strong><%= configFunctions.getProperty("aliases.lot") %></strong><br />
<% if (lotOccupancy.lotId) { %>
<a href="<%= urlPrefix %>/lots/<%= lotOccupancy.lotId %>"><%= lotOccupancy.lotName %></a>
<% } else { %>
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.lot") %>)</span>
<% } %>
</p>
<p>
<strong><%= configFunctions.getProperty("aliases.map") %></strong><br />
<% if (lotOccupancy.mapId) { %>
<a href="<%= urlPrefix %>/maps/<%= lotOccupancy.mapId %>"><%= lotOccupancy.mapName %></a>
<% } else { %>
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.map") %>)</span>
<% } %>
</p>
</div>
<div class="column">
<p class="mb-2">
<strong><%= configFunctions.getProperty("aliases.occupancyStartDate") %></strong><br />
<%= lotOccupancy.occupancyStartDateString %>
</p>
<p>
<strong>End Date</strong><br />
<% if (lotOccupancy.occupancyEndDateString === "") { %>
<span class="has-text-grey">(No End Date)</span>
<% } else { %>
<%= lotOccupancy.occupancyEndDateString %>
<% } %>
</p>
</div>
<% if (lotOccupancy.lotOccupancyFields.length > 0) { %>
<div class="column">
<% for (const lotOccupancyField of lotOccupancy.lotOccupancyFields) { %>
<p class="mb-2">
<strong><%= lotOccupancyField.occupancyTypeField %></strong><br />
<% if (lotOccupancyField.lotOccupancyFieldValue) { %>
<%= lotOccupancyField.lotOccupancyFieldValue %>
<% } else { %>
<span class="has-text-grey">(No Value)</span>
<% } %>
</p>
<% } %>
</div>
<% } %>
</div>
</div> </div>
</div> </div>
@ -183,7 +183,7 @@
<% for (const lotOccupancyOccupant of lotOccupancy.lotOccupancyOccupants) { %> <% for (const lotOccupancyOccupant of lotOccupancy.lotOccupancyOccupants) { %>
<tr> <tr>
<td> <td>
<%= lotOccupancyOccupant.occupantName %><br /> <%= lotOccupancyOccupant.occupantName %> <%= lotOccupancyOccupant.occupantFamilyName %><br />
<span class="tag"> <span class="tag">
<i class="fas fa-fw fa-<%= lotOccupancyOccupant.fontAwesomeIconClass %>" aria-hidden="true"></i> <i class="fas fa-fw fa-<%= lotOccupancyOccupant.fontAwesomeIconClass %>" aria-hidden="true"></i>
<span class="ml-1"><%= lotOccupancyOccupant.lotOccupantType %></span> <span class="ml-1"><%= lotOccupancyOccupant.lotOccupantType %></span>

View File

@ -27,25 +27,25 @@
</p> </p>
<p class="has-text-centered"> <p class="has-text-centered">
<% if (funeralDirectorOccupants.length > 0) { %> <% if (funeralDirectorOccupants.length > 0) { %>
<% const funeralDirector = funeralDirectorOccupants[0]; %> <% const funeralDirector = funeralDirectorOccupants[0]; %>
<strong><%= funeralDirector.occupantName %></strong><br /> <strong><%= funeralDirector.occupantName %> <%= funeralDirector.occupantFamilyName %></strong><br />
<%= funeralDirector.occupantAddress1 %><br /> <%= funeralDirector.occupantAddress1 %><br />
<% if (funeralDirector.occupantAddress2) { %><%= funeralDirector.occupantAddress2 %><br /><% } %> <% if (funeralDirector.occupantAddress2) { %><%= funeralDirector.occupantAddress2 %><br /><% } %>
<%= funeralDirector.occupantCity %>, <%= funeralDirector.occupantProvince %><br /> <%= funeralDirector.occupantCity %>, <%= funeralDirector.occupantProvince %><br />
<%= funeralDirector.occupantPostalCode %> <%= funeralDirector.occupantPostalCode %>
<% } %> <% } %>
</p> </p>
<p class="mt-4"> <p class="mt-4">
for the purpose of the burial or other disposition of the body of: for the purpose of the burial or other disposition of the body of:
</p> </p>
<p class="has-text-centered"> <p class="has-text-centered">
<% if (deceasedOccupants.length > 0) { %> <% if (deceasedOccupants.length > 0) { %>
<% const deceased = deceasedOccupants[0]; %> <% const deceased = deceasedOccupants[0]; %>
<strong><%= deceased.occupantName %></strong> <strong><%= deceased.occupantName %> <%= deceased.occupantFamilyName %></strong>
<% } %> <% } %>
</p> </p>
<p> <p>
@ -65,16 +65,16 @@
</p> </p>
<p class="has-text-right mt-6"> <p class="has-text-right mt-6">
<span class="field mb-1" style="width:300px">&nbsp;</span><br /> <span class="field mb-1" style="width:300px">&nbsp;</span><br />
<span class="is-8pt">(Signature of Division Registrar)</span> <span class="is-8pt">(Signature of Division Registrar)</span>
</p> </p>
<p class="has-text-right"> <p class="has-text-right">
Sault Ste. Marie Sault Ste. Marie
&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp;
5724 5724
</p> </p>
<p class="has-text-right mt-4"> <p class="has-text-right mt-4">

View File

@ -3,10 +3,10 @@
let purchaserOccupants = []; let purchaserOccupants = [];
for (const purchaserLotOccupantType of purchaserLotOccupantTypes) { for (const purchaserLotOccupantType of purchaserLotOccupantTypes) {
purchaserOccupants = lotOccupancyFunctions.filterOccupantsByLotOccupantType(lotOccupancy, purchaserLotOccupantType); purchaserOccupants = lotOccupancyFunctions.filterOccupantsByLotOccupantType(lotOccupancy, purchaserLotOccupantType);
if (purchaserOccupants.length > 0) { if (purchaserOccupants.length > 0) {
break; break;
} }
} }
const purchaser = purchaserOccupants.length > 0 ? purchaserOccupants[0] : undefined; const purchaser = purchaserOccupants.length > 0 ? purchaserOccupants[0] : undefined;
@ -15,10 +15,10 @@
let recipientOccupants = []; let recipientOccupants = [];
for (const recipientLotOccupantType of recipientLotOccupantTypes) { for (const recipientLotOccupantType of recipientLotOccupantTypes) {
recipientOccupants = lotOccupancyFunctions.filterOccupantsByLotOccupantType(lotOccupancy, recipientLotOccupantType); recipientOccupants = lotOccupancyFunctions.filterOccupantsByLotOccupantType(lotOccupancy, recipientLotOccupantType);
if (recipientOccupants.length > 0) { if (recipientOccupants.length > 0) {
break; break;
} }
} }
const recipient = recipientOccupants.length > 0 ? recipientOccupants[0] : undefined; const recipient = recipientOccupants.length > 0 ? recipientOccupants[0] : undefined;
@ -73,18 +73,18 @@
</head> </head>
<body class="is-10pt"> <body class="is-10pt">
<h1 class="is-12pt has-text-centered is-capitalized"> <h1 class="is-12pt has-text-centered is-capitalized">
Contract for the Purchase of Interment Rights or<br /> Contract for the Purchase of Interment Rights or<br />
Cemetery Services Cemetery Services
</h1> </h1>
<p class="has-text-centered"> <p class="has-text-centered">
in in
<span class="field" style="width:300px"> <span class="field" style="width:300px">
<%= lotOccupancy.mapName %> <%= lotOccupancy.mapName %>
</span> </span>
cemetery<br /> cemetery<br />
<span class="is-capitalized">operated by</span><br /> <span class="is-capitalized">operated by</span><br />
The Corporation of the City of Sault Ste. Marie, 99 Foster Drive<br /> The Corporation of the City of Sault Ste. Marie, 99 Foster Drive<br />
Sault Ste. Marie Ontario &nbsp; P6A 5X6 Sault Ste. Marie Ontario &nbsp; P6A 5X6
</p> </p>
<p> <p>
Contract No. Contract No.
@ -105,71 +105,75 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
<h2 class="is-10pt">Purchaser</h2> <h2 class="is-10pt">Purchaser</h2>
<table class="is-10pt layout-table"> <table class="is-10pt layout-table">
<tbody> <tbody>
<tr> <tr>
<th class="has-text-left">Name:</th> <th class="has-text-left">Name:</th>
<td class="has-border-bottom"><%= purchaser ? purchaser.occupantName : "" %></td> <td class="has-border-bottom">
</tr><tr> <%= purchaser ? purchaser.occupantName + ' ' + purchaser.occupantFamilyName : "" %>
<th class="has-text-left" rowspan="2" style="vertical-align:top">Address:</th> </td>
<td class="has-border-bottom"><%= purchaser ? purchaser.occupantAddress1 : "" %>&nbsp;</td> </tr><tr>
</tr><tr> <th class="has-text-left" rowspan="2" style="vertical-align:top">Address:</th>
<td class="has-border-bottom"><%= purchaser ? purchaser.occupantAddress2 : "" %>&nbsp;</td> <td class="has-border-bottom"><%= purchaser ? purchaser.occupantAddress1 : "" %>&nbsp;</td>
</tr><tr> </tr><tr>
<th class="has-text-left">City:</th> <td class="has-border-bottom"><%= purchaser ? purchaser.occupantAddress2 : "" %>&nbsp;</td>
<td class="has-border-bottom"><%= purchaser ? purchaser.occupantCity : "" %>&nbsp;</td> </tr><tr>
</tr><tr> <th class="has-text-left">City:</th>
<th class="has-text-left">Province:</th> <td class="has-border-bottom"><%= purchaser ? purchaser.occupantCity : "" %>&nbsp;</td>
<td class="has-border-bottom"><%= purchaser ? purchaser.occupantProvince : "" %>&nbsp;</td> </tr><tr>
</tr><tr> <th class="has-text-left">Province:</th>
<th class="has-text-left has-text-nowrap">Postal Code:</th> <td class="has-border-bottom"><%= purchaser ? purchaser.occupantProvince : "" %>&nbsp;</td>
<td class="has-border-bottom" style="width:100%"><%= purchaser ? purchaser.occupantPostalCode : "" %>&nbsp;</td> </tr><tr>
</tr><tr> <th class="has-text-left has-text-nowrap">Postal Code:</th>
<th class="has-text-left">Telephone:</th> <td class="has-border-bottom" style="width:100%"><%= purchaser ? purchaser.occupantPostalCode : "" %>&nbsp;</td>
<td class="has-border-bottom"><%= purchaser ? purchaser.occupantPhoneNumber : "" %>&nbsp;</td> </tr><tr>
</tr><tr> <th class="has-text-left">Telephone:</th>
<th class="has-text-left">E-mail:</th> <td class="has-border-bottom"><%= purchaser ? purchaser.occupantPhoneNumber : "" %>&nbsp;</td>
<td class="has-border-bottom"><%= purchaser ? purchaser.occupantEmailAddress : "" %>&nbsp;</td> </tr><tr>
</tr> <th class="has-text-left">E-mail:</th>
</tbody> <td class="has-border-bottom"><%= purchaser ? purchaser.occupantEmailAddress : "" %>&nbsp;</td>
</table> </tr>
</tbody>
</table>
</td> </td>
<td> <td>
<h2 class="is-10pt">Recipient</h2> <h2 class="is-10pt">Recipient</h2>
<table class="is-10pt layout-table"> <table class="is-10pt layout-table">
<tbody> <tbody>
<tr> <tr>
<th class="has-text-left">Name:</th> <th class="has-text-left">Name:</th>
<td class="has-border-bottom"><%= recipient ? recipient.occupantName : "" %></td> <td class="has-border-bottom">
</tr><tr> <%= recipient ? recipient.occupantName + ' ' + recipient.occupantFamilyName : "" %>
<th class="has-text-left" rowspan="2" style="vertical-align:top">Address:</th> </td>
<td class="has-border-bottom"><%= recipient ? recipient.occupantAddress1 : "" %>&nbsp;</td> </tr><tr>
</tr><tr> <th class="has-text-left" rowspan="2" style="vertical-align:top">Address:</th>
<td class="has-border-bottom"><%= recipient ? recipient.occupantAddress2 : "" %>&nbsp;</td> <td class="has-border-bottom"><%= recipient ? recipient.occupantAddress1 : "" %>&nbsp;</td>
</tr><tr> </tr><tr>
<th class="has-text-left">City:</th> <td class="has-border-bottom"><%= recipient ? recipient.occupantAddress2 : "" %>&nbsp;</td>
<td class="has-border-bottom"><%= recipient ? recipient.occupantCity : "" %>&nbsp;</td> </tr><tr>
</tr><tr> <th class="has-text-left">City:</th>
<th class="has-text-left">Province:</th> <td class="has-border-bottom"><%= recipient ? recipient.occupantCity : "" %>&nbsp;</td>
<td class="has-border-bottom"><%= recipient ? recipient.occupantProvince : "" %>&nbsp;</td> </tr><tr>
</tr><tr> <th class="has-text-left">Province:</th>
<th class="has-text-left">Postal Code:</th> <td class="has-border-bottom"><%= recipient ? recipient.occupantProvince : "" %>&nbsp;</td>
<td class="has-border-bottom"><%= recipient ? recipient.occupantPostalCode : "" %>&nbsp;</td> </tr><tr>
</tr><tr> <th class="has-text-left">Postal Code:</th>
<th class="has-text-left">Telephone:</th> <td class="has-border-bottom"><%= recipient ? recipient.occupantPostalCode : "" %>&nbsp;</td>
<td class="has-border-bottom"><%= recipient ? recipient.occupantPhoneNumber : "" %>&nbsp;</td> </tr><tr>
</tr><tr> <th class="has-text-left">Telephone:</th>
<th class="has-text-left">E-mail:</th> <td class="has-border-bottom"><%= recipient ? recipient.occupantPhoneNumber : "" %>&nbsp;</td>
<td class="has-border-bottom"><%= recipient ? recipient.occupantEmailAddress : "" %>&nbsp;</td> </tr><tr>
</tr><tr> <th class="has-text-left">E-mail:</th>
<th class="has-text-left">Date of birth:</th> <td class="has-border-bottom"><%= recipient ? recipient.occupantEmailAddress : "" %>&nbsp;</td>
<td class="has-border-bottom">&nbsp;</td> </tr><tr>
</tr><tr> <th class="has-text-left">Date of birth:</th>
<th class="has-text-left has-text-nowrap">Place of birth:</th> <td class="has-border-bottom">&nbsp;</td>
<td class="has-border-bottom" style="width:100%">&nbsp;</td> </tr><tr>
</tr> <th class="has-text-left has-text-nowrap">Place of birth:</th>
</tbody> <td class="has-border-bottom" style="width:100%">&nbsp;</td>
</tr>
</tbody>
</table> </table>
</td> </td>
</tr> </tr>
@ -183,45 +187,45 @@
</span> </span>
</p> </p>
<p> <p>
This Contract for Purchase of Interment Rights or Cemetery Services This Contract for Purchase of Interment Rights or Cemetery Services
is between the Purchaser and The Corporation of the City of Sault Ste. Marie (Corporation) is between the Purchaser and The Corporation of the City of Sault Ste. Marie (Corporation)
concerning interment rights or cemetery services for the Recipient(s) concerning interment rights or cemetery services for the Recipient(s)
as identified in this Contract. as identified in this Contract.
</p> </p>
<p> <p>
The Purchaser (if different than the Recipient) The Purchaser (if different than the Recipient)
represents being legally authorized or charged with the responsibility for represents being legally authorized or charged with the responsibility for
the Recipient's interment rights and prepaid cemetery services the Recipient's interment rights and prepaid cemetery services
specified in this Contract. This Contract will be enforceable to specified in this Contract. This Contract will be enforceable to
the benefit of and be binding upon the parties hereto the benefit of and be binding upon the parties hereto
and their respective heirs, executors, administrators, successors, and assigns. and their respective heirs, executors, administrators, successors, and assigns.
</p> </p>
<table class="layout-table" style="table-layout:fixed"> <table class="layout-table" style="table-layout:fixed">
<tr> <tr>
<td> <td>
<h2 class="is-10pt is-capitalized">Details</h2> <h2 class="is-10pt is-capitalized">Details</h2>
<table class="is-10pt data-table"> <table class="is-10pt data-table">
<tr>
<td><%= configFunctions.getProperty("aliases.map") %></td>
<td><%= lotOccupancy.mapName %></td>
</tr>
<tr>
<td><%= configFunctions.getProperty("aliases.lot") %></td>
<td><%= lotOccupancy.lotName %></td>
</tr>
<%
for (const field of lotOccupancy.lotOccupancyFields) {
if (field.lotOccupancyFieldValue) {
%>
<tr> <tr>
<td><%= configFunctions.getProperty("aliases.map") %></td> <td><%= field.occupancyTypeField %></td>
<td><%= lotOccupancy.mapName %></td> <td><%= field.lotOccupancyFieldValue %></td>
</tr> </tr>
<tr> <%
<td><%= configFunctions.getProperty("aliases.lot") %></td>
<td><%= lotOccupancy.lotName %></td>
</tr>
<%
for (const field of lotOccupancy.lotOccupancyFields) {
if (field.lotOccupancyFieldValue) {
%>
<tr>
<td><%= field.occupancyTypeField %></td>
<td><%= field.lotOccupancyFieldValue %></td>
</tr>
<%
}
} }
%> }
</table> %>
</table>
</td> </td>
<td> <td>
<h2 class="is-10pt is-capitalized">Interment Rights and Services</h2> <h2 class="is-10pt is-capitalized">Interment Rights and Services</h2>

View File

@ -54,7 +54,10 @@
<td><%= occupancy.occupancyStartEndString %></td> <td><%= occupancy.occupancyStartEndString %></td>
<td> <td>
<% for (const occupant of occupancy.lotOccupancyOccupants) { %> <% for (const occupant of occupancy.lotOccupancyOccupants) { %>
<%= occupant.lotOccupantType %>: <%= occupant.occupantName %><br /> <%= occupant.lotOccupantType %>:
<%= occupant.occupantName %>
<%= occupant.occupantFamilyName %>
<br />
<% } %> <% } %>
</td> </td>
</tr> </tr>

View File

@ -76,7 +76,7 @@
<% for (const lotOccupancyOccupant of lotOccupancy.lotOccupancyOccupants) { %> <% for (const lotOccupancyOccupant of lotOccupancy.lotOccupancyOccupants) { %>
<tr> <tr>
<td><%= lotOccupancyOccupant.lotOccupantType %></td> <td><%= lotOccupancyOccupant.lotOccupantType %></td>
<td><%= lotOccupancyOccupant.occupantName %></td> <td><%= lotOccupancyOccupant.occupantName %> <%= lotOccupancyOccupant.occupantFamilyName %></td>
<td> <td>
<%= lotOccupancyOccupant.occupantAddress1 %><br /> <%= lotOccupancyOccupant.occupantAddress1 %><br />
<% if (lotOccupancyOccupant.occupantAddress2 && lotOccupancyOccupant.occupantAddress2 !== "") { %> <% if (lotOccupancyOccupant.occupantAddress2 && lotOccupancyOccupant.occupantAddress2 !== "") { %>

View File

@ -87,172 +87,173 @@
<div class="columns is-desktop"> <div class="columns is-desktop">
<div class="column"> <div class="column">
<div class="panel"> <div class="panel">
<div class="panel-block is-block"> <div class="panel-block is-block">
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<p class="mb-2"> <p class="mb-2">
<strong>Work Order Type</strong><br /> <strong>Work Order Type</strong><br />
<%= workOrder.workOrderType %> <%= workOrder.workOrderType %>
</p> </p>
<p> <p>
<strong>Description</strong><br /> <strong>Description</strong><br />
<% if (workOrder.workOrderDescription) { %> <% if (workOrder.workOrderDescription) { %>
<%= workOrder.workOrderDescription %> <%= workOrder.workOrderDescription %>
<% } else { %> <% } else { %>
<span class="has-text-grey">(No Description)</span> <span class="has-text-grey">(No Description)</span>
<% } %> <% } %>
</p> </p>
</div> </div>
<div class="column"> <div class="column">
<p class="mb-2"> <p class="mb-2">
<strong><%= configFunctions.getProperty("aliases.workOrderOpenDate") %></strong><br /> <strong><%= configFunctions.getProperty("aliases.workOrderOpenDate") %></strong><br />
<%= workOrder.workOrderOpenDateString %> <%= workOrder.workOrderOpenDateString %>
</p> </p>
<p> <p>
<strong><%= configFunctions.getProperty("aliases.workOrderCloseDate") %></strong><br /> <strong><%= configFunctions.getProperty("aliases.workOrderCloseDate") %></strong><br />
<% if (workOrder.workOrderCloseDate) { %> <% if (workOrder.workOrderCloseDate) { %>
<%= workOrder.workOrderCloseDateString %> <%= workOrder.workOrderCloseDateString %>
<% } else { %> <% } else { %>
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.workOrderCloseDate") %>)</span> <span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.workOrderCloseDate") %>)</span>
<% } %> <% } %>
</p> </p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="panel"> <div class="panel">
<h2 class="panel-heading">Related <%= configFunctions.getProperty("aliases.lots") %></h2> <h2 class="panel-heading">Related <%= configFunctions.getProperty("aliases.lots") %></h2>
<div class="panel-block is-block"> <div class="panel-block is-block">
<% <%
const tabToSelect = (workOrder.workOrderLotOccupancies.length > 0 || workOrder.workOrderLots.length === 0 ? "lotOccupancies" : "lots"); const tabToSelect = (workOrder.workOrderLotOccupancies.length > 0 || workOrder.workOrderLots.length === 0 ? "lotOccupancies" : "lots");
%> %>
<div class="tabs is-boxed"> <div class="tabs is-boxed">
<ul> <ul>
<li class="<%= (tabToSelect === "lotOccupancies" ? "is-active" : "") %>"> <li class="<%= (tabToSelect === "lotOccupancies" ? "is-active" : "") %>">
<a href="#relatedTab--lotOccupancies"> <a href="#relatedTab--lotOccupancies">
<span><%= configFunctions.getProperty("aliases.occupancies") %></span> <span><%= configFunctions.getProperty("aliases.occupancies") %></span>
<span class="ml-2 tag"><%= workOrder.workOrderLotOccupancies.length %></span> <span class="ml-2 tag"><%= workOrder.workOrderLotOccupancies.length %></span>
</a> </a>
</li> </li>
<li class="<%= (tabToSelect === "lots" ? "is-active" : "") %>"> <li class="<%= (tabToSelect === "lots" ? "is-active" : "") %>">
<a href="#relatedTab--lots"> <a href="#relatedTab--lots">
<span><%= configFunctions.getProperty("aliases.lots") %></span> <span><%= configFunctions.getProperty("aliases.lots") %></span>
<span class="ml-2 tag"><%= workOrder.workOrderLots.length %></span> <span class="ml-2 tag"><%= workOrder.workOrderLots.length %></span>
</a> </a>
</li> </li>
</ul> </ul>
</div> </div>
<div class="tab-container"> <div class="tab-container">
<div class="<%= (tabToSelect === "lotOccupancies" ? "" : "is-hidden") %>" id="relatedTab--lotOccupancies"> <div class="<%= (tabToSelect === "lotOccupancies" ? "" : "is-hidden") %>" id="relatedTab--lotOccupancies">
<% if (workOrder.workOrderLotOccupancies.length === 0) { %> <% if (workOrder.workOrderLotOccupancies.length === 0) { %>
<div class="message is-info"> <div class="message is-info">
<p class="message-body"> <p class="message-body">
There are no There are no
<%= configFunctions.getProperty("aliases.lot").toLowerCase() %> <%= configFunctions.getProperty("aliases.lot").toLowerCase() %>
<%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %> <%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %>
records associated with this work order. records associated with this work order.
</p> </p>
</div> </div>
<% } else { %> <% } else { %>
<% const currentDate = dateTimeFunctions.dateToInteger(new Date()); %> <% const currentDate = dateTimeFunctions.dateToInteger(new Date()); %>
<table class="table is-fullwidth is-striped is-hoverable"> <table class="table is-fullwidth is-striped is-hoverable">
<thead> <thead>
<tr> <tr>
<th class="has-width-1"></th> <th class="has-width-1"></th>
<th><%= configFunctions.getProperty("aliases.occupancy") %> Type</th> <th><%= configFunctions.getProperty("aliases.occupancy") %> Type</th>
<th><%= configFunctions.getProperty("aliases.lot") %></th> <th><%= configFunctions.getProperty("aliases.lot") %></th>
<th><%= configFunctions.getProperty("aliases.occupancyStartDate") %></th> <th><%= configFunctions.getProperty("aliases.occupancyStartDate") %></th>
<th>End Date</th> <th>End Date</th>
<th><%= configFunctions.getProperty("aliases.occupants") %></th> <th><%= configFunctions.getProperty("aliases.occupants") %></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% for (const lotOccupancy of workOrder.workOrderLotOccupancies) { %> <% for (const lotOccupancy of workOrder.workOrderLotOccupancies) { %>
<% const isActive = !(lotOccupancy.occupancyEndDate && lotOccupancy.occupancyEndDate < currentDate); %> <% const isActive = !(lotOccupancy.occupancyEndDate && lotOccupancy.occupancyEndDate < currentDate); %>
<tr> <tr>
<td class="has-text-centered"> <td class="has-text-centered">
<% if (isActive) { %> <% if (isActive) { %>
<i class="fas fa-play" title="Current <%= configFunctions.getProperty("aliases.occupancy") %>"></i> <i class="fas fa-play" title="Current <%= configFunctions.getProperty("aliases.occupancy") %>"></i>
<% } else { %> <% } else { %>
<i class="fas fa-stop" title="Previous <%= configFunctions.getProperty("aliases.occupancy") %>"></i> <i class="fas fa-stop" title="Previous <%= configFunctions.getProperty("aliases.occupancy") %>"></i>
<% } %> <% } %>
</td> </td>
<td> <td>
<a class="has-text-weight-bold" <a class="has-text-weight-bold"
href="<%= urlPrefix %>/lotOccupancies/<%= lotOccupancy.lotOccupancyId %>"> href="<%= urlPrefix %>/lotOccupancies/<%= lotOccupancy.lotOccupancyId %>">
<%= lotOccupancy.occupancyType %> <%= lotOccupancy.occupancyType %>
</a> </a>
</td> </td>
<td> <td>
<% if (lotOccupancy.lotId) { %> <% if (lotOccupancy.lotId) { %>
<%= lotOccupancy.lotName %> <%= lotOccupancy.lotName %>
<% } else { %> <% } else { %>
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.lot") %>)</span> <span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.lot") %>)</span>
<% } %> <% } %>
</td> </td>
<td><%= lotOccupancy.occupancyStartDateString %></td> <td><%= lotOccupancy.occupancyStartDateString %></td>
<td> <td>
<% if (lotOccupancy.occupancyEndDate) { %> <% if (lotOccupancy.occupancyEndDate) { %>
<%= lotOccupancy.occupancyEndDateString %> <%= lotOccupancy.occupancyEndDateString %>
<% } else { %> <% } else { %>
<span class="has-text-grey">(No End Date)</span> <span class="has-text-grey">(No End Date)</span>
<% } %> <% } %>
</td> </td>
<td> <td>
<% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %> <% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %>
<span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.occupants") %>)</span> <span class="has-text-grey">(No <%= configFunctions.getProperty("aliases.occupants") %>)</span>
<% } else { %> <% } else { %>
<% for (const occupant of lotOccupancy.lotOccupancyOccupants) { %> <% for (const occupant of lotOccupancy.lotOccupancyOccupants) { %>
<span class="has-tooltip-left" data-tooltip="<%= occupant.lotOccupantType %>"> <span class="has-tooltip-left" data-tooltip="<%= occupant.lotOccupantType %>">
<i class="fas fa-fw fa-<%= occupant.fontAwesomeIconClass || 'user' %>" aria-hidden="true"></i> <i class="fas fa-fw fa-<%= occupant.fontAwesomeIconClass || 'user' %>" aria-hidden="true"></i>
<%= occupant.occupantName %> <%= occupant.occupantName %>
</span><br /> <%= occupant.occupantFamilyName %>
<% } %> </span><br />
<% } %> <% } %>
</td> <% } %>
</tr> </td>
<% } %> </tr>
</tbody> <% } %>
</table> </tbody>
<% } %> </table>
</div> <% } %>
<div class="<%= (tabToSelect === "lots" ? "" : "is-hidden") %>" id="relatedTab--lots"> </div>
<% if (workOrder.workOrderLots.length === 0) { %> <div class="<%= (tabToSelect === "lots" ? "" : "is-hidden") %>" id="relatedTab--lots">
<div class="message is-info"> <% if (workOrder.workOrderLots.length === 0) { %>
<p class="message-body"> <div class="message is-info">
There are no <p class="message-body">
<%= configFunctions.getProperty("aliases.lots").toLowerCase() %> There are no
records associated with this work order. <%= configFunctions.getProperty("aliases.lots").toLowerCase() %>
</p> records associated with this work order.
</div> </p>
<% } else { %> </div>
<table class="table is-fullwidth is-striped is-hoverable"> <% } else { %>
<thead> <table class="table is-fullwidth is-striped is-hoverable">
<tr> <thead>
<th><%= configFunctions.getProperty("aliases.lot") %></th> <tr>
<th><%= configFunctions.getProperty("aliases.map") %></th> <th><%= configFunctions.getProperty("aliases.lot") %></th>
<th><%= configFunctions.getProperty("aliases.lot") %> Type</th> <th><%= configFunctions.getProperty("aliases.map") %></th>
<th>Status</th> <th><%= configFunctions.getProperty("aliases.lot") %> Type</th>
</tr> <th>Status</th>
</thead> </tr>
<tbody> </thead>
<% for (const lot of workOrder.workOrderLots) { %> <tbody>
<tr> <% for (const lot of workOrder.workOrderLots) { %>
<td> <tr>
<a class="has-text-weight-bold" href="<%= urlPrefix %>/lots/<%= lot.lotId %>"><%= lot.lotName %></a> <td>
</td> <a class="has-text-weight-bold" href="<%= urlPrefix %>/lots/<%= lot.lotId %>"><%= lot.lotName %></a>
<td><%= lot.mapName %></td> </td>
<td><%= lot.lotType %></td> <td><%= lot.mapName %></td>
<td><%= lot.lotStatus %></td> <td><%= lot.lotType %></td>
</tr> <td><%= lot.lotStatus %></td>
<% } %> </tr>
</tbody> <% } %>
</table> </tbody>
<% } %> </table>
</div> <% } %>
</div> </div>
</div> </div>
</div>
</div> </div>
<% if (workOrder.workOrderComments.length > 0) { %> <% if (workOrder.workOrderComments.length > 0) { %>