<md-toolbar layout="row" class="md-toolbar-tools md-whiteframe-4dp small-toolbar" >
	<span flex></span>
   	<h5>Ricerca disposizioni</h5>
    <span flex></span>
	    		
</md-toolbar>

<form> 
 <div layout="column" style="width:100%;height:800px">
 	<div layout-gt-sm="row" layout="column" flex>
 		<md-input-container flex>
 		 	<label>Funzione ordinante</label>
 			<md-select ng-model="ctrl.filter.funzioneOrdinante" aria-label="funzione ordinante" flex>
 				<md-option></md-option>
 				<md-option ng-repeat="item in ctrl.funzioniOrdinanti" value="{{item.funzioneOrdinante}}">{{item.funzioneOrdinante}}</md-option>
 			</md-select> 	
		</md-input-container>
		<md-input-container flex>
			<label>N. distinta banca da</label>
			<input ng-model="ctrl.filter.daDistinta" maxlength="9" ng-keypress="ctrl.onlyDigit($event,20)">		
		</md-input-container>	
		<md-input-container flex>
			<label>a</label>
			<input ng-model="ctrl.filter.aDistinta" maxlength="9" ng-keypress="ctrl.onlyDigit($event,20)">		
		</md-input-container>	
	</div>
	<div layout-gt-sm="row" layout="column" flex>
 		<md-input-container flex>
 		 	<label>Tipo disposizione</label>
 			<md-select ng-model="ctrl.filter.tipoDisposizione" ng-change="ctrl.cambiaTipoDisposizione()" aria-label="Tipo disposizione" flex>
 				<md-option ng-value=""></md-option>
 				<md-option ng-repeat="item in ctrl.tipologie" ng-value="item">{{item}}</md-option>
 			</md-select> 	
		</md-input-container>
		<div layout="row" flex>
   			<md-checkbox ng-model="ctrl.filter.flagDaDataInserimento" aria-label="Abilita da data" class="date-flag"></md-checkbox>
			<md-input-container flex>
				<label>Da data inserimento</label>
				<md-datepicker ng-model="ctrl.filter.daDataInserimento" ng-disabled="!ctrl.filter.flagDaDataInserimento"></md-datepicker>
			</md-input-container>
		</div>
		<div layout="row" flex>
   			<md-checkbox ng-model="ctrl.filter.flagADataInserimento" aria-label="Abilita a data " class="date-flag"></md-checkbox>
			<md-input-container flex>
				<label>A data inserimento</label>
				<md-datepicker ng-model="ctrl.filter.aDataInserimento" ng-disabled="!ctrl.filter.flagADataInserimento"></md-datepicker>
			</md-input-container>
		</div>
	</div>
	<div layout-gt-sm="row" layout="column" flex >
 		<md-input-container flex>
 		 	<label>Stato convalida</label>
 			<md-select ng-model="ctrl.filter.statoConvalida" aria-label="Stato convalida" flex>
 				<md-option></md-option>
 				<md-option ng-value="-1">Disposizioni valide</md-option>
 				<md-option ng-value="0">Disposizioni errate</md-option>
 				<md-option ng-value="2">Disposizioni warning</md-option>
 			</md-select> 	
		</md-input-container>
		<md-input-container flex>
 		 	<label>Provenienza</label>
 			<md-select ng-model="ctrl.filter.provenienza" aria-label="Provenienza" flex>
 				<md-option></md-option>
 				<md-option ng-repeat="item in ctrl.provenienza" value="{{item}}">{{item}}</md-option>
 			</md-select> 	
		</md-input-container>
		<md-input-container flex>
 		 	<label>Stato disposizione</label>
 			<md-select ng-model="ctrl.filter.statoDisposizione" aria-label="Stato disposizione" flex>
 				<md-option></md-option>
 				<md-option ng-value="'Inserita'">Inserita</md-option>
 				<md-option ng-value="'Approvata'">Approvata</md-option>
 				<md-option ng-value="'Confermata'">Confermata</md-option>
 				<md-option ng-value="'Predisposta'">Predisposta</md-option>
 				<md-option ng-value="'Validata'">Validata</md-option>
 				<md-option ng-value="'Disposta'">Disposta</md-option>
 				<md-option ng-value="'Inviata'">Inviata</md-option>
 				<md-option ng-value="'Esitata'">Esitata</md-option>
 				<md-option ng-value="'Scartata'">Scartata</md-option>
 				<md-option ng-value="'Archiviata'">Archiviata</md-option>
 				<md-option ng-value="'Cancellata'">Cancellata</md-option>
 				<md-option ng-value="'In Richiamo'">In Richiamo</md-option>
 				<md-option ng-value="'Richiamata'">Richiamata</md-option>
 				<md-option ng-value="'Richiamo Errato'">Richiamo Errato</md-option>
 			</md-select> 	
		</md-input-container>
	</div>
	<div layout-gt-sm="row" layout="column" flex>
		<md-input-container flex>
			<label>Destinatario</label>
			<input ng-model="ctrl.filter.destinatario">		
		</md-input-container>	
		<div layout="row" flex>
   			<md-checkbox ng-model="ctrl.filter.flagDaValutaBeneficiario" aria-label="Abilita da data valuta" ></md-checkbox>
			<md-input-container flex>
				<label>Da data valuta</label>
				<md-datepicker ng-model="ctrl.filter.daValutaBeneficiario" ng-disabled="!ctrl.filter.flagDaValutaBeneficiario"></md-datepicker>
			</md-input-container>
		</div>
		<div layout="row" flex>
   			<md-checkbox ng-model="ctrl.filter.flagAValutaBeneficiario" aria-label="Abilita a data valuta"></md-checkbox>
			<md-input-container flex>
				<label>A data valuta</label>
				<md-datepicker ng-model="ctrl.filter.aValutaBeneficiario" ng-disabled="!ctrl.filter.flagAValutaBeneficiario"></md-datepicker>
			</md-input-container>
		</div>
	</div>
	<div layout-gt-sm="row" layout="column" flex>
		<md-input-container flex>
			<label>Codice fiscale</label>
			<input ng-model="ctrl.filter.codiceFiscale">		
		</md-input-container>	
		<md-input-container flex>
			<label>Codice destinatario</label>
			<input ng-model="ctrl.filter.codiceDestinatario">		
		</md-input-container>
		<md-input-container flex>
			<label>Da importo</label>
			<input ng-model="ctrl.filter.daImporto" ng-keypress="ctrl.checkDigit($event,20)" ng-blur="ctrl.checkImporto($event)"> <!-- ng-keypress="ctrl.checkDigit($event,20)" ng-blur="ctrl.checkImporto($event)" --> 		
		</md-input-container>
		<md-input-container flex>
			<label>A importo</label>
			<input ng-model="ctrl.filter.aImporto" ng-keypress="ctrl.checkDigit($event,20)" ng-blur="ctrl.checkImporto($event)"><!-- ng-keypress="ctrl.checkDigit($event,20)" ng-blur="ctrl.checkImporto($event)" --> 		
		</md-input-container>
	</div>	
	<div layout-gt-sm="row" layout="column" flex>
		<md-input-container flex>
			<label>Codice movimento</label>
			<input ng-model="ctrl.filter.causaleMovimento">		
		</md-input-container>	
		<md-input-container flex>
			<label>Identificativo End-to-End</label>
			<input ng-model="ctrl.filter.idEndToEnd">		
		</md-input-container>
	</div>	
	<div layout-gt-sm="row" layout="column" flex>
		<md-input-container flex>
			<label>Id funzione</label>
			<input ng-model="ctrl.filter.idFunzione">		
		</md-input-container>	
		<md-input-container flex>
			<label>Id univoco</label>
			<input ng-model="ctrl.filter.idUnivoco" maxlength="9" ng-keypress="ctrl.checkDigit($event,20)">		
		</md-input-container>
		<md-input-container flex>
			<label>Numero polizza</label>
			<input ng-model="ctrl.filter.numeroPolizza">		
		</md-input-container>
	</div>	
	<div layout-gt-sm="row" layout="column" flex>
		<md-input-container flex>	
			<label>Abi ordinante</label>
			<input ng-model="ctrl.filter.abiOrdinante">		
		</md-input-container>	
		<md-input-container flex>
			<label>Cab ordinante</label>
			<input ng-model="ctrl.filter.cabOrdinante">		
		</md-input-container>
		<md-input-container flex>
			<label>Conto ordinante</label>
			<input ng-model="ctrl.filter.contoOrdinante">		
		</md-input-container>
		<md-input-container flex>	
			<label>Abi destinatario</label>
			<input ng-model="ctrl.filter.abiDestinatario">		
		</md-input-container>	
		<md-input-container flex>
			<label>Cab destinatario</label>
			<input ng-model="ctrl.filter.cabDestinatario">		
		</md-input-container>
		<md-input-container flex>
			<label>Conto destinatario</label>
			<input ng-model="ctrl.filter.contoDestinatario">		
		</md-input-container>
	</div>	
	<div layout-gt-sm="row" layout="column" flex>
		<div layout="row" flex>
   			<md-checkbox ng-model="ctrl.filter.flagDaDataRicezioneEsito" aria-label="Abilita da data ricezione esito" ></md-checkbox>
			<md-input-container flex>
				<label>Da data ricezione esito</label>
				<md-datepicker ng-model="ctrl.filter.daDataRicezioneEsito" ng-disabled="!ctrl.filter.flagDaDataRicezioneEsito"></md-datepicker>
			</md-input-container>
		</div>
		<div layout="row" flex>
   			<md-checkbox ng-model="ctrl.filter.flagADataRicezioneEsito" aria-label="Abilita a data ricezione esito"></md-checkbox>
			<md-input-container flex>
				<label>A data ricezione esito</label>
				<md-datepicker ng-model="ctrl.filter.aDataRicezioneEsito" ng-disabled="!ctrl.filter.flagADataRicezioneEsito"></md-datepicker>
			</md-input-container>
		</div>
		<div layout="row" flex>
   			<md-checkbox ng-model="ctrl.filter.flagDaDataEsecuzioneBanca" aria-label="Abilita da data esecuzione banca" ></md-checkbox>
			<md-input-container flex>
				<label>Da data esecuzione banca</label>
				<md-datepicker ng-model="ctrl.filter.daDataEsecuzioneBanca" ng-disabled="!ctrl.filter.flagDaDataEsecuzioneBanca"></md-datepicker>
			</md-input-container>
		</div>
		<div layout="row" flex>
   			<md-checkbox ng-model="ctrl.filter.flagADataEsecuzioneBanca" aria-label="Abilita a data esecuzione banca"></md-checkbox>
			<md-input-container flex>
				<label>A data esecuzione banca</label>
				<md-datepicker ng-model="ctrl.filter.aDataEsecuzioneBanca" ng-disabled="!ctrl.filter.flagADataEsecuzioneBanca"></md-datepicker>
			</md-input-container>
		</div>
	</div>
	<div layout-gt-sm="row" layout="column" flex>
 		<md-input-container flex>
 		 	<label>Esito disposizione</label>
 			<md-select ng-model="ctrl.filter.esitoDisposizione" aria-label="Esito disposizione" flex>
 				<md-option ng-value=""></md-option>
 				<md-option ng-value="1">Eseguita</md-option>
 				<md-option ng-value="2">Stornata</md-option>
 				<md-option ng-value="0">Non esitata</md-option>
 			</md-select> 	
		</md-input-container>
		<md-input-container flex>
			<label>ID SDD</label>
			<input ng-model="ctrl.filter.idSDD">		
		</md-input-container>
		<md-input-container flex>
 		 	<label>Causale storno</label>
 			<md-select ng-model="ctrl.filter.causaleStorno" aria-label="Causale storno" flex>
 				<md-option></md-option>
 				<md-option ng-repeat="item in ctrl.causaleStorno" ng-value="item.descrizione">{{item.descrizione}}</md-option>
 			</md-select> 	
		</md-input-container>
		<md-input-container flex>
			<label>TRN Bonifico SCT</label>
			<input ng-model="ctrl.filter.trnBonificoSCT">		
		</md-input-container>
		<md-input-container flex>
			<label>Numero assegno</label>
			<input ng-model="ctrl.filter.numeroAssegno">		
		</md-input-container>
	</div>
