Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos-tav
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
agplv3
kohinos-tav
Commits
ee167589
Commit
ee167589
authored
Mar 07, 2024
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: create new method to distribute TAV allowance, based on household
parent
61220dcf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
TAVCotisationUtils.php
src/Utils/TAVCotisationUtils.php
+39
-0
No files found.
src/Utils/TAVCotisationUtils.php
View file @
ee167589
...
...
@@ -45,6 +45,9 @@ class TAVCotisationUtils
}
/**
* First method to calculate allowance:
* according to a contribution rate defined in user's profile (ProfilDeCotisation).
*
* Apply the cotisation profile rate to the amount paid
* and register the complement as a new flux (only if rate != 1)
*
...
...
@@ -95,6 +98,42 @@ class TAVCotisationUtils
}
/**
* Second method to calculate allowance:
* allowance based on user's household.
*
* Rules are as follow:
* - 150 emlc for the first person in user's household
* - 75 emlc for each other
* - in case of shared custody for a dependent child, apply a percentage on the "75 emlc" amount for this child:
* 25%, 50% or 75% depending on the shared custody arrangement
*
* Once the full amount is calculated, cap user's balance.
* User account balance is capped at twice the amount previously calculated.
*/
public
function
applyAllowanceAccordingToHousehold
()
{
$profile
=
$flux
->
getDestinataire
()
->
getProfilDeCotisation
();
$cotisationAmount
=
$profile
->
getMontant
();
$mlcAllowanceAmount
=
150
;
// $mlcAllowanceAmount += 75 * NombreDAdultesACharge;
// for each enfant à charge
// $childAllowanceAmount = 75;
// if (custody != null)
// $childAllowanceAmount = $childAllowanceAmount * custody
//
// $mlcAllowanceAmount += $childAllowanceAmount;
// // Apply cap
// $currentBalance = UserCurrentBalance;
// if ($currentBalance + $mlcAllowanceAmount >= 2 * $mlcAllowanceAmount)
// $capped = true
// $mlcAllowanceAmount = 2 * $mlcAllowanceAmount - $currentBalance // give difference to reach max balance
// create flux
}
/**
* Get the last cotisation of an adhérent
*
* @param Adherent $adherent
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment