Great to be able to sum browse columns with nuGetBrowseSum()
Posted: Tue Mar 31, 2015 8:10 pm
Hi,
I have just found that now nuBuilder can sum the records of browese columns using the php nuGetBrowseSum() function and it is great!
I made some tests and I found that when the browse columns have format the sum does not display correctly (as shown on image below)
This is because $fields variable inside the nuSumColumns($s) function found on line 1759 of nuapi.php file, includes the the format of the field tables.
Therefore I relpaced line 1769 of the nuapi.php file
from:
to:
Now the sum of browse column displays correctly (as shown on image below)
If there is a better way to make the nuSumColumns($s) function to compute the sum correctly when using formatted fields please share it.
KInd regrads,
Fike
I have just found that now nuBuilder can sum the records of browese columns using the php nuGetBrowseSum() function and it is great!
I made some tests and I found that when the browse columns have format the sum does not display correctly (as shown on image below)
This is because $fields variable inside the nuSumColumns($s) function found on line 1759 of nuapi.php file, includes the the format of the field tables.
Therefore I relpaced line 1769 of the nuapi.php file
from:
Code: Select all
$SQL->addField('SUM(IFNULL(' . $fields[$i] . ')');
Code: Select all
$pos = strpos($fields[$i],'ORMAT(');
if($pos === false)
{
$fld = $fields[$i];
}
else
{
$fld_for = explode('ORMAT(',$fields[$i]);
$fld_com = explode(',',$fld_for[1]);
$fld = $fld_com[0].",'')";
}
$SQL->addField('SUM(IFNULL(' . $fld . ')');
If there is a better way to make the nuSumColumns($s) function to compute the sum correctly when using formatted fields please share it.
KInd regrads,
Fike