Compare commits
No commits in common. "main" and "v1.0.0-alpha.10" have entirely different histories.
main
...
v1.0.0-alp
|
|
@ -1,2 +1,2 @@
|
|||
theme: jekyll-theme-cayman
|
||||
title: Sunrise Cemetery Management System (CMS)
|
||||
title: Sunrise Cemetery Management System
|
||||
|
|
@ -15,10 +15,10 @@ export default function addContractTransaction(contractTransactionForm, user) {
|
|||
transactionIndex = maxIndexResult.transactionIndex + 1;
|
||||
}
|
||||
const rightNow = new Date();
|
||||
const transactionDate = (contractTransactionForm.transactionDateString ?? '') === ''
|
||||
const transactionDate = contractTransactionForm.transactionDateString === ''
|
||||
? dateToInteger(rightNow)
|
||||
: dateStringToInteger(contractTransactionForm.transactionDateString);
|
||||
const transactionTime = (contractTransactionForm.transactionTimeString ?? '') === ''
|
||||
const transactionTime = contractTransactionForm.transactionTimeString === ''
|
||||
? dateToTimeInteger(rightNow)
|
||||
: timeStringToInteger(contractTransactionForm.transactionTimeString);
|
||||
database
|
||||
|
|
|
|||
|
|
@ -48,14 +48,14 @@ export default function addContractTransaction(
|
|||
const rightNow = new Date()
|
||||
|
||||
const transactionDate =
|
||||
(contractTransactionForm.transactionDateString ?? '') === ''
|
||||
contractTransactionForm.transactionDateString === ''
|
||||
? dateToInteger(rightNow)
|
||||
: dateStringToInteger(
|
||||
contractTransactionForm.transactionDateString as DateString
|
||||
)
|
||||
|
||||
const transactionTime =
|
||||
(contractTransactionForm.transactionTimeString ?? '') === ''
|
||||
contractTransactionForm.transactionTimeString === ''
|
||||
? dateToTimeInteger(rightNow)
|
||||
: timeStringToInteger(
|
||||
contractTransactionForm.transactionTimeString as TimeString
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ export default function getBurialSites(filters, options, connectedDatabase) {
|
|||
group by burialSiteId
|
||||
) o on l.burialSiteId = o.burialSiteId
|
||||
${sqlWhereClause}`)
|
||||
.pluck()
|
||||
.get(sqlParameters);
|
||||
.get(sqlParameters).recordCount;
|
||||
}
|
||||
let burialSites = [];
|
||||
if (options.limit === -1 || count > 0) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ export default function getBurialSites(
|
|||
let count = 0
|
||||
|
||||
if (options.limit !== -1) {
|
||||
count = database
|
||||
count = (
|
||||
database
|
||||
.prepare(
|
||||
`select count(*) as recordCount
|
||||
from BurialSites l
|
||||
|
|
@ -52,8 +53,8 @@ export default function getBurialSites(
|
|||
) o on l.burialSiteId = o.burialSiteId
|
||||
${sqlWhereClause}`
|
||||
)
|
||||
.pluck()
|
||||
.get(sqlParameters) as number
|
||||
.get(sqlParameters) as { recordCount: number }
|
||||
).recordCount
|
||||
}
|
||||
|
||||
let burialSites: BurialSite[] = []
|
||||
|
|
|
|||
|
|
@ -24,14 +24,10 @@ export default async function getContracts(filters, options, connectedDatabase)
|
|||
left join BurialSites l on c.burialSiteId = l.burialSiteId
|
||||
left join Cemeteries m on l.cemeteryId = m.cemeteryId
|
||||
${sqlWhereClause}`)
|
||||
.pluck()
|
||||
.get(sqlParameters);
|
||||
.get(sqlParameters).recordCount;
|
||||
}
|
||||
let contracts = [];
|
||||
if (count !== 0) {
|
||||
const sqlLimitClause = isLimited
|
||||
? ` limit ${options.limit} offset ${options.offset}`
|
||||
: '';
|
||||
contracts = database
|
||||
.prepare(`select c.contractId,
|
||||
c.contractTypeId, t.contractType, t.isPreneed,
|
||||
|
|
@ -68,7 +64,7 @@ export default async function getContracts(filters, options, connectedDatabase)
|
|||
l.burialSiteNameSegment4,
|
||||
l.burialSiteNameSegment5,
|
||||
c.burialSiteId, c.contractId desc`}
|
||||
${sqlLimitClause}`)
|
||||
${isLimited ? ` limit ${options.limit} offset ${options.offset}` : ''}`)
|
||||
.all(sqlParameters);
|
||||
if (!isLimited) {
|
||||
count = contracts.length;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,8 @@ export default async function getContracts(
|
|||
const isLimited = options.limit !== -1
|
||||
|
||||
if (isLimited) {
|
||||
count = database
|
||||
count = (
|
||||
database
|
||||
.prepare(
|
||||
`select count(*) as recordCount
|
||||
from Contracts c
|
||||
|
|
@ -89,17 +90,13 @@ export default async function getContracts(
|
|||
left join Cemeteries m on l.cemeteryId = m.cemeteryId
|
||||
${sqlWhereClause}`
|
||||
)
|
||||
.pluck()
|
||||
.get(sqlParameters) as number
|
||||
.get(sqlParameters) as { recordCount: number }
|
||||
).recordCount
|
||||
}
|
||||
|
||||
let contracts: Contract[] = []
|
||||
|
||||
if (count !== 0) {
|
||||
const sqlLimitClause = isLimited
|
||||
? ` limit ${options.limit} offset ${options.offset}`
|
||||
: ''
|
||||
|
||||
contracts = database
|
||||
.prepare(
|
||||
`select c.contractId,
|
||||
|
|
@ -139,7 +136,7 @@ export default async function getContracts(
|
|||
l.burialSiteNameSegment5,
|
||||
c.burialSiteId, c.contractId desc`
|
||||
}
|
||||
${sqlLimitClause}`
|
||||
${isLimited ? ` limit ${options.limit} offset ${options.offset}` : ''}`
|
||||
)
|
||||
.all(sqlParameters) as Contract[]
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ export default function getNextWorkOrderNumber(connectedDatabase) {
|
|||
const database = connectedDatabase ?? sqlite(sunriseDB, { readonly: true });
|
||||
const paddingLength = getConfigProperty('settings.workOrders.workOrderNumberLength');
|
||||
const currentYearString = new Date().getFullYear().toString();
|
||||
// eslint-disable-next-line security/detect-non-literal-regexp
|
||||
const regex = new RegExp(`^${currentYearString}-\\d+$`);
|
||||
database.function(
|
||||
// eslint-disable-next-line no-secrets/no-secrets
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ export default function getNextWorkOrderNumber(
|
|||
)
|
||||
const currentYearString = new Date().getFullYear().toString()
|
||||
|
||||
// eslint-disable-next-line security/detect-non-literal-regexp
|
||||
const regex = new RegExp(`^${currentYearString}-\\d+$`)
|
||||
|
||||
database.function(
|
||||
|
|
|
|||
|
|
@ -14,8 +14,7 @@ export async function getWorkOrders(filters, options, connectedDatabase) {
|
|||
.prepare(`select count(*) as recordCount
|
||||
from WorkOrders w
|
||||
${sqlWhereClause}`)
|
||||
.pluck()
|
||||
.get(sqlParameters);
|
||||
.get(sqlParameters).recordCount;
|
||||
let workOrders = [];
|
||||
if (count > 0) {
|
||||
workOrders = database
|
||||
|
|
|
|||
|
|
@ -48,14 +48,15 @@ export async function getWorkOrders(
|
|||
|
||||
const { sqlParameters, sqlWhereClause } = buildWhereClause(filters)
|
||||
|
||||
const count: number = database
|
||||
const count: number = (
|
||||
database
|
||||
.prepare(
|
||||
`select count(*) as recordCount
|
||||
from WorkOrders w
|
||||
${sqlWhereClause}`
|
||||
)
|
||||
.pluck()
|
||||
.get(sqlParameters) as number
|
||||
.get(sqlParameters) as { recordCount: number }
|
||||
).recordCount
|
||||
|
||||
let workOrders: WorkOrder[] = []
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable @typescript-eslint/no-magic-numbers, max-lines, no-secrets/no-secrets */
|
||||
/* eslint-disable max-lines, no-secrets/no-secrets */
|
||||
import sqlite from 'better-sqlite3';
|
||||
import Debug from 'debug';
|
||||
import { DEBUG_NAMESPACE } from '../debug.config.js';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
|
||||
/* eslint-disable @typescript-eslint/no-magic-numbers, max-lines, no-secrets/no-secrets */
|
||||
/* eslint-disable max-lines, no-secrets/no-secrets */
|
||||
|
||||
import sqlite from 'better-sqlite3'
|
||||
import Debug from 'debug'
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { clearCacheByTableName } from '../helpers/functions.cache.js'
|
|||
|
||||
export interface UpdateBurialSiteTypeFieldForm {
|
||||
burialSiteTypeFieldId: number | string
|
||||
|
||||
burialSiteTypeField: string
|
||||
isRequired: '0' | '1'
|
||||
|
||||
|
|
|
|||
|
|
@ -15,13 +15,11 @@ export default async function handler(
|
|||
|
||||
response.json({
|
||||
success: true,
|
||||
|
||||
fileName
|
||||
})
|
||||
} else {
|
||||
response.json({
|
||||
success: false,
|
||||
|
||||
errorMessage: 'Unable to write backup file.'
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,2 @@
|
|||
import type { Request, Response } from 'express';
|
||||
export default function handler(request: Request<{
|
||||
cemeteryId: string;
|
||||
}>, response: Response): Promise<void>;
|
||||
export default function handler(request: Request, response: Response): Promise<void>;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { getConfigProperty } from '../../helpers/config.helpers.js'
|
|||
import { getCemeterySVGs } from '../../helpers/images.helpers.js'
|
||||
|
||||
export default async function handler(
|
||||
request: Request<{ cemeteryId: string }>,
|
||||
request: Request,
|
||||
response: Response
|
||||
): Promise<void> {
|
||||
const cemetery = getCemetery(request.params.cemeteryId)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,2 @@
|
|||
import type { Request, Response } from 'express';
|
||||
export default function handler(request: Request<{
|
||||
cemeteryId: string;
|
||||
}>, response: Response): void;
|
||||
export default function handler(request: Request, response: Response): void;
|
||||
|
|
|
|||
|
|
@ -3,10 +3,7 @@ import type { Request, Response } from 'express'
|
|||
import getPreviousCemeteryId from '../../database/getPreviousCemeteryId.js'
|
||||
import { getConfigProperty } from '../../helpers/config.helpers.js'
|
||||
|
||||
export default function handler(
|
||||
request: Request<{ cemeteryId: string }>,
|
||||
response: Response
|
||||
): void {
|
||||
export default function handler(request: Request, response: Response): void {
|
||||
const cemeteryId = Number.parseInt(request.params.cemeteryId, 10)
|
||||
|
||||
const previousCemeteryId = getPreviousCemeteryId(cemeteryId)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,2 @@
|
|||
import type { Request, Response } from 'express';
|
||||
export default function handler(request: Request<{
|
||||
cemeteryId: string;
|
||||
}>, response: Response): void;
|
||||
export default function handler(request: Request, response: Response): void;
|
||||
|
|
|
|||
|
|
@ -5,10 +5,7 @@ import getBurialSiteTypeSummary from '../../database/getBurialSiteTypeSummary.js
|
|||
import getCemetery from '../../database/getCemetery.js'
|
||||
import { getConfigProperty } from '../../helpers/config.helpers.js'
|
||||
|
||||
export default function handler(
|
||||
request: Request<{ cemeteryId: string }>,
|
||||
response: Response
|
||||
): void {
|
||||
export default function handler(request: Request, response: Response): void {
|
||||
const cemetery = getCemetery(request.params.cemeteryId)
|
||||
|
||||
if (cemetery === undefined) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export default function handler(request, response) {
|
|||
});
|
||||
if (success) {
|
||||
response.on('finish', () => {
|
||||
clearNextPreviousBurialSiteIdCache();
|
||||
clearNextPreviousBurialSiteIdCache(-1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export default function handler(
|
|||
|
||||
if (success) {
|
||||
response.on('finish', () => {
|
||||
clearNextPreviousBurialSiteIdCache()
|
||||
clearNextPreviousBurialSiteIdCache(-1)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { dateToInteger, dateToString } from '@cityssm/utils-datetime'
|
||||
import type { Request, Response } from 'express'
|
||||
|
||||
import { dateToInteger, dateToString } from '@cityssm/utils-datetime'
|
||||
|
||||
import getBurialSite from '../../database/getBurialSite.js'
|
||||
import getBurialSiteDirectionsOfArrival, { defaultDirectionsOfArrival } from '../../database/getBurialSiteDirectionsOfArrival.js'
|
||||
import getCemeteries from '../../database/getCemeteries.js'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { dateToString } from '@cityssm/utils-datetime'
|
||||
import type { Request, Response } from 'express'
|
||||
|
||||
import { dateToString } from '@cityssm/utils-datetime'
|
||||
|
||||
import getWorkOrderMilestones from '../../database/getWorkOrderMilestones.js'
|
||||
|
||||
export default async function handler(
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
import type { NextFunction, Request, Response } from 'express'
|
||||
|
||||
import path from 'node:path'
|
||||
|
||||
import { convertHTMLToPDF } from '@cityssm/pdf-puppeteer'
|
||||
import camelcase from 'camelcase'
|
||||
import { renderFile as renderEjsFile } from 'ejs'
|
||||
import type { NextFunction, Request, Response } from 'express'
|
||||
|
||||
import { getConfigProperty } from '../../helpers/config.helpers.js'
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { Request, Response } from 'express'
|
||||
|
||||
import papaParse from 'papaparse'
|
||||
|
||||
import getReportData, {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { dateToString } from '@cityssm/utils-datetime'
|
||||
import type { Request, Response } from 'express'
|
||||
|
||||
import { dateToString } from '@cityssm/utils-datetime'
|
||||
|
||||
import getCemeteries from '../../database/getCemeteries.js'
|
||||
import {
|
||||
getBurialSiteStatuses,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { dateToInteger, dateToString } from '@cityssm/utils-datetime'
|
||||
import type { Request, Response } from 'express'
|
||||
|
||||
import { dateToInteger, dateToString } from '@cityssm/utils-datetime'
|
||||
|
||||
import { getWorkOrderTypes } from '../../helpers/functions.cache.js'
|
||||
import type { WorkOrder } from '../../types/record.types.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const birthDate = new Date(birthDateStringElement.value);
|
||||
const deathDate = new Date(deathDateStringElement.value);
|
||||
const ageInDays = Math.floor((deathDate.getTime() - birthDate.getTime()) / (1000 * 60 * 60 * 24));
|
||||
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
||||
const ageInYears = Math.floor(ageInDays / 365.25);
|
||||
if (ageInYears > 0) {
|
||||
deathAgeElement.value = ageInYears.toString();
|
||||
|
|
@ -190,9 +189,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
});
|
||||
}
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Delete Interment?',
|
||||
message: 'Are you sure you want to remove this interment from the contract?',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Remove Interment',
|
||||
callbackFunction: doDelete
|
||||
|
|
|
|||
|
|
@ -84,7 +84,6 @@ declare const exports: Record<string, unknown>
|
|||
(deathDate.getTime() - birthDate.getTime()) / (1000 * 60 * 60 * 24)
|
||||
)
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
||||
const ageInYears = Math.floor(ageInDays / 365.25)
|
||||
|
||||
if (ageInYears > 0) {
|
||||
|
|
@ -315,15 +314,12 @@ declare const exports: Record<string, unknown>
|
|||
}
|
||||
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Delete Interment?',
|
||||
|
||||
message:
|
||||
'Are you sure you want to remove this interment from the contract?',
|
||||
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Remove Interment',
|
||||
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
contextualColorName: 'danger',
|
||||
title: 'Error Creating Work Order',
|
||||
message: responseJSON.errorMessage,
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -54,10 +54,9 @@ declare const exports: Record<string, unknown>
|
|||
})
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
contextualColorName: 'danger',
|
||||
title: 'Error Creating Work Order',
|
||||
|
||||
message: responseJSON.errorMessage as string,
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
contextualColorName: 'danger',
|
||||
title: 'Error Updating Contract Type',
|
||||
message: responseJSON.errorMessage ?? ''
|
||||
title: "Error Updating Contract Type",
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -53,12 +53,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}, contractTypeResponseHandler);
|
||||
}
|
||||
bulmaJS.confirm({
|
||||
title: "Delete Contract Type",
|
||||
message: "Are you sure you want to delete this contract type?",
|
||||
contextualColorName: 'warning',
|
||||
title: 'Delete Contract Type',
|
||||
message: 'Are you sure you want to delete this contract type?',
|
||||
okButton: {
|
||||
callbackFunction: doDelete,
|
||||
text: 'Yes, Delete Contract Type'
|
||||
text: "Yes, Delete Contract Type",
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -206,13 +206,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
function confirmDoDelete() {
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Delete Field',
|
||||
message: `Are you sure you want to delete this field?
|
||||
Note that historical records that make use of this field will not be affected.`,
|
||||
message: 'Are you sure you want to delete this field? Note that historical records that make use of this field will not be affected.',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
callbackFunction: doDelete,
|
||||
text: 'Yes, Delete Field'
|
||||
text: 'Yes, Delete Field',
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -373,12 +372,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}, contractTypeResponseHandler);
|
||||
}
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Delete Print',
|
||||
message: 'Are you sure you want to remove this print option?',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
callbackFunction: doDelete,
|
||||
text: 'Yes, Remove Print'
|
||||
text: 'Yes, Remove Print',
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -589,7 +588,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Adding Contract Type',
|
||||
title: "Error Adding Contract Type",
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -89,10 +89,9 @@ type ResponseJSON =
|
|||
renderContractTypes()
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
contextualColorName: 'danger',
|
||||
title: 'Error Updating Contract Type',
|
||||
|
||||
message: responseJSON.errorMessage ?? ''
|
||||
title: "Error Updating Contract Type",
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -118,13 +117,12 @@ type ResponseJSON =
|
|||
}
|
||||
|
||||
bulmaJS.confirm({
|
||||
title: "Delete Contract Type",
|
||||
message: "Are you sure you want to delete this contract type?",
|
||||
contextualColorName: 'warning',
|
||||
title: 'Delete Contract Type',
|
||||
|
||||
message: 'Are you sure you want to delete this contract type?',
|
||||
okButton: {
|
||||
callbackFunction: doDelete,
|
||||
text: 'Yes, Delete Contract Type'
|
||||
text: "Yes, Delete Contract Type",
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -197,7 +195,6 @@ type ResponseJSON =
|
|||
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
},
|
||||
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
}
|
||||
|
|
@ -263,7 +260,6 @@ type ResponseJSON =
|
|||
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
},
|
||||
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
}
|
||||
|
|
@ -389,14 +385,13 @@ type ResponseJSON =
|
|||
|
||||
function confirmDoDelete(): void {
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Delete Field',
|
||||
|
||||
message: `Are you sure you want to delete this field?
|
||||
Note that historical records that make use of this field will not be affected.`,
|
||||
message:
|
||||
'Are you sure you want to delete this field? Note that historical records that make use of this field will not be affected.',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
callbackFunction: doDelete,
|
||||
text: 'Yes, Delete Field'
|
||||
text: 'Yes, Delete Field',
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -472,7 +467,6 @@ type ResponseJSON =
|
|||
.querySelector('#button--deleteContractTypeField')
|
||||
?.addEventListener('click', confirmDoDelete)
|
||||
},
|
||||
|
||||
onremoved() {
|
||||
bulmaJS.toggleHtmlClipped()
|
||||
cityssm.disableNavBlocker()
|
||||
|
|
@ -712,13 +706,12 @@ type ResponseJSON =
|
|||
}
|
||||
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Delete Print',
|
||||
|
||||
message: 'Are you sure you want to remove this print option?',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
callbackFunction: doDelete,
|
||||
text: 'Yes, Remove Print'
|
||||
text: 'Yes, Remove Print',
|
||||
callbackFunction: doDelete
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -1024,7 +1017,7 @@ type ResponseJSON =
|
|||
renderContractTypes()
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
title: 'Error Adding Contract Type',
|
||||
title: "Error Adding Contract Type",
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
|
|
|
|||
|
|
@ -31,16 +31,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
contextualColorName: 'success',
|
||||
message: 'Work Order Updated Successfully'
|
||||
message: 'Work Order Updated Successfully',
|
||||
contextualColorName: 'success'
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
contextualColorName: 'danger',
|
||||
title: 'Error Updating Work Order',
|
||||
message: responseJSON.errorMessage ?? ''
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -81,9 +81,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.alert({
|
||||
contextualColorName: 'danger',
|
||||
title: 'Error Deleting Work Order',
|
||||
message: responseJSON.errorMessage ?? ''
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -95,10 +95,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const hasOpenMilestones = workOrderMilestones.some((milestone) => !milestone.workOrderMilestoneCompletionDate);
|
||||
if (hasOpenMilestones) {
|
||||
bulmaJS.alert({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Outstanding Milestones',
|
||||
message: `You cannot close a work order with outstanding milestones.
|
||||
Either complete the outstanding milestones, or remove them from the work order.`
|
||||
Either complete the outstanding milestones, or remove them from the work order.`,
|
||||
contextualColorName: 'warning'
|
||||
});
|
||||
/*
|
||||
// Disable closing work orders with open milestones
|
||||
|
|
@ -116,14 +116,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
else {
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: sunrise.hasUnsavedChanges() ? 'warning' : 'info',
|
||||
title: 'Close Work Order',
|
||||
message: sunrise.hasUnsavedChanges()
|
||||
? 'Are you sure you want to close this work order with unsaved changes?'
|
||||
: 'Are you sure you want to close this work order?',
|
||||
contextualColorName: sunrise.hasUnsavedChanges() ? 'warning' : 'info',
|
||||
okButton: {
|
||||
callbackFunction: doClose,
|
||||
text: 'Yes, Close Work Order'
|
||||
text: 'Yes, Close Work Order',
|
||||
callbackFunction: doClose
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -133,9 +133,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
?.addEventListener('click', (clickEvent) => {
|
||||
clickEvent.preventDefault();
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Delete Work Order',
|
||||
message: 'Are you sure you want to delete this work order?',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Delete Work Order',
|
||||
callbackFunction: doDelete
|
||||
|
|
@ -243,12 +243,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}, processMilestoneResponse);
|
||||
}
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Reopen Milestone',
|
||||
message: 'Are you sure you want to remove the completion status from this milestone, and reopen it?',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
callbackFunction: doReopen,
|
||||
text: 'Yes, Reopen Milestone',
|
||||
callbackFunction: doReopen
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -262,9 +262,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}, processMilestoneResponse);
|
||||
}
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Delete Milestone',
|
||||
message: 'Are you sure you want to delete this milestone?',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Delete Milestone',
|
||||
callbackFunction: doDeleteMilestone
|
||||
|
|
@ -442,6 +442,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
let addFormElement;
|
||||
let workOrderMilestoneDateStringElement;
|
||||
let addCloseModalFunction;
|
||||
function doAdd(submitEvent) {
|
||||
if (submitEvent) {
|
||||
submitEvent.preventDefault();
|
||||
}
|
||||
const currentDateString = cityssm.dateToString(new Date());
|
||||
function _doAdd() {
|
||||
cityssm.postJSON(`${sunrise.urlPrefix}/workOrders/doAddWorkOrderMilestone`, addFormElement, (rawResponseJSON) => {
|
||||
const responseJSON = rawResponseJSON;
|
||||
|
|
@ -451,18 +456,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
}
|
||||
});
|
||||
}
|
||||
function doAddFormSubmit(submitEvent) {
|
||||
if (submitEvent) {
|
||||
submitEvent.preventDefault();
|
||||
}
|
||||
const currentDateString = cityssm.dateToString(new Date());
|
||||
const milestoneDateString = workOrderMilestoneDateStringElement.value;
|
||||
if (milestoneDateString !== '' &&
|
||||
milestoneDateString < currentDateString) {
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Milestone Date in the Past',
|
||||
message: 'Are you sure you want to create a milestone with a date in the past?',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Create a Past Milestone',
|
||||
callbackFunction: _doAdd
|
||||
|
|
@ -495,7 +495,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
bulmaJS.toggleHtmlClipped();
|
||||
modalElement.querySelector('#milestoneAdd--workOrderMilestoneTypeId').focus();
|
||||
addFormElement = modalElement.querySelector('form');
|
||||
addFormElement.addEventListener('submit', doAddFormSubmit);
|
||||
addFormElement.addEventListener('submit', doAdd);
|
||||
const conflictingMilestonePanelElement = document.querySelector('#milestoneAdd--conflictingMilestonesPanel');
|
||||
workOrderMilestoneDateStringElement.addEventListener('change', () => {
|
||||
refreshConflictingMilestones(workOrderMilestoneDateStringElement.value, conflictingMilestonePanelElement);
|
||||
|
|
|
|||
|
|
@ -67,16 +67,15 @@ declare const exports: Record<string, unknown>
|
|||
)
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
contextualColorName: 'success',
|
||||
message: 'Work Order Updated Successfully'
|
||||
message: 'Work Order Updated Successfully',
|
||||
contextualColorName: 'success'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
contextualColorName: 'danger',
|
||||
title: 'Error Updating Work Order',
|
||||
|
||||
message: responseJSON.errorMessage ?? ''
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -138,10 +137,9 @@ declare const exports: Record<string, unknown>
|
|||
globalThis.location.href = `${sunrise.urlPrefix}/workOrders`
|
||||
} else {
|
||||
bulmaJS.alert({
|
||||
contextualColorName: 'danger',
|
||||
title: 'Error Deleting Work Order',
|
||||
|
||||
message: responseJSON.errorMessage ?? ''
|
||||
message: responseJSON.errorMessage ?? '',
|
||||
contextualColorName: 'danger'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -159,11 +157,10 @@ declare const exports: Record<string, unknown>
|
|||
|
||||
if (hasOpenMilestones) {
|
||||
bulmaJS.alert({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Outstanding Milestones',
|
||||
|
||||
message: `You cannot close a work order with outstanding milestones.
|
||||
Either complete the outstanding milestones, or remove them from the work order.`
|
||||
Either complete the outstanding milestones, or remove them from the work order.`,
|
||||
contextualColorName: 'warning'
|
||||
})
|
||||
|
||||
/*
|
||||
|
|
@ -181,16 +178,14 @@ declare const exports: Record<string, unknown>
|
|||
*/
|
||||
} else {
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: sunrise.hasUnsavedChanges() ? 'warning' : 'info',
|
||||
title: 'Close Work Order',
|
||||
|
||||
message: sunrise.hasUnsavedChanges()
|
||||
? 'Are you sure you want to close this work order with unsaved changes?'
|
||||
: 'Are you sure you want to close this work order?',
|
||||
|
||||
contextualColorName: sunrise.hasUnsavedChanges() ? 'warning' : 'info',
|
||||
okButton: {
|
||||
callbackFunction: doClose,
|
||||
text: 'Yes, Close Work Order'
|
||||
text: 'Yes, Close Work Order',
|
||||
callbackFunction: doClose
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -202,9 +197,9 @@ declare const exports: Record<string, unknown>
|
|||
clickEvent.preventDefault()
|
||||
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Delete Work Order',
|
||||
message: 'Are you sure you want to delete this work order?',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Delete Work Order',
|
||||
callbackFunction: doDelete
|
||||
|
|
@ -383,15 +378,13 @@ declare const exports: Record<string, unknown>
|
|||
}
|
||||
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Reopen Milestone',
|
||||
|
||||
message:
|
||||
'Are you sure you want to remove the completion status from this milestone, and reopen it?',
|
||||
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
callbackFunction: doReopen,
|
||||
text: 'Yes, Reopen Milestone',
|
||||
callbackFunction: doReopen
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -417,9 +410,9 @@ declare const exports: Record<string, unknown>
|
|||
}
|
||||
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Delete Milestone',
|
||||
message: 'Are you sure you want to delete this milestone?',
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Delete Milestone',
|
||||
callbackFunction: doDeleteMilestone
|
||||
|
|
@ -666,7 +659,6 @@ declare const exports: Record<string, unknown>
|
|||
panelBlockElement
|
||||
.querySelector('.button--reopenMilestone')
|
||||
?.addEventListener('click', reopenMilestone)
|
||||
|
||||
panelBlockElement
|
||||
.querySelector('.button--editMilestone')
|
||||
?.addEventListener('click', editMilestone)
|
||||
|
|
@ -710,6 +702,13 @@ declare const exports: Record<string, unknown>
|
|||
let workOrderMilestoneDateStringElement: HTMLInputElement
|
||||
let addCloseModalFunction: () => void
|
||||
|
||||
function doAdd(submitEvent?: SubmitEvent): void {
|
||||
if (submitEvent) {
|
||||
submitEvent.preventDefault()
|
||||
}
|
||||
|
||||
const currentDateString = cityssm.dateToString(new Date())
|
||||
|
||||
function _doAdd(): void {
|
||||
cityssm.postJSON(
|
||||
`${sunrise.urlPrefix}/workOrders/doAddWorkOrderMilestone`,
|
||||
|
|
@ -730,13 +729,6 @@ declare const exports: Record<string, unknown>
|
|||
)
|
||||
}
|
||||
|
||||
function doAddFormSubmit(submitEvent?: SubmitEvent): void {
|
||||
if (submitEvent) {
|
||||
submitEvent.preventDefault()
|
||||
}
|
||||
|
||||
const currentDateString = cityssm.dateToString(new Date())
|
||||
|
||||
const milestoneDateString = workOrderMilestoneDateStringElement.value
|
||||
|
||||
if (
|
||||
|
|
@ -744,12 +736,10 @@ declare const exports: Record<string, unknown>
|
|||
milestoneDateString < currentDateString
|
||||
) {
|
||||
bulmaJS.confirm({
|
||||
contextualColorName: 'warning',
|
||||
title: 'Milestone Date in the Past',
|
||||
|
||||
message:
|
||||
'Are you sure you want to create a milestone with a date in the past?',
|
||||
|
||||
contextualColorName: 'warning',
|
||||
okButton: {
|
||||
text: 'Yes, Create a Past Milestone',
|
||||
callbackFunction: _doAdd
|
||||
|
|
@ -802,7 +792,7 @@ declare const exports: Record<string, unknown>
|
|||
).focus()
|
||||
|
||||
addFormElement = modalElement.querySelector('form') as HTMLFormElement
|
||||
addFormElement.addEventListener('submit', doAddFormSubmit)
|
||||
addFormElement.addEventListener('submit', doAdd)
|
||||
|
||||
const conflictingMilestonePanelElement = document.querySelector(
|
||||
'#milestoneAdd--conflictingMilestonesPanel'
|
||||
|
|
|
|||
|
|
@ -495,7 +495,6 @@ async function importFromPrepaidCSV() {
|
|||
externalReceiptNumber: '',
|
||||
transactionAmount,
|
||||
transactionDateString: contractStartDateString,
|
||||
transactionTimeString: '00:00',
|
||||
transactionNote: `Order Number: ${prepaidRow.CMPP_ORDER_NO}`
|
||||
}, user);
|
||||
if (prepaidRow.CMPP_REMARK1 !== '') {
|
||||
|
|
|
|||
|
|
@ -794,8 +794,6 @@ async function importFromPrepaidCSV(): Promise<void> {
|
|||
externalReceiptNumber: '',
|
||||
transactionAmount,
|
||||
transactionDateString: contractStartDateString,
|
||||
transactionTimeString: '00:00',
|
||||
|
||||
transactionNote: `Order Number: ${prepaidRow.CMPP_ORDER_NO}`
|
||||
},
|
||||
user
|
||||
|
|
|
|||
|
|
@ -26,14 +26,11 @@
|
|||
Database Maintenance
|
||||
</h1>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<div class="panel is-primary">
|
||||
<h2 class="panel-heading">
|
||||
<h2 class="title is-3">
|
||||
Database Backup
|
||||
</h2>
|
||||
<div class="panel-block is-block">
|
||||
<div class="message is-primary">
|
||||
|
||||
<div class="message is-info">
|
||||
<div class="message-body">
|
||||
<p>
|
||||
Before making significant changes to the records in the database,
|
||||
|
|
@ -41,22 +38,22 @@
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-block is-block has-text-right">
|
||||
<button class="button is-primary" id="button--backupDatabase" data-cy="backup" type="button">
|
||||
|
||||
<p class="has-text-right">
|
||||
<button class="button is-success" id="button--backupDatabase" data-cy="backup" type="button">
|
||||
<span class="icon"><i class="fas fa-save" aria-hidden="true"></i></span>
|
||||
<span>Backup Database</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="panel is-warning">
|
||||
<h2 class="panel-heading">
|
||||
</p>
|
||||
|
||||
<h2 class="title is-3">
|
||||
Database Cleanup
|
||||
</h2>
|
||||
<div class="panel-block is-block">
|
||||
|
||||
<div class="message is-warning">
|
||||
<div class="message-header">
|
||||
Important Note about Cleanup
|
||||
</div>
|
||||
<div class="message-body">
|
||||
<p>
|
||||
When records are deleted in this application, they are not removed entirely.
|
||||
|
|
@ -70,16 +67,13 @@
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-block is-block has-text-right">
|
||||
<button class="button is-warning" id="button--cleanupDatabase" data-cy="cleanup" type="button">
|
||||
|
||||
<p class="has-text-right">
|
||||
<button class="button is-success" id="button--cleanupDatabase" data-cy="cleanup" type="button">
|
||||
<span class="icon"><i class="fas fa-broom" aria-hidden="true"></i></span>
|
||||
<span>Cleanup Database</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue