BF [ 1789279 ] DisplayType for group columns are incorect

http://sourceforge.net/tracker/index.php?func=detail&aid=1789279&group_id=176962&atid=879332
This commit is contained in:
teo_sarca 2007-09-07 18:32:19 +00:00
parent 4646b7813a
commit 2de320b935
2 changed files with 17 additions and 13 deletions

View File

@ -738,7 +738,7 @@ public class DataEngine
pd.addNode(new PrintDataElement(pdc.getColumnName(),
m_group.getValue(group_pdc.getColumnName(),
pdc.getColumnName(), functions[f]),
PrintDataFunction.getFunctionDisplayType(functions[f]),
PrintDataFunction.getFunctionDisplayType(functions[f], pdc.getDisplayType()),
false, pdc.isPageBreak()));
}
} // for all columns
@ -920,7 +920,7 @@ public class DataEngine
pd.addNode(new PrintDataElement(pdc.getColumnName(),
m_group.getValue(group_pdc.getColumnName(),
pdc.getColumnName(), functions[f]),
PrintDataFunction.getFunctionDisplayType(functions[f])));
PrintDataFunction.getFunctionDisplayType(functions[f], pdc.getDisplayType())));
}
}
} // for all functions
@ -954,7 +954,7 @@ public class DataEngine
pd.addNode(new PrintDataElement(pdc.getColumnName(),
m_group.getValue(PrintDataGroup.TOTAL,
pdc.getColumnName(), functions[f]),
PrintDataFunction.getFunctionDisplayType(functions[f])));
PrintDataFunction.getFunctionDisplayType(functions[f], pdc.getDisplayType())));
}
} // for all columns
} // for all functions
@ -1011,7 +1011,7 @@ public class DataEngine
{
pd.addNode(new PrintDataElement(pdc.getColumnName(),
m_group.getValue(PrintDataGroup.TOTAL, pdc.getColumnName(), PrintDataFunction.F_SUM),
PrintDataFunction.getFunctionDisplayType(PrintDataFunction.F_SUM), false, false));
PrintDataFunction.getFunctionDisplayType(PrintDataFunction.F_SUM, pdc.getDisplayType()), false, false));
}
} // for all sum columns
} // two lines

View File

@ -20,10 +20,13 @@ import java.math.*;
import org.compiere.util.*;
/**
* Print Data Function
* Print Data Function
*
* @author Jorg Janke
* @version $Id: PrintDataFunction.java,v 1.3 2006/07/30 00:53:02 jjanke Exp $
* @author Jorg Janke
* @version $Id: PrintDataFunction.java,v 1.3 2006/07/30 00:53:02 jjanke Exp $
*
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>BF [ 1789279 ] DisplayType for group columns are incorect
*/
public class PrintDataFunction
{
@ -211,18 +214,19 @@ public class PrintDataFunction
} // getFunctionName
/**
* Get Funcuion Name of function
* @param function function
* @return function name
* Get DisplayType of function
* @param function function
* @param displayType columns display type
* @return function name
*/
static public int getFunctionDisplayType (char function)
static public int getFunctionDisplayType (char function, int displayType)
{
if (function == F_SUM || function == F_MIN || function == F_MAX)
return DisplayType.Amount;
return displayType;
if (function == F_COUNT)
return DisplayType.Integer;
// Mean, Variance, Std. Deviation
return DisplayType.Number;
} // getFunctionName
}
} // PrintDataFunction