<md-toolbar layout="row" class="md-toolbar-tools md-whiteframe-4dp small-toolbar" >
	<span flex></span>
   	<h5>Seda Remuneration<span ng-if="ctrl.largeScreen()"> (Rendiconto Previsionale Costo Totale e Dettaglio Mandati SEDA)</span></h5>
    <span flex></span>
    <md-select ng-model="ctrl.codiceSiaSelezionato" placeholder="Filtra codice Sia" ng-change="ctrl.getData()">
    	<md-option value=""></md-option>
    	<md-option ng-repeat="codice in ctrl.codiciSia" ng-value="codice">{{codice}}</md-option>
   	</md-select>
 </md-toolbar>
 
 <div style="height:100%" id="seda">
 	<div style="height:30%">
	 	<md-list>
	 		<md-subheader>
	 			<div flex layout="row">
	 				<div style="width:48px">&nbsp;</div>
					<div flex="15">Data rendicontazione</div> 			
					<div flex="10">Cod. SIA</div>
					<div flex="10">Cod. ABI</div>
					<div flex="15">Denominazione banca</div>
					<div flex="25">Tipo messaggio</div>
					<div flex="20">Identificativo messaggio</div>
					<div>Esportato</div>
	 			</div>
			</md-subheader>
			<div class="virtualRepeatVerticalUsage" id="container" ng-style="ctrl.getListHeight()" >
				<md-virtual-repeat-container id="vertical-container" style="width:100%">
				     <md-list-item class="md-1-line hilight"  md-on-demand md-virtual-repeat="data in ctrl.infiniteItems" md-item-size="25" 
				     	 	ng-click="ctrl.getProvisioning($index, data.idremuneration)"
				     		ng-class="{'odd-row':$index%2==1,'even-row':$index%2==0, 'selectedRow': ctrl.selectedIndex===$index}"
					     	ng-style="ctrl.getGridWithButtonItemHeight()">
						<div flex layout="row" layout-align="start center" ng-style="ctrl.getGridWithButtonItemHeight()">
			 				<div style="width:48px">
			 					<md-button aria-label="comandi" class="md-icon-button" ng-click="ctrl.mostraComandi($index, $event)">
			 						<md-icon md-font-icon="fa-bars" class="fa" aria-label="Opzioni" title="Opzioni"></md-icon>
			 					</md-button>
			 				</div>
			 				<div style="width:0" ng-style="ctrl.getGridWithButtonItemHeight()"></div>
							<div flex="15">{{data.dataRendi.formatAsDateTimeSec()}}</div> 			
							<div flex="10">{{data.codiceSia}}</div>
							<div flex="10">{{data.codiceAbi}}</div>
							<div flex="15">{{data.denominazioneBanca}}</div>
							<div flex="25">{{data.tipoMessaggio}}</div>
							<div flex="20">{{data.idmessaggio}}</div>
							<div style="text-align:center"><i ng-if="data.flagUtil" class="fa fa-check"></i></div>
			 			</div>
					</md-list-item>
				</md-virtual-repeat-container>
			</div>
		</md-list>
	</div>
	<md-content style="height:70%;overflow-x:hidden" id="details">
		<md-toolbar layout="row" class="md-toolbar-tools small-toolbar md-whiteframe-4dp"  >
			Dettagli

		 </md-toolbar>
		<div style="overflow:auto">
	 		<md-subheader>
	 			<div layout="row" id="header-details">
					<div ng-style="ctrl.getColumnWidth(0)">Data Msg. banca</div> 			
					<div ng-style="ctrl.getColumnWidth(1)">Anno</div>
					<div ng-style="ctrl.getColumnWidth(2)">Trimestre</div>
					<div ng-style="ctrl.getColumnWidth(3)">Identificativo creditore</div>
					<div ng-style="ctrl.getColumnWidth(4)">BIC creditore</div>
					<div ng-style="ctrl.getColumnWidth(5)">BIC debitore</div>
					<div ng-style="ctrl.getColumnWidth(6)">N. CMF</div>
					<div ng-style="ctrl.getColumnWidth(7)">Prezzo unitario CMF</div>
					<div ng-style="ctrl.getColumnWidth(8)">Totale CMF</div>
					<div ng-style="ctrl.getColumnWidth(9)">N. DMF</div>
					<div ng-style="ctrl.getColumnWidth(10)">Prezzo unitario DMF</div>
					<div ng-style="ctrl.getColumnWidth(11)">Totale DMF</div>
					<div ng-style="ctrl.getColumnWidth(12)">Totale flat</div>
					<div ng-style="ctrl.getColumnWidth(13)">Costo totale trimestre</div>
					<div ng-style="ctrl.getColumnWidth(14)">Quadratura trimestre</div>
					<div ng-style="ctrl.getColumnWidth(15)">N.CMF+DMF acquisiti</div>
					<div ng-style="ctrl.getColumnWidth(16)">N.CMF+DMF calcolati</div>
					<div ng-style="ctrl.getColumnWidth(17)">Data ultima quadratura</div>
					<div ng-style="ctrl.getColumnWidth(18)">Richiesta dettaglio</div>
					<div ng-style="ctrl.getColumnWidth(19)">Esito</div>
					<div ng-style="ctrl.getColumnWidth(20)">Descrizione esito richiesta mandati</div>
					<div ng-style="ctrl.getColumnWidth(21)">Data richiesta</div>
					<div ng-style="ctrl.getColumnWidth(22)">Tipo dettaglio</div>
					<div ng-style="ctrl.getColumnWidth(23)">Tipo richiesta</div>
					<div ng-style="ctrl.getColumnWidth(24)">Data esito</div>
					<div ng-style="ctrl.getColumnWidth(25)">Identificativo rendiconto previsionale</div>
	 			</div>
			</md-subheader>
			<div class="virtualRepeatVerticalUsage" id="containerDetails" ng-style="ctrl.getDetailListHeight()">
				<md-virtual-repeat-container id="vertical-container-details" style="height:100%" ng-style="ctrl.getMaxListWidth()">
				     <md-list-item class="md-1-line hilight"  md-on-demand md-virtual-repeat="data in ctrl.infiniteDetailItems" md-item-size="25" 
				     	ng-class="{'odd-row':$index%2==1,'even-row':$index%2==0}" ang-style="ctrl.getMaxListWidth()" ng-click="ctrl.mostraComandiDettaglio($index, $event)"
				     	 ng-style="ctrl.getGridItemHeight()"> 
						<div layout="row" layout-align="start center" ang-style="ctrl.getMaxListWidth()" ng-style="ctrl.getGridItemHeight()">
							<div style="width:0" ng-style="ctrl.getGridItemHeight()"></div>
							<div ng-style="ctrl.getColumnWidth(0)">{{data.datarendi.formatAsDate()}}</div> 			
							<div ng-style="ctrl.getColumnWidth(1)">{{data.anno}}</div>
							<div ng-style="ctrl.getColumnWidth(2)">{{data.trimestre}}</div>
							<div ng-style="ctrl.getColumnWidth(3)">{{data.creditorId}}</div>
							<div ng-style="ctrl.getColumnWidth(4)">{{data.bicCreditore}}</div>
							<div ng-style="ctrl.getColumnWidth(5)">{{data.bicDebitore}}</div>
							<div ng-style="ctrl.getColumnWidth(6)" style="text-align:right">{{data.numeroCmf}}</div>
							<div ng-style="ctrl.getColumnWidth(7)" style="text-align:right">{{data.prezzoUnitarioCmf.toFormattedValue()}}</div>
							<div ng-style="ctrl.getColumnWidth(8)" style="text-align:right">{{data.totaleCmfUnitOrFlat.toFormattedValue()}}</div>
							<div ng-style="ctrl.getColumnWidth(9)" style="text-align:right">{{data.numeroDmf}}</div>
							<div ng-style="ctrl.getColumnWidth(10)" style="text-align:right">{{data.prezzoUnitarioDmf.toFormattedValue()}}</div>
							<div ng-style="ctrl.getColumnWidth(11)" style="text-align:right"> {{data.totaleDmfUnitOrFlat.toFormattedValue()}}</div>
							<div ng-style="ctrl.getColumnWidth(12)" style="text-align:right">{{data.prezzoFlatTotale}}</div>
							<div ng-style="ctrl.getColumnWidth(13)" style="text-align:right">{{data.importoTotaleRemuneration.toFormattedValue()}}</div>
							<div ng-style="ctrl.getColumnWidth(14)">
								<i class="fa fa-circle" ng-style="ctrl.getStatusColor(data.totaleCmfDmfQuadratura)"></i>
							</div>
							<div ng-style="ctrl.getColumnWidth(15)" style="text-align:right">{{data.totaleCmfDmf.format(0,'.',',')}}</div>
							<div ng-style="ctrl.getColumnWidth(16)" style="text-align:right">{{data.totaleCmfDmfCarico}}</div>
							<div ng-style="ctrl.getColumnWidth(17)">{{data.dataUltimaQuadratura.formatAsDate()}}</div>
							<div ng-style="ctrl.getColumnWidth(18)" style="text-align:center">
								<i class="fa fa-check" ng-if="data.flagRichiestaDetail"></i>
							</div>
							<div ng-style="ctrl.getColumnWidth(19)">{{data.esitoRichiestaDetail}}</div>
							<div ng-style="ctrl.getColumnWidth(20)">{{data.descrizioneEsitoRichiestaDetail}}</div>
							<div ng-style="ctrl.getColumnWidth(21)">{{data.dataRichiestaDetail.formatAsDate()}}</div>
							<div ng-style="ctrl.getColumnWidth(22)">{{ctrl.decodeTipoDettaglio(data.richiestaMndtTp)}}</div>
							<div ng-style="ctrl.getColumnWidth(23)">{{ctrl.decodeTipoRichiesta(data.richiestaRqstTp)}}</div>
							<div ng-style="ctrl.getColumnWidth(24)">{{data.dataEsitoRichiestaDetail.formatAsDate()}}</div>
							<div ng-style="ctrl.getColumnWidth(25)" style="white-space: nowrap;overflow:hidden;text-overflow:ellipsis;">{{data.previsioningIdentification}}<md-tooltip>{{data.previsioningIdentification}}</md-tooltip></div>
			 			</div>
					</md-list-item>
				</md-virtual-repeat-container>
			</div>			
		</div>
	</md-content>
</div>

