// User should receive less than he•she paid: fetch the difference from his account
$fluxCotis=newCotisationTavPrelevement();
$fluxCotis->setExpediteur($adherent);
$fluxCotis->setDestinataire($siege);
$fluxCotis->setMontant(-$amountDiff);
$fluxCotis->setReference("Réduction de l'allocation correspondant à un paiement de ".$cotisationAmount."€ pour atteindre une allocation de ".$mlcAllowanceAmount." MonA.");
* Create the ThirdPartyAllocationFunding from adherent and cotisation flux data
*/
privatefunctioncreateThirdPartyAllocationFunding(
$adherent,
$flux,
&$fluxCotis,
$mlcAllowanceAmount,
$cotisationAmount,
$amountDiff
){
$thirdparty=$adherent->getThirdPartyFinancer();
$thirdparty=$adherent->getThirdPartyFinancer();
$fundingAmount=$thirdparty->getFundingAmount();
$fundingAmount=$thirdparty->getFundingAmount();
...
@@ -368,25 +406,10 @@ class TAVCotisationUtils
...
@@ -368,25 +406,10 @@ class TAVCotisationUtils
$this->em->persist($thirdPartyAllocationFunding);
$this->em->persist($thirdPartyAllocationFunding);
// Update allocation flux reference to include third party
// Update allocation flux reference to include third party
$fluxCotisRef=$fluxCotis->getReference();
$fluxCotisRef.=" ; dont prise en charge de ".$fundingAmount."€ par le tiers financeur $thirdparty";
$fluxCotisRef.=" ; dont prise en charge de ".$fundingAmount."€ par le tiers financeur $thirdparty";
$fluxCotis->setReference($fluxCotisRef);
$fluxCotis->setReference($fluxCotisRef);
}
}
}else{
// User should receive less than he•she paid: fetch the difference from his account
$fluxCotis=newCotisationTavPrelevement();
$fluxCotis->setExpediteur($adherent);
$fluxCotis->setDestinataire($siege);
$fluxCotis->setMontant(-$amountDiff);
$fluxCotis->setReference("Réduction de l'allocation correspondant à un paiement de ".$cotisationAmount."€ pour atteindre une allocation de ".$mlcAllowanceAmount." MonA.");