public SalesStatistic generateSalesStatistics(Integer year, Integer week,
String productAreaName) throws ProTransException {
ProductArea productArea = productAreaManager
.findByName(productAreaName);
Periode periode = new Periode(year, week, week);
// henter for gjeldende uke
Multimap<ProbabilityEnum, SaleReportSum> salesMap = salesVManager
.getAllReportData(productArea, periode);
SalesStatistic salesStatistic = new SalesStatistic();
salesStatistic.setProductAreaName(productAreaName);
salesStatistic = setNumberOfAndSumOrder(salesMap, salesStatistic);
debugSalesStatistic(salesStatistic, productAreaName, week);
// henter for hele �ret dersom etter uke 1
if (week > 1) {
periode = new Periode(year, 1, week - 1);
LOGGER
.debug("Periode: "
+ periode.getFormattetYearFromWeekToWeek());
salesMap = salesVManager.getAllReportData(productArea, periode);
salesStatistic = setAccumulatedNumberOfAndSumOrder(salesMap,
salesStatistic);
} else {// setter akkumulert til uke dersmo uke 1
salesStatistic.setAccumulatedLikeWeekSum();