Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OSE
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
OSE
Commits
ca2d54b8
Commit
ca2d54b8
authored
4 months ago
by
Laurent Lecluse
Browse files
Options
Downloads
Patches
Plain Diff
Correction pb total HETD : remise provisoire en l'état v23 adaptée
parent
bee2b14d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
module/Contrat/src/Processus/ContratProcessus.php
+27
-4
27 additions, 4 deletions
module/Contrat/src/Processus/ContratProcessus.php
with
27 additions
and
4 deletions
module/Contrat/src/Processus/ContratProcessus.php
+
27
−
4
View file @
ca2d54b8
...
@@ -131,7 +131,7 @@ class ContratProcessus extends AbstractProcessus
...
@@ -131,7 +131,7 @@ class ContratProcessus extends AbstractProcessus
*
*
* @return Contrat
* @return Contrat
*/
*/
public
function
creer
(
Intervenant
$intervenant
,
$volumeHoraire
,
float
$totalHetd
):
Contrat
public
function
creer
(
Intervenant
$intervenant
,
$volumeHoraire
):
Contrat
{
{
$contrat
=
$this
->
getServiceContrat
()
->
newEntity
();
$contrat
=
$this
->
getServiceContrat
()
->
newEntity
();
/* @var $contrat Contrat */
/* @var $contrat Contrat */
...
@@ -141,9 +141,9 @@ class ContratProcessus extends AbstractProcessus
...
@@ -141,9 +141,9 @@ class ContratProcessus extends AbstractProcessus
$structure
=
$this
->
getServiceStructure
()
->
get
(
$volumeHoraire
[
'structureId'
]);
$structure
=
$this
->
getServiceStructure
()
->
get
(
$volumeHoraire
[
'structureId'
]);
$contrat
->
setStructure
(
$structure
);
$contrat
->
setStructure
(
$structure
);
$contrat
->
setTotalHetd
(
$t
otalHetd
);
$contrat
->
setTotalHetd
(
$t
his
->
getIntervenantTotalHetd
(
$intervenant
)
);
try
{
try
{
$dateDebut
=
new
\DateTime
(
$volumeHoraire
[
'dateDebut'
]);
$dateDebut
=
$volumeHoraire
[
'dateDebut'
]
?
new
\DateTime
(
$volumeHoraire
[
'dateDebut'
])
:
null
;
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$dateDebut
=
null
;
$dateDebut
=
null
;
...
@@ -151,7 +151,7 @@ class ContratProcessus extends AbstractProcessus
...
@@ -151,7 +151,7 @@ class ContratProcessus extends AbstractProcessus
$contrat
->
setDebutValidite
(
$dateDebut
);
$contrat
->
setDebutValidite
(
$dateDebut
);
try
{
try
{
$dateFin
=
new
\DateTime
(
$volumeHoraire
[
'dateFin'
]);
$dateFin
=
$volumeHoraire
[
'dateFin'
]
?
new
\DateTime
(
$volumeHoraire
[
'dateFin'
])
:
null
;
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$dateFin
=
null
;
$dateFin
=
null
;
}
}
...
@@ -173,6 +173,29 @@ class ContratProcessus extends AbstractProcessus
...
@@ -173,6 +173,29 @@ class ContratProcessus extends AbstractProcessus
/**
* @param Intervenant $intervenant
*
* @return float
*/
public
function
getIntervenantTotalHetd
(
Intervenant
$intervenant
):
float
{
$typeVolumeHoraire
=
$this
->
getServiceTypeVolumeHoraire
()
->
getPrevu
();
$etatVolumeHoraire
=
$this
->
getServiceEtatVolumeHoraire
()
->
getValide
();
$sql
=
"SELECT total FROM formule_resultat_intervenant WHERE intervenant_id = :intervenant AND type_volume_horaire_id = :tvh AND etat_volume_horaire_id = :evh"
;
$params
=
[
'intervenant'
=>
$intervenant
->
getId
(),
'tvh'
=>
$typeVolumeHoraire
->
getId
(),
'evh'
=>
$etatVolumeHoraire
->
getId
(),
];
$hetd
=
(
float
)
$this
->
getEntityManager
()
->
getConnection
()
->
fetchOne
(
$sql
,
$params
);
return
$hetd
;
}
/**
/**
* Enregistrement du contrat ET liaison aux volumes horaires correspondants
* Enregistrement du contrat ET liaison aux volumes horaires correspondants
*
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment