How to add totals in a form/report.

More
3 months 2 weeks ago - 3 months 2 weeks ago #84825 by HenkKV
Hi I need a total value to show the total value of a harvets event/month/year

With this link I show a page for a garden site. In  this site also cost and harvest are logged. Th page shows an example for a harvest event.
www.fluve.nl/index.php/tuin-logboek/tuin...-week-september-2023 .

The harvest is in bottom tab "Oogst"
I need to add the sum of values in Column "Waarde".  Field "Waarde" is part of repeating fieldgroup "Oogstdetail", within Type: "Tuinoogst".
I tried to figure this out, but can't find a startingpoint.

I have a workaround with sqlquery. The results need much rework in a spreadheet, That is only workable for a year overview.:
Suggestions I appreciate
Regards Henk KV 
Last edit: 3 months 2 weeks ago by HenkKV.

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago #84826 by micker
i think the best way is to code it in php directly in a layout for your field

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago #84827 by HenkKV
Thanks ,
I gues copy a field plugin and create a new field. 
It seems quite a challenge But give it a try.
Regards Henk KV

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago #84828 by micker
no in your field you can create a layout
Ex : www.flexicontent.org/documentation/tutor...-for-file-field.html

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago - 3 months 2 weeks ago #84829 by HenkKV
Micker Thanks,
You put me in the right direction.
However I had t deal with fieldtype text.
This solution only works with non-formatted numeric values.
In Value_defaul.,php I added a variable $tot
and added code:
    // Add prefix / suffix    
    if (!is_numeric($value))
    {
        $field->{$prop}[$n]    = $pretext .  $value . $posttext;
    }

//         add value to total    
    if (is_numeric($value))

    {
        $tot += $value ;
        if($n < array_key_last($values))
        {    
            $field->{$prop}[$n]    = $pretext .  $value . $posttext;
        }
        else
        {
            $field->{$prop}[$n]    = $pretext .  $value . $posttext . "<br /> ===== <br /> ". $pretext .  $tot . $posttext ;    
        }
    }

The result however is that all numeric fields display the sum.
So I made a copy of the textfieldtype as  Euro fieldtype.
After that I removed the changes in the text field type
This is the result
www.fluve.nl/index.php/tuin-logboek/tuin...oogst/2312-oogsten-3
Regards HenkKV
Last edit: 3 months 2 weeks ago by HenkKV.

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago #84835 by micker
great

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]
The following user(s) said Thank You: HenkKV

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.292 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline