systopia / de.systopia.campaign

SYSTOPIA's Google Summer of Code project: CampaignManager
https://campaignmanager.systopia.de/
Other
6 stars 19 forks source link

"Average Cost per Second or Later Contribution" has a different meaning than calculated value #8

Closed scardinius closed 8 years ago

scardinius commented 8 years ago

Hi,

I'd like to ask what was a aim of this KPI, because description has a different meaning than calculated value :-)

$second_or_later = $amount_all - $first_contributions;
// get average cost per second or later contribution
$kpi['amount_average_second_or_later'] = array(
  "id" => "amount_average_second",
  "title" => "Average Cost per Second or Later Contribution",
  "kpi_type" => "money",
  "vis_type" => "none",
  "description" => "Average Cost per second or later contribution associated with this campaign",
  "value" => $second_or_later,
  "link" => ""
);

KPI.php:L225

bjendres commented 8 years ago

I'd like to ask what was a aim of this KPI, because description has a different meaning than calculated value :-)

Well, the description is what we want: the average cost of a "not first (ever, per contact)" contribution.

@nikobo: do you want to make a case for your implementation or do you agree that there might be a bug?

ghost commented 8 years ago

I think this is a bug, because the line obviously calculates the number of contributions that are not classified as a "first" contribution and not their average amount.

bjendres commented 8 years ago

@Niko: Is this an easy fix? Or @scardinius: did you have a PR ready?

ghost commented 8 years ago

@systopia Fixing this should be trivial

scardinius commented 8 years ago

PR #9 is ready.

ghost commented 8 years ago

And merged, thanks!

bjendres commented 8 years ago

Great!