Hello the community,
I am building a platform that includes:
- 1 [Partenaires] : they are shops who issue a commercial offer
- 2 [cse] : they are companies who contribute to the commercial offer and offer an additional amount to their employees, their employees' invitees and their employees' family (these are 3 categories of beneficiary). The amount of the contribution will vary based on a beneficiary category.
- 3 [Salarié] : they are employees who can benefit from either a commercial offer, or an exclusive offer if their company contributes on the given offer.
I want to created a table where I will calculate the amount due by the employee, based on a) his Employee ID (and the company attached), b) the Commercial offer chosen and c) the beneficiary (the employee himself, an invitee or a family member).
For a chosen Commercial offer, and given the company the employee is linked to, I need to know if there is a contribution from its company. That would be quite easy if there was only one contribution, from one company, for one commercial offer. My problem is that there are 3 possible contributions (for the 3 beneficiaries categories) from one company, for one commercial offer.
So if I put it straight:
- I want to create a form where the employee record ID is prefilled. So the employee is known, therefore I know its company
- The employee would select a commercial offer from the catalogue
- The employee would select the beneficiary of this order (it's one order, so one record and calculation, per type of beneficiary).
From there, I need to :
1) know if there is a special contribution from the company (if there is, I will likely get 3 records, for the 3 contributions per beneficiary that exist)
2) that's my tricky step > extract the one record that matches with the chosen beneficiary
3) and from there, make my calculation so I can send an email to the employee telling him how much he must pay online via Stripe.
Thanks in advance for your super precious help!
Elodie