<#-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <#macro resultSummary resultMap> <#if resultMap?has_content> ${resultMap.quantityTotal?default(0)}:${resultMap.amountTotal?default(0)}:<#if (resultMap.quantityTotal?exists && resultMap.quantityTotal > 0)>${resultMap.amountTotal/resultMap.quantityTotal}<#else/>0 <#else/> 0:0:0
NOTE: each set of numbers is: <quantity>:<total amount>:<average amount>
<#-- Create the header row --> <#list productList as product> <#list productCategoryList as productCategory> <#-- Days of the month --> <#list productNullResultByDayList as productNullResult> <#assign productResultMap = productResultMapByDayList.get(productNullResult_index)/> <#assign categoryResultMap = categoryResultMapByDayList.get(productNullResult_index)/> <#-- now do the null product, then iterate through the products, then categories --> <#list productList as product> <#assign productResult = productResultMap[product.productId]?if_exists/> <#list productCategoryList as productCategory> <#assign categoryResult = categoryResultMap[productCategory.productCategoryId]?if_exists/> <#-- Totals for the month --> <#list productList as product> <#assign productResult = monthProductResultMap[product.productId]?if_exists/> <#list productCategoryList as productCategory> <#assign categoryResult = monthCategoryResultMap[productCategory.productCategoryId]?if_exists/>
Day [No Product]${product.internalName?default((Static["org.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(product, "PRODUCT_NAME", locale, dispatcher))?if_exists)}
P:[${product.productId}]
${(Static["org.ofbiz.product.category.CategoryContentWrapper"].getProductCategoryContentAsText(productCategory, "CATEGORY_NAME", locale, dispatcher))?if_exists}
C:[${productCategory.productCategoryId}]
${(productNullResult_index + 1)} <@resultSummary resultMap=productNullResult/><@resultSummary resultMap=productResult/> <@resultSummary resultMap=categoryResult/>
Month Total <@resultSummary resultMap=monthProductNullResult/><@resultSummary resultMap=productResult/> <@resultSummary resultMap=categoryResult/>