<div id="viewPortfolio">
<!-- 	<div id="bannerContentNI"> -->
<!-- 	    <div class="header"> -->
<!-- 	        <div class="headerLeft"></div> -->
<!-- 	    </div>   -->
<!-- 	</div> -->

	<div class="breadcrumbRight">&nbsp;</div>
	<div id="breadcrumb" msgid="titleSecuritiesMovement">Securities Movement</div>


	<div id="masterContent">
		<div id="pageTitle" class="content" msgid="titleSecuritiesMovement">Securities Movement</div>
		
		<div id="date" class="content">
			<table>
				<tr>
					<td class="setDateTd">
						<span class="asOfDate" msgid="publicDate">As of Date:</span> 
						<select
							id="securitiesMovementSelectId" 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 class="securitiesMovement">
				{{each(i,portfolioNumber) getKeyArray(data.result.securitiesMovement) }}
				{{if i%2==0}}
				<div class="content">
				{{/if}}
				{{if i%2!=0}}
				<div class="content" style="background: #156236">
				{{/if}}
					<div class="pDetail" >
						<span><b msgid="publicAccountNumber">Account Number:</b> <b>${app.selectBpKey}</b></span><span style="margin-left: 50px;"></span>
						<span><b msgid="publicPortfolioNumber">Portfolio Number:</b> <b>${portfolioNumber}</b></span><span style="margin-left: 50px;"></span>
						<span><b msgid="publicNetAssetValues">Net Asset Value:</b> <b id="netAsset${i}"></b></span>
						<br/>
						<span><b msgid="publicPortfolioName">Portfolsfsfsdio Name Portfolsfsfsdio Name Portfolsfsfsdio Name Portfolsfsfsdio Name:</b> <b>${data.result.portfolio[portfolioNumber].portfolioName}</b></span>
					</div>
					{{each(txType,obj) data.result.securitiesMovement[portfolioNumber] }}
					<div class="otherDetail">
					{{if txType =='Completed Transactions' }}<font style="font-weight:bold"><span msgid="pDetailPeriod">Period:</span> ${data.result.totalDto[portfolioNumber + "_" + txType].period}{{else}}<div class="spaceBetweenTxTable">&nbsp;</div><font style="font-weight:bold"><span msgid="pFromValueDate">From value date:</span> ${data.result.totalDto[portfolioNumber + "_" + txType].fromValueDate}{{/if}}<br/>${txType}</font>
					
					</div>
					<table id="positionDTable" class="positionDT">
							<thead>
								<tr>
									<th colspan="4" style="text-align:left; text-indent: 7px;">
										<span msgid="securitiesMovementDesc">Description / Unit Price</span>
									</th>
									<th>
										<span msgid="pDetailSysDate">System Date</span>
									</th>
									<th>
										<span msgid="pDetailValueDate">Value Date</span>
									</th>
									<th>
										<span msgid="securitiesMovementOrder">Order</span>
									</th>
									<th>
										<span msgid="securitiesMovementAmt">Quantity / Nominal Amt</span>
									</th>
									<th>
										<span msgid="securitiesMovementAvg">Avg. Cost Price / Transaction Price</span>
									</th>
									<th style="width:100px; ">
										<span msgid="pDetailValue">Value</span>
									</th>
									<th>
										<span msgid="pDetailValue">Value</span> (${data.result.portfolio[portfolioNumber].refCcy})
									</th>
								</tr>
							</thead>
							<tbody>
			         	 {{each(j,m) getKeyArray(data.result.securitiesMovement[portfolioNumber][txType]) }}
			         		<tr class="category_t1_l1"><td colspan="11" style="text-align:left;">${m}</td></tr>
			         		 {{each(y,n) getKeyArray(data.result.securitiesMovement[portfolioNumber][txType][m]) }}
			         		<tr class="category_t1_l2"><td colspan="11" style="text-align:left;">{{if m!="Funds"}}${n}{{else}}&nbsp;{{/if}}</td></tr>
			         			{{each(z,p) getKeyArray(data.result.securitiesMovement[portfolioNumber][txType][m][n])}}
			         		<tr class="odd">
			         			<td><div style="width:34px;word-wrap: break-word;overflow:hidden;">${data.result.securitiesMovement[portfolioNumber][txType][m][n][p].ccy}</div></td>
			         			<td colspan="3" style="text-align:left;">
				         			<div style="width:170px;word-wrap: break-word;overflow:hidden;">
				         				${data.result.securitiesMovement[portfolioNumber][txType][m][n][p].description}<br/>
				         				<font class="smallfont">${data.result.securitiesMovement[portfolioNumber][txType][m][n][p].isin}</font>
				         			</div>
			         			</td>
			         			<td>
			         				
			         			</td>
			         			<td>
			         				
			         			</td>
			         			<td>
			         				
			         			</td>
			         			<td>
			         				${data.result.securitiesMovement[portfolioNumber][txType][m][n][p].qty}
			         			</td>
			         			<td>
			         				
			         			</td>
			         			<td>
			         				${data.result.securitiesMovement[portfolioNumber][txType][m][n][p].value}
			         			</td>
			         			<td>
			         				${data.result.securitiesMovement[portfolioNumber][txType][m][n][p].valueInRefCcy}
			         			</td>
			         		</tr>
			         		{{each(orderNr,u) data.result.securitiesMovement[portfolioNumber][txType][m][n][p].movements}}
			         			{{each data.result.securitiesMovement[portfolioNumber][txType][m][n][p].movements[orderNr]}}
					         		<tr style="margin-top: 15px;">
					         			<td style="border: 0px solid;"></td>
					         			<td  colspan="3" style="border: 0px solid;text-align:left;">
					         				<p>&nbsp;</p>
					         				<p>${unitPriceDescription}</p>
					         			</td>		
					         			<td style="border: 0px solid;">
					         				<p>&nbsp;</p>
					         				<p>${sysDate}</p>
					         			</td>
					         			<td style="border: 0px solid;">
					         				<p>&nbsp;</p>
					         				<p>${valueDate}</p>
					         			</td>
					         			<td style="border: 0px solid;">
					         				<p>&nbsp;</p>
					         				<p>${order}</p>
					         			</td>
					         			<td style="border: 0px solid;" nowrap>
					         				<p>&nbsp;</p>
					         				<p>${qty}</p>
					         			</td>
					         			<td style="border: 0px solid;">
					         				{{if displayPercentage==false}}
												<p>${avgCost}</p>
					         					<p>${txCost}</p>
											{{/if}}
											{{if displayPercentage==true}}
												<p>${avgCost}%</p>
					         					<p>${txCost}%</p>
											{{/if}}
					         			</td>
					         			<td style="border: 0px solid;" nowrap>
					         				<p>${bookValue}</p>
					         				<p>${value}</p>			         				
					         			</td>
					         			<td style="border: 0px solid;" nowrap>
					         				<p>&nbsp;</p>
					         				<p>${valueInRef}</p>
					         			</td>
					         		</tr>
			         					{{/each}}
			         				{{/each}}
			         			{{/each}}
			         		{{/each}}
			         	{{/each}}
							</tbody>
			         
						</table> 
						{{/each}}
				{{/each}}
				{{if getKeyArray(data.result.securitiesMovement).length == 0 }}
					<div class="content">
						<P msgid="publicNoSelectDate">There is no record for the selected date</P>			
					</div>
				
				{{else}}
						<!-- Notes -->
						<p>&nbsp;</p>
						<div id="notes"></div>
						</div><!--end class'content' if else-->
				{{/if}}
				</div><!--end class'content' if else-->
				<!-- 
				</div>
				
			</div><!--end tableScrollDiv-->
			
		{{/if}}
		
		<div class="footer">
			<img src="images/layout/bkg-content-base-right.gif?version=|||xxx|||">
		</div>	
</div>