• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

SOLVED Running calc depending on group repetition

Hi,

here's the thing: I want to use a repeating group for a timetable of installments. So in my form I have a field where you input amount of installments and then such amount of repeats appears below. Now is the tricky part: I use calc element in repeating group that devides the main amount of money by number of installments. The problem is - when I sum these installments, it nearly never gives the initial amount of money. You know - you have $10 and when you have 3 installments, you'll never gonna get these $10 with this method.

So I thought that maybe there is a way to program calc to make it devide the debt by amount of installments minus one and make the last iteration of calc use other method - substraction of the installments minus one from the initial amount of money, so the last installment would be slightly different, but would make the overall timetable correct.

Here's the question: is there a way to tell callc to behave differently on the last repetition of the group? If so - how?

Cheers,

Olek
 
Yep, I've started there, but obviously I'm not competent enough to actually access given repetition. I've tried various combinations of '{table___element}' with [number_of_repetition] with no luck. Help, please?...
 
I tested for you:
$formModel->getElementData is working and I think additionally you have all data in $data.
Did you use var_dump()? or
All posted data is stored in the array $data, this is useful if you wish to retrieve repeat group data. To get a debug output of this data you can use this php:
PHP:
echo '<pre>';
print_r($data);
echo '</pre>';
exit;
 
Nope, getElementData causes white screen with big error number at the center whenever I try to open my form.

However I managed to access the desired group iteration with:

$somevariable = $data['table___element'];
return $somevariable[iteration_number];

Simple as that, but since my programming skills are highly laughable, it wasn't obvious for me at all.

Anyway - thank you for your time and patience, troester!
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top