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

<%= configFunctions.getConfigProperty("aliases.occupancy") %> #<%= contract.contractId %>: <%= contract.lotName || ("(No " + configFunctions.getConfigProperty("aliases.lot") + ")") %>

<%= configFunctions.getConfigProperty("aliases.occupancy") %> #<%= contract.contractId %>: <%= contract.lotName || ("(No " + configFunctions.getConfigProperty("aliases.lot") + ")") %>
<% if (ContractTypePrints.length > 0) { %> <% if (ContractTypePrints.length === 1) { %> <% } else { %>
<% } %> <% } %> <% if (user.userProperties.canUpdate) { %> <% } %>

<%= configFunctions.getConfigProperty("aliases.occupancy") %> Type
<%= contract.contractType %>

Burial Site
<% if (contract.lotId) { %> <%= contract.lotName %> <% } else { %> (No Burial Site) <% } %>

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

<%= configFunctions.getConfigProperty("aliases.occupancyStartDate") %>
<%= contract.occupancyStartDateString %>

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

<% if (contract.contractFields.length > 0) { %>
<% for (const contractField of contract.contractFields) { %>

<%= contractField.contractTypeField %>
<% if (contractField.contractFieldValue) { %> <%= contractField.contractFieldValue %> <% } else { %> (No Value) <% } %>

<% } %>
<% } %>

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

<% if (contract.contractOccupants.length === 0) { %>

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

<% } else { %> <% for (const contractOccupant of contract.contractOccupants) { %> <% } %>
<%= configFunctions.getConfigProperty("aliases.occupant") %> Address Other Contact Comment
<%= contractOccupant.occupantName %> <%= contractOccupant.occupantFamilyName %>
<%= contractOccupant.lotOccupantType %>
<% if (contractOccupant.occupantAddress1) { %> <%= contractOccupant.occupantAddress1 %>
<% } %> <% if (contractOccupant.occupantAddress2) { %> <%= contractOccupant.occupantAddress2 %>
<% } %> <% if (contractOccupant.occupantCity) { %> <%= contractOccupant.occupantCity %>, <% } %> <%= contractOccupant.occupantProvince %>
<%= contractOccupant.occupantPostalCode %>
<% if (contractOccupant.occupantPhoneNumber) { %> <%= contractOccupant.occupantPhoneNumber %>
<% } %> <%= contractOccupant.occupantEmailAddress %>
<%= contractOccupant.occupantComment %>
<% } %>
<% if (contract.contractComments.length > 0) { %>

Comments

<% for (const contractComment of contract.contractComments) { %> <% } %>
Commentor Comment Date Comment
<%= contractComment.recordCreate_userName %> <%= contractComment.contractCommentDateString %> <%= (contractComment.contractCommentTime === 0 ? "" : contractComment.contractCommentTimePeriodString) %> <%= contractComment.contractComment %>
<% } %> <% if (contract.workOrders.length > 0) { %> <% const workOrderOpenDateAlias = configFunctions.getConfigProperty("aliases.workOrderOpenDate"); const workOrderCloseDateAlias = configFunctions.getConfigProperty("aliases.workOrderCloseDate"); %>

Work Orders

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

Fees

<% if (contract.contractFees.length === 0) { %>

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

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

Transactions

<% if (contract.contractTransactions.length === 0) { %>

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

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