<%@ include file="/project/include.jsp" %>

<script type="text/javascript">
	function gotoElaboraLiquidazioni() {
		buiGotoCustomMode('Elabora', 'fromMode=view');
	}
	
	function onchangeServizio() {
		var selectServizio = document.getElementById('selectServizio');
		var idServizio = selectServizio.options[selectServizio.selectedIndex].value;
		loadStandardSelectOptionsAndFill('selectTipoIntervento',
			'it.cedaf.icare.liquidazioni.control.binding.requestbean.valuesetproviders.TipoInterventoLiquidazioneValueSetProvider(idServizio,mode)', 
			'idServizio=' + idServizio + '&mode=modify', ' ');
		document.getElementById('trEnteErogatore').style.display='none';
		clearCombo('selectEnteErogatore');	
	}

	function onchangeTipoIntervento() {
		var idTipoIntervento = getComboValueById('selectTipoIntervento');
		var idServizio = getComboValueById('selectServizio');

		/** popolo combo voci budget */
		loadStandardSelectOptionsAndFill('selectVoceBudget', 
				'it.cedaf.icare.liquidazioni.control.binding.requestbean.valuesetproviders.VoceBudgetLiquidazioneValueSetProvider(idServizio, idTipoIntervento,mode)', 
				'idServizio=' + idServizio + '&idTipoIntervento=' + idTipoIntervento + '&mode=modify',' ');

		/** visualizzo e popolo combo enti erogatori */
		var enteErogatoreEnabled = 'false';
		if (idTipoIntervento) {
			enteErogatoreEnabled = jsLoadString('it.cedaf.icare.liquidazioni.etc.LiquidazionePerEnteErogatoreEnabled', '&idServizio=' + idServizio + '&idTipoIntervento=' + idTipoIntervento);
		}
		if (enteErogatoreEnabled == 'false') {
			document.getElementById('trEnteErogatore').style.display='none';
		} else {
			var idEnteErogatore = getComboValueById('selectEnteErogatore');
				loadStandardSelectOptionsAndFill('selectEnteErogatore', 
						'it.cedaf.icare.liquidazioni.control.binding.requestbean.valuesetproviders.EnteErogatoreLiquidazioneValueSetProvider(idServizio,idTipoIntervento,mode)', 
						'idServizio=' + idServizio + '&idTipoIntervento=' + idTipoIntervento + '&mode=modify', ' ', idEnteErogatore);	
			document.getElementById('trEnteErogatore').style.display='';
		}	
	}
	
	function tformat_cpmt_contabilizzata(element, value, name) {
		shellFormatImg(element, value, new Array(
			['si', juiceGetResource('shell', 'img/misc/check_small.gif')]
		));
	}	
</script>

<icare:grid description="servizio,10%; tipoIntervento,10%; ${icare:ifOptional('Ente Erogatore [p]','enteErogatore;')} voceBudget,14%; descrizione,15%; totImportoNetto, 5%,-1,right; totImportoIva, 5%,-1,right; totImporto,8%,-1,right; dataLiquidazione,7%; periodoRiferimentoDa,7%; periodoRiferimentoA,7%; dataElaborazione,7%; contabilizzata,5%,-1,center" />