Calculations result based on 2 tables with filters

nomek

New Member
Hello all
Im not experienced in Fabrik, php or mysql but im trying to do some joomla site based on Fabrik. So i have 2 tables and list Reports and workinghours. in first i have one value "hours" which is how many hours was spended and on the second table i have price for one hour in month/year.
What i need is to display based on list filter from first table Reports per month/year with calculations
price*hours with filter included and propably store this value in db for future use.
I have try:

$ilosc = '{Raporty___godzin}';
$wartosc = '{roboczogodziny___wartosc_rg}';
$wynik = ($losc*$wartosc);
return (int)$wynik;
where "roboczogodziny" is the second table

My calculation element works only for one table and i don't know how to get values from second table based on filter applyed?
Sorry for my english...
 
Ok
some part is sorted out - i've made list with join data so i can calculate and can see result.
Code:
$ilosc = '{Raporty___godzin}';
$wartosc = '{roboczogodziny___wartosc_rg}';
$wynik = ($losc*$wartosc);
return (int)$wynik;
Question is why results are without decimal view and why are not summed ?
 

Attachments

  • Zrzut ekranu z 2016-07-06 13-36-10.png
    Zrzut ekranu z 2016-07-06 13-36-10.png
    6.5 KB · Views: 118
I've removed (int) from return so now i have in decimal format but how get sum for this column?
Other columns with values stoered in DB are summed ok but this not....
Code:
$ilosc = '{Raporty___godzin}';
$wartosc = '{roboczogodziny___wartosc_rg}';
$wynik = ($losc*$wartosc);
return $wynik;
 

Attachments

  • Zrzut ekranu z 2016-07-06 13-52-45.png
    Zrzut ekranu z 2016-07-06 13-52-45.png
    26.2 KB · Views: 119
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top