Skip to main content

Period Closing Report

Another example, where we combine the use of stencils and settings can be found in the configuration of the PeriodClosingReport (also known as an End-of-Day report).

The template in this example will result in the transmission of a Period Closing Report to a designated e-mail address, or, if you'll follow the link at the end of this short guide, multiple e-mail addresses. After setting this up, you will receive this report whenever you close the financial period.

To make this extra clear: the generation of an EOD report requires this stencil to be configured.

Template

For this template we can skip layout and instead go and create a new template straight away.

  • For Name, select PeriodClosingReport
  • As usual, you can assign this template to a specific OU, or you can leave it empty which will assign it to all OUs. The same goes for Country and Language. You can find more information on this at the start of this document.
  • At Destination, select Mail

You can insert the following, generic example template at Content:

HTML
<head>
<style>
h1,
h2,
h3 {
font-family: 'Hind', sans-serif;
font-weight: 600;
color: #202020;
}
table {
font-family: 'Hind', sans-serif;
}
.store-align{
width:50%;
padding-left: 50px;
}
.right-column{
padding: 22px 0 0 30px;
}
</style>

<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Hind:wght@400;600&display=swap" rel="stylesheet">

</head>

{#subject}Period Closing Report{#/subject}
<div style="box-sizing:border-box;margin:0;padding:0;width:100%">



<div class="m_3966551746016967307show" style="font-size:0px;max-height:0px;overflow:hidden;display:none">Period Closing Report<br>
<br>



</div>



<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="m_3966551746016967307wrapper" bgcolor="#ffffff">
<tbody><tr>
<td align="center"><table width="600" border="0" cellspacing="0" cellpadding="0" class="m_3966551746016967307full-width" align="center" style="width:600px;margin:0 auto">
<tbody><tr>
<td style="height:100%; border-left:1px solid #e1e1e1;border-right:1px solid #e1e1e1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody><tr>
<td align="center"><table width="600" border="0" cellspacing="0" cellpadding="0" class="m_3966551746016967307full-width" align="center" style="width:600px;margin:0 auto">
<tbody><tr>
<td height="20" style="font-size:1px;line-height:1px;height:20px">

<div class="m_3966551746016967307gmailfix" style="white-space:nowrap;font:15px courier;line-height:1px;background:#ffffff">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>

</td>
</tr>
<tr>
<td class="m_3966551746016967307mobile-hide" height="10" style="font-size:1px;line-height:1px;height:10px"></td>
</tr>
<tr>
<td align="center">
<!-- logo -->
<table role="presentation" border="0" cellspacing="0"
cellpadding="0" class="content-wrapper" align="center"
style="width:516px; margin:0 auto;" bgcolor="#202020">
<tbody>
<tr>
<td class="mobile-hide" height="1"
style="font-size:1px; line-height:1px; height:1px;">
<!--[if !mso]><!-->
<div class="gmailfix"
style="white-space:nowrap; font:15px courier; line-height:1px; background:#202020;">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;</div>
<!--<![endif]-->
</td>
</tr>
<tr>
<td class="logo" align="center"
style="padding: 10px 0;"><a
href="yourURLhere"><img
src="https://i.ibb.co/x7y4Fkd/EVA-Logo-wit-no-padding.png"
width="auto" height="22"
alt="alt" border="0"
style="display: block; margin: 0 auto;"></a>
</td>
</tr>
</tbody>
</table><!-- /logo -->

</td>
</tr>
<tr>
<td class="m_3966551746016967307full-width" style="width:600px;max-width:600px;min-width:600px" align="center">

<table width="515" border="0" cellspacing="0" cellpadding="0" class="m_3966551746016967307content-wrapper-small" align="center" style="width:515px;margin:0 auto">
<tbody><tr>
<td class="m_3966551746016967307full-width-img"><a href="" target="_blank" ><img src="https://i.ibb.co/v4bzPB4/image.png" width="515" alt="" border="0" style="display:block" class="CToWUd"></a></td>
</tr>
</tbody></table>
<table width="515" border="0" cellspacing="0" cellpadding="0" class="m_3966551746016967307content-wrapper-small" align="center" style="width:515px;margin:0 auto">
<tbody><tr>
<td height="30"></td>
</tr>
</tbody></table>





<table width="515" border="0" cellspacing="0" cellpadding="0" class="m_3966551746016967307content-wrapper-small" align="center" style="width:515px;margin:0 auto">
<tbody><tr>
<td class="m_3966551746016967307libre" align="center" style="font-family:'Hind',sans-serif;font-size:23px;line-height:36px;color:#202020;font-weight:600">Financial Period Closing Report</td>
</tr>
<tr>
<td class="m_3966551746016967307libre" align="center" style="font-family:'Hind',sans-serif;font-size:18px;line-height:16px;color:#202020;font-weight:400">Store: {{>OrganizationUnit.Name}}</td>
</tr>
<tr>
<td class="m_3966551746016967307libre" align="center" style="font-family:'Hind',sans-serif;font-size:18px;line-height:36px;color:#202020;font-weight:400">{{:~date(FinanceDate, "DD/MM/YYYY HH:MM:SS", "nl")}}</td>
</tr>
<tr>
<td align="left" style="padding:10px 0 0 0"><table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tbody><tr>
<td style="border-top:4px solid #000000;padding-bottom:20px;font-size:1px;line-height:1px">&nbsp;</td>
</tr>
</tbody></table>
</td>
</tr>
<table class="data" style="width:80%">
<tr>
<td style="width:50%">Description</td>
<td style="width:15%">Number (Qty)</td>
<td align="right" style="width:35%">Amount</td>
</tr>
</table>
<tr>
<td align="center" style="padding:10px 0 0 0"><table cellpadding="0" cellspacing="0" border="0" style="width:80%">
<tbody><tr>
<td style="border-top:2px #000000; border-style:dashed; border-bottom:none; border-left:none; border-right:none; padding-bottom:0px;font-size:1px;line-height:1px">&nbsp;</td>
</tr>
</tbody></table>
</td>
</tr>
<table class="data" style="width:80%">
<tr>
<td style="width:50%">Sales</td>
<td class="count" style="width:20%">{{>SaleInvoiceQuantity}}</td>
<td align="right" style="width:30%">{{:~currency(TotalAmountInvoicedExTax,CurrencyID)}}</td>
</tr>
<tr>
<td style="width:50%">Units sold</td>
<td class="count" style="width:20%">{{>SoldProductsQuantity}}</td>
<td align="right" style="width:30%"></td>
</tr>
<tr>
<td style="width:50%">Returns</td>
<td class="count" style="width:20%">{{>ReturnedLinesQuantity}}</td>
<td align="right" style="width:30%">{{:~symbolD(ReturnedLinesAmountExTax, ~root.CurrencyID)}}</td>
</tr>
{{if Discounts}}
<tr>
<td style="width:50%">Discounts</td>
<td class="count" style="width:20%">{{>DiscountQuantity}}</td>
<!--<td align="right" style="width:30%">{{:~symbolD(Amount, ~root.CurrencyID)}}</td>-->
<td align="right" style="width:30%">{{:~symbolD(DiscountAmount, ~root.CurrencyID)}}</td>
</tr>
{{else}}
<tr>
<td style="width:50%">Discounts</td>
<td class="count" style="width:20%">0</td>
<td align="right" style="width:30%">{{:~symbolD(0, ~root.CurrencyID)}}</td>
</tr>
{{/if}}
<tr>
<td></td>
<td></td>
<td style="border-top:2px; border-style:dashed; border-bottom:none; border-left:none; border-right:none;"></td>
</tr>
<tr style="padding-top: 10px;">
<td style="width:50%;">Closing total</td>
<td></td>
<!--<td align="right" style="width:30%">{{:~symbolD(ClosingAmount, ~root.CurrencyID)}}</td>-->
<td align="right" style="width:30%">{{:~symbolD(~subtotalClosing(~root.Payments, ReturnedLinesAmount, ~root.Discounts), ~root.CurrencyID)}}</td>
</tr>
{{if Taxes}}
<tr>
<td style="width:50%;">Taxes:</td>
</tr>
{{for Taxes}}
<tr>
<td style="width:50%;">{{>TaxCodeName}}</td>
<td></td>
<td align="right" style="width:30%">{{:~symbolD(Amount, ~root.CurrencyID)}}</td>
</tr>
{{/for}}
{{else}}
<tr>
<td style="width:50%;">Taxes:</td>
<td></td>
<td align="right" style="width:30%">{{:~symbolD(0, ~root.CurrencyID)}}</td>
</tr>
{{/if}}
<tr>
<td></td>
<td></td>
<td style="border-top:2px; border-style:dashed; border-bottom:none; border-left:none; border-right:none;"></td>
</tr>
</table>
<table class="data" style="width:80%; padding-top: 10px;">
<tr>
<td style="width:50%; font-weight:bold;">Subtotal</td>
<td></td>
{{if Taxes}}
<td align="right" style="width:30%">{{:~symbolD(~subtotalA(~subtotalClosing(~root.Payments, ReturnedLinesAmount, ~root.Discounts), Taxes), ~root.CurrencyID)}}</td>
{{else}}
<td align="right" style="width:30%">{{:~symbolD(0, ~root.CurrencyID)}}</td>
{{/if}}
</tr>
</table>
<table class="data" style="width:80%; padding-top: 10px;">
{{if SoldSerialNumbers && SoldSerialNumbers.length > 0}}
<tr>
<td style="width:50%;">Giftcard out</td>
<td class="count" style="width:20%">{{>SoldSerialNumbers.length}}</td>
<td align="right" style="width:30%">{{:~symbolD(GiftCardsAmount, ~root.CurrencyID)}}</td>
</tr>
<!--
<tr>
<td style="width:50%;">Giftcard in</td>
<td class="count" style="width:20%"></td>
<td align="right" style="width:30%">{{:~symbolD(~getGiftcardInAmount(~root.Payments),~root.CurrencyID)}}</td>
</tr>
-->
{{else}}
<tr>
<td style="width:50%;">Giftcard out</td>
<td class="count" style="width:20%">0</td>
<td align="right" style="width:30%">{{:~symbolD(0, ~root.CurrencyID)}}</td>
</tr>
<!--
<tr>
<td style="width:50%;">Giftcard in</td>
<td class="count" style="width:20%">0</td>
<td align="right" style="width:30%">{{:~symbolD(0, ~root.CurrencyID)}}</td>
</tr>
-->
{{/if}}

<tr>
<td></td>
<td></td>
<td style="border-top:2px; border-style:dashed; border-bottom:none; border-left:none; border-right:none;"></td>
</tr>
</table>
<table class="data" style="width:80%; padding-top: 10px;">
<tr>
<td style="width:50%; font-weight:bold;">Subtotal</td>
<td></td>
{{if Taxes}}
<td align="right" style="width:30%">{{:~symbolD(~subtotalB(~subtotalA(~subtotalClosing(~root.Payments, ReturnedLinesAmount, ~root.Discounts), Taxes), ~root.GiftCardsAmount), ~root.CurrencyID)}}</td>
{{else}}
<td align="right" style="width:30%">{{:~symbolD(0, ~root.CurrencyID)}}</td>
{{/if}}
</tr>
</table>
<table class="data" style="width:80%; padding-top: 10px;">
{{if Expenses.length >= 1}}
<tr>
<td style="width:50%;">Total Expenses</td>
<td class="count" style="width:20%"></td>
<td align="right" style="width:30%">{{:~symbolD(~SumTotal(Expenses), ~root.CurrencyID)}}</td>
</tr>
<tr>
<td style="width:50%; padding-right:10px; font-weight:bold; font-style:italic;">Breakdown:</td>
</tr>
{{for Expenses}}
<tr>
<td style="width:50%; padding-right:10px;">{{>Description}}</td>
<td class="count" style="width:20%"></td>
<td align="right" style="width:30%">{{:~symbolD(Total,~root.CurrencyID)}}</td>
</tr>
{{/for}}
{{else}}
<tr>
<td style="width:50%;">Total Expenses</td>
<td class="count" style="width:20%"></td>
<td align="right" style="width:30%">{{:~symbolD(0, ~root.CurrencyID)}}</td>
</tr>
{{/if}}

{{if Movements}}
<tr>
<td style="width:50%; font-weight: bold; padding-top: 10px;">Cash Movements:</td>
</tr>
{{for Movements}}
<tr>
<td style="width:50%;">{{>Description}}</td>
<td class="count" style="width:20%"></td>
<td align="right" style="width:30%">{{:~symbolD(Total, ~root.CurrencyID)}}</td>
</tr>
{{/for}}
{{else}}
<tr>
<td style="width:50%; font-weight: bold; padding-top:10px;">Cash Movements</td>
<td class="count" style="width:20%"></td>
<td align="right" style="width:30%">{{:~symbolD(0, ~root.CurrencyID)}}</td>
</tr>
{{/if}}
{{if RoundingDifference}}
<tr>
<td style="width:50%;">Round-off difference</td>
<td class="count" style="width:20%"></td>
<td align="right" style="width:30%">{{:~currency(~root.RoundingDifference, ~root.CurrencyID)}}</td>
</tr>
{{else}}
<tr>
<td style="width:50%;">Round-off difference</td>
<td class="count" style="width:20%"></td>
<td align="right" style="width:30%">{{:~symbolD(0, ~root.CurrencyID)}}</td>
</tr>
{{/if}}
<!-- this is the dotted line for POS Details
<tr>
<td></td>
<td></td>
<td style="border-top:2px; border-style:dashed; border-bottom:none; border-left:none; border-right:none;"></td>
</tr>
-->
</table>
<table class="data" style="width:80%; padding-top: 10px;">
<tr>
<td style="width:50%;">Cash balance</td>
<td></td>
<td align="right" style="width:30%">{{:~symbolD(ClosingAmount, ~root.CurrencyID)}}</td>
</tr>
{{if OpeningAmount}}
<tr>
<td style="width:50%;">Change balance</td>
<td></td>
<td align="right" style="width:30%">{{:~symbolD(~changeBalance(OpeningAmount, ClosingAmount), ~root.CurrencyID)}}</td>
</tr>
{{else}}
<tr>
<td style="width:50%;">Change balance</td>
<td></td>
<td align="right" style="width:30%">{{:~symbolD(0, ~root.CurrencyID)}}</td>
</tr>
{{/if}}
<tr>
<td style="width:50%; font-weight:bold; padding-top: 5px;">Cash Register Journal:</td>
</tr>
<tr>
<td style="width:50%;">Opening Amount:</td>
<td></td>
<td align="right" style="width:30%">{{:~symbolD(OpeningAmount, ~root.CurrencyID)}}</td>
</tr>
<tr>
<td style="width:50%;">Opening difference:</td>
<td></td>
<td align="right" style="width:30%">{{:~symbolD(~changeBalance(ClosingAmount,OpeningAmount), ~root.CurrencyID)}}</td>
</tr>
<tr>
<td style="width:50%;">Closing difference:</td>
<td></td>
<td align="right" style="width:30%">{{:~symbolD(OpeningsDifference, ~root.CurrencyID)}}</td>
</tr>
<tr>
<td style="width:50%;">Closing Amount</td>
<td></td>
<td align="right" style="width:30%">{{:~symbolD(ClosingAmount, ~root.CurrencyID)}}</td>
</tr>
<tr>
<td style="width:50%;">Cash Deposit</td>
<td></td>
<td align="right" style="width:30%">{{:~symbolD(CashDeposit, ~root.CurrencyID)}}</td>
</tr>
</table>
<table class="data" style="width:80%; padding-top: 10px;">
{{if ReturnInvoiceQuantity}}
<tr>
<td style="width:50%;">Return slips</td>
<td style="width:15%">{{>ReturnInvoiceQuantity}}</td>
<td align="right" style="width:30%"></td>
</tr>
{{else}}
<tr>
<td style="width:50%;">Return slips</td>
<td style="width:15%">0</td>
<td align="right" style="width:30%"></td>
</tr>
{{/if}}
{{if InterbranchReceived}}
<tr>
<td style="width:50%;">Transfers in</td>
<td style="width:15%">{{>InterbranchReceived}}</td>
<td align="right" style="width:30%"></td>
</tr>
{{else}}
<tr>
<td style="width:50%;">Transfers in</td>
<td style="width:15%">0</td>
<td align="right" style="width:30%"></td>
</tr>
{{/if}}
{{if InterbranchSent}}
<tr>
<td style="width:50%;">Transfers out</td>
<td style="width:15%">{{>InterbranchSent}}</td>
<td align="right" style="width:30%"></td>
</tr>
{{else}}
<tr>
<td style="width:50%;">Transfers out</td>
<td style="width:15%">0</td>
<td align="right" style="width:30%"></td>
</tr>
{{/if}}
{{if CycleCounts}}
<tr>
<td style="width:50%; font-weight: bold; padding-top: 5px;">Cycle count:</td>
</tr>
{{for CycleCounts}}
<tr>
<td style="width:50%;">Total</td>
<td style="width:15%">{{>Total}}</td>
<td align="right" style="width:30%"></td>
</tr>
<tr>
<td style="width:50%;">Deviated</td>
<td style="width:15%">{{>Deviated}}</td>
<td align="right" style="width:30%"></td>
</tr>
{{/for}}
{{else}}
<tr>
<td style="width:50%; font-weight: bold; padding-top: 5px;">Cycle count</td>
<td style="width:15%">0</td>
<td align="right" style="width:30%"></td>
</tr>
{{/if}}
<!--
<tr>
<td style="width:50%;">No sale / drawer open</td>
<td></td>
<td align="right" style="width:30%">Nvt</td>
</tr>
-->
</table>

<!--CASH SPECIFICATION-->
<table width="515" border="0" cellspacing="0" cellpadding="0" class="m_3966551746016967307content-wrapper-small" align="center" style="width:515px;margin:0 auto">
<tbody>
<tr>
<td class="m_3966551746016967307libre" align="center" style="font-family:'Hind',sans-serif;font-size:23px;line-height:36px;color:#202020;font-weight:600">Payment Specification</td>
</tr>
<tr>
<td align="left" style="padding:10px 0 0 0"><table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tbody><tr>
<td style="border-top:4px solid #000000;padding-bottom:20px;font-size:1px;line-height:1px">&nbsp;</td>
</tr>
</tbody></table>
</td>
</tr>
<table class="data" style="width:80%">
<tr>
<td style="width:50%">Description</td>
<td style="width:15%"></td>
<td align="right" style="width:35%">Amount</td>
</tr>
</table>
<table class="data" style="width:80%">
<tr>
<td style="width:50%; font-weight:bold;">Payment Method:</td>
</tr>
{{if Payments && Payments.length > 0}}
{{for Payments}}
{{if Type.toUpperCase() !== 'AUTO FULFILLED'}}
<tr>
<!--<td style="width:50%">{{>Type}}</td>-->
<td style="width:50%">{{:~replaceText(Type, "INTERSOLVE")}}</td>
<td class="count" style="width:20%"></td>
<td align="right" style="width:35%">{{:~currency(Total,~root.CurrencyID)}}</td>
</tr>
{{/if}}
{{/for}}
{{/if}}
</table>
<table class="data" style="width:80%; padding-top: 10px;">
<tr>
<td></td>
<td></td>
<td style="border-top:2px; border-style:dashed; border-bottom:none; border-left:none; border-right:none;"></td>
</tr>
</table>
<table class="data" style="width:80%; padding-top: 10px;">
<tr>
<td style="width:50%;">Total received payments</td>
<td></td>
<td align="right" style="width:30%">{{:~currency(~sumTotalReceivedPayments(Payments),CurrencyID)}}</td>
</tr>
</table>

<table width="515" border="0" cellspacing="0" cellpadding="0" class="m_3966551746016967307content-wrapper-small" align="center" style="width:515px;margin:0 auto">
<tbody><tr>
<td height="25" style="border-bottom:2px solid #e0ddd8"></td>
</tr>
<tr>
<td height="35"></td>
</tr>
</tbody></table>

</tbody>
</table>
<br />
</tbody></table>
</td></tr>
</tbody></table>

</td>
</tr>
</tbody></table>

</td>
</tr>
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="100%">

<tbody><tr>
<td align="center" bgcolor="#202020">
<table align="center" border="0" cellpadding="0" cellspacing="0" class="m_3966551746016967307full-width" style="width:600px;margin:0 auto" width="600">

<tbody><tr>
<td height="20" style="font-size:1px;line-height:1px;height:20px">
<div class="m_3966551746016967307gmailfix" style="white-space:nowrap;font:15px courier;line-height:1px;background:#202020">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div></td></tr><tr>
<td align="center">
<table align="center" border="0" cellpadding="0" cellspacing="0" class="m_3966551746016967307content-wrapper-small" style="width:515px;margin:0 auto" width="515">

<tbody><tr>
<td align="center" style="padding-bottom:20px">
<table align="center" border="0" cellpadding="0" cellspacing="0">

<tbody><tr>
<td align="center" style="font-family:Hind,sans-serif;font-size:10px;line-height:18px;color:#ffffff;font-weight:400"> © <span class="il">New Black {{:~date(Date, 'YYYY', 'en')}}</td>
</tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>

</div>

Helpers

After pasting the above template at Content, continue by adding the following helpers at the Helpers tab:

JavaScript
function SumTotal(list) {
var res = 0;
for (var i=0; i<list.length; i++) {
res += list[i].Total;
}
return res;
}

function sumTotalReceivedPayments(list) {
var res = 0;
for (var i=0; i<list.length; i++) {
if (list[i].Type.toUpperCase() !== 'AUTO FULFILLED')
res += list[i].Total;
}
return res;
}

function taxAmount(rate) {
return 'TAX ' + rate + '%';
}

function fixed(e) {
e = e || 0;
return e.toFixed(2);
}

function conversionAmount(e) {
return e + '%';
}

function symbolD(value, currencyId) {
return currencySymbol(currencyId) + ' ' + (value || 0.00).toFixed(2);
}

function changeBalance(openingAmount, closingAmount) {
return closingAmount-openingAmount;
}

function getGiftcardInAmount(payment){
var paymentGiftcard;
paymentGiftcard = payment.filter(p => p.Type == "INTERSOLVE");
return paymentGiftcard.Total;
}

function subtotalA(closingAmount, taxes){
i = taxes.length;
while(i--){
closingAmount += taxes[i].Amount;
}
return closingAmount;
}

function subtotalB(totalA, giftcardAmount){
return totalA + giftcardAmount;
}

function subtotalExpenses(expenses) {
i = expenses.length;
var totalExpenseAmount = 0;
while(i--) {
totalExpenseAmount += expenses[i].Total;
}
return totalExpenseAmount;
}

function subtotalClosing(payment, returns, discounts) {
var paymentTotal = 0;
var discountTotal = 0;
for (var i=0; i<payment.length; i++) {
paymentTotal += payment[i].Total;
}
if(discounts !== null) {
d = discounts.length;
discountTotal = 0;
while(d--) {
discountTotal += discounts[d].Amount;
}
return paymentTotal + returns + discountTotal;
}
}

function subtotalPOSDetails(subtotalB, expenses, movements){
i = movements.length;
while(i--) {
expenses += movements.Total;
}
return subtotalB - expenses;
}

function getSumDiscount(total, sum) {
return total + sum;
}

function getTotalDiscount(discount) {
i = discount.length;
discountTotal = 0;
while(i--) {
discountTotal += discount[i].Amount;
}
return discountTotal;
}

function replaceText(obj, textString) {
if(obj.toUpperCase() === textString) {
obj = 'Giftcard';
} else {
return obj;
}
return obj;
}

Now don't forget to Save your new template.

Additional configuration

Now that the template's setup, we still need to add a user to which the Period Closing Report will be sent.

This user can be specified in the Organization chapter, by selecting the OU in question and adding the user in the Email address field in the Basic information card.

Now that you've added this user, a report will be sent to the user's e-mail address whenever the period is closed.

Would you like to have this report sent to more than one person? Enter the necessary email address in the PeriodClosing:BCC setting.

Configure SMTP

Bear in mind that before any kind of e-mail can be sent via EVA, SMTP has to be configured: SMTP.