<%- include('_header'); -%>

<%= configFunctions.getProperty("aliases.occupancy") %> #<%= lotOccupancy.lotOccupancyId %>: <%= lotOccupancy.lotName || ("(No " + configFunctions.getProperty("aliases.lot") + ")") %>

<%= configFunctions.getProperty("aliases.occupancy") %> #<%= lotOccupancy.lotOccupancyId %>: <%= lotOccupancy.lotName || ("(No " + configFunctions.getProperty("aliases.lot") + ")") %>
<% if (occupancyTypePrints.length > 0) { %> <% if (occupancyTypePrints.length === 1) { %> <% } else { %>
<% } %> <% } %> <% if (user.userProperties.canUpdate) { %> <% } %>

<%= configFunctions.getProperty("aliases.occupancy") %> Type
<%= lotOccupancy.occupancyType %>

<%= configFunctions.getProperty("aliases.lot") %>
<% if (lotOccupancy.lotId) { %> <%= lotOccupancy.lotName %> <% } else { %> (No <%= configFunctions.getProperty("aliases.lot") %>) <% } %>

<%= configFunctions.getProperty("aliases.map") %>
<% if (lotOccupancy.mapId) { %> <%= lotOccupancy.mapName %> <% } else { %> (No <%= configFunctions.getProperty("aliases.map") %>) <% } %>

<%= configFunctions.getProperty("aliases.occupancyStartDate") %>
<%= lotOccupancy.occupancyStartDateString %>

End Date
<% if (lotOccupancy.occupancyEndDateString === "") { %> (No End Date) <% } else { %> <%= lotOccupancy.occupancyEndDateString %> <% } %>

<% if (lotOccupancy.lotOccupancyFields.length > 0) { %>
<% for (const lotOccupancyField of lotOccupancy.lotOccupancyFields) { %>

<%= lotOccupancyField.occupancyTypeField %>
<% if (lotOccupancyField.lotOccupancyFieldValue) { %> <%= lotOccupancyField.lotOccupancyFieldValue %> <% } else { %> (No Value) <% } %>

<% } %>
<% } %>

<%= configFunctions.getProperty("aliases.occupants") %>

<% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %>

There are no <%= configFunctions.getProperty("aliases.occupants").toLowerCase() %> associated with this record.

<% } else { %> <% for (const lotOccupancyOccupant of lotOccupancy.lotOccupancyOccupants) { %> <% } %>
<%= configFunctions.getProperty("aliases.occupant") %> Address Other Contact Comment
<%= lotOccupancyOccupant.occupantName %> <%= lotOccupancyOccupant.occupantFamilyName %>
<%= lotOccupancyOccupant.lotOccupantType %>
<% if (lotOccupancyOccupant.occupantAddress1) { %> <%= lotOccupancyOccupant.occupantAddress1 %>
<% } %> <% if (lotOccupancyOccupant.occupantAddress2) { %> <%= lotOccupancyOccupant.occupantAddress2 %>
<% } %> <% if (lotOccupancyOccupant.occupantCity) { %> <%= lotOccupancyOccupant.occupantCity %>, <% } %> <%= lotOccupancyOccupant.occupantProvince %>
<%= lotOccupancyOccupant.occupantPostalCode %>
<% if (lotOccupancyOccupant.occupantPhoneNumber) { %> <%= lotOccupancyOccupant.occupantPhoneNumber %>
<% } %> <%= lotOccupancyOccupant.occupantEmailAddress %>
<%= lotOccupancyOccupant.occupantComment %>
<% } %>
<% if (lotOccupancy.lotOccupancyComments.length > 0) { %>

Comments

<% for (const lotOccupancyComment of lotOccupancy.lotOccupancyComments) { %> <% } %>
Commentor Comment Date Comment
<%= lotOccupancyComment.recordCreate_userName %> <%= lotOccupancyComment.lotOccupancyCommentDateString %> <%= (lotOccupancyComment.lotOccupancyCommentTime === 0 ? "" : lotOccupancyComment.lotOccupancyCommentTimeString) %> <%= lotOccupancyComment.lotOccupancyComment %>
<% } %> <% if (lotOccupancy.workOrders.length > 0) { %> <% const workOrderOpenDateAlias = configFunctions.getProperty("aliases.workOrderOpenDate"); const workOrderCloseDateAlias = configFunctions.getProperty("aliases.workOrderCloseDate"); %>

Work Orders

<% for (const workOrder of lotOccupancy.workOrders) { %> <% } %>
Work Order Number Description Date
<%= workOrder.workOrderNumber %> <%= workOrder.workOrderType %>
<%= workOrder.workOrderDescription %>
<%= workOrder.workOrderOpenDateString %>
<% if (workOrder.workOrderCloseDate) { %> <%= workOrder.workOrderCloseDateString %> <% } else { %> (No <%= workOrderCloseDateAlias %>) <% } %>
<% } %>

Fees

<% if (lotOccupancy.lotOccupancyFees.length === 0) { %>

There are no fees applied to this <%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %> record.

<% } else { %> <% let feeAmountTotal = 0; let taxAmountTotal = 0; %> <% for (const lotOccupancyFee of lotOccupancy.lotOccupancyFees) { %> <% feeAmountTotal += (lotOccupancyFee.feeAmount * lotOccupancyFee.quantity); taxAmountTotal += (lotOccupancyFee.taxAmount * lotOccupancyFee.quantity); %> <% if (lotOccupancyFee.quantity !== 1) { %> <% } %> <% } %>
Fee Unit Cost × Quantity = Total
"> <%= lotOccupancyFee.feeName %>
<%= lotOccupancyFee.feeCategory %>
$<%= lotOccupancyFee.feeAmount.toFixed(2) %> × <%= lotOccupancyFee.quantity %> =$<%= (lotOccupancyFee.feeAmount * lotOccupancyFee.quantity).toFixed(2) %>
Subtotal $<%= feeAmountTotal.toFixed(2) %>
Tax $<%= taxAmountTotal.toFixed(2) %>
Grand Total $<%= (feeAmountTotal + taxAmountTotal).toFixed(2) %>
<% } %>

Transactions

<% if (lotOccupancy.lotOccupancyTransactions.length === 0) { %>

There are no transactions associated with this <%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %> record.

<% } else { %> <% let transactionTotal = 0; %> <% for (const lotOccupancyTransaction of lotOccupancy.lotOccupancyTransactions) { %> <% transactionTotal += lotOccupancyTransaction.transactionAmount; %> <% } %>
Date <%= configFunctions.getProperty("aliases.externalReceiptNumber") %> Amount
<%= lotOccupancyTransaction.transactionDateString %> <% if (lotOccupancyTransaction.externalReceiptNumber !== '') { %> <%= lotOccupancyTransaction.externalReceiptNumber %> <% if (configFunctions.getProperty('settings.dynamicsGP.integrationIsEnabled')) { %> <% if (lotOccupancyTransaction.dynamicsGPDocument === undefined) { %> <% } else if (lotOccupancyTransaction.dynamicsGPDocument.documentTotal.toFixed(2) === lotOccupancyTransaction.transactionAmount.toFixed(2)) { %> <% } else { %> <% } %> <% } %>
<% } %> <%= lotOccupancyTransaction.transactionNote %>
$<%= lotOccupancyTransaction.transactionAmount.toFixed(2) %>
Transaction Total $<%= transactionTotal.toFixed(2) %>
<% } %>
<%- include('_footerA'); -%> <%- include('_footerB'); -%>