Charlie,
If you already have a field called 'totalFees' then you do not need any method called getFulfillmentFees, and in fact, you do not need any of the above customization. However, it's possible that the 'totalFees' column is never actually populated and this was erroneously put there but never used?
The 'getFulfillmentFees' annotation you see on the class will control the display properties for the 'getFulfillmentFees' method. However, the result of this method will never get shown in the admin unless you have the above code for your OrderDataSourceFactory.
All that to say, if you have a method that does this (only returns the result of a property):
Code: Select all
protected Money getTotalFees() {
return this.totalFees;
}
Then you don't have to do anything complicated at all in order to make that show up; just annotate as normal with @AdminPresentation. Only when you have this scenario (add up a few fields and give you a result):
Code: Select all
protected Money getFulfillmentFees() {
Money result = new Money(BigDecimal.ZERO);
for (FulfillmentGroup group : getFulfillmentGroups()) {
for (FulfillmentGroupFee fee : group.getFulfillmentGroupFees()) {
result = result.add(fee.getPrice());
}
}
return result;
}
Will you need the complicated process that I outlined earlier.