Skip to content

Commit

Permalink
affichage du salaire souhaitee (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ornella452 authored Sep 24, 2024
1 parent 5d73792 commit d7a4646
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views/connected/structure/popins/PopinEditionContrat.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import DatePicker, { registerLocale } from 'react-datepicker';
import fr from 'date-fns/locale/fr';
import { validTypeDeContratWithoutEndDate } from '../../../../utils/formatagesUtils';
import { ModalMode } from '../../../../utils/enumUtils';
import { DatePickerPortal, getDateFin } from '../utils/functionUtils';
import { DatePickerPortal, getDateFin, getSalaire } from '../utils/functionUtils';

registerLocale('fr', fr);

Expand Down Expand Up @@ -49,7 +49,7 @@ function PopinEditionContrat({ setOpenModalContrat, updateContract, extendContra
setIsRecrutementCoordinateur(conseiller?.contratCoordinateur ?? false);
setDateDebut(conseiller?.dateDebutDeContrat ? new Date(conseiller?.dateDebutDeContrat) : null);
setDateFin(getDateFin(conseiller));
setSalaire(conseiller?.salaire ? String(conseiller?.salaire) : '');
setSalaire(getSalaire(conseiller));
}
}, [mode, conseiller]);

Expand Down
10 changes: 10 additions & 0 deletions src/views/connected/structure/utils/functionUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@ export function getDateFin(conseiller) {
return null;
}

export function getSalaire(conseiller) {
const demandeInitiee = getDemandeInitiee(conseiller);
if (demandeInitiee) {
return String(demandeInitiee.salaireSouhaitee);
} else if (conseiller?.salaire) {
return String(conseiller?.salaire);
}
return '';
}

export function getDemandeInitiee(contrat) {
return contrat.demandesDeProlongation?.find(demande => demande.statut === 'initiee');
}
Expand Down

0 comments on commit d7a4646

Please sign in to comment.