fix missing quantity calculation

deepsource-autofix-76c6eb20
Dan Gowans 2023-02-27 14:30:23 -05:00
parent 37984ed2f3
commit 5eb925c2cd
1 changed files with 168 additions and 161 deletions

View File

@ -207,11 +207,11 @@
<table class="is-10pt data-table">
<tr>
<td><%= configFunctions.getProperty("aliases.map") %></td>
<td><%= lotOccupancy.mapName %></td>
<td><%= lotOccupancy.mapName ?? '(No ' + configFunctions.getProperty("aliases.map") + ')' %></td>
</tr>
<tr>
<td><%= configFunctions.getProperty("aliases.lot") %></td>
<td><%= lotOccupancy.lotName %></td>
<td><%= lotOccupancy.lotName ?? '(No ' + configFunctions.getProperty("aliases.lot") + ')' %></td>
</tr>
<%
for (const field of lotOccupancy.lotOccupancyFields) {
@ -239,47 +239,54 @@
<% for (const fee of lotOccupancy.lotOccupancyFees) { %>
<% if (currentFeeCategory !== fee.feeCategory) { %>
<tr>
<td colspan="2">
<td colspan="3">
<strong><%= fee.feeCategory %></strong>
</td>
</tr>
<% currentFeeCategory = fee.feeCategory; %>
<% } %>
<tr>
<td>
<td <% if (fee.quantity === 1) { %>colspan="2"<% } %>>
<%= fee.feeName %>
</td>
<% if (fee.quantity !== 1) { %>
<td class="has-text-right is-8pt has-text-nowrap">
$<%= fee.feeAmount.toFixed(2) %>
&times;
<%= fee.quantity %>
</td>
<% } %>
<td class="has-text-right">
$<%= fee.feeAmount.toFixed(2) %>
</td>
</tr>
<%
feeAmountTotal += fee.feeAmount;
taxAmountTotal += fee.taxAmount;
feeAmountTotal += fee.feeAmount * fee.quantity;
taxAmountTotal += fee.taxAmount * fee.quantity;
%>
<% } %>
<tr>
<td><strong>Sub Total</strong></td>
<td colspan="2"><strong>Sub Total</strong></td>
<td class="has-text-right">
<strong>$<%= feeAmountTotal.toFixed(2) %></strong>
</td>
</tr><tr>
<td>HST</td>
<td colspan="2">HST</td>
<td class="has-text-right">
$<%= taxAmountTotal.toFixed(2) %>
</td>
</tr><tr>
<td><strong>Total Sale</strong></td>
<td colspan="2"><strong>Total Sale</strong></td>
<td class="has-text-right">
<strong>$<%= (feeAmountTotal + taxAmountTotal).toFixed(2) %></strong>
</td>
</tr><tr>
<td><strong>Balance Owing</strong></td>
<td colspan="2"><strong>Balance Owing</strong></td>
<td class="has-text-right">
<strong>$<%= (feeAmountTotal + taxAmountTotal - lotOccupancyFunctions.getTransactionTotal(lotOccupancy)).toFixed(2) %></strong>
</td>
</tr>
</tfoot>
</tbody>
</table>
</td>
</tr>