Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Cannot show Money in summary field


Go to End


2 Posts   1860 Views

Avatar
Raccoonwao

Community Member, 4 Posts

16 March 2011 at 5:28am

I followed this doc (http://doc.silverstripe.org/sapphire/en/reference/dataobject) and tried to show Payment Amount in the summary table but failed. Here is my change to Payment.php

public static $summary_fields = array(
		'ID' => 'ID',
		'Status' => 'Status',
		'Amount.amount' => 'aaa',
		'PaymentDate',
		'Message' => 'Message'
	);

PaymentDate and Message show correctly but an empty column for 'aaa' above in the summary table.

'Amount.getAmount', 'Amount.getAmount()', 'Amount.Amount' give no difference.

Any advice is appreciated

Avatar
swaiba

Forum Moderator, 1899 Posts

24 March 2011 at 5:15am

check out casting - it's what I use for currencies...
http://doc.silverstripe.org/sapphire/en/topics/datamodel#casting