140 lines
		
	
	
		
			6.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			140 lines
		
	
	
		
			6.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
 | 
						|
<!-- affichage du detail de la fiche frais / Derniere modification le 03/05/2023 à 11H01 par Pascal BLAIN -->
 | 
						|
	<div class="encadre">
 | 
						|
	<!-- ============================================================== frais forfaitaires -->
 | 
						|
  	<table class="listeLegere">
 | 
						|
  	   <caption><h3> Éléments forfaitisés 
 | 
						|
  	   <?php 
 | 
						|
  	   if ($ajoutFraisPossible['forfait']=="oui") echo '
 | 
						|
	   <a href="index.php?uc=gererFraisForfaitaire&action=choix" title="ajout frais forfaitaire">
 | 
						|
	   <img alt="Ajouter un frais forfaitaire" src="images/ajouter.jpg" border="0"> </a>
 | 
						|
	   ';?></h3>
 | 
						|
	   </caption>
 | 
						|
		<thead>
 | 
						|
			<tr>
 | 
						|
				<th class="date">Quantité</th>
 | 
						|
				<th class="eltForfait">Nature de la dépense</th>
 | 
						|
				<th class="montant">Prix</th>
 | 
						|
				<th class="montant">Montant</th>
 | 
						|
				<?php
 | 
						|
				if ($ajoutFraisPossible['horsForfait']=="oui" or $ajoutFraisPossible['modifComptable']=="oui") {echo '
 | 
						|
				<th> </th>
 | 
						|
				<th> </th>';} ?>
 | 
						|
			</tr>
 | 
						|
		</thead>
 | 
						|
		<tbody>
 | 
						|
 | 
						|
	        <?php
 | 
						|
	        $totalFraisForfait=0;
 | 
						|
			foreach ( $lesFraisForfait as $unFraisForfait ) 
 | 
						|
			{	echo '
 | 
						|
			 <tr>
 | 
						|
				<td align="right">'.$unFraisForfait['lfQuantite'].'</td>
 | 
						|
				<td>'.$unFraisForfait['fLibelle'].'</td>
 | 
						|
				<td align="right">'.number_format($unFraisForfait['lfMontant'],2,',','.').'</td>
 | 
						|
				<td align="right">'.number_format($unFraisForfait['totalLigne'],2,',','.').'</td>';
 | 
						|
 | 
						|
  	   			if ($ajoutFraisPossible['horsForfait']=="oui" or $ajoutFraisPossible['modifComptable']=="oui") echo '				
 | 
						|
	         	<td><a href="index.php?uc=gererFraisForfaitaire&action=editer&forfait='.$unFraisForfait['idfrais'].'"><img alt="modifier" src="images/editer.jpg" border="0"></a></td>
 | 
						|
	        	<td><a href="index.php?uc=gererFraisForfaitaire&action=supprimer&forfait='.$unFraisForfait['idfrais'].'"><img alt="supprimer" src="images/supprimer.jpg" border="0"></a></td>';
 | 
						|
	        	
 | 
						|
	        	echo '
 | 
						|
			 </tr>';
 | 
						|
			 $totalFraisForfait=$totalFraisForfait + $unFraisForfait['totalLigne'];
 | 
						|
	         }
 | 
						|
	         echo '
 | 
						|
	         <tr>
 | 
						|
	         	<td> </td>
 | 
						|
	        	<td> </td>
 | 
						|
	        	<td align="right"><b>Total</b></td>
 | 
						|
	        	<td align="right"><b>'.number_format($totalFraisForfait,2,',','.').'</b></td>';
 | 
						|
	        	
 | 
						|
	        	if ($ajoutFraisPossible['horsForfait']=="oui" or $ajoutFraisPossible['modifComptable']=="oui") {echo '
 | 
						|
				<td> </td>
 | 
						|
				<td> </td>
 | 
						|
	         </tr>';}
 | 
						|
			?>
 | 
						|
		</tbody>
 | 
						|
	    </table>
 | 
						|
	    
 | 
						|
	    <!-- ============================================================== rappel des elements du remboursement -->
 | 
						|
	    <form name="autresfrais" action="index.php?uc=etatFrais&action=validerEtat" method="post">
 | 
						|
	    <div id="menu"> 
 | 
						|
	    	<ul>
 | 
						|
				<li>Etat : <b><?php echo $libEtat;?> </b></li>
 | 
						|
				<li>depuis le :<br /><b><?php echo $dateModif;?></b> </li>
 | 
						|
				<li>Justificatifs : <b><?php echo $nbJustificatifs; ?></b></li>
 | 
						|
				<li>Montant validé : <br /><b><?php echo number_format($montantValide,2,',','.').' €';?></b> </li><br />
 | 
						|
				<?php 
 | 
						|
				if ($ajoutFraisPossible['modifComptable']=="oui") { echo '
 | 
						|
				<li style="list-style-type:none;"><img alt="validation de la demande de remboursement" src="images/validation.jpg" onClick="document.autresfrais.submit();"></li>';} 
 | 
						|
				?>
 | 
						|
			</ul>
 | 
						|
		</div>
 | 
						|
		
 | 
						|
	    <!-- ============================================================== frais hors forfaits -->
 | 
						|
	  	<table class="listeLegere">
 | 
						|
	  	   <caption><h3> Autres dépenses (hors forfaits) 
 | 
						|
	  	   <?php 
 | 
						|
  	   		if ($ajoutFraisPossible['horsForfait']=="oui") echo '
 | 
						|
	   		<a href="index.php?uc=gererFraisHorsForfait&action=ajouter" title="ajout frais hors forfait">
 | 
						|
	   		<img alt="Ajouter un frais hors forfait" src="images/ajouter.jpg" border="0"> </a>
 | 
						|
	   		';?></h3>
 | 
						|
	       </caption>
 | 
						|
			<thead>
 | 
						|
	             <tr>
 | 
						|
	                <th class="date">Date</th>
 | 
						|
	                <th class="libelle">Nature de la dépense</th>
 | 
						|
	                <th class="montant">Montant</th>
 | 
						|
	                <?php
 | 
						|
					if ($ajoutFraisPossible['horsForfait']=="oui" or $ajoutFraisPossible['modifComptable']=="oui") {echo '
 | 
						|
					<th> </th>
 | 
						|
					<th> </th>';}
 | 
						|
					if ($ajoutFraisPossible['modifComptable']=="oui") {echo '
 | 
						|
					<th><img name="zTous" alt="valider tous les justificatifs" src="images/cocheB.gif" width="20px" onClick="tousLesJustificatifs(document.autresfrais);" onMouseOver="src=\'images/cocheR.gif\'"  onMouseOut="src=\'images/cocheB.gif\'">
 | 
						|
					<input type="hidden" name="zSens" value="on"></th>';} 
 | 
						|
					?>
 | 
						|
	             </tr> 
 | 
						|
	        </thead>
 | 
						|
	        <tbody> 
 | 
						|
	        <?php 
 | 
						|
	        	$totalFraisHorsForfait=0;     
 | 
						|
		        foreach ( $lesFraisHorsForfait as $unFraisHorsForfait ) 
 | 
						|
				{if (substr($unFraisHorsForfait['lhLibelle'],0,6)<>'REFUSE') {$td='<td style="text-decoration:none;"';} else {$td='<td style="text-decoration:line-through; color:red;"';} 
 | 
						|
				echo '<tr>'.
 | 
						|
		            $td.'>'.$unFraisHorsForfait['lhDate'].'</td>'.
 | 
						|
		            $td.'>'.$unFraisHorsForfait['lhLibelle'].'</td>'.
 | 
						|
		            $td.' align="right">'.number_format($unFraisHorsForfait['lhMontant'],2,',','.').'</td>';
 | 
						|
		            
 | 
						|
	  	   			if ($ajoutFraisPossible['horsForfait']=="oui" or $ajoutFraisPossible['modifComptable']=="oui") 
 | 
						|
	  	   			{echo '				
 | 
						|
		         	<td><a href="index.php?uc=gererFraisHorsForfait&action=editer&idFrais='.$unFraisHorsForfait['lhId'].'"><img alt="modifier" src="images/editer.jpg" border="0"></a></td>
 | 
						|
		        	<td><img alt="supprimer" src="images/supprimer.jpg" border="0"></td>';
 | 
						|
		        	}
 | 
						|
					if ($ajoutFraisPossible['modifComptable']=="oui") 
 | 
						|
					{if (substr($unFraisHorsForfait['lhLibelle'],0,6)<>'REFUSE') 
 | 
						|
						{echo '<td><input type="checkbox" name="justificatifs[]" value="'.$unFraisHorsForfait['lhId'].'" checked onClick=""></td>';}
 | 
						|
					else
 | 
						|
						{echo '<td> </td>';}						
 | 
						|
		        	}
 | 
						|
		        	$totalFraisHorsForfait=$totalFraisHorsForfait + $unFraisHorsForfait['lhMontant']; echo '
 | 
						|
	         	</tr>';
 | 
						|
		       }
 | 
						|
	         echo '
 | 
						|
	         <tr>
 | 
						|
	         	<td> </td>
 | 
						|
	        	<td align="right"><b>Total</b></td>
 | 
						|
	        	<td align="right"><b>'.number_format($totalFraisHorsForfait,2,',','.').'</b></td>';
 | 
						|
			 	if ($ajoutFraisPossible['horsForfait']=="oui" or $ajoutFraisPossible['modifComptable']=="oui") {echo '
 | 
						|
			 	<td> </td>
 | 
						|
				<td> </td>';} 
 | 
						|
				if ($ajoutFraisPossible['modifComptable']=="oui") {echo '
 | 
						|
				<td> </td>';} echo '
 | 
						|
	         </tr>
 | 
						|
			</tbody>
 | 
						|
	    </table>
 | 
						|
	</div>    
 | 
						|
	<h3 align="center"><b>Total de la demande de remboursement de frais : '.number_format($totalFraisForfait + $totalFraisHorsForfait,2,',','.').' €</b></h3>
 | 
						|
    </form>
 | 
						|
 | 
						|
  </div>'; ?>
 |