Files
cbsnexora-backend/JavaScriptApps/IndivLendHome.html
T
2012-07-07 17:20:36 +10:00

1417 lines
53 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>Mifos - Individual Lending</title>
<link rel="SHORTCUT ICON" href="resources/favicon.ico" />
<link rel="stylesheet" type="text/css" href="resources/allinone.css" />
<link rel="stylesheet" type="text/css" href="resources/libs/DataTables-1.8.2/extras/TableTools/media/css/TableTools.css" />
<link rel="stylesheet" type="text/css" href="resources/libs/DataTables-1.8.2/media/css/demo_page.css" />
<link rel="stylesheet" type="text/css" href="resources/libs/DataTables-1.8.2/media/css/demo_table.css" />
<link rel="stylesheet" type="text/css" href="resources/libs/jquery-ui-1.8.16.custom/css/smoothness/jquery-ui-1.8.16.custom.css" />
<link rel="stylesheet" type="text/css" href="resources/excel/excel-2007.css" />
<link rel="stylesheet" type="text/css" href="resources/stretchyreporting/stretchyreporting.css">
<link rel="stylesheet" type="text/css" href="resources/IndividualLendingCode.css" />
<script type="text/javascript" src="resources/libs/jquery-1.7.min.js"></script>
<script type="text/javascript" src="resources/libs/jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="resources/libs/DataTables-1.8.2/media/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="resources/libs/jquery.dataTables.TitleNumeric.js"></script>
<script type="text/javascript" src="resources/libs/DataTables-1.8.2/extras/TableTools/media/js/ZeroClipboard.js"></script>
<script type="text/javascript" src="resources/libs/DataTables-1.8.2/extras/TableTools/media/js/TableTools.min.js"></script>
<script type="text/javascript" src="resources/libs/jquery.i18n.properties-min-1.0.9.js"></script>
<script type="text/javascript" src="resources/libs/jsrender.js"></script>
<script type="text/javascript" src="resources/libs/jquery.views.js"></script>
<script type="text/javascript" src="resources/libs/jquery.observable.min.js"></script>
<script type="text/javascript" src="resources/libs/globalize/globalize.js"></script>
<script type="text/javascript" src="resources/stretchydata-0.95.js"></script>
<script type="text/javascript" src="resources/stretchyreporting/stretchyreporting-0.99.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
</script>
<script type="text/javascript" src="resources/IndividualLendingCode.js"></script>
</head>
<body>
<div id="container"></div>
<script>
$(document).ready(function() {
initialiseAndShowILLogon();
});
</script>
<!-- Everything below here is just templates for jsrender to process in order to display the various pages -->
<!-- Normally this would be put in a server side include... but you need to run the html through a web server for that to work -->
<!-- If anyone knows how to include this text without the need for a web server that would help a lot. -->
<!-- I guess I could just read the file and write it into the DOM -->
<!-- portfolio templates -->
<script id="newLoanScheduleTemplate" type="text/x-jquery-tmpl"><table id="repaymentschedule" class="pretty displayschedule">
<caption>Repayment Schedule</caption>
<thead>
<tr>
<th>#</th>
<th>{{=$ctx.doI18N("tab.client.account.loan.schedule.table.column.heading.date")}}</th>
<th>{{=$ctx.doI18N("tab.client.account.loan.schedule.table.column.heading.principal")}}</th>
<th>{{=$ctx.doI18N("tab.client.account.loan.schedule.table.column.heading.interest")}}</th>
<th>{{=$ctx.doI18N("tab.client.account.loan.schedule.table.column.heading.total")}}</th>
<th>{{=$ctx.doI18N("tab.client.account.loan.schedule.table.heading.outstanding")}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>{{=$ctx.money(cumulativePrincipal)}}</td>
</tr>
{{#each scheduledLoanInstallments}}
<tr>
<td>{{=$ctx.number(installmentNumber)}}</td>
<td>{{=$ctx.globalDate(periodEnd)}}</td>
<td>{{=$ctx.money(principalDue)}}</td>
<td>{{=$ctx.money(interestDue)}}</td>
<td>{{=$ctx.money(totalInstallmentDue)}}</td>
<td>{{=$ctx.money(outStandingBalance)}}</td>
</tr>
{{/each}}
</tbody>
<tfoot class="ui-widget-header">
<tr class="ui-widget-header">
<th>{{=$ctx.doI18N("tab.client.account.loan.schedule.table.column.heading.total")}}</th>
<th>&nbsp;</th>
<th>{{=$ctx.money(cumulativePrincipal)}}</th>
<th>{{=$ctx.money(cumulativeInterest)}}</th>
<th>{{=$ctx.money(cumulativeTotal)}}</th>
<th>&nbsp;</th>
</tr>
</tfoot>
</table>
</script>
<script id="newLoanFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<input type="hidden" id="clientId" name="clientId" value="{{=clientId}}" />
<input type="hidden" id="dateFormat" name="dateFormat" value="dd MMMM yyyy" />
<input type="hidden" id="locale" name="locale" value="en" />
<fieldset>
<legend>Loan Information</legend>
<div>
<table id="productdetails">
<tr>
<td valign="top">
<label for="clientname">Applicant:</label>
<input id="clientname" name="clientName" title="" type="text" value="{{=clientName}}" disabled="disabled" />
<label for="productId">Product:</label>
<select name="productId" id="productId">
<option value="-1">--Select Product--</option>
{{#each allowedProducts}}
{{#if $ctx.number($parent.parent.data.productId)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=name}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=name}}</option>
{{/if}}
{{/each}}
</select>
<label for="description">Description:</label>
<textarea id="description" rows="2" cols="50" draggable="false" disabled="disabled">{{=selectedProduct.description}}</textarea>
</td>
<td style="text-align:right;vertical-align:bottom;width:50px;">&nbsp;</td>
<td valign="top">
<label for="submittedOnDate">Submitted on:</label>
<input id="submittedOnDate" name="submittedOnDate" title="" type="text" class="datepickerfield" value="{{=$ctx.globalDate(submittedOnDate)}}" />
<label for="submittedOnNote">Loan submittal note:</label>
<textarea id="submittedOnNote" name="submittedOnNote" rows="2" cols="50" draggable="false">{{=submittedOnNote}}</textarea>
</td>
</tr>
</table>
</div>
</fieldset>
<fieldset>
<legend>Loan Terms</legend>
<table>
<tr>
<td valign="top" style="padding-right: 5px; border-right: 1px solid;">
<table>
<tr>
<td>Loan amount:</td>
<td>
<input id="principal" name="principal" title="" type="text" value="{{=$ctx.money(selectedProduct.principal)}}" style="width: 125px;" />
<input id="principalCurrencyCode" name="principalCurrencyCode" title="" type="text" value="{{=selectedProduct.principal.displaySymbol}}" style="width: 40px;" disabled="disabled" />
</td>
</tr>
<tr>
<td>Repaid every:</td>
<td>
<input id="repaymentEvery" name="repaymentEvery" title="" type="text" value="{{=$ctx.number(selectedProduct.repaymentEvery)}}" style="width: 50px;" />
<select name="repaymentFrequencyType" id="repaymentFrequencyType" title="" style="width: 121px;">
{{#each selectedProduct.repaymentFrequencyTypeOptions}}
{{#if $ctx.number($parent.parent.data.selectedProduct.repaymentFrequencyType.id)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
{{/if}}
{{/each}}
</select>
</td>
</tr>
<tr>
<td># of repayments:</td>
<td>
<input id="numberOfRepayments" name="numberOfRepayments" title="" type="text" value="{{=$ctx.number(selectedProduct.numberOfRepayments)}}" style="width: 50px;" />
</td>
</tr>
<tr>
<td>Expected disbursement on:</td>
<td>
<input id="expectedDisbursementDate" name="expectedDisbursementDate" title="" type="text" class="datepickerfield" value="{{=$ctx.globalDate(expectedDisbursementDate)}}" style="width:172px;"/>
</td>
</tr>
<tr>
<td>First repayment on:</td>
<td>
<input id="repaymentsStartingFromDate" name="repaymentsStartingFromDate" title="" type="text" class="datepickerfield" value="{{=$ctx.globalDate(repaymentsStartingFromDate)}}" style="width:172px;"/>
</td>
</tr>
</table>
</td>
<!-- interest details cell -->
<td valign="top" style="padding-left: 5px; padding-right: 5px; border-right: 1px solid;">
<table>
<tr>
<td>Nominal interest rate %:</td>
<td>
<input id="interestRatePerPeriod" name="interestRatePerPeriod" title="" type="text" value="{{=$ctx.decimal(selectedProduct.interestRatePerPeriod, 4)}}" style="width: 60px;" />
<select name="interestRateFrequencyType" id="interestRateFrequencyType" title="" style="width: 115px;">
{{#each selectedProduct.interestRateFrequencyTypeOptions}}
{{#if $ctx.number($parent.parent.data.selectedProduct.interestRateFrequencyType.id)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
{{/if}}
{{/each}}
</select>
</td>
</tr>
<tr>
<td>Annual nominal rate %:</td>
<td>
<input id="interestRatePerYear" name="interestRatePerYear" title="" type="text" style="width: 60px;" disabled="disabled" />
</td>
</tr>
<tr>
<td>Amortization:</td>
<td>
<select name="amortizationType" id="amortizationType" title="" style="width: 178px;">
{{#each selectedProduct.amortizationTypeOptions}}
{{#if $ctx.number($parent.parent.data.selectedProduct.amortizationType.id)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
{{/if}}
{{/each}}
</select>
</td>
</tr>
<tr>
<td>Interest method:</td>
<td>
<select name="interestType" id="interestType" title="" style="width: 180px;">
{{#each selectedProduct.interestTypeOptions}}
{{#if $ctx.number($parent.parent.data.selectedProduct.interestType.id)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
{{/if}}
{{/each}}
</select>
</td>
</tr>
<tr>
<td>Interest calculation period:</td>
<td>
<select id="interestCalculationPeriodType" name="interestCalculationPeriodType" title="" style="width: 220px;">
{{#each selectedProduct.interestCalculationPeriodTypeOptions}}
{{#if $ctx.number($parent.parent.data.selectedProduct.interestCalculationPeriodType.id)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
{{/if}}
{{/each}}
</select>
</td>
</tr>
<tr>
<td>Interest charged from:</td>
<td>
<input id="interestChargedFromDate" name="interestChargedFromDate" title="" type="text" class="datepickerfield" value="{{=$ctx.globalDate(interestCalculatedFromDate)}}" style="width:172px;"/>
</td>
</tr>
<tr>
<td>Arrears tolerance:</td>
<td>
<input id="inArrearsTolerance" name="inArrearsTolerance" title="" type="text" value="{{=$ctx.money(selectedProduct.inArrearsTolerance)}}" style="width: 125px;" />
<input id="inArrearsCurrencyCode" name="inArrearsCurrencyCode" title="" type="text" value="{{=selectedProduct.inArrearsTolerance.displaySymbol}}" style="width: 40px;" disabled="disabled" />
</td>
</tr>
</table>
</td>
<td>
<!-- Other options -->
<div>
<span id="toolbar" class="ui-widget-header ui-corner-all">
<button type="submit" class="submitloanapp" id="submitloanapp" name="_eventId_submit" title="Submit loan application.">Submit loan application</button>
<button type="submit" class="cancelloanapp" id="cancelloanapp" name="_eventId_cancel" title="Cancel loan application.">Cancel</button>
</span>
</div>
<!-- other options -->
</td>
</tr>
</table>
</fieldset>
</form>
</script>
<script id="newLoanFormTemplateMin" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<input type="hidden" id="clientId" name="clientId" value="{{=clientId}}" />
<label for="clientname">Applicant:</label>
<input id="clientname" name="clientName" title="" type="text" value="{{=clientName}}" disabled="disabled" />
<label for="productId">Product:</label>
<select name="productId" id="productId">
<option value="-1">--Select Product--</option>
{{#each allowedProducts}}
{{#if $ctx.number($parent.parent.data.productId)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=name}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=name}}</option>
{{/if}}
{{/each}}
</select>
</form>
</script>
<script id="noteListViewTemplate" type="text/x-jquery-tmpl">
{{#if notes.length > 0}}
<div class="ui-widget .ui-widget-content ui-corner-all notecontainer">
<div class="ui-widget-header">
<span class="ui-icon ui-icon-info" style="float: left; margin-right: 5px;" ></span>
<span>{{=title}}</span>
</div>
<div class="ui-widget ui-widget-content ui-corner-all">
{{#each notes}}
<div>
<div class="notespacer">
<span class="ui-icon ui-icon-note" style="float: left; margin-right: 5px;"></span>
{{#if noteType.id === 100}}
<span>Client note:</span>
{{/if}}
{{#if noteType.id === 200}}
<span>Loan note:</span>
{{/if}}
{{#if noteType.id === 300}}
<span>Loan transaction note:</span>
{{/if}}
<span><a href="#" class="editclientnote" id="editclientnotelink{{=id}}">Edit</a></span>
</div>
<div class="notecontent">{{=note}}</div>
<div class="notespacer">
<span class="ui-icon ui-icon-person" style="float: left; margin-right: 5px;" ></span>
<span class="noteusername">{{=updatedByUsername}}</span>
<span>&nbsp;{{=$ctx.globalDateTime(updatedOn)}}</span>
</div>
</div>
{{/each}}
</div>
</div>
{{/if}}
</script>
<script id="noteFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<label for="note">Note:</label>
<textarea rows="10" cols="75" id="note" name="note" cssClass="text ui-widget-content ui-corner-all">{{=note}}</textarea>
</form>
</script>
<script id="clientSearchTabTemplate" type="text/x-jquery-tmpl">
<form method="post" id="viewClient" name="viewClient" action="switchToClient">
<label for="client">Choose client:</label>
<select name="client" id="client" onChange="showILClient(options[selectedIndex].value);">
<option value="0">--Select Client--</option>
{{#each clients}}
<option value="{{=id}}">{{=displayName}}&nbsp;-&nbsp;({{=officeName}})</option>
{{/each}}
</select>
</form>
</script>
<script id="clientFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<label for="office">Office:</label>
<select id="officeId" name="officeId" title="">
<option value="">--Select Office--</option>
{{#each allowedOffices}}
{{#if $ctx.number($parent.parent.data.officeId)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=name}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=name}}</option>
{{/if}}
{{/each}}
</select>
<table>
<tr>
<td>
<label for="firstname">First name:</label>
<input id="firstname" name="firstname" title="" type="text" value="{{=firstname}}"/>
</td>
<td>
<label for="lastname">Last name:</label>
<input id="lastname" name="lastname" title="" type="text" value="{{=lastname}}"/>
</td>
<tr>
<tr>
<td colspan="2">
<label for="clientOrBusinessName">Client or Business name:</label>
<input id="clientOrBusinessName" name="clientOrBusinessName" title="" type="text" value="{{=fullname}}" style="width:100%"/>
</td>
</tr>
</table>
<input type="hidden" id="dateFormat" name="dateFormat" value="dd MMMM yyyy" />
<label for="joiningDate">Joining date:</label>
<input id="joiningDate" name="joiningDate" title="" type="text" class="datepickerfield" value="{{=$ctx.globalDate(joinedDate)}}"/>
</form>
</script>
<script id="clientAccountSummariesTemplate" type="text/x-jquery-tmpl">
{{#if $ctx.numberGreaterThanZero(anyLoanCount)}}
{{#if $ctx.numberGreaterThanZero(pendingApprovalLoanCount)}}
<div class="row">
<span class="longrowlabel">Pending approval loans ({{=$ctx.number(pendingApprovalLoanCount)}}):</span>
<span class="rowvalue">
{{#each pendingApprovalLoans}}
<span class="loanaccount"><a href="unknown.html" onclick="showILLoan({{=id}}, '{{=loanProductName}}');return false ;" >{{=loanProductName}}: &#35;{{=id}}</a></span>
{{/each}}
</span>
</div>
{{/if}}
{{#if $ctx.numberGreaterThanZero(awaitingDisbursalLoanCount)}}
<div class="row">
<span class="longrowlabel">Awaiting disbursal loans ({{=$ctx.number(awaitingDisbursalLoanCount)}}):</span>
<span class="rowvalue">
{{#each awaitingDisbursalLoans}}
<span class="loanaccount"><a href="unknown.html" onclick="showILLoan({{=id}}, '{{=loanProductName}}');return false ;" >{{=loanProductName}}: &#35;{{=id}}</a></span>
{{/each}}
</span>
</div>
{{/if}}
{{#if $ctx.numberGreaterThanZero(activeLoanCount)}}
<div class="row">
<span class="longrowlabel">Active loans ({{=$ctx.number(activeLoanCount)}}):</span>
<span class="rowvalue">
{{#each openLoans}}
<span class="loanaccount"><a href="unknown.html" onclick="showILLoan({{=id}}, '{{=loanProductName}}');return false ;" >{{=loanProductName}}: &#35;{{=id}}</a></span>
{{/each}}
</span>
</div>
{{/if}}
{{#if $ctx.numberGreaterThanZero(closedLoanCount)}}
<div class="row">
<div class="longrowlabel">Closed loans ({{=$ctx.number(closedLoanCount)}}):</div>
<div class="rowvalue">
{{#each closedLoans}}
<span class="loanaccount"><a href="unknown.html" onclick="showILLoan({{=id}}, '{{=loanProductName}}');return false ;" >{{=loanProductName}}: &#35;{{=id}}</a></span>
{{/each}}
</div>
</div>
{{/if}}
{{#else}}
<div>
No accounts exist</div>
{{/if}}
</script>
<script id="clientDataTabTemplate" type="text/x-jquery-tmpl">
<span id="toolbar" class="ui-widget-header ui-corner-all">
<!--
<button id="cashflowbtn{{=id}}" class="casflowbtn">New cashflow analysis</button>
-->
<button id="newloanbtn{{=id}}" class="newloanbtn">New loan application</button>
<button id="addnotebtn{{=id}}" class="addnotebtn">Add note</button>
</span>
<hr/>
<div id="clienttabcontent">
<div id="clienttableftpane" style="float:left; max-width: 700px; width: 700px;">
<div class="row">
<span class="longrowlabel">Name:</span>
<span class="rowvalue">{{=displayName}}</span>
</div>
<div class="row">
<span class="longrowlabel">Branch:</span>
<span class="rowvalue">{{=officeName}}</span>
</div>
<div class="row">
<span class="longrowlabel">Joined on:</span>
<span class="rowvalue">{{=$ctx.globalDate(joinedDate)}}</span>
</div>
<p><b>Account Overview</b></p>
<div id="clientaccountssummary"></div>
<div id="clientadditionaldata"></div>
</div>
<!-- end of left pane content -->
<!-- placeholder for notes content -->
<div id="clienttabrightpane" style="float:right;"></div>
</div>
<div style="clear: both;"></div>
</script>
<script id="loanDataTabTemplate" type="text/x-jquery-tmpl">
{{#each permissions}}
{{#if anyActionOnLoanAllowed}}
<div id="loanactions">
<span id="toolbar" class="ui-widget-header ui-corner-all">
{{#if rejectAllowed}}
<button id="rejectbtn{{=$parent.parent.parent.data.id}}" class="rejectloan">Reject</button>
{{/if}}
{{#if withdrawnByApplicantAllowed}}
<button id="withdrawnbyapplicantloanbtn{{=$parent.parent.parent.data.id}}" class="withdrawnbyapplicantloan">Withdrawn By Applicant</button>
{{/if}}
{{#if pendingApproval}}
<button id="approvebtn{{=$parent.parent.parent.data.id}}" class="approveloan">Approve</button>
{{/if}}
{{#if pendingApproval}}
<button id="deletebtn{{=$parent.parent.parent.data.id}}" class="deleteloan">Delete</button>
{{/if}}
{{#if undoApprovalAllowed}}
<button id="undoapprovebtn{{=$parent.parent.parent.data.id}}" class="undoapproveloan">Undo Approval</button>
{{/if}}
{{#if disbursalAllowed}}
<button id="disbursebtn{{=$parent.parent.parent.data.id}}" class="disburseloan">Disburse</button>
{{/if}}
{{#if undoDisbursalAllowed}}
<button id="undodisbursalbtn{{=$parent.parent.parent.data.id}}" class="undodisbursalloan">Undo Disbursal</button>
{{/if}}
{{#if makeRepaymentAllowed}}
<button id="repaymentbtn{{=$parent.parent.parent.data.id}}" class="repaymentloan">Make Repayment</button>
{{/if}}
{{#if waiveAllowed}}
<button id="waivebtn{{=$parent.parent.parent.data.id}}" class="waiveloan">Waive</button>
{{/if}}
</span>
</div>
{{/if}}
{{/each}}
<div id="loantabs{{=id}}" class="loantabs">
<ul>
<li><a href="#details{{=id}}" title="details">Details</a></li>
<li><a href="#schedule{{=id}}" title="schedule">Schedule</a></li>
{{#if loanRepayments}}
<li><a href="#repayments{{=id}}" title="repayments">Repayments</a></li>
{{/if}}
</ul>
<!-- first loan tab -->
<div id="details{{=id}}" style="margin-top: 5px;">
<div class="row">
<span class="longrowlabel">Status:</span>
<span class="rowvalue">{{=lifeCycleStatusText}} (since {{=$ctx.globalDate(lifeCycleStatusDate)}})
{{#if $ctx.numberGreaterThanZero(summary.totalInArrears.amount)}}
{{#if actualDisbursementDate !== null}}
- In arrears by: {{=$ctx.moneyWithCurrency($parent.parent.data.summary.totalInArrears)}}
{{/if}}
{{/if}}
</span>
</div>
{{#if submittedOnDate !== null}}
<div class="row">
<span class="longrowlabel">Sumbitted on:</span>
<span class="rowvalue">{{=$ctx.globalDate(submittedOnDate)}}</span>
</div>
{{/if}}
{{#if approvedOnDate !== null}}
<div class="row">
<span class="longrowlabel">Approved on:</span>
<span class="rowvalue">{{=$ctx.globalDate(approvedOnDate)}}</span>
</div>
{{/if}}
{{#if actualDisbursementDate === null}}
<div class="row">
<span class="longrowlabel">Expected dibursement on:</span>
<span class="rowvalue">{{=$ctx.globalDate(expectedDisbursementDate)}}</span>
</div>
{{/if}}
{{#if actualDisbursementDate !== null}}
<div class="row">
<span class="longrowlabel">Disbursed on:</span>
<span class="rowvalue">{{=$ctx.globalDate(actualDisbursementDate)}}</span>
</div>
{{/if}}
{{#if expectedFirstRepaymentOnDate !== null}}
<div class="row">
<span class="longrowlabel">First repayment due on:</span>
<span class="rowvalue">{{=$ctx.globalDate(expectedFirstRepaymentOnDate)}}</span>
</div>
{{/if}}
{{#if interestChargedFromDate !== null}}
<div class="row">
<span class="longrowlabel">Interest charged from:</span>
<span class="rowvalue">{{=$ctx.globalDate(interestChargedFromDate)}}</span>
</div>
{{/if}}
{{#if actualDisbursementDate !== null}}
<div class="row">
<span class="longrowlabel">Expected to mature on:</span>
<span class="rowvalue">{{=$ctx.globalDate(expectedMaturityDate)}}</span>
</div>
{{/if}}
{{#if closedOnDate !== null}}
<div class="row">
<span class="longrowlabel">Closed on:</span>
<span class="rowvalue">{{=$ctx.globalDate(closedOnDate)}}</span>
</div>
{{/if}}
<div class="row">
<span class="longrowlabel">Expected loan term:</span>
<span class="rowvalue">{{=convenienceData.expectedLoanTermInMonths}} Months / ({{=convenienceData.expectedLoanTermInDays}} Days)</span>
</div>
{{#if closedOnDate !== null}}
<div class="row">
<span class="longrowlabel">Actual loan term:</span>
<span class="rowvalue">{{=convenienceData.actualLoanTermInMonths}} Months / ({{=convenienceData.actualLoanTermInDays}} Days)</span>
</div>
{{/if}}
<br/>
<div class="row">
<span class="longrowlabel">Product:</span>
<span class="rowvalue">{{=loanProductName}}</span>
</div>
<div class="row">
<span class="longrowlabel">External id:</span>
<span class="rowvalue">{{=externalId}}</span>
</div>
<br/>
<div class="row">
<span class="longrowlabel">Currency:</span>
<span class="rowvalue">{{=principal.defaultName}}</span>
</div>
<div class="row">
<span class="longrowlabel">Principal:</span>
<span class="rowvalue">{{=$ctx.moneyWithCurrency(principal)}}</span>
</div>
<div class="row">
<span class="longrowlabel">Repayments:</span>
<span class="rowvalue">{{=numberOfRepayments}} every {{=repaymentEvery}}&nbsp;{{=repaymentFrequencyType.value}}</span>
</div>
<div class="row">
<span class="longrowlabel">Amortization:</span>
<span class="rowvalue">{{=amortizationType.value}}</span>
</div>
<div class="row">
<span class="longrowlabel">Interest:</span>
<span class="rowvalue">{{=$ctx.decimal(annualInterestRate, 4)}}% per annum ({{=$ctx.decimal(interestRatePerPeriod, 4)}}%&nbsp; {{=interestRateFrequencyType.value}}) - {{=interestType.value}}</span>
</div>
<div id="loanadditionaldata{{=id}}"></div>
</div>
<!-- second loan tab -->
<div id="schedule{{=id}}" style="margin-top: 5px;">
<table id="summarytable{{=id}}" class="pretty displayschedule">
<caption>Summary</caption>
<thead>
<tr>
<th class="empty"></th>
<th>Original Loan</th>
<th>Paid</th>
<th>Waived</th>
<th>Outstanding</th>
</tr>
</thead>
<tbody>
<tr>
<th>Principal</th>
<td>{{=$ctx.money(summary.originalPrincipal)}}</td>
<td>{{=$ctx.money(summary.principalPaid)}}</td>
<td>&nbsp;</td>
<td>{{=$ctx.money(summary.principalOutstanding)}}</td>
</tr>
<tr>
<th>Interest</th>
<td>{{=$ctx.money(summary.originalInterest)}}</td>
<td>{{=$ctx.money(summary.interestPaid)}}</td>
<td>&nbsp;</td>
<td>{{=$ctx.money(summary.interestOutstanding)}}</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Total</th>
<th>{{=$ctx.money(summary.originalTotal)}}</th>
<th>{{=$ctx.money(summary.totalPaid)}}</th>
<th>{{=$ctx.money(summary.totalWaived)}}</th>
<th>{{=$ctx.money(summary.totalOutstanding)}}</th>
</tr>
</tfoot>
</table>
<br/>
<table id="repaymentschedule_todate{{=id}}" class="pretty displayschedule">
<caption>Repayment Schedule</caption>
<colgroup span="2"></colgroup>
<colgroup span="3">
<col class="lefthighlightcol">
<col>
<col class="righthighlightcol">
</colgroup>
<colgroup span="3">
<col class="lefthighlightcol">
<col>
<col class="righthighlightcol">
</colgroup>
<colgroup span="3">
<col class="lefthighlightcol">
<col>
<col class="righthighlightcol">
</colgroup>
<thead>
<tr>
<th colspan="2" scope="colgroup" class="empty">&nbsp;</th>
<th colspan="3" scope="colgroup" class="highlightcol">Principal</th>
<th colspan="3" scope="colgroup" class="highlightcol">Interest</th>
<th colspan="3" scope="colgroup" class="highlightcol">Total</th>
</tr>
<tr>
<th scope="col">#</th>
<th scope="col">Date</th>
<th scope="col" class="lefthighlightcolheader">Expected</th>
<th scope="col">Paid</th>
<th scope="col" class="righthighlightcolheader">Outstanding</th>
<th scope="col" class="lefthighlightcolheader">Expected</th>
<th scope="col">Paid</th>
<th scope="col" class="righthighlightcolheader">Outstanding</th>
<th scope="col" class="lefthighlightcolheader">Expected</th>
<th scope="col">Paid</th>
<th scope="col" class="righthighlightcolheader">Outstanding</th>
</tr>
</thead>
<tbody>
{{#each repaymentSchedule.periods}}
<tr>
<td scope="row">{{=$ctx.number(period)}}</td>
<td>{{=$ctx.globalDate(date)}}</td>
<td class="lefthighlightcolheader">{{=$ctx.money(principal)}}</td>
<td>{{=$ctx.money(principalPaid)}}</td>
<td class="righthighlightcolheader">{{=$ctx.money(principalOutstanding)}}</td>
<td class="lefthighlightcolheader">{{=$ctx.money(interest)}}</td>
<td>{{=$ctx.money(interestPaid)}}</td>
<td class="righthighlightcolheader">{{=$ctx.money(interestOutstanding)}}</td>
<td class="lefthighlightcolheader">{{=$ctx.money(total)}}</td>
<td>{{=$ctx.money(totalPaid)}}</td>
<td class="righthighlightcolheader">{{=$ctx.money(totalOutstanding)}}</td>
</tr>
{{/each}}
</tbody>
<tfoot>
<tr>
<th colspan="2">Total</th>
<th class="lefthighlightcolheader">{{=$ctx.money(summary.originalPrincipal)}}</th>
<th>{{=$ctx.money(summary.principalPaid)}}</th>
<th class="righthighlightcolheader">{{=$ctx.money(summary.principalOutstanding)}}</th>
<th class="lefthighlightcolheader">{{=$ctx.money(summary.originalInterest)}}</th>
<th>{{=$ctx.money(summary.interestPaid)}}</th>
<th class="righthighlightcolheader">{{=$ctx.money(summary.interestOutstanding)}}</th>
<th class="lefthighlightcolheader">{{=$ctx.money(summary.originalTotal)}}</th>
<th>{{=$ctx.money(summary.totalPaid)}}</th>
<th class="righthighlightcolheader">{{=$ctx.money(summary.totalOutstanding)}}</th>
</tr>
</tfoot>
</table>
</div>
{{#if loanRepayments}}
<!-- Third loan tab -->
<div id="repayments{{=id}}" style="margin-top: 5px;">
<table id="newrepaymentsactivity{{=id}}" class="pretty displaypayments">
<caption>Repayment Activity</caption>
<thead>
<tr>
<th>Payment Date</th>
<th>Amount Paid</th>
<th>Principal Portion</th>
<th>Interest Portion</th>
{{#if actualDisbursementDate !== null}}
<th>Action</th>
{{/if}}
</tr>
</thead>
<tbody>
{{#each loanRepayments}}
<tr>
<td>{{=$ctx.globalDate(date)}}</td>
<td>{{=$ctx.money(total)}}</td>
<td>{{=$ctx.money(principal)}}</td>
<td>{{=$ctx.money(interest)}}</td>
{{#if $parent.parent.data.actualDisbursementDate !== null}}
<td><button id="adjustrepaymentbtn{{=$parent.parent.parent.data.id}}_{{=id}}" class="adjustloanrepayment">Adjust</button></td>
{{/if}}
</tr>
{{/each}}
</tbody>
</table>
</div>
{{/if}}
</div>
</script>
<script id="stateTransitionLoanFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<input type="hidden" id="dateFormat" name="dateFormat" value="dd MMMM yyyy" />
<label for="eventDate">On:</label>
<input id="eventDate" name="eventDate" title="" class="datepickerfield" />
<label for="note">Note:</label>
<textarea rows="3" cols="53" id="note" name="note"></textarea>
</form>
</script>
<script id="undoStateTransitionLoanFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<label for="note">Note:</label>
<textarea rows="6" cols="53" id="note" name="note"></textarea>
</form>
</script>
<script id="transactionLoanFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<input type="hidden" id="dateFormat" name="dateFormat" value="dd MMMM yyyy" />
<input type="hidden" id="locale" name="locale" value="{{=$ctx.currentLocale()}}" />
<label for="transactionDate">Repayment on:</label>
<input id="transactionDate" name="transactionDate" class="text ui-widget-content ui-corner-all datepickerfield" title=""d value="{{=$ctx.globalDate(date)}}"/>
<label for="transactionAmount">Amount:</label>
<input id="transactionAmount" name="transactionAmount" class="text ui-widget-content ui-corner-all" title="" value="{{=$ctx.money(total)}}" />
<label for="note">Note:</label>
<textarea rows="3" cols="53" id="note" name="note" class="text ui-widget-content ui-corner-all"></textarea>
</form>
</script>
<script id="formErrorsTemplate" type="text/x-jquery-tmpl">
<div class="ui-widget">
<div class="ui-state-error ui-corner-all">
<span class="ui-icon ui-icon-alert" style="float: left; margin-right: 5px;" ></span>
<span>{{=title}}</span>
<div style="margin-left: 5px;">
{{#each errors}}
<div>
<em>{{=message}}</em>
</div>
{{/each}}
</div>
</div>
</div>
</script>
<!-- end of portfolio template section -->
<!-- admin templates below here -->
<script id="productFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<fieldset>
<input type="hidden" id="locale" name="locale" value="{{=$ctx.currentLocale()}}" />
<legend>{{=$ctx.doI18N("form.legend.loan.product.information")}}</legend>
<label for="name">{{=$ctx.doI18N("form.label.loan.product.name")}}</label>
<input id="name" name="name" type="text" title="" value="{{=name}}"/>
<label for="description">{{=$ctx.doI18N("form.label.loan.product.description")}}</label>
<textarea cols="73" rows="3" id="description" name="description" title="">{{=description}}</textarea>
</fieldset>
<fieldset>
<legend>{{=$ctx.doI18N("form.legend.loan.product.currency")}}</legend>
<label for="currencyCode">{{=$ctx.doI18N("form.label.loan.product.currency")}}</label>
<select id="currencyCode" name="currencyCode" title="" style="width: 300px;">
{{#each currencyOptions}}
{{#if $parent.parent.data.principal.currencyCode===code}}
<option value="{{=code}}" selected="selected">{{=name}}</option>
{{#else}}
<option value="{{=code}}">{{=name}}</option>
{{/if}}
{{/each}}
</select>
<label for="digitsAfterDecimal">{{=$ctx.doI18N("form.label.loan.product.decimalplaces")}}</label>
<input id="digitsAfterDecimal" name="digitsAfterDecimal" title="" style="width: 300px;" value="{{=$ctx.number(principal.digitsAfterDecimal)}}" />
</fieldset>
<fieldset>
<legend>{{=$ctx.doI18N("form.legend.loan.product.loan.terms")}}</legend>
<table>
<tr>
<td valign="top" style="padding-right: 5px; border-right: 1px solid;">
<table>
<tr>
<td>{{=$ctx.doI18N("form.label.loan.product.loan.amount")}}</td>
<td>
<input id="principal" name="principal" title="" style="width: 125px;" value="{{=$ctx.money(principal)}}" />
</td>
</tr>
<tr>
<td>{{=$ctx.doI18N("form.label.loan.product.repaidevery")}}</td>
<td>
<input id="repaymentEvery" name="repaymentEvery" title="" style="width: 50px;" value="{{=$ctx.number(repaymentEvery)}}"/>
<select id="repaymentFrequencyType" name="repaymentFrequencyType" title="" style="width: 121px;">
{{#each repaymentFrequencyTypeOptions}}
{{#if $ctx.number($parent.parent.data.repaymentFrequencyType.id)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
{{/if}}
{{/each}}
</select>
</td>
</tr>
<tr>
<td>{{=$ctx.doI18N("form.label.loan.product.numberof.repayments")}}</td>
<td>
<input id="numberOfRepayments" name="numberOfRepayments" title="" style="width: 50px;" value="{{=$ctx.number(numberOfRepayments)}}"/>
</td>
</tr>
</table>
</td>
<td valign="top" style="padding-left: 5px; padding-right: 5px; border-right: 1px solid;">
<table>
<tr>
<td>{{=$ctx.doI18N("form.label.loan.product.nominal.interestrate")}}</td>
<td>
<input id="interestRatePerPeriod" name="interestRatePerPeriod" title="" style="width: 70px;" value="{{=$ctx.decimal(interestRatePerPeriod, 4)}}" />
<select id="interestRateFrequencyType" name="interestRateFrequencyType" title="" style="width: 139px;">
{{#each interestRateFrequencyTypeOptions}}
{{#if $ctx.number($parent.parent.data.interestRateFrequencyType.id)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
{{/if}}
{{/each}}
</select>
</td>
</tr>
<tr>
<td>{{=$ctx.doI18N("form.label.loan.product.amortization")}}</td>
<td>
<select id="amortizationType" name="amortizationType" title="" style="width: 220px;">
{{#each amortizationTypeOptions}}
{{#if $ctx.number($parent.parent.data.amortizationType.id)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
{{/if}}
{{/each}}
</select>
</td>
</tr>
<tr>
<td>{{=$ctx.doI18N("form.label.loan.product.interest.method")}}</td>
<td>
<select id="interestType" name="interestType" title="" style="width: 220px;">
{{#each interestTypeOptions}}
{{#if $ctx.number($parent.parent.data.interestType.id)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
{{/if}}
{{/each}}
</select>
</td>
</tr>
<tr>
<td>{{=$ctx.doI18N("form.label.loan.product.interest.rate.calcutated.in.period")}}</td>
<td>
<select id="interestCalculationPeriodType" name="interestCalculationPeriodType" title="" style="width: 220px;">
{{#each interestCalculationPeriodTypeOptions}}
{{#if $ctx.number($parent.parent.data.interestCalculationPeriodType.id)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=value}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=value}}</option>
{{/if}}
{{/each}}
</select>
</td>
</tr>
<tr>
<td>{{=$ctx.doI18N("form.label.loan.product.arrears.tolerance")}}</td>
<td>
<input id="inArrearsTolerance" name="inArrearsTolerance" title="" style="width: 215px;" value="{{=$ctx.money(inArrearsTolerance)}}" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</form>
</script>
<script id="productListTemplate" type="text/x-jquery-tmpl">
<table id='productstable' width='100%'>
<thead>
<tr>
<th>{{=$ctx.doI18N("table.heading.product.name")}}</th>
<th>{{=$ctx.doI18N("table.heading.product.created")}}</th>
<th>{{=$ctx.doI18N("table.heading.product.modified")}}</th>
<th>{{=$ctx.doI18N("table.heading.product.active")}}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{{#each products}}
<tr>
<td title='{{=description}}'>{{=name}}</td>
<td>{{=$ctx.globalDateTime(createdOn)}}</td>
<td>{{=$ctx.globalDateTime(lastModifedOn)}}</td>
<td>Yes</td>
<td>
<a id='deactivateproduct{{=id}}' class='deactivateproduct' href='#' style='margin-right: 5px;'>{{=$ctx.doI18N("link.action.product.deactivate")}}</a>
<a id='editproduct{{=id}}' class='editproduct' href='#' style='margin-right: 5px;'>{{=$ctx.doI18N("link.action.product.viewedit")}}</a>
<a id='deleteproduct{{=id}}' class='deleteproduct' href='#' style='margin-right: 5px;'>{{=$ctx.doI18N("link.action.product.delete")}}</a>
</td>
</tr>
{{/each}}
</tbody>
</table>
</script>
<script id="officeListTemplate" type="text/x-jquery-tmpl">
<table id='officestable' width='100%'>
<thead>
<tr>
<th>{{=$ctx.doI18N("table.heading.office.name")}}</th>
<th>{{=$ctx.doI18N("table.heading.office.externalid")}}</th>
<th>{{=$ctx.doI18N("table.heading.office.openedon")}}</th>
<th>{{=$ctx.doI18N("table.heading.office.parent")}}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{{#each offices}}
<tr>
<td>{{=name}}</td>
<td>{{=externalId}}</td>
<td>{{=$ctx.globalDate(openingDate)}}</td>
<td>{{=parentName}}</td>
<td>
<a id='edit{{=id}}' class='edit' href='#' style='margin-right: 5px;'>{{=$ctx.doI18N("link.action.product.viewedit")}}</a>
<a id='delete{{=id}}' class='delete' href='#' style='margin-right: 5px;'>{{=$ctx.doI18N("link.action.product.delete")}}</a>
</td>
</tr>
{{/each}}
</tbody>
</table>
</script>
<script id="officeFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
</div>
<fieldset>
<legend>{{=$ctx.doI18N("form.legend.office.details")}}</legend>
<label for="name">{{=$ctx.doI18N("form.label.office.name")}}</label>
<input id="name" name="name" title="" type="text" value="{{=name}}" size="75"/>
{{#if allowedParents.length > 0}}
<label for="parentId">{{=$ctx.doI18N("form.label.office.parent")}}</label>
<select id="parentId" name="parentId" title="">
<option value="-1">{{=$ctx.doI18N("option.office.first.choice")}}</option>
{{#each allowedParents}}
{{#if $ctx.number($parent.parent.data.parentId)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=name}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=name}}</option>
{{/if}}
{{/each}}
</select>
{{#else}}
<input type="hidden" id="rootOffice" name="rootOffice" value="true" />
{{/if}}
<input type="hidden" id="dateFormat" name="dateFormat" value="dd MMMM yyyy" />
<label for="openingDate">{{=$ctx.doI18N("form.label.office.openedon")}}</label>
<input id="openingDate" name="openingDate" title="" type="text" value="{{=$ctx.globalDate(openingDate)}}" size="75" class="datepickerfield" />
<label for="externalId">{{=$ctx.doI18N("form.label.office.externalid")}}</label>
<input id="externalId" name="externalId" title="" type="text" value="{{=externalId}}" size="75"/>
</fieldset>
</form>
</script>
<script id="configurationFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<fieldset>
<legend>{{=$ctx.doI18N("form.legend.loan.product.currency")}}</legend>
<div class="multiselectwidget" style="width:400px;height:125px;">
<label for="notSelectedCurrencies">{{=$ctx.doI18N("form.label.configuration.available.currencies")}}</label>
<select id="notSelectedCurrencies" name="notSelectedCurrencies" title="" class="multiselectwidget" multiple="multiple" style="width:400px;height:125px;">
{{#each currencyOptions}}
{{#if $ctx.number($parent.parent.data.code)===code}}
<option value="{{=code}}" selected="selected">{{=displayLabel}}</option>
{{#else}}
<option value="{{=code}}">{{=displayLabel}}</option>
{{/if}}
{{/each}}
</select>
<a href="unknown.html" id="addcurrencies" class="multiselectwidget">{{=$ctx.doI18N("widget.multiselect.button.add")}} &gt;&gt;</a>
</div>
<div class="multiselectwidget">
<label for="currencies">{{=$ctx.doI18N("form.label.configuration.allowed.currencies")}}</label>
<select id="currencies" name="currencies" title="" class="multiselectwidget" multiple="multiple" style="width:400px;height:125px;">
{{#each selectedCurrencyOptions}}
{{#if $ctx.number($parent.parent.data.code)===code}}
<option value="{{=code}}" selected="selected">{{=displayLabel}}</option>
{{#else}}
<option value="{{=code}}">{{=displayLabel}}</option>
{{/if}}
{{/each}}
</select>
<a href="unknown.html" id="removecurrencies" class="multiselectwidget">&lt;&lt; {{=$ctx.doI18N("widget.multiselect.button.remove")}}</a>
</div>
</fieldset>
</form>
</script>
<script id="changePasswordFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<label for="password">{{=$ctx.doI18N("form.label.new.password")}}</label>
<input id="password" name="password" title="" type="password" value="{{=password}}" size="75"/>
<label for="repeatPassword">{{=$ctx.doI18N("form.label.repeat.new.password")}}</label>
<input id="repeatPassword" name="repeatPassword" title="" type="password" value="{{=passwordrepeat}}" size="75"/>
</form>
</script>
<script id="userSettingsFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<label for="username">{{=$ctx.doI18N("form.label.username")}}</label>
<input id="username" name="username" title="" type="text" value="{{=username}}" size="75"/>
<label for="firstname">{{=$ctx.doI18N("form.label.firstname")}}</label>
<input id="firstname" name="firstname" title="The first name of user." type="text" value="{{=firstname}}" size="75"/>
<label for="lastname">{{=$ctx.doI18N("form.label.lastname")}}</label>
<input id="lastname" name="lastname" title="The last name of user." type="text" value="{{=lastname}}" size="75"/>
<label for="email">{{=$ctx.doI18N("form.label.email")}}</label>
<input id="email" name="email" title="" type="text" value="{{=email}}" size="75"/>
</form>
</script>
<script id="userSettingsTemplate" type="text/x-jquery-tmpl">
<h2>{{=$ctx.doI18N("form.label.heading.office")}}</h2>
<div class="row">
<span class="rowlabel">{{=$ctx.doI18N("form.label.office")}}</span>
<span class="rowvalue">{{=officeName}}</span>
</div>
<br/>
<h2>{{=$ctx.doI18N("form.label.heading.details")}}</h2>
<div class="row">
<span class="rowlabel">{{=$ctx.doI18N("form.label.name")}}</span>
<span class="rowvalue">{{=firstname}}&nbsp;{{=lastname}}</span>
</div>
<div class="row">
<span class="rowlabel">{{=$ctx.doI18N("form.label.username")}}</span>
<span class="rowvalue">{{=username}}</span>
</div>
<div class="row">
<span class="rowlabel">{{=$ctx.doI18N("form.label.email")}}</span>
<span class="rowvalue">{{=email}}</span>
</div>
<div class="row">
<span class="rowlabel">&nbsp;</span>
<span class="rowvalue"><a href="#" id="changedetails">{{=$ctx.doI18N("form.link.changedetails")}}</a></span>
</div>
<br/>
<h2>{{=$ctx.doI18N("form.label.heading.security")}}</h2>
<div class="row">
<span class="rowlabel">{{=$ctx.doI18N("form.label.password")}}</span>
<span class="rowvalue"><a href="#" id="changepassword">{{=$ctx.doI18N("form.link.changepassword")}}</a></span>
</div>
<br/>
<h2>{{=$ctx.doI18N("form.label.heading.roles")}}</h2>
{{#each selectedRoles}}
<div class="row">
<span class="rowlabel">&nbsp;</span>
<span class="rowvalue"><b>{{=name}}</b> - <i>{{=description}}</i></span>
</div>
{{/each}}
</script>
<script id="permissionListTemplate" type="text/x-jquery-tmpl">
<table id='entitytable' width='100%'>
<thead>
<tr>
<th>{{=$ctx.doI18N("table.heading.permission.type")}}</th>
<th>{{=$ctx.doI18N("table.heading.permission.permission")}}</th>
<th>{{=$ctx.doI18N("table.heading.permission.description")}}</th>
</tr>
</thead>
<tbody>
{{#each permissions}}
<tr>
<td>
{{#if $ctx.number(groupType)===$ctx.number(0)}}
Unknown
{{/if}}
{{#if $ctx.number(groupType)===$ctx.number(1)}}
User Administration
{{/if}}
{{#if $ctx.number(groupType)===$ctx.number(2)}}
Organisation Administration
{{/if}}
{{#if $ctx.number(groupType)===$ctx.number(3)}}
Portfolio Management
{{/if}}
{{#if $ctx.number(groupType)===$ctx.number(4)}}
Reporting
{{/if}}
{{#if $ctx.number(groupType)===$ctx.number(5)}}
Migration
{{/if}}
</td>
<td>{{=name}}</td>
<td>{{=description}}</td>
</tr>
{{/each}}
</tbody>
</table>
</script>
<script id="roleListTemplate" type="text/x-jquery-tmpl">
<table id='entitytable' width='100%'>
<thead>
<tr>
<th>{{=$ctx.doI18N("table.heading.rolename")}}</th>
<th>{{=$ctx.doI18N("table.heading.description")}}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{{#each roles}}
<tr>
<td>{{=name}}</td>
<td>{{=description}}</td>
<td>
<a id='edit{{=id}}' class='edit' href='#' style='margin-right: 5px;'>{{=$ctx.doI18N("link.action.product.viewedit")}}</a>
<a id='delete{{=id}}' class='delete' href='#' style='margin-right: 5px;'>{{=$ctx.doI18N("link.action.product.delete")}}</a>
</td>
</tr>
{{/each}}
</tbody>
</table>
</script>
<script id="usersListTemplate" type="text/x-jquery-tmpl">
<table id='entitytable' width='100%'>
<thead>
<tr>
<th>{{=$ctx.doI18N("table.heading.officename")}}</th>
<th>{{=$ctx.doI18N("table.heading.username")}}</th>
<th>{{=$ctx.doI18N("table.heading.name")}}</th>
<th>{{=$ctx.doI18N("table.heading.email")}}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{{#each users}}
<tr>
<td>{{=officeName}}</td>
<td>{{=username}}</td>
<td>{{=lastname}}, {{=firstname}}</td>
<td>{{=email}}</td>
<td>
<a id='edit{{=id}}' class='edit' href='#' style='margin-right: 5px;'>{{=$ctx.doI18N("link.action.product.viewedit")}}</a>
<a id='delete{{=id}}' class='delete' href='#' style='margin-right: 5px;'>{{=$ctx.doI18N("link.action.product.delete")}}</a>
</td>
</tr>
{{/each}}
</tbody>
</table>
</script>
<script id="userFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<fieldset>
<legend>{{=$ctx.doI18N("form.legend.user.details")}}</legend>
<label for="username">{{=$ctx.doI18N("form.label.user.username")}}</label>
<input id="username" name="username" title="" type="text" value="{{=username}}" size="75"/>
<label for="firstname">{{=$ctx.doI18N("form.label.user.firstname")}}</label>
<input id="firstname" name="firstname" title="" type="text" value="{{=firstname}}" size="75"/>
<label for="lastname">{{=$ctx.doI18N("form.label.user.lastname")}}</label>
<input id="lastname" name="lastname" title="" type="text" value="{{=lastname}}" size="75"/>
<label for="email">{{=$ctx.doI18N("form.label.user.email")}}</label>
<input id="email" name="email" title="" type="text" value="{{=email}}" size="75"/>
<label for="officeId">{{=$ctx.doI18N("form.label.user.office")}}</label>
<select id="officeId" name="officeId" title="">
<option value="-1">{{=$ctx.doI18N("option.office.first.choice")}}</option>
{{#each allowedOffices}}
{{#if $ctx.number($parent.parent.data.officeId)===$ctx.number(id)}}
<option value="{{=$ctx.number(id)}}" selected="selected">{{=name}}</option>
{{#else}}
<option value="{{=$ctx.number(id)}}">{{=name}}</option>
{{/if}}
{{/each}}
</select>
<br/>
<div class="multiselectwidget">
<label for="notSelectedRoles">{{=$ctx.doI18N("form.label.user.available.roles")}}</label>
<select id="notSelectedRoles" name="notSelectedRoles" title="Available application roles." class="multiselectwidget multiNotSelectedItems" multiple="multiple" style="width:450px;height:125px;">
{{#each availableRoles}}
<option value="{{=id}}">{{=name}}</option>
{{/each}}
</select>
<a href="#" id="addroles" class="multiselectwidget multiadd">{{=$ctx.doI18N("widget.multiselect.button.add")}} &gt;&gt;</a>
</div>
<div class="multiselectwidget">
<label for="roles">{{=$ctx.doI18N("form.label.user.selected.roles")}}</label>
<select id="roles" name="roles" title="User selected roles." class="multiselectwidget multiSelectedItems" multiple="multiple" style="width:450px;height:125px;">
{{#each selectedRoles}}
<option value="{{=id}}" selected="selected">{{=name}}</option>
{{/each}}
</select>
<a href="#" id="removeroles" class="multiselectwidget multiremove">&lt;&lt; {{=$ctx.doI18N("widget.multiselect.button.remove")}}</a>
</div>
</fieldset>
</form>
</script>
<script id="roleFormTemplate" type="text/x-jquery-tmpl">
<form id="entityform">
<div id="formerrors"></div>
<fieldset>
<legend>{{=$ctx.doI18N("form.legend.role.details")}}</legend>
<label for="name">{{=$ctx.doI18N("form.label.role.name")}}</label>
<input id="name" name="name" title="" type="text" value="{{=name}}" size="75"/>
<label for="description">{{=$ctx.doI18N("form.label.role.description")}}</label>
<textarea cols="73" rows="3" id="description" name="description" title="">{{=description}}</textarea>
<br/>
<div class="multiselectwidget">
<label for="notSelectedPermissions">{{=$ctx.doI18N("form.label.role.available.permissions")}}</label>
<select id="notSelectedPermissions" name="notSelectedPermissions" title="" class="multiselectwidget multiNotSelectedItems" multiple="multiple" style="width:450px;height:125px;">
{{#each availablePermissions}}
<option value="{{=id}}" title="{{=description}}">{{=name}}</option>
{{/each}}
</select>
<a href="#" id="addpermissions" class="multiselectwidget multiadd">{{=$ctx.doI18N("widget.multiselect.button.add")}} &gt;&gt;</a>
</div>
<div class="multiselectwidget">
<label for="permissions">{{=$ctx.doI18N("form.label.role.selected.permissions")}}</label>
<select id="permissions" name="permissions" title="" class="multiselectwidget multiSelectedItems" multiple="multiple" style="width:450px;height:125px;">
{{#each selectedPermissions}}
<option value="{{=id}}" title="{{=description}}">{{=name}}</option>
{{/each}}
</select>
<a href="#" id="removepermissions" class="multiselectwidget multiremove">&lt;&lt; {{=$ctx.doI18N("widget.multiselect.button.remove")}}</a>
</div>
</fieldset>
</form>
</script>
<!-- end of admin templates -->
</body>
</html>