- my $curr = $self->{data}->{curr} || '';
- $curr =~ s/\s+//g;
- $self->{currencies} = [ split m/:/, $curr ];
+ #To get all currencies and the default currency:
+ ($self->{data}->{curr}) = selectrow_query($::form, $::form->get_standard_dbh, qq|SELECT name AS curr FROM currencies WHERE id = (SELECT currency_id FROM defaults)|);
+ $self->{currencies} = [ map { $_->{name} } selectall_hashref_query($::form, $::form->get_standard_dbh, qq|SELECT name FROM currencies ORDER BY id|) ];