diff --git a/helpers/lotOccupancyDB/updateLotOccupancyComment.ts b/helpers/lotOccupancyDB/updateLotOccupancyComment.ts index b59f5247..a7f11e3a 100644 --- a/helpers/lotOccupancyDB/updateLotOccupancyComment.ts +++ b/helpers/lotOccupancyDB/updateLotOccupancyComment.ts @@ -5,10 +5,7 @@ import { } from "../../data/databasePaths.js"; import { - dateStringToInteger, - dateToInteger, - dateToTimeInteger, - timeStringToInteger + dateStringToInteger } from "@cityssm/expressjs-server-js/dateTimeFns.js"; import type * as recordTypes from "../../types/recordTypes"; diff --git a/public-typescript/lotOccupancyEdit.js b/public-typescript/lotOccupancyEdit.js index ac80ad01..053f202d 100644 --- a/public-typescript/lotOccupancyEdit.js +++ b/public-typescript/lotOccupancyEdit.js @@ -226,6 +226,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); } }); }); + document.querySelector(".is-lot-view-button").addEventListener("click", () => { + const lotId = document.querySelector("#lotOccupancy--lotId").value; + if (lotId) { + window.open(urlPrefix + "/lots/" + lotId); + } + else { + bulmaJS.alert({ + message: "No " + exports.aliases.lot.toLowerCase() + " selected.", + contextualColorName: "info" + }); + } + }); document.querySelector("#lotOccupancy--occupancyStartDateString").addEventListener("change", () => { document.querySelector("#lotOccupancy--occupancyEndDateString").min = document.querySelector("#lotOccupancy--occupancyStartDateString").value; @@ -347,7 +359,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); "" + exports.aliases.occupant + "" + "Address" + "Phone Number" + - "" + + "Options" + "" + ""; for (const lotOccupancyOccupant of lotOccupancyOccupants) { @@ -358,11 +370,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); ("" + cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1) + "
" + (lotOccupancyOccupant.occupantAddress2 ? cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2) + "
" : "") + - cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ", " + cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince) + "
" + + (lotOccupancyOccupant.occupantCity ? cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ", " : "") + cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince) + "
" + cityssm.escapeHTML(lotOccupancyOccupant.occupantPostalCode) + "") + ("" + cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber) + "") + - ("" + + ("" + "
" + ("" + @@ -756,8 +769,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); const categoryContainerElement = document.createElement("div"); categoryContainerElement.className = "container--feeCategory"; categoryContainerElement.dataset.feeCategoryId = feeCategory.feeCategoryId.toString(); - categoryContainerElement.innerHTML = "

" + cityssm.escapeHTML(feeCategory.feeCategory) + "

" + - "
"; + categoryContainerElement.innerHTML = "

" + cityssm.escapeHTML(feeCategory.feeCategory) + "

" + + "
"; let hasFees = false; for (const fee of feeCategory.fees) { if (lotOccupancyFeesContainerElement.querySelector(".container--lotOccupancyFee[data-fee-id='" + fee.feeId + "']")) { @@ -864,13 +877,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); "Date" + "" + cityssm.escapeHTML(exports.aliases.externalReceiptNumber) + "" + "Amount" + - "Options" + + "Options" + "" + "" + ("" + "Transaction Total" + "" + - "" + + "" + "") + ""; let transactionGrandTotal = 0; @@ -885,7 +898,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); "" + cityssm.escapeHTML(lotOccupancyTransaction.transactionNote) + "" + "") + ("$" + lotOccupancyTransaction.transactionAmount.toFixed(2) + "") + - ("" + + ("" + "" + diff --git a/public-typescript/lotOccupancyEdit.ts b/public-typescript/lotOccupancyEdit.ts index 0368a418..01a04965 100644 --- a/public-typescript/lotOccupancyEdit.ts +++ b/public-typescript/lotOccupancyEdit.ts @@ -336,6 +336,20 @@ declare const bulmaJS: BulmaJS; }); }); + document.querySelector(".is-lot-view-button").addEventListener("click", () => { + + const lotId = (document.querySelector("#lotOccupancy--lotId") as HTMLInputElement).value; + + if (lotId) { + window.open(urlPrefix + "/lots/" + lotId); + } else { + bulmaJS.alert({ + message: "No " + exports.aliases.lot.toLowerCase() + " selected.", + contextualColorName: "info" + }); + } + }); + // Start Date document.querySelector("#lotOccupancy--occupancyStartDateString").addEventListener("change", () => { @@ -504,7 +518,7 @@ declare const bulmaJS: BulmaJS; "" + exports.aliases.occupant + "" + "Address" + "Phone Number" + - "" + + "Options" + "" + ""; @@ -518,11 +532,11 @@ declare const bulmaJS: BulmaJS; ("" + cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress1) + "
" + (lotOccupancyOccupant.occupantAddress2 ? cityssm.escapeHTML(lotOccupancyOccupant.occupantAddress2) + "
" : "") + - cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ", " + cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince) + "
" + + (lotOccupancyOccupant.occupantCity ? cityssm.escapeHTML(lotOccupancyOccupant.occupantCity) + ", " : "") + cityssm.escapeHTML(lotOccupancyOccupant.occupantProvince) + "
" + cityssm.escapeHTML(lotOccupancyOccupant.occupantPostalCode) + "") + ("" + cityssm.escapeHTML(lotOccupancyOccupant.occupantPhoneNumber) + "") + - ("" + + ("" + "
" + ("
"; + renderLotOccupancyTransactions(); + return; } @@ -908,13 +924,13 @@ declare const bulmaJS: BulmaJS; "Quantity" + "equals" + "Total" + - "Options" + + "Options" + "") + "" + ("" + - "Subtotal" + - "Tax" + - "Grand Total" + + "Subtotal" + + "Tax" + + "Grand Total" + "") + ""; @@ -937,7 +953,7 @@ declare const bulmaJS: BulmaJS; "" + lotOccupancyFee.quantity + "" + "=") + "$" + (lotOccupancyFee.feeAmount * lotOccupancyFee.quantity).toFixed(2) + "" + - ("" + + ("" + "" + @@ -1057,8 +1073,8 @@ declare const bulmaJS: BulmaJS; const categoryContainerElement = document.createElement("div"); categoryContainerElement.className = "container--feeCategory"; categoryContainerElement.dataset.feeCategoryId = feeCategory.feeCategoryId.toString(); - categoryContainerElement.innerHTML = "

" + cityssm.escapeHTML(feeCategory.feeCategory) + "

" + - "
"; + categoryContainerElement.innerHTML = "

" + cityssm.escapeHTML(feeCategory.feeCategory) + "

" + + "
"; let hasFees = false; @@ -1204,14 +1220,14 @@ declare const bulmaJS: BulmaJS; "Date" + "" + cityssm.escapeHTML(exports.aliases.externalReceiptNumber) + "" + "Amount" + - "Options" + + "Options" + "" + "" + ("" + - "Transaction Total" + - "" + - "" + - "") + + "Transaction Total" + + "" + + "" + + "") + ""; let transactionGrandTotal = 0; @@ -1230,11 +1246,11 @@ declare const bulmaJS: BulmaJS; "" + cityssm.escapeHTML(lotOccupancyTransaction.transactionNote) + "" + "") + ("$" + lotOccupancyTransaction.transactionAmount.toFixed(2) + "") + - ("" + - "" + - ""); + ("" + + "" + + ""); tableRowElement.querySelector("button").addEventListener("click", deleteLotOccupancyTransaction); @@ -1246,16 +1262,16 @@ declare const bulmaJS: BulmaJS; const feeGrandTotal = getFeeGrandTotal(); if (feeGrandTotal > transactionGrandTotal) { - - lotOccupancyTransactionsContainerElement.insertAdjacentHTML("afterbegin", - "
" + - "
" + - "
" + - "
Outstanding Balance
" + - "
$" + (feeGrandTotal - transactionGrandTotal).toFixed(2) + "
" + - "
" + - "
" + - "
"); + + lotOccupancyTransactionsContainerElement.insertAdjacentHTML("afterbegin", + "
" + + "
" + + "
" + + "
Outstanding Balance
" + + "
$" + (feeGrandTotal - transactionGrandTotal).toFixed(2) + "
" + + "
" + + "
" + + "
"); } }; diff --git a/public/html/adminFees-addFee.html b/public/html/adminFees-addFee.html index 9bf662df..9bc692c0 100644 --- a/public/html/adminFees-addFee.html +++ b/public/html/adminFees-addFee.html @@ -20,7 +20,7 @@
- +
diff --git a/public/html/adminFees-addFeeCategory.html b/public/html/adminFees-addFeeCategory.html index 6baf2779..878b9995 100644 --- a/public/html/adminFees-addFeeCategory.html +++ b/public/html/adminFees-addFeeCategory.html @@ -12,7 +12,7 @@
- +
diff --git a/public/html/adminFees-editFee.html b/public/html/adminFees-editFee.html index 18683c36..5329047e 100644 --- a/public/html/adminFees-editFee.html +++ b/public/html/adminFees-editFee.html @@ -21,7 +21,7 @@
- +
diff --git a/public/html/adminFees-editFeeCategory.html b/public/html/adminFees-editFeeCategory.html index 805271c9..9b3a8222 100644 --- a/public/html/adminFees-editFeeCategory.html +++ b/public/html/adminFees-editFeeCategory.html @@ -13,7 +13,7 @@
- +
diff --git a/public/html/lotOccupancy-addOccupant.html b/public/html/lotOccupancy-addOccupant.html index 3c37b17f..372eb856 100644 --- a/public/html/lotOccupancy-addOccupant.html +++ b/public/html/lotOccupancy-addOccupant.html @@ -23,18 +23,18 @@
- +
- +
- +
@@ -58,7 +58,7 @@
- +
@@ -66,7 +66,7 @@
- +
diff --git a/public/html/lotOccupancy-addTransaction.html b/public/html/lotOccupancy-addTransaction.html index 9cc6b239..26f23fa6 100644 --- a/public/html/lotOccupancy-addTransaction.html +++ b/public/html/lotOccupancy-addTransaction.html @@ -25,7 +25,7 @@
- +
diff --git a/public/html/lotOccupancy-editComment.html b/public/html/lotOccupancy-editComment.html index 82d0e0e9..4fddc56e 100644 --- a/public/html/lotOccupancy-editComment.html +++ b/public/html/lotOccupancy-editComment.html @@ -3,7 +3,7 @@