<div id="viewPortfolio">

	<div class="breadcrumbRight">&nbsp;</div>
	<div id="breadcrumb" msgid="titleDeposit">Deposit & Loan</div>
	
	<div id="masterContent">
		<div id="pageTitle" class="content" msgid="titleDeposit">Deposit & Loan</div>
		<div id="date" class="content">
			<table>
				<tr>
					<td class="setDateTd">
						<span class="asOfDate" msgid="publicDate">As of Date</span> 
						<select
							id="depositSelectId" class="AsOfDate dropDownStyle">
							{{each(i,selectDate) app.user.asOfDate}}
						  		<option>${selectDate}</option>
							{{/each}}
						</select>
					</td>
					<td class="tdDateLine">
						<div class="dateLine"></div>
					</td>
				</tr>
			</table>
		</div>
	
	{{if (meta.errorType) != null}}
		<div class="content">The request fail, ErrorMessage:${meta.errorMessage}</div>
	{{else}}
		<div>
			<div id="forexSelectId" class="content">
			{{each(i, portfolioNumber) getKeyArray(data.result.assetPosition)}}
			<table id="positionDTable" class="positionDT" style="width:100%;" >
				<tr>
					<td colspan="8" class="netAssetValueTd" ><span msgid="publicAccountNumber">Account Number:</span> ${app.selectBpKey}<span style="margin-left: 50px;"></span>
						<span msgid="publicPortfolioNumber">Portfolio Number:</span> ${portfolioNumber}<span style="margin-left: 50px;"></span>
						<span msgid="publicNetAssetValues">Net Asset Value:</span> <span id="netAsset${i}"></span>
						<br/>
						<span msgid="publicPortfolioName">Portfolio Name:</span> ${data.result.portfolio[portfolioNumber].portfolioName}
					</td>
				<tr>
				<tr>
					
	           		<th  style="text-align:left;" class="indent6">
	           			<div style="width:34px;word-wrap: break-word;overflow:hidden;">
	           				<span msgid="pDetailCCY">CCY</span>
	           			</div>
	           		</th>
 	           		<th nowrap style="text-align:left;">
 	           			<div style="width:144px;word-wrap: break-word;overflow:hidden;text-align:left;padding-left:28px;">
 	           				<span style="text-align:left;" msgid="pDetailDescription">Description</span> 	           				
 	           			</div>
 	           		</th>
	               	<th>
	               		<span msgid="pDetailPrincipal">Principal</span>
	               	</th>
	               	<th>
		               	<span msgid="pDetailPeriod">Period</span>
		               	<p msgid="pDetailDDMMYYYY" class="smallWord">DD.MM.YYYY</p>
	               	</th>
	               	<th>
	               		<span msgid="pDetailInterestRate">Interest Rate %</span>
	               	</th>
	               	<th>
	               		<span msgid="pDetailInterestAmt">Interest Amt</span>
	               	</th>
	               	<th>
	               		<span msgid="pDetailNoOfDays">No. of Days</span>
	               	</th>
	               	<th>
	               		<span msgid="pDetailValue">Value</span> (${data.result.portfolio[portfolioNumber].refCcy})
	               		<p msgid="pDetailAccrInteres" class="smallWord">Accr interest</p>
	               	</th>
	        	</tr>
	        	{{each(x, class1Types) getKeyArray(data.result.assetPosition[portfolioNumber])}}
	         		<tr class="category_t1_l1"><td colspan="8" class="class1Category">${class1Types}</td></tr>
		         	{{each(j, types) getKeyArray(data.result.assetPosition[portfolioNumber][class1Types])}}
		         		<tr class="category_t1_l2"><td colspan="8" style="text-align:left;">${types}</td></tr>
		         		{{each(k, typesData) getKeyArray(data.result.assetPosition[portfolioNumber][class1Types][types])}}
		         			{{if k%2==1 }}
			         			<tr class="even">
			         		{{else}}
			         			<tr class="odd">
			         		{{/if}}
		         			{{if data.result.assetPosition[portfolioNumber][class1Types][types][typesData].ccy=='Total'}}
		         				<td style="font-weight:bold">${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].ccy}</td>
		         			{{else}}
		         				<td><div style="width:34px;word-wrap: break-word;overflow:hidden;">${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].ccy}</div></td>
		         			{{/if}}
		         			<td style="text-align:left">
			         			<div style="width:144px;word-wrap: break-word;overflow:hidden;text-align:left;padding-left:28px;">
			         				${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].description1}
			         			</div>
		         			</td>		
		         			<td nowrap>
		         				${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].principal)}
		         			</td>
		         			<td>
		         				${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].periodDate}
		         			</td>
		         			<td nowrap>
		         				${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].interestRate)}
		         			</td>
		         			<td nowrap>
		         				${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].interestAmt)}
		         			</td>
		         			<td>
		         				${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].onOfDays}
		         			</td>
		         			<td nowrap>
		         				{{if data.result.assetPosition[portfolioNumber][class1Types][types][typesData].ccy=='Total'}}
		         					<p style="font-weight:bold">${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].refValue)}</p>
		         				{{else}}
		         					<p>${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].refValue)}</p>
		         				{{/if}}
		         				{{if formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].refValueAccrInt) == 0 }}
		         					<p></p>
		         				{{else}}
		         					<p class="smallWord">${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].refValueAccrInt)}</p>
		         				{{/if}}
		         			</td>
		         		</tr>
		         		{{/each}}
		         	{{/each}}
	         	{{/each}}
	         		<!-- <tr class="total">
	         			<td msgid="pDetailTotal" style="font-weight:bold">Total</td>
	         			<td colspan="6"></td>
	         			<td nowrap>
	         				<p><b>${formatMoney(data.result.portfolio[portfolioNumber].refValueTotal)}</b></p>
	         				{{if formatMoney(data.result.portfolio[portfolioNumber].refValueAccrIntTotal) == 0 }}
		         					<p></p>
		         			{{else}}
	         						<p class="smallWord">${formatMoney(data.result.portfolio[portfolioNumber].refValueAccrIntTotal)}</p>
	         				{{/if}}
	         			</td>
	         		</tr>-->
	         </table> 
	         {{/each}}
	         
	         {{if getKeyArray(data.result.assetPosition).length == 0}}
	         	<div>There is no record for the selected date</div>
	         {{/if}}
			</div>
		</div>
	 {{/if}}
		
		<div class="footer">
			<img src="images/layout/bkg-content-base-right.gif?version=|||xxx|||">
		</div>
	</div>
</div>