522 lines
21 KiB
Plaintext
522 lines
21 KiB
Plaintext
<%- include('_header'); -%>
|
|
|
|
<nav class="breadcrumb">
|
|
<ul>
|
|
<li><a href="<%= urlPrefix %>/dashboard">Home</a></li>
|
|
<li>
|
|
<a href="<%= urlPrefix %>/contracts">
|
|
<span class="icon is-small">
|
|
<span class="fa-layers fa-fw" aria-hidden="true">
|
|
<i class="fas fa-vector-square"></i>
|
|
<i class="fas fa-user" data-fa-transform="shrink-10"></i>
|
|
</span>
|
|
</span>
|
|
<span>Contracts</span>
|
|
</a>
|
|
</li>
|
|
<li class="is-active">
|
|
<a href="#" aria-current="page">
|
|
Contract #<%= contract.contractId %>: <%= contract.burialSiteName ?? "(No Burial Site)" %>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<h1 class="title is-1">
|
|
Contract
|
|
#<%= contract.contractId %>:
|
|
<%= contract.burialSiteName || "(No Burial Site)" %>
|
|
</h1>
|
|
|
|
<div class="level is-fixed-bottom is-mobile has-background-white has-shadow is-hidden-print">
|
|
<div class="level-left">
|
|
<span class="level-item has-text-weight-bold">
|
|
Contract #<%= contract.contractId %>:
|
|
<%= contract.burialSiteName ?? "(No Burial Site)" %>
|
|
</span>
|
|
</div>
|
|
<div class="level-right">
|
|
<% if (contractTypePrints.length > 0) { %>
|
|
<% if (contractTypePrints.length === 1) { %>
|
|
<div class="level-item">
|
|
<a href="<%= urlPrefix %>/print/<%= contractTypePrints[0] %>/?contractId=<%= contract.contractId %>" 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>
|
|
</div>
|
|
<% } else { %>
|
|
<div class="level-item">
|
|
<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>
|
|
</a>
|
|
</div>
|
|
<div class="dropdown-menu">
|
|
<div class="dropdown-content">
|
|
<% for (const printName of contractTypePrints) { %>
|
|
<% const printConfig = printFunctions.getPrintConfig(printName); %>
|
|
<% if (printConfig) { %>
|
|
<a class="dropdown-item" href="<%= urlPrefix %>/print/<%= printName %>/?contractId=<%= contract.contractId %>" target="_blank">
|
|
<span class="icon"><i class="fas fa-print" aria-hidden="true"></i></span>
|
|
<span><%= printConfig.title %></span>
|
|
</a>
|
|
<% } %>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% } %>
|
|
<% } %>
|
|
<% if (user.userProperties.canUpdate) { %>
|
|
<div class="level-item">
|
|
<a class="button <%= (contract.contractEndDate ? "is-warning" : "is-primary") %>"
|
|
href="<%= urlPrefix %>/contracts/<%= contract.contractId %>/edit"
|
|
accesskey="e">
|
|
<span class="icon"><i class="fas fa-pencil-alt" aria-hidden="true"></i></span>
|
|
<span>Switch to Edit Mode</span>
|
|
</a>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel">
|
|
<div class="panel-block is-block">
|
|
<div class="columns">
|
|
<div class="column">
|
|
<p>
|
|
<strong>Contract Type</strong><br />
|
|
<%= contract.contractType %>
|
|
</p>
|
|
</div>
|
|
<div class="column">
|
|
<p class="mb-2">
|
|
<strong>Burial Site</strong><br />
|
|
<% if (contract.burialSiteId) { %>
|
|
<a href="<%= urlPrefix %>/burialSites/<%= contract.burialSiteId %>"><%= contract.burialSiteName %></a>
|
|
<% } else { %>
|
|
<span class="has-text-grey">(No Burial Site)</span>
|
|
<% } %>
|
|
</p>
|
|
<p>
|
|
<strong>Cemetery</strong><br />
|
|
<% if (contract.cemeteryId) { %>
|
|
<a href="<%= urlPrefix %>/cemeteries/<%= contract.cemeteryId %>"><%= contract.cemeteryName %></a>
|
|
<% } else { %>
|
|
<span class="has-text-grey">(No Cemetery)</span>
|
|
<% } %>
|
|
</p>
|
|
</div>
|
|
<div class="column">
|
|
<p class="mb-2">
|
|
<strong>Contract Date</strong><br />
|
|
<%= contract.contractStartDateString %>
|
|
</p>
|
|
<p>
|
|
<strong>End Date</strong><br />
|
|
<% if (contract.contractEndDateString === "") { %>
|
|
<span class="has-text-grey">(No End Date)</span>
|
|
<% } else { %>
|
|
<%= contract.contractEndDateString %>
|
|
<% } %>
|
|
</p>
|
|
</div>
|
|
<% if (contract.contractFields.length > 0) { %>
|
|
<div class="column">
|
|
<% for (const contractField of contract.contractFields) { %>
|
|
<p class="mb-2">
|
|
<strong><%= contractField.contractTypeField %></strong><br />
|
|
<% if (contractField.contractFieldValue) { %>
|
|
<%= contractField.contractFieldValue %>
|
|
<% } else { %>
|
|
<span class="has-text-grey">(No Value)</span>
|
|
<% } %>
|
|
</p>
|
|
<% } %>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="columns">
|
|
<div class="column">
|
|
<div class="panel">
|
|
<h2 class="panel-heading">Purchaser</h2>
|
|
<div class="panel-block is-block">
|
|
<div class="columns">
|
|
<div class="column">
|
|
<p>
|
|
<%= contract.purchaserName %><br />
|
|
<span class="is-size-7">
|
|
<% if (contract.purchaserAddress1) { %>
|
|
<%= contract.purchaserAddress1 %><br />
|
|
<% } %>
|
|
<% if (contract.purchaserAddress2) { %>
|
|
<%= contract.purchaserAddress2 %><br />
|
|
<% } %>
|
|
<% if (contract.purchaserCity) { %>
|
|
<%= contract.purchaserCity %>,
|
|
<% } %>
|
|
<%= contract.purchaserProvince %><br />
|
|
<%= contract.purchaserPostalCode %>
|
|
</span>
|
|
</p>
|
|
</div>
|
|
<div class="column">
|
|
<% if ((contract.purchaserPhoneNumber ?? '') !== '') { %>
|
|
<p class="mb-2">
|
|
<strong>Phone</strong><br />
|
|
<%= contract.purchaserPhoneNumber %>
|
|
</p>
|
|
<% } %>
|
|
<% if ((contract.purchaserEmail ?? '') !== '') { %>
|
|
<p class="mb-2">
|
|
<strong>Email</strong><br />
|
|
<%= contract.purchaserEmail %>
|
|
</p>
|
|
<% } %>
|
|
<p>
|
|
<strong>
|
|
Relationship to
|
|
<%= (contract.isPreneed ? "Recipient" : "Deceased") %>
|
|
</strong><br />
|
|
<%= contract.purchaserRelationship %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="column">
|
|
<div class="panel">
|
|
<div class="panel-heading">
|
|
<div class="level is-mobile">
|
|
<div class="level-left">
|
|
<div class="level-item">
|
|
<h2 class="has-text-weight-bold is-size-5">
|
|
<%= (contract.isPreneed ? "Recipient" : "Deceased") %>
|
|
</h2>
|
|
</div>
|
|
</div>
|
|
<div class="level-right">
|
|
<div class="level-item">
|
|
<a class="button is-link is-small is-hidden-print has-text-weight-normal"
|
|
href="<%= urlPrefix %>/reports/contractInterments-byContractId/?contractId=<%= contract.contractId %>" target="_blank" download>
|
|
<span class="icon is-small"><i class="fas fa-download" aria-hidden="true"></i></span>
|
|
<span>Export</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="panel-block is-block">
|
|
<% if (contract.contractInterments.length === 0) { %>
|
|
<div class="message is-warning">
|
|
<p class="message-body">
|
|
There are no interments associated with this record.
|
|
</p>
|
|
</div>
|
|
<% } else { %>
|
|
<table class="table is-fullwidth is-striped is-hoverable">
|
|
<thead>
|
|
<tr>
|
|
<th><%= (contract.isPreneed ? "Recipient" : "Deceased") %></th>
|
|
<th>Details</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% for (const contractInterment of contract.contractInterments) { %>
|
|
<tr>
|
|
<td>
|
|
<%= contractInterment.deceasedName %><br />
|
|
<span class="is-size-7">
|
|
<% if (contractInterment.deceasedAddress1) { %>
|
|
<%= contractInterment.deceasedAddress1 %><br />
|
|
<% } %>
|
|
<% if (contractInterment.deceasedAddress2) { %>
|
|
<%= contractInterment.deceasedAddress2 %><br />
|
|
<% } %>
|
|
<% if (contractInterment.deceasedCity) { %>
|
|
<%= contractInterment.deceasedCity %>,
|
|
<% } %>
|
|
<%= contractInterment.deceasedProvince %><br />
|
|
<%= contractInterment.deceasedPostalCode %>
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<div class="columns mb-0">
|
|
<div class="column">
|
|
<strong>Birth:</strong>
|
|
</div>
|
|
<div class="column">
|
|
<% if (contractInterment.birthDateString === '') { %>
|
|
<span class="has-text-grey">(No Birth Date)</span>
|
|
<% } else { %>
|
|
<%= contractInterment.birthDateString %>
|
|
<% } %><br />
|
|
<%= contractInterment.birthPlace %>
|
|
</div>
|
|
</div>
|
|
<div class="columns mb-0">
|
|
<div class="column">
|
|
<strong>Death:</strong>
|
|
</div>
|
|
<div class="column">
|
|
<% if (contractInterment.deathDateString === '') { %>
|
|
<span class="has-text-grey">(No Death Date)</span>
|
|
<% } else { %>
|
|
<%= contractInterment.deathDateString %>
|
|
<% } %><br />
|
|
<%= contractInterment.deathPlace %>
|
|
</div>
|
|
</div>
|
|
<div class="columns mb-0">
|
|
<div class="column">
|
|
<strong>Age:</strong>
|
|
</div>
|
|
<div class="column">
|
|
<%= contractInterment.deathAge %>
|
|
<%= contractInterment.deathAgePeriod %>
|
|
</div>
|
|
</div>
|
|
<div class="columns">
|
|
<div class="column">
|
|
<strong>Container:</strong>
|
|
</div>
|
|
<div class="column">
|
|
<%= contractInterment.intermentContainerType ?? '(No Container Type)' %>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<% } %>
|
|
</tbody>
|
|
</table>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="columns">
|
|
<div class="column">
|
|
<div class="panel">
|
|
<h2 class="panel-heading">Fees</h2>
|
|
<div class="panel-block is-block">
|
|
<% if (contract.contractFees.length === 0) { %>
|
|
<div class="message is-info">
|
|
<p class="message-body">
|
|
There are no fees applied to this contract.
|
|
</p>
|
|
</div>
|
|
<% } else { %>
|
|
<%
|
|
let feeAmountTotal = 0;
|
|
let taxAmountTotal = 0;
|
|
%>
|
|
<table class="table is-fullwidth is-striped is-hoverable">
|
|
<thead>
|
|
<tr>
|
|
<th>Fee</th>
|
|
<th class="has-text-right"><span class="is-sr-only">Unit Cost</span></th>
|
|
<th class="has-width-1"><span class="is-sr-only">×</span></th>
|
|
<th class="has-width-1 has-text-right"><span class="is-sr-only">Quantity</span></th>
|
|
<th class="has-width-1"><span class="is-sr-only">=</span></th>
|
|
<th class="has-width-1 has-text-right">Total</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% for (const contractFee of contract.contractFees) { %>
|
|
<%
|
|
feeAmountTotal += (contractFee.feeAmount * contractFee.quantity);
|
|
taxAmountTotal += (contractFee.taxAmount * contractFee.quantity);
|
|
%>
|
|
<tr>
|
|
<td colspan="<%= (contractFee.quantity === 1 ? "5" : "1") %>">
|
|
<%= contractFee.feeName %><br />
|
|
<span class="tag"><%= contractFee.feeCategory %></span>
|
|
</td>
|
|
<% if (contractFee.quantity !== 1) { %>
|
|
<td class="has-text-right">$<%= contractFee.feeAmount.toFixed(2) %></td>
|
|
<td>×</td>
|
|
<td class="has-text-right"><%= contractFee.quantity %></td>
|
|
<td>=</td>
|
|
<% } %>
|
|
<td class="has-text-right">$<%= (contractFee.feeAmount * contractFee.quantity).toFixed(2) %></td>
|
|
</tr>
|
|
<% } %>
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<th colspan="5">Subtotal</th>
|
|
<td class="has-text-right has-text-weight-bold">$<%= feeAmountTotal.toFixed(2) %></td>
|
|
</tr>
|
|
<tr>
|
|
<th colspan="5">Tax</th>
|
|
<td class="has-text-right">$<%= taxAmountTotal.toFixed(2) %></td>
|
|
</tr>
|
|
<tr>
|
|
<th colspan="5">Grand Total</th>
|
|
<td class="has-text-right has-text-weight-bold">$<%= (feeAmountTotal + taxAmountTotal).toFixed(2) %></td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="column">
|
|
<div class="panel">
|
|
<h2 class="panel-heading">Transactions</h2>
|
|
<div class="panel-block is-block">
|
|
<% if (contract.contractTransactions.length === 0) { %>
|
|
<div class="message is-info">
|
|
<p class="message-body">
|
|
There are no transactions associated with this contract.
|
|
</p>
|
|
</div>
|
|
<% } else { %>
|
|
<table class="table is-fullwidth is-striped is-hoverable">
|
|
<thead>
|
|
<tr>
|
|
<th>Date</th>
|
|
<th><%= configFunctions.getConfigProperty("aliases.externalReceiptNumber") %></th>
|
|
<th class="has-text-right">Amount</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% let transactionTotal = 0; %>
|
|
<% for (const contractTransaction of contract.contractTransactions) { %>
|
|
<% transactionTotal += contractTransaction.transactionAmount; %>
|
|
<tr>
|
|
<td><%= contractTransaction.transactionDateString %></td>
|
|
<td>
|
|
<% if (contractTransaction.externalReceiptNumber !== '') { %>
|
|
<%= contractTransaction.externalReceiptNumber %>
|
|
<% if (configFunctions.getConfigProperty('settings.dynamicsGP.integrationIsEnabled')) { %>
|
|
<% if (contractTransaction.dynamicsGPDocument === undefined) { %>
|
|
<span data-tooltip="No Matching Document Found">
|
|
<i class="fas fa-times-circle has-text-danger" aria-label="No Matching Document Found"></i>
|
|
</span>
|
|
<% } else if (contractTransaction.dynamicsGPDocument.documentTotal.toFixed(2) === contractTransaction.transactionAmount.toFixed(2)) { %>
|
|
<span data-tooltip="Matching Document Found">
|
|
<i class="fas fa-check-circle has-text-success" aria-label="Matching Document Found"></i>
|
|
</span>
|
|
<% } else { %>
|
|
<span data-tooltip="Matching Document: $<%= contractTransaction.dynamicsGPDocument.documentTotal.toFixed(2) %>">
|
|
<i class="fas fa-exclamation-triangle has-text-warning" aria-label="Matching Document: $<%= contractTransaction.dynamicsGPDocument.documentTotal.toFixed(2) %>"></i>
|
|
</span>
|
|
<% } %>
|
|
<% } %>
|
|
<br />
|
|
<% } %>
|
|
<small><%= contractTransaction.transactionNote %></small>
|
|
</td>
|
|
<td class="has-text-right">
|
|
$<%= contractTransaction.transactionAmount.toFixed(2) %>
|
|
</td>
|
|
</tr>
|
|
<% } %>
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<th colspan="2">Transaction Total</th>
|
|
<td class="has-text-weight-bold has-text-right">
|
|
$<%= transactionTotal.toFixed(2) %>
|
|
</td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<% if (contract.workOrders.length > 0) { %>
|
|
<%
|
|
const workOrderOpenDateAlias = configFunctions.getConfigProperty("aliases.workOrderOpenDate");
|
|
const workOrderCloseDateAlias = configFunctions.getConfigProperty("aliases.workOrderCloseDate");
|
|
%>
|
|
<div class="panel">
|
|
<h2 class="panel-heading">Work Orders</h2>
|
|
<div class="panel-block is-block">
|
|
<table class="table is-fullwidth is-striped is-hoverable">
|
|
<thead>
|
|
<tr>
|
|
<th>Work Order Number</th>
|
|
<th>Description</th>
|
|
<th>Date</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% for (const workOrder of contract.workOrders) { %>
|
|
<tr>
|
|
<td>
|
|
<a class="has-text-weight-bold" href="<%= urlPrefix %>/workOrders/<%= workOrder.workOrderId %>">
|
|
<%= workOrder.workOrderNumber %>
|
|
</a>
|
|
</td>
|
|
<td>
|
|
<%= workOrder.workOrderType %><br />
|
|
<span class="is-size-7"><%= workOrder.workOrderDescription %></span>
|
|
</td>
|
|
<td class="is-nowrap">
|
|
<span class="has-tooltip-left" data-tooltip="<%= workOrderOpenDateAlias %>">
|
|
<i class="fas fa-fw fa-play" aria-label="<%= workOrderOpenDateAlias %>"></i>
|
|
<%= workOrder.workOrderOpenDateString %>
|
|
</span><br />
|
|
<span class="has-tooltip-left" data-tooltip="<%= workOrderCloseDateAlias %>">
|
|
<i class="fas fa-fw fa-stop" aria-label="<%= workOrderCloseDateAlias %>"></i>
|
|
<% if (workOrder.workOrderCloseDate) { %>
|
|
<%= workOrder.workOrderCloseDateString %>
|
|
<% } else { %>
|
|
<span class="has-text-grey">(No <%= workOrderCloseDateAlias %>)</span>
|
|
<% } %>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<% } %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<% } %>
|
|
|
|
<% if (contract.contractComments.length > 0) { %>
|
|
<div class="panel">
|
|
<h2 class="panel-heading">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 contractComment of contract.contractComments) { %>
|
|
<tr>
|
|
<td><%= contractComment.recordCreate_userName %></td>
|
|
<td>
|
|
<%= contractComment.commentDateString %>
|
|
<%= (contractComment.commentTime === 0 ? "" : contractComment.commentTimePeriodString) %>
|
|
</td>
|
|
<td><%= contractComment.comment %></td>
|
|
</tr>
|
|
<% } %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<% } %>
|
|
|
|
<%- include('_footerA'); -%>
|
|
|
|
<%- include('_footerB'); -%> |