Calc Subtotal on Repeat Group

bonghetti

Member
I have to subtotal the paid installments. I have the installment amount field and the field that indicates whether this has been paid.
using the function:
$sum += array_sum($data['ptb_monitoraggio_insoluti_68_repeat___importo_rata']);
I correctly get the sum of all installments, but if I want the sum of the paid installments only, what can I do?
i tried to use the function:
$n = (int)$formModel->formData['ptb_monitoraggio_insoluti_68_repeat___stato_rata'];
$total = array_sum(array_filter($data['ptb_monitoraggio_insoluti_68_repeat___importo_rata'], function($n) { return $n = 2; }));
But it does not work. Any suggestions?
Thanks and sorry my english
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top