<% //# which types belong together in 1 tbody, the tbody wont close after 1 tr, until it doesnt match one of the types below! var isJoinType = function(type) { return (type == 'subclass' || type == 'leveldetail' || type == 'subclassgroup' || type == 'subclassdetail') } %> <% if(!isJoinType(field.getType())) { if(isJoinType(oldType)) { %> <% } //# print if(field.getType() == 'level%'){ %> <% }else{ %> <% } %> <% } else if(!isJoinType(oldType)) { %> <% } //# PRINT START ROW %> <% if(field.getType() == 'subclass' || field.getType() == 'subclassdetail'){ %> data-coa-id="<%= field.getId() %>"<% } %> class="<% if(field.getType() == 'level%'){ print("comparesales") } else if(field.getType() == 'leveldetail' || field.getType() == 'subclassdetail' || field.getType() == 'subclassgroup'){ print(field.getType()) } %>"> <% if(params.is_detail && field.getType() == 'subclass'){ %>
"); for (var i = 0; i < temp.length; i++) { print("
  • " + temp[i] + "
  • "); }; print(""); } %>" data-html="true"><%= field.getId() %>
    (<%= Ffof.App.Formatters.ellipsis(field.getName(), 50) %>)
    <% }else{ %> <%= field.getName() %> <% } //# ADD SUBTABLE _.each(datatable.getSubtables(), function(subtable, subtableIndex){ //# ADD COLUMNS if(subtable.getType() != 'curyear'){ if(options.hasCompareLastYearPeriod || subtable.getType() != 'compareyear'){ var field = subtable.getLastColumn().getFields()[index]; %> style="width: 50px"><%= Ffof.App.Formatters.formatField(field) %> <% } }else{ _.each(subtable.getColumns(), function(column, i){ var field = column.getFields()[index]; %> style="width: 50px;<% if (field.color != '') { %> background: <%= field.color %>; <% } %><%= field.getStyle() %>"><%= Ffof.App.Formatters.formatField(field) %> <% }); } //# ADD TOTALS AND COMPARE COLUMNS if(subtable.getType() != 'curyear'){ //# -* PREVYEAR & BUDGETYEAR *- //# ADD COMPARE COLUMN if(options.hasCompareLastYearPeriod || subtable.getType() != 'compareyear'){ var subcomparecolumnfield = subtable.getCompareColumn().getFields()[index]; %> periodprev <%= subtable.getType() %>" <%= subcomparecolumnfield.structureToString() %> style="width: 50px"><%= Ffof.App.Formatters.formatField(subcomparecolumnfield, true) %> <% } //# ADD SUBTOTAL COLUMN if(!params.hide_totals && (options.hasCompareLastYearTotal || subtable.getType() != 'compareyear') && (options.hasCompareBudgetTotal || subtable.getType() != 'comparebudget')){ var subtotalcolumnfield = subtable.getTotalColumn().getFields()[index]; %> style="width: 50px"><%= Ffof.App.Formatters.formatField(subtotalcolumnfield) %> <% //# ADD COMPAREYEAR COLUMN FOR PREVYEAR var subcompareyearcolumnfield = subtable.getCompareYearColumn().getFields()[index]; %> <%= subtable.getType() %>" <%= subcompareyearcolumnfield.structureToString() %> style="width: 50px"><%= Ffof.App.Formatters.formatField(subcompareyearcolumnfield, true) %> <% } }else{ //# -* CURYEAR *- //# ADD COMPARE COLUMN if(!subtable.hasOnlyOneColumn()){ var subcomparecolumnfield = subtable.getCompareColumn().getFields()[index]; if(options.hasCompareLastPeriod){ %> periodprev" <%= subcomparecolumnfield.structureToString() %> style="width: 50px"><%= Ffof.App.Formatters.formatField(subcomparecolumnfield, true) %> <% } %> <% if(options.hasSamePeriodsCur){ if(subcomparecolumnfield.getFormat() == 'empty'){ %> <% }else{ %> 1){ %> data-prevyear="<%= datatable.getSubtables()[1].getRowValues(index) %>" data-prevyearperc="<%= datatable.getSubtables()[1].getRowPerc(index) %>" data-prevdiffprevperiod="<%= datatable.getSubtables()[1].getRowByKey(index, 'diffprevperiod').join(',') %>" data-prevprevperiodperc="<%= datatable.getSubtables()[1].getRowByKey(index, 'prevperiod').join(',') %>" <% } %> <% if(subcomparecolumnfield.getType() == 'level%' || subcomparecolumnfield.getFormat() == 'perc'){ print('data-type="perc"') } %>> <% } } } //# ADD SUBTOTAL COLUMN if(!params.hide_totals){ var subtotalcolumnfield = subtable.getTotalColumn().getFields()[index]; %> <%= subtotalcolumnfield.structureToString() %> style="width: 50px"><%= Ffof.App.Formatters.formatField(subtotalcolumnfield) %><% } } }); %> <% if(!isJoinType(field.getType())) { %> <% } %>