
1. Re: Automated Levy Calculations
philmodjunk Jul 9, 2013 8:26 AM (in response to Matty_1)Levies = taxes?
I see no need for triggers either.
There are two basic approaches you can use with your autoenter calculation:
Do the calculation in the autoenter expression:
IF ( LevyType = "PCT" ; Levies::Rate * MT ; Levies::PerUnitTon * MT )
Set up the calculation in your related Levies table:
Evaluate ( Levies::LevyCalc )
In the second case, LevyCalc is a text field where you'd enter a FileMaker calc such as "Levies::Rate * MT" for percent calculations and "Levies::PerUnitTon * MT" for amount per metric ton calculations.
The second option is trickier to set up and to debug issues when they fail to calc correctly but makes adding additional formulae a matter of data entryyou don't have to redefine a field option's calculation to handle additional formulas.

2. Re: Automated Levy Calculations
Matty_1 Jul 9, 2013 8:28 AM (in response to Matty_1)Levies = taxes?
Yes I suppose you could say it's something like that but it's not constant and clearly defined like a tax would be. It's only applied in certain situations and varies on a case by case basis.
Do the calculation in the autoenter expression:
IF ( LevyType = "PCT" ; Levies::Rate * MT ; Levies::PerUnitTon * MT )
I'm trying to avoid this for the very reason you mention later in your reply. Ideally I'd like to give the user the ability to add in more levies and their "types" and teaching them how to crack open an calculation field just isn't an option. So what would like it something along these lines; if it's a blue levy calculate on a % basis, red $/MT, orange % basis etc.
The auto calc field would look at which association is selected, go to the levy records find the same association, take the type and apply the calculation.

3. Re: Automated Levy Calculations
philmodjunk Jul 10, 2013 6:44 AM (in response to Matty_1)Yet you still have the same calculation formula for blue and orange in your exampleleaving you with only two formulas. The inputs to those two methods may differthe rate or unit amount per ton may differ, but the math performed with those values appears to always be one of the two. The rate and unit cost values can be entered into your related Levies table for each "color" along with an indicator field that tells your autoenter calc which method to use to calculate the levied amount. The relationship to that levies table will then match by that "color" to access the correct calculation method and inputs for computing it.