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

Work Order #<%= workOrder.workOrderNumber || "(No Number)" %>

<% if (user.userProperties.canUpdate && !workOrder.workOrderCloseDate) { %>
Update Work Order
<% } %>

Work Order Type
<%= workOrder.workOrderType %>

Description
<% if (workOrder.workOrderDescription) { %> <%= workOrder.workOrderDescription %> <% } else { %> (No Description) <% } %>

Open Date
<%= workOrder.workOrderOpenDateString %>

Close Date
<% if (workOrder.workOrderCloseDate) { %> <%= workOrder.workOrderCloseDateString %> <% } else { %> (No Close Date) <% } %>

<% if (user.userProperties.canUpdate && workOrder.workOrderCloseDate) { %>
<% } %>

Related <%= configFunctions.getProperty("aliases.lots") %>

<% const tabToSelect = (workOrder.workOrderLotOccupancies.length > 0 || workOrder.workOrderLots.length === 0 ? "lotOccupancies" : "lots"); %>
" id="relatedTab--lotOccupancies"> <% if (workOrder.workOrderLotOccupancies.length === 0) { %>

There are no <%= configFunctions.getProperty("aliases.lot").toLowerCase() %> <%= configFunctions.getProperty("aliases.occupancy").toLowerCase() %> records associated with this work order.

<% } else { %> <% const currentDate = dateTimeFunctions.dateToInteger(new Date()); %> <% for (const lotOccupancy of workOrder.workOrderLotOccupancies) { %> <% const isActive = !(lotOccupancy.occupancyEndDate && lotOccupancy.occupancyEndDate < currentDate); %> <% } %>
Occupancy Type <%= configFunctions.getProperty("aliases.lot") %> Start Date End Date <%= configFunctions.getProperty("aliases.occupants") %>
<% if (isActive) { %> "> <% } else { %> "> <% } %> <%= lotOccupancy.occupancyType %> <% if (lotOccupancy.lotId) { %> <%= lotOccupancy.lotName %> <% } else { %> (No <%= configFunctions.getProperty("aliases.lot") %>) <% } %> <%= lotOccupancy.occupancyStartDateString %> <% if (lotOccupancy.occupancyEndDate) { %> <%= lotOccupancy.occupancyEndDateString %> <% } else { %> (No End Date) <% } %> <% if (lotOccupancy.lotOccupancyOccupants.length === 0) { %> (No <%= configFunctions.getProperty("aliases.occupants") %>) <% } else { %> <% const occupant = lotOccupancy.lotOccupancyOccupants[0]; %> <%= occupant.occupantName %> <%= (lotOccupancy.lotOccupancyOccupants.length > 1 ? " plus " + (lotOccupancy.lotOccupancyOccupants.length - 1) : "") %> <% } %>
<% } %>
" id="relatedTab--lots"> <% if (workOrder.workOrderLots.length === 0) { %>

There are no <%= configFunctions.getProperty("aliases.lots").toLowerCase() %> records associated with this work order.

<% } else { %> <% for (const lot of workOrder.workOrderLots) { %> <% } %>
<%= configFunctions.getProperty("aliases.lot") %> <%= configFunctions.getProperty("aliases.map") %> <%= configFunctions.getProperty("aliases.lot") %> Type Status
<%= lot.lotName %> <%= lot.mapName %> <%= lot.lotType %> <%= lot.lotStatus %>
<% } %>
<% if (workOrder.workOrderComments.length > 0) { %>

Work Order Comments

<% for (const workOrderComment of workOrder.workOrderComments) { %> <% } %>
Commentor Comment Date Comment
<%= workOrderComment.recordCreate_userName %> <%= workOrderComment.workOrderCommentDateString %> <%= (workOrderComment.workOrderCommentTime === 0 ? "" : workOrderComment.workOrderCommentTimeString) %> <%= workOrderComment.workOrderComment %>
<% } %>
<% if (workOrder.workOrderMilestones.length > 0) { %>
<% for (const milestone of workOrder.workOrderMilestones) { %>
<% if (milestone.workOrderMilestoneCompletionDate) { %> <% } else { %> <% } %>
<% if (milestone.workOrderMilestoneTypeId) { %> <%= milestone.workOrderMilestoneType %>
<% } %> <%= milestone.workOrderMilestoneDateString %> <% if (milestone.workOrderMilestoneTime !== 0) { %> <%= milestone.workOrderMilestoneTimeString %> <% } %>
<%= milestone.workOrderMilestoneDescription %>
<% } %>
<% } %>
<%- include('_footerA'); -%> <%- include('_footerB'); -%>