-sub init {
- my ($self) = @_;
-
- $self->{data} = selectfirst_hashref_query($::form, $::form->get_standard_dbh, qq|SELECT * FROM defaults|);
-
- my $curr = $self->{data}->{curr} || '';
- $curr =~ s/\s+//g;
- $self->{currencies} = [ split m/:/, $curr ];
-
- return $self;
-}
-
-sub get_default_currency {
- my ($self) = @_;
-
- return ($self->get_currencies)[0];
-}
-
-sub get_currencies {
- my ($self) = @_;
-
- return $self->{currencies} ? @{ $self->{currencies} } : ();
-}
-
-sub get_accounting_method {
- my ($self) = @_;
- return $self->{data}->{accounting_method};
-}
-
-sub get_inventory_system {
- my ($self) = @_;
- return $self->{data}->{inventory_system};
-}
-
-sub get_profit_determination {
- my ($self) = @_;
- return $self->{data}->{profit_determination};
-}
-
-sub get_is_changeable {
- my ($self) = @_;
- return $self->{data}->{is_changeable};
-}
-
-sub get_ir_changeable {
- my ($self) = @_;
- return $self->{data}->{ir_changeable};
-}
-
-sub get_ar_changeable {
- my ($self) = @_;
- return $self->{data}->{ar_changeable};
-}
-
-sub get_ap_changeable {
- my ($self) = @_;
- return $self->{data}->{ap_changeable};
-}
-
-sub get_gl_changeable {
- my ($self) = @_;
- return $self->{data}->{gl_changeable};
-}
-
-sub get_datev_check_on_sales_invoice {
- my ($self) = @_;
- return $self->{data}->{datev_check_on_sales_invoice};
-}
-
-sub get_datev_check_on_purchase_invoice {
- my ($self) = @_;
- return $self->{data}->{datev_check_on_purchase_invoice};
+sub init__table_currencies_exists {
+ return 0 if !$::auth->client;
+ return !!(SL::DBUtils::selectall_hashref_query($::form, $::form->get_standard_dbh, qq|SELECT tablename FROM pg_tables WHERE (schemaname = 'public') AND (tablename = 'currencies')|))[0];