18 package org.turro.financials.report;
20 import java.util.List;
21 import org.turro.string.Strings;
22 import org.turro.script.Script;
31 private String label, formula;
32 private boolean percent =
false;
44 this.formula = formula;
60 this.percent = percent;
75 p.
setValue(
new Script().evalToDoubleOrZero(parseFormula(period)));
82 String result = formula;
83 List<String> items = Strings.extractAll(result,
"\\@\\{([a-zA-Z0-9]+)\\}");
84 for(String item : items) {
86 result = result.replaceAll(
"--",
"");
88 List<String> formulas = Strings.extractAll(result,
"\\@F\\{([a-zA-Z0-9]+)\\}");
89 for(String form : formulas) {
90 result = result.replaceAll(
"\\@F\\{" + form +
"\\}", report.
getFormula(form).
getValue(period) +
"");
91 result = result.replaceAll(
"--",
"");
double getAccumulatedFor(AccountReportPeriod period)
void setValue(double value)
AccountReportItem getItem(String label)
AccountReportFormula getFormula(String label)
AccountReportPeriod getPeriod(AccountReportPeriod period)