416 lines
17 KiB
Plaintext
416 lines
17 KiB
Plaintext
<%- include('_header'); -%>
|
|
|
|
<nav class="breadcrumb">
|
|
<ul>
|
|
<li><a href="<%= urlPrefix %>/dashboard">Home</a></li>
|
|
<li>
|
|
<a href="<%= urlPrefix %>/workOrders">
|
|
<span class="icon is-small"><i class="fas fa-hard-hat" aria-hidden="true"></i></span>
|
|
<span>Work Orders</span>
|
|
</a>
|
|
</li>
|
|
<li class="is-active">
|
|
<a href="#" aria-current="page">
|
|
Work Order #<%= workOrder.workOrderNumber || "(No Number)" %>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<div class="level is-mobile">
|
|
<div class="level-left">
|
|
<div class="level-item">
|
|
<h1 class="title is-1">
|
|
Work Order
|
|
#<%= workOrder.workOrderNumber || "(No Number)" %>
|
|
</h1>
|
|
</div>
|
|
</div>
|
|
<% if (workOrder.workOrderCloseDate) { %>
|
|
<div class="level-right">
|
|
<div class="level-item">
|
|
<span class="tag is-info is-medium">
|
|
<span class="icon is-small">
|
|
<i class="fas fa-stop" aria-hidden="true"></i>
|
|
</span>
|
|
<span>Closed</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
|
|
<div class="columns is-vcentered is-fixed-bottom has-background-white has-shadow is-hidden-print">
|
|
<div class="column">
|
|
<span class="has-text-weight-bold">
|
|
Work Order
|
|
#<%= workOrder.workOrderNumber || "(No Number)" %>
|
|
</span>
|
|
</div>
|
|
<div class="column is-narrow has-text-right">
|
|
<div class="buttons is-right">
|
|
<% if (configFunctions.getConfigProperty("settings.workOrders.prints").length > 0) { %>
|
|
<% if (configFunctions.getConfigProperty("settings.workOrders.prints").length === 1) { %>
|
|
<a href="<%= urlPrefix %>/print/<%= configFunctions.getConfigProperty("settings.workOrders.prints")[0] %>/?workOrderId=<%= workOrder.workOrderId %>" target="_blank" aria-label="Print">
|
|
<span class="icon"><i class="fas fa-print" aria-hidden="true"></i></span>
|
|
<span class="is-hidden-touch">Print</span>
|
|
</a>
|
|
<% } else { %>
|
|
<div class="dropdown is-right is-up">
|
|
<div class="dropdown-trigger">
|
|
<button class="button" type="button" aria-label="Print">
|
|
<span class="icon"><i class="fas fa-print" aria-hidden="true"></i></span>
|
|
<span class="is-hidden-touch">Print</span>
|
|
<span class="icon"><i class="fas fa-angle-up" aria-hidden="true"></i></span>
|
|
</button>
|
|
</div>
|
|
<div class="dropdown-menu">
|
|
<div class="dropdown-content has-text-left">
|
|
<% for (const printName of configFunctions.getConfigProperty("settings.workOrders.prints")) { %>
|
|
<% const printConfig = printFunctions.getPrintConfig(printName); %>
|
|
<% if (printConfig) { %>
|
|
<a class="dropdown-item" href="<%= urlPrefix %>/print/<%= printName %>/?workOrderId=<%= workOrder.workOrderId %>" target="_blank">
|
|
<span class="icon"><i class="fas fa-print" aria-hidden="true"></i></span>
|
|
<span><%= printConfig.title %></span>
|
|
</a>
|
|
<% } %>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% } %>
|
|
<% } %>
|
|
<% if (user.userProperties.canUpdateWorkOrders) { %>
|
|
<% if (workOrder.workOrderCloseDate) { %>
|
|
<button class="button is-warning" id="button--reopenWorkOrder" data-work-order-id="<%= workOrder.workOrderId %>" type="button">
|
|
<span class="icon"><i class="fas fa-undo" aria-hidden="true"></i></span>
|
|
<span>Reopen Work Order</span>
|
|
</button>
|
|
<% } else { %>
|
|
<a class="button is-primary"
|
|
href="<%= urlPrefix %>/workOrders/<%= workOrder.workOrderId %>/edit"
|
|
accesskey="e">
|
|
<span class="icon"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
|
|
<span>
|
|
Edit
|
|
<span class="is-hidden-mobile">Work Order</span>
|
|
</span>
|
|
</a>
|
|
<% } %>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="columns is-desktop">
|
|
<div class="column">
|
|
<div class="panel">
|
|
<div class="panel-block is-block">
|
|
<div class="columns">
|
|
<div class="column">
|
|
<p class="mb-2">
|
|
<strong>Work Order Type</strong><br />
|
|
<%= workOrder.workOrderType %>
|
|
</p>
|
|
<p>
|
|
<strong>Description</strong><br />
|
|
<% if (workOrder.workOrderDescription) { %>
|
|
<%= workOrder.workOrderDescription %>
|
|
<% } else { %>
|
|
<span class="has-text-grey">(No Description)</span>
|
|
<% } %>
|
|
</p>
|
|
</div>
|
|
<div class="column">
|
|
<p class="mb-2">
|
|
<strong><%= configFunctions.getConfigProperty("aliases.workOrderOpenDate") %></strong><br />
|
|
<%= workOrder.workOrderOpenDateString %>
|
|
</p>
|
|
<p>
|
|
<strong><%= configFunctions.getConfigProperty("aliases.workOrderCloseDate") %></strong><br />
|
|
<% if (workOrder.workOrderCloseDate) { %>
|
|
<%= workOrder.workOrderCloseDateString %>
|
|
<% } else { %>
|
|
<span class="has-text-grey">
|
|
(No <%= configFunctions.getConfigProperty("aliases.workOrderCloseDate") %>)
|
|
</span>
|
|
<% } %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel">
|
|
<h2 class="panel-heading">Related Contracts</h2>
|
|
<div class="panel-block is-block">
|
|
<%
|
|
const tabToSelect = (workOrder.workOrderContracts.length > 0 || workOrder.workOrderBurialSites.length === 0 ? "contracts" : "burialSites");
|
|
%>
|
|
<div class="tabs is-boxed">
|
|
<ul>
|
|
<li class="<%= (tabToSelect === "contracts" ? "is-active" : "") %>">
|
|
<a href="#relatedTab--contracts">
|
|
<span>Contracts</span>
|
|
<span class="ml-2 tag"><%= workOrder.workOrderContracts.length %></span>
|
|
</a>
|
|
</li>
|
|
<li class="<%= (tabToSelect === "burialSites" ? "is-active" : "") %>">
|
|
<a href="#relatedTab--burialSites">
|
|
<span>Burial Sites</span>
|
|
<span class="ml-2 tag"><%= workOrder.workOrderBurialSites.length %></span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="tab-container">
|
|
<div class="<%= (tabToSelect === "contracts" ? "" : "is-hidden") %>" id="relatedTab--contracts">
|
|
<% if (workOrder.workOrderContracts.length === 0) { %>
|
|
<div class="message is-info">
|
|
<p class="message-body">
|
|
There are no contracts associated with this work order.
|
|
</p>
|
|
</div>
|
|
<% } else { %>
|
|
<% const currentDate = dateTimeFunctions.dateToInteger(new Date()); %>
|
|
<table class="table is-fullwidth is-striped is-hoverable">
|
|
<thead>
|
|
<tr>
|
|
<th class="has-width-1"></th>
|
|
<th>Contract Type</th>
|
|
<th>Burial Site</th>
|
|
<th>Contract Date</th>
|
|
<th>End Date</th>
|
|
<th>Contacts</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% for (const contract of workOrder.workOrderContracts) { %>
|
|
<% const isActive = !(contract.contractEndDate && contract.contractEndDate < currentDate); %>
|
|
<tr>
|
|
<td class="has-text-centered">
|
|
<% if (isActive) { %>
|
|
<i class="fas fa-play" title="Current Contract"></i>
|
|
<% } else { %>
|
|
<i class="fas fa-stop" title="Previous Contract"></i>
|
|
<% } %>
|
|
</td>
|
|
<td>
|
|
<a class="has-text-weight-bold"
|
|
href="<%= urlPrefix %>/contracts/<%= contract.contractId %>">
|
|
<%= contract.contractType %>
|
|
</a><br />
|
|
<span class="is-size-7">
|
|
#<%= contract.contractId %>
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<% if (contract.burialSiteId) { %>
|
|
<%= contract.burialSiteName %>
|
|
<% } else { %>
|
|
<span class="has-text-grey">(No Burial Site)</span>
|
|
<% } %>
|
|
</td>
|
|
<td><%= contract.contractStartDateString %></td>
|
|
<td>
|
|
<% if (contract.contractEndDate) { %>
|
|
<%= contract.contractEndDateString %>
|
|
<% } else { %>
|
|
<span class="has-text-grey">(No End Date)</span>
|
|
<% } %>
|
|
</td>
|
|
<td>
|
|
<ul class="fa-ul ml-5">
|
|
<% for (const interment of contract.contractInterments) { %>
|
|
<li class="has-tooltip-left" data-tooltip="<%= contract.isPreneed ? 'Recipient' : 'Deceased' %>">
|
|
<span class="fa-li"><i class="fas fa-user" aria-label="Recipient"></i></span>
|
|
<%= interment.deceasedName %>
|
|
</li>
|
|
<% } %>
|
|
<% if (contract.purchaserName !== '') { %>
|
|
<li class="has-tooltip-left" data-tooltip="Purchaser">
|
|
<span class="fa-li"><i class="fas fa-hand-holding-dollar" aria-label="Purchase"></i></span>
|
|
<%= contract.purchaserName %>
|
|
</li>
|
|
<% } %>
|
|
<% if (contract.funeralHomeName) { %>
|
|
<li class="has-tooltip-left" data-tooltip="Funeral Home">
|
|
<span class="fa-li"><i class="fas fa-place-of-worship" aria-label="Funeral Home"></i></span>
|
|
<%= contract.funeralHomeName %>
|
|
</li>
|
|
<% } %>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<% } %>
|
|
</tbody>
|
|
</table>
|
|
<% } %>
|
|
</div>
|
|
<div class="<%= (tabToSelect === "burialSites" ? "" : "is-hidden") %>" id="relatedTab--burialSites">
|
|
<% if (workOrder.workOrderBurialSites.length === 0) { %>
|
|
<div class="message is-info">
|
|
<p class="message-body">
|
|
There are no burial sites associated with this work order.
|
|
</p>
|
|
</div>
|
|
<% } else { %>
|
|
<table class="table is-fullwidth is-striped is-hoverable">
|
|
<thead>
|
|
<tr>
|
|
<th>Burial Site</th>
|
|
<th>Cemetery</th>
|
|
<th>Burial Site Type</th>
|
|
<th>Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% for (const burialSite of workOrder.workOrderBurialSites) { %>
|
|
<tr>
|
|
<td>
|
|
<a class="has-text-weight-bold" href="<%= urlPrefix %>/burialSites/<%= burialSite.burialSiteId %>">
|
|
<%= burialSite.burialSiteName %>
|
|
</a>
|
|
</td>
|
|
<td><%= burialSite.cemeteryName %></td>
|
|
<td><%= burialSite.burialSiteType %></td>
|
|
<td><%= burialSite.burialSiteStatus %></td>
|
|
</tr>
|
|
<% } %>
|
|
</tbody>
|
|
</table>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<% if (workOrder.workOrderComments.length > 0) { %>
|
|
<div class="panel">
|
|
<h2 class="panel-heading">Work Order Comments</h2>
|
|
<div class="panel-block is-block">
|
|
<table class="table is-fullwidth is-striped is-hoverable">
|
|
<thead>
|
|
<tr>
|
|
<th>Commentor</th>
|
|
<th>Comment Date</th>
|
|
<th>Comment</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% for (const workOrderComment of workOrder.workOrderComments) { %>
|
|
<tr>
|
|
<td><%= workOrderComment.recordCreate_userName %></td>
|
|
<td>
|
|
<%= workOrderComment.commentDateString %>
|
|
<%= (workOrderComment.commentTime === 0 ? "" : workOrderComment.commentTimePeriodString) %>
|
|
</td>
|
|
<td><%= workOrderComment.comment %></td>
|
|
</tr>
|
|
<% } %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
|
|
<div class="column is-4-desktop">
|
|
<% if (workOrder.workOrderContracts.length > 0) { %>
|
|
<div class="panel">
|
|
<h2 class="panel-heading">Contract Milestones</h2>
|
|
<% let hasContractMilestones = false; %>
|
|
<% for (const contract of workOrder.workOrderContracts) { %>
|
|
<% if (contract.funeralDate !== null && contract.funeralDate >= workOrder.workOrderOpenDate && (workOrder.workOrderCloseDate === null || workOrder.workOrderCloseDate >= contract.funeralDate)) { %>
|
|
<% hasContractMilestones = true; %>
|
|
<div class="panel-block is-block">
|
|
<strong>Funeral</strong><br />
|
|
<%= contract.funeralDateString %>
|
|
<% if (contract.funeralTime !== null && contract.funeralTime !== 0) { %>
|
|
<%= contract.funeralTimePeriodString %>
|
|
<% } %><br />
|
|
<%= contract.funeralHomeName %><br />
|
|
</div>
|
|
<% } %>
|
|
<% } %>
|
|
<% if (!hasContractMilestones) { %>
|
|
<div class="panel-block is-block">
|
|
<p class="has-text-grey">No relevant contract milestones available.</p>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
<% } %>
|
|
<div class="panel">
|
|
<div class="panel-heading">
|
|
<div class="level is-mobile">
|
|
<div class="level-left">
|
|
<div class="level-item">
|
|
<h2 class="title is-5 has-text-white has-text-weight-bold">Milestones</h2>
|
|
</div>
|
|
</div>
|
|
<div class="level-right">
|
|
<div class="level-item">
|
|
<div class="dropdown is-right has-text-weight-normal">
|
|
<div class="dropdown-trigger">
|
|
<button class="button is-small has-tooltip-left" type="button" data-tooltip="Milestone Options" aria-label="Options">
|
|
<i class="fas fa-ellipsis-v" aria-hidden="true"></i>
|
|
</button>
|
|
</div>
|
|
<div class="dropdown-menu">
|
|
<div class="dropdown-content">
|
|
<a class="dropdown-item" href="<%= urlPrefix %>/api/<%= user.userProperties.apiKey %>/milestoneICS/?workOrderId=<%= workOrder.workOrderId %>">
|
|
<span class="icon is-small"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
|
<span>Download iCalendar</span>
|
|
</a>
|
|
<a class="dropdown-item" href="<%= urlPrefix %>/reports/workOrderMilestones-byWorkOrderId/?workOrderId=<%= workOrder.workOrderId %>" target="_blank" download>
|
|
<span class="icon is-small"><i class="fas fa-download" aria-hidden="true"></i></span>
|
|
<span>Export as CSV</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% for (const milestone of workOrder.workOrderMilestones) { %>
|
|
<div class="panel-block is-block">
|
|
<div class="columns is-mobile">
|
|
<div class="column is-narrow">
|
|
<% if (milestone.workOrderMilestoneCompletionDate) { %>
|
|
<span class="icon is-small" data-tooltip="Completed <%= milestone.workOrderMilestoneCompletionDateString %>">
|
|
<i class="fas fa-check" aria-label="Completed <%= milestone.workOrderMilestoneCompletionDateString %>"></i>
|
|
</span>
|
|
<% } else { %>
|
|
<span class="icon is-small">
|
|
<i class="far fa-square has-text-grey" aria-label="Incomplete"></i>
|
|
</span>
|
|
<% } %>
|
|
</div>
|
|
<div class="column">
|
|
<% if (milestone.workOrderMilestoneTypeId) { %>
|
|
<strong><%= milestone.workOrderMilestoneType %></strong><br />
|
|
<% } %>
|
|
<% if (milestone.workOrderMilestoneDate === 0) { %>
|
|
<span class="has-text-grey">(No Set Date)</span>
|
|
<% } else { %>
|
|
<%= milestone.workOrderMilestoneDateString %>
|
|
<% } %>
|
|
<% if (milestone.workOrderMilestoneTime !== 0) { %>
|
|
<%= milestone.workOrderMilestoneTimePeriodString %>
|
|
<% } %>
|
|
<br />
|
|
<span class="is-size-7"><%= milestone.workOrderMilestoneDescription %></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<%- include('_footerA'); -%>
|
|
|
|
<script src="<%= urlPrefix %>/javascripts/workOrder.view.js"></script>
|
|
|
|
<%- include('_footerB'); -%> |