<div id="viewPortfolio">

	<div class="breadcrumbRight">&nbsp;</div>
	<div id="breadcrumb" msgid="titleOthers">Others</div>
	
	<div id="masterContent">
		<div id="pageTitle" class="content" msgid="titleOthers">Others</div>
		<div id="date" class="content">
			<table>
				<tr>
					<td class="setDateTd">
						<span class="asOfDate" msgid="publicDate">As of Date</span> 
						<select
							id="othersSelectId" 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="7" 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 colspan="2" style="text-align:left;" class="indent6">
	            			<span msgid="pDetailDescription">Description</span>
	            		</th>
	                	<th>
	                		<span msgid="pDetailOthersType">Type</span>
	                	</th>
	                	<th>
	                		<span msgid="pDetailQuantity">Quantity</span>
	                	</th>
	<!--                 	<th>Purchase Price%</th> -->
	                	<th>
	                		<span msgid="pDetailValue">Value</span>
	                	</th>
	                	<th>
	                		<span msgid="pDetailValue">Value</span> (${data.result.portfolio[portfolioNumber].refCcy})
	                	</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])}}		         		         		
		         		{{each(k, typesData) getKeyArray(data.result.assetPosition[portfolioNumber][class1Types][types])}}
		         		{{if k==0}} <tr class="category_t1_l2"><td colspan="10" style="text-align:left;">${types} 
		         		<span class="superScript">${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].superScript}</span></td></tr>{{/if}}
		         			{{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:270px;word-wrap: break-word;overflow:hidden;">
			         				<p align="left">${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].description1}</p>
			         				<p align="left">${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].description2}</p>
			         			</div>
		         			</td>		
		         			<td>
		         				${data.result.assetPosition[portfolioNumber][class1Types][types][typesData].type}
		         			</td>
		         			<td nowrap>
		         				${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].nominalAmt)}
		         			</td>
		         			<td nowrap>
		         				${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].value)}
		         			</td>
		         			<td nowrap>
		         				${formatMoney(data.result.assetPosition[portfolioNumber][class1Types][types][typesData].refValue)}
		         			</td>
		         		</tr>
		         		{{/each}}		         		  
		         	{{/each}}
		         {{/each}}
	         		<tr class="total">
	         			<td msgid="pDetailTotal" style="font-weight:bold">Total</td>
	         			<td colspan="4"></td>
	         			<td style="text-align:right" nowrap>
	         				<p align="right"><b>${formatMoney(data.result.portfolio[portfolioNumber].refValueTotal)}</b></p>
	         			</td>
	         		</tr>
	         </table> 
	         {{/each}}
	         
	         
	         {{if getKeyArray(data.result.assetPosition).length == 0}}
	         	<div>There is no record for the selected date</div>
	         {{else}}
	         	<p>&nbsp;</p>
	         	<!-- Notes -->
	         	<div id="notes"></div>
	         {{/if}}
		</div>
		</div>
	{{/if}}
		<div class="footer">
			<img src="images/layout/bkg-content-base-right.gif?version=|||xxx|||">
		</div>
	</div>
</div>