Right now, I have a table that gets updated daily. There are separate postage amounts that get put in, and I want to only display the total of all the postage, not each individual postage import.
<body>
<div class="divTableHeading1">Section A: Costs / Expenses</div>
<div class="divTable">
<div class="divTableBody">
<div class="divTableRow1">
<div class="divTableCellB">Invoice Number</div>
<div class="divTableCellB">Date</div>
<div class="divTableCellB">Description</div>
<div class="divTableCellB">Status</div>
<div class="divTableCellB">Amount</div>
</div>
<%
// Sum of total postage (value)
postageCount = Finances[Display_Name == searchParam && Line_Item.contains("Postage")].count(Line_Item); // should equal 2 for example 215534 at time of writing
totalPostageValue = Finances[Display_Name == searchParam && Line_Item.contains("Postage")].sum(Amount);
for each Expense in Finances[Display_Name == searchParam.toString() && Type == "Client Expenses"]
{
// If Trust isn't in the row, capture those amounts
if(!Expense.Line_Item.containsIgnoreCase("Trust"))
{
if(Expense.Line_Item.contains("Postage") && postageCount > 1) {
Amount = totalPostageValue.round(2);
} else {
DateOf = Expense.Date_of_Invoice;
Invoice = Expense.Invoice_Number;
Amount = Expense.Amount;
Description = Expense.Line_Item;
Status = Expense.Status;
}
%>
<div class="divTableRow1">
<div class="divTableCell"><%=Invoice%></div>
<div class="divTableCell"><%=DateOf%></div>
<div class="divTableCell"><%=Description%></div>
<div class="divTableCell"><%=Status%></div>
<div class="divTableCell">$ <%=Amount%></div>
</div>
<%
}
}
%>
</div>
</div>
</body>
<%
}%>
I can get the total value of all postage in the form with just checking the line item, but when I render the list below, I want to only see one postage value for all postage values that have been an import. Just a total value with only one postage in the table. Is this possible?
Thank you.