public Float getSumDevis(Collection<CommandesEntity> commandesEntityCollection) {
   Float res = 0.f;
   for (CommandesEntity commandesEntity : commandesEntityCollection) {
     res += commandesEntity.getCommandDevis();
   }
   return res;
 }
 public Float getSumOfCostByCommandes(CommandesEntity commandesEntity) {
   Float res = 0.f;
   for (HistoriqueSommeEntity historiqueSommeEntity :
       commandesEntity.getHistoriqueSommesByCommandId()) {
     res += historiqueSommeEntity.getHistoriqueSomme();
   }
   return res;
 }
 public Float getSumOfHoursByCommandes(CommandesEntity commandesEntity) {
   Float res = 0.f;
   for (HistoriqueHeuresEntity historiqueHeuresEntity :
       commandesEntity.getHistoriqueHeuresesByCommandId()) {
     res += historiqueHeuresEntity.getHistoriqueHeures();
   }
   return res;
 }
 public Float getResult(CommandesEntity commandesEntity) {
   return commandesEntity.getCommandDevis() - this.getRealCost(commandesEntity);
 }
 public CommandesEntity finaliserCommande(CommandesEntity commandesEntity, boolean finaliser) {
   commandesEntity.setFinalise(finaliser);
   dao.makePersistent(commandesEntity);
   return commandesEntity;
 }
 public CommandesEntity removeHistoriqueSommeToCommandes(
     HistoriqueSommeEntity historiqueSommeEntity, CommandesEntity commandesEntity) {
   commandesEntity.getHistoriqueSommesByCommandId().remove(historiqueSommeEntity);
   dao.makePersistent(commandesEntity);
   return commandesEntity;
 }
 public CommandesEntity addHistoriqueHeuresToCommandes(
     HistoriqueHeuresEntity historiqueHeuresEntity, CommandesEntity commandesEntity) {
   commandesEntity.getHistoriqueHeuresesByCommandId().add(historiqueHeuresEntity);
   dao.makePersistent(commandesEntity);
   return commandesEntity;
 }