varsumOfMonthTurnover=db.table("select year(SALESORDERDATE) yearNum, month(SALESORDERDATE) monthNum, sum(NET + VAT) from SALESORDER group by year(SALESORDERDATE), month(SALESORDERDATE) order by yearNum, monthNum");
varsumOfMonthForecast=db.table("select year(DATE_START) yearNum, month(DATE_START) monthNum, sum(VOLUME * 1000) from SALESPROJECT_FORECAST group by year(DATE_START), month(DATE_START) order by yearNum, monthNum");
join SALESORDERITEM on SALESORDERITEM.SALESORDER_ID = SALESORDER.SALESORDERID \n\
where SALESORDERITEM.OPTIONAL <> 1 \n\
group by year(SALESORDERDATE), month(SALESORDERDATE), SALESORDERITEM.GROUPCODEID, SALESORDERITEM.DISCOUNT, SALESORDERITEM.VAT, SALESORDERITEM.PRICE \n\
order by yearNum, monthNum");// V--V--> there is no VAT/Discount in forecasts V-----> forecasts are grouped by grupcode and have always quantity 1
varsumOfMonthProductsForecast=db.table("select year(DATE_START) yearNum, month(DATE_START) monthNum, 0, 0, sum(VOLUME * 1000), 1, GROUPCODE, ("+KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.productGroupcode(),"GROUPCODE")+") from SALESPROJECT_FORECAST group by year(DATE_START), month(DATE_START), GROUPCODE order by yearNum, monthNum");
* add the counts to countData for the given key and value
* @param {Array} pKeys an array containing all keys for this value. If the x-value for one key is different from the key-value: add an array [key, value] instead of only the key