Skip to content

Commit

Permalink
fixed pivot viz if sul field had nulber formatting already applied
Browse files Browse the repository at this point in the history
  • Loading branch information
pollen8 committed Aug 8, 2014
1 parent 094a111 commit 99c967e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions plugins/fabrik_list/pivot/pivot.php
Expand Up @@ -34,6 +34,7 @@ class PlgFabrik_ListPivot extends PlgFabrik_List
public function onBuildQuerySelect($params, &$model, $args)
{
$sum = $this->sums($model);

if ($query = $this->hasQuery($args))
{
$query->select($sum);
Expand All @@ -42,6 +43,7 @@ public function onBuildQuerySelect($params, &$model, $args)
{
$model->_pluginQuerySelect[] = $sum;
}

return;
}

Expand Down Expand Up @@ -318,7 +320,7 @@ public function onLoadData($params, &$model, &$args)
{
if (!empty($xColData))
{
$newRow->$xColData = $row->$sums;
$newRow->$xColData = $row->$rawSums;
}

$total += (float) $row->$rawSums;
Expand All @@ -339,7 +341,8 @@ public function onLoadData($params, &$model, &$args)

if ($order == '1')
{
usort($new, function($a, $b) {
usort($new, function($a, $b)
{
if ($a->pivot_total == $b->pivot_total)
{
return 0;
Expand All @@ -356,7 +359,8 @@ public function onLoadData($params, &$model, &$args)
}
else if ($order == '2')
{
usort($new, function($a, $b) {
usort($new, function($a, $b)
{
if ($a->pivot_total == $b->pivot_total)
{
return 0;
Expand Down Expand Up @@ -444,6 +448,7 @@ protected function numberFormat($data, $params)
{
$thousand_sep = ' ';
}

return number_format((float) $data, $decimal_length, $decimal_sep, $thousand_sep);
}

Expand Down

0 comments on commit 99c967e

Please sign in to comment.