partial #1831 - fixed the revenue query

This commit is contained in:
Daniel Camargo 2013-10-09 16:53:32 -03:00
parent fc1c4a263b
commit 63008f738b

View File

@ -18,9 +18,9 @@ class Crunchbutton_Chart_Revenue extends Crunchbutton_Chart {
'title' => 'Gross Revenue', 'title' => 'Gross Revenue',
'tags' => array( 'reps' ), 'tags' => array( 'reps' ),
'charts' => array( 'charts' => array(
'gross-revenue-per-day-by-community' => array( 'title' => 'Day', 'interval' => 'day', 'type' => 'column-community', 'method' => 'byDay' ), 'gross-revenue-per-day-by-community' => array( 'title' => 'Day', 'interval' => 'day', 'type' => 'column-community', 'method' => 'byDayByCommunity' ),
'gross-revenue-per-week-by-community' => array( 'title' => 'Week', 'interval' => 'week', 'type' => 'column-community', 'method' => 'byWeek' ), 'gross-revenue-per-week-by-community' => array( 'title' => 'Week', 'interval' => 'week', 'type' => 'column-community', 'method' => 'byWeekByCommunity' ),
'gross-revenue-per-month-by-community' => array( 'title' => 'Month', 'interval' => 'month', 'type' => 'column-community', 'method' => 'byMonth' ), 'gross-revenue-per-month-by-community' => array( 'title' => 'Month', 'interval' => 'month', 'type' => 'column-community', 'method' => 'byMonthByCommunity' ),
) )
), ),
); );
@ -169,7 +169,7 @@ class Crunchbutton_Chart_Revenue extends Crunchbutton_Chart {
r.community r.community
ORDER BY YEARWEEK(date) DESC"; ORDER BY YEARWEEK(date) DESC";
$parsedData = $this->parseDataWeeksGroup( $query, $this->description ); $parsedData = $this->parseDataWeeksSimple( $query, $this->description );
} else { } else {
$query = "SELECT YEARWEEK(date) AS `Week`, $query = "SELECT YEARWEEK(date) AS `Week`,
CAST(SUM(final_price) AS DECIMAL(14, 2)) AS 'Total', CAST(SUM(final_price) AS DECIMAL(14, 2)) AS 'Total',