</div>
</form>	

	<div layout="row">
		<span flex></span>
         <md-button aria-label="Ricerca disposizioni" class="md-primary md-raised" ng-click="ctrl.ricercaDisposizioni()">
           	<md-icon md-font-icon="fa-search" class="fa" aria-label="Ricerca disposizioni" title="Ricerca disposizioni"></md-icon>
           	Ricerca disposizioni
         </md-button>
         <md-button aria-label="Esporta su file Excel" class="md-raised" ng-click="ctrl.esportaDisposizioni()" style="display:none">
           <md-icon md-font-icon="fa-file-excel-o" class="fa" aria-label="Esporta su file Excel" title="Esporta su file Excel"></md-icon>
           Esporta su file Excel
         </md-button>
         <md-button aria-label="Ricerca in tutte le funzioni" class="md-raised" ng-click="ctrl.ricercaTutteFunzioni()"  style="display:none">
           <md-icon md-font-icon="fa-search" class="fa" aria-label="Ricerca errori" title="Ricerca in tutte le funzioni"></md-icon>
           Ricerca in tutte le funzioni
        	</md-button>
         <md-button aria-label="Pulisci filtri di ricerca" class="md-raised md-warn" ng-click="ctrl.clearFilter()">
           <md-icon md-font-icon="fa-times" class="fa" aria-label="Pulisci filtri di ricerca"" title="Pulisci filtri di ricerca""></md-icon>
           Pulisci filtri di ricerca
         </md-button>
	</div>
