Displaying Currency Values in Aggregated Reports
Displaying Currency Values in Aggregated Reports
Reports that displays aggregated data, such as cross-tables, charts, or paginated reports that use grouping data sources, cannot aggregate costs that have different currencies. For example, if some payments were made in USD and others in Euro, the report cannot sum them.
These aggregated reports can display only costs that have the same currency. They can display costs in Budget Currency, or costs in Payment Currency that are filtered to include only one specific currency.
Summing Costs in the Budget Currency
To sum cost records in the Budget Currency, add the cost field to the grouping data source of the report:
// Aggregated cost for cost records in Euro.
<field table="cost_trans" name="amount_income" formula="sum"/>
Summing Filtered Costs in the Payment Currency
To sum only those cost records that have a specified currency, apply the currency restriction to the grouping data source of the report:
// Aggregated cost for cost records in Euro.
<field table="cost_trans" name="amount_income_trans" formula="sum"
hidden="${activityParameters['EnableVatAndMultiCurrency']==1 }"/>
// In JS code: apply the restriction.
var restriction = new Ab.view.Restriction();
restriction.addClause('cost_trans.transaction_currency', 'Euro');
this.report.refresh(restriction);