Revision 2678f499
Von Niclas Zimmermann vor mehr als 11 Jahren hinzugefügt
SL/InstanceConfiguration.pm | ||
---|---|---|
15 | 15 |
|
16 | 16 |
$self->{data} = selectfirst_hashref_query($::form, $::form->get_standard_dbh, qq|SELECT * FROM defaults|); |
17 | 17 |
|
18 |
my $curr = $self->{data}->{curr} || '';
|
|
19 |
$curr =~ s/\s+//g;
|
|
20 |
$self->{currencies} = [ split m/:/, $curr ];
|
|
18 |
#To get all currencies and the default currency:
|
|
19 |
($self->{data}->{curr}) = selectrow_query($::form, $::form->get_standard_dbh, qq|SELECT name AS curr FROM currencies WHERE id = (SELECT currency_id FROM defaults)|);
|
|
20 |
$self->{currencies} = [ map { $_->{name} } selectall_hashref_query($::form, $::form->get_standard_dbh, qq|SELECT name FROM currencies ORDER BY id|) ];
|
|
21 | 21 |
|
22 | 22 |
return $self; |
23 | 23 |
} |
... | ... | |
25 | 25 |
sub get_default_currency { |
26 | 26 |
my ($self) = @_; |
27 | 27 |
|
28 |
return ($self->get_currencies)[0];
|
|
28 |
return $self->{data}->{curr};
|
|
29 | 29 |
} |
30 | 30 |
|
31 | 31 |
sub get_currencies { |
32 | 32 |
my ($self) = @_; |
33 | 33 |
|
34 |
return $self->{currencies} ? @{ $self->{currencies} } : ();
|
|
34 |
return @{ $self->{currencies} };
|
|
35 | 35 |
} |
36 | 36 |
|
37 | 37 |
sub get_accounting_method { |
Auch abrufbar als: Unified diff
currencies in SL/InstanceConfiguration.pm
In der InstanceConfiguration.pm wird jetzt auch auf die Tabelle
currencies zugegriffen.