<style type="text/css">
	#viewPortfolio {
		font-size: 9pt;
	}
	#viewPortfolio th p {
		font-size: 7pt;
	}
</style>
<div id="viewPortfolio">
	<div class="breadcrumbRight">&nbsp;</div>
	<div id="breadcrumb" msgid="titleBonds">Bonds</div>
	<div id="masterContent">
		<div id="pageTitle" class="content" msgid="titleBonds">Bonds</div>
		
<!-- 		<div id="date" class="content"> -->
<!-- 			<div class="dateContent"> -->
<!-- 				<span msgid="publicDate">As of Date:</span> -->
<!-- 				<select id="bondsSelectId" class="AsOfDate"> -->
<!-- 				{{each(i,selectDate) app.user.asOfDate}} -->
<!-- 			  		<option>${selectDate}</option> -->
<!-- 				{{/each}} -->
<!-- 				</select> -->
<!-- 			</div> -->
<!-- 			<div class="dateLine"></div> -->
<!-- 		</div> -->
		<div id="date" class="content">
			<table>
				<tr>
					<td class="setDateTd">
						<span class="asOfDate" msgid="publicDate">As of Date</span> 
						<select
							id="bondsSelectId" 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 class="content">
				{{each(i, portfolioNumber) getKeyArray(data.result.assetPosition)}}
					<table id="positionDTable" class="positionDT" >
						<tr>
							<td colspan="10" class="netAssetValueTd">
								<span msgid="publicAccountNumber">Account Number:</span> ${app.selectBpKey}<span style="margin-left: 20px;"></span>
								<span msgid="publicPortfolioNumber">Portfolio Number:</span> ${portfolioNumber}<span style="margin-left: 20px;"></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 colspan="2" style="text-align:left;" class="indent6">
		            			<span msgid="pDetailDescription">Description</span>
		            		</th>
		                	<th>
		                		<span msgid="pDetailNominalAmt">Nominal Amt</span>
		                	</th>
		                	<th>
		                		<span msgid="pDetailMaturity">Maturity</span>
		                		<p msgid="pDetailDDMMYYYY">DD.MM.YYYY</p>
		                	</th>
		                	<th>
		                		<span msgid="pDetailPurchasePricePercent">Purchase Price %</span>
		                	</th>
		                	<th>
		                		<span msgid="pDetailMarketPricePercent">Market Price %</span>
		                		<p msgid="pDetailDDMMYYYY">DD.MM.YYYY</p>
		                	</th>
		                	<th>
		                		<span msgid="pDetailValue">Value</span>
		                		<p msgid="pDetailAccrInteres">Accr interest</p>
		                	</th>
		                	<th>
			                	<span msgid="pDetailValue">Value</span> (${data.result.portfolio[portfolioNumber].refCcy})
			                	<p msgid="pDetailAccrInteres">Accr interest</p>
		                	</th>
		                	<th>
		                		<span msgid="pDetailAlloc">Alloc. %</span>
		                	</th>
		                	<th>
		                		<span msgid="pDetailUnrealPL">Unreal. P/L</span>
		                		<p msgid="pDetailOrginalCurrency">(Original Currency)</p>
		                	</th>
		         		</tr>
		         	{{each(x, class1Types) getKeyArray(data.result.assetPosition[portfolioNumber])}}
	         			<tr class="category_t1_l1"><td colspan="10" class="class1Category">${class1Types}</td></tr>	
			         	{{each(j, types) getKeyArray(data.result.assetPosition[portfolioNumber][class1Types])}}
			         		<tr class="category_t1_l2"><td colspan="10" 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}}
			         			<td><div style="width:34px;word-wrap: break-word;overflow:hidden;">${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].ccy}</div></td>
			         			<td>
				         			<div style="width:214px;word-wrap: break-word;overflow:hidden;">
				         				<p align="left">${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].description1}</p>
				         				<p align="left" class="smallWord">${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].description2}</p>
			         				</div>
			         			</td>		
			         			<td>
			         				${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].nominalAmt, true)}
			         			</td>
			         			<td>
			         				${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].maturityDate}
			         			</td>
			         			<td>
			         				${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].purchasePrice)}
			         			</td>
			         			<td>
			         				<p align="right">${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].marketPrice)}</p>
			         				<p align="right" class="smallWord">${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].marketPriceDate}</p>
			         			</td>
			         			<td>
			         				<p align="right">${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].value)}</p>
			         				{{if formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].valueAccrInt) == 0 }}
			         					<p></p>
			         				{{else}}
			         					<p align="right" class="smallWord">${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].valueAccrInt)}</p>
			         				{{/if}}
			         			</td>
			         			<td>
			         				<p align="right">${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].refValue)}</p>
			         				{{if formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].refValueAccrInt) == 0 }}
			         					<p></p>
			         				{{else}}
			         					<p align="right" class="smallWord">${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].refValueAccrInt)}</p>
			         				{{/if}}	
			         			</td>
			         			<td>
			         				${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].allocation)}
			         			</td>
			         			<td nowrap>
			         				${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].unrealPL)}
			         			</td>
			         		</tr>
			         		{{/each}}
			         	{{/each}}
			         {{/each}}
		         		<tr class="total">
		         			<td msgid="pDetailTotal" style="font-weight:bold">Total</td>
		         			<td colspan="6"></td>
		         			<td>
		         				<p align="right"><b>${formatMoney(data.result.portfolio[portfolioNumber].refValueTotal)}</b></p>
	         					<p align="right" class="smallWord">${formatMoney(data.result.portfolio[portfolioNumber].refValueAccrIntTotal)}</p>
		         			</td>
		         			<td><b>${formatMoney(data.result.portfolio[portfolioNumber].totalPercentage)}</b></td>
		         			<td>
		         			</td>
		         		</tr>
		         </table> 
		         <p>&nbsp;</p>
		         {{/each}}
		         {{if getKeyArray(data.result.assetPosition).length == 0}}
		         	<div>There is no record for the selected date</div>
		         {{else}}
			         <!-- Notes -->
					 <div id="notes" class="notes_bonds"></div>
				 {{/if}}
			</div>
			
		</div>
		
	{{/if}}
		<div class="footer">
			<img src="images/layout/bkg-content-base-right.gif?version=|||xxx|||">
		</div>
	</div>
</div>