-sub init {
- my ($self) = @_;
-
- $self->{data} = selectfirst_hashref_query($::form, $::form->get_standard_dbh, qq|SELECT * FROM defaults|);
-
- #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|) ];
-
- return $self;
-}
-
-sub get_default_currency {
- my ($self) = @_;
-
- return $self->{data}->{curr};
-}
-
-sub get_currencies {
- my ($self) = @_;
-
- return @{ $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 get_datev_check_on_ar_transaction {
- my ($self) = @_;
- return $self->{data}->{datev_check_on_ar_transaction};
-}
-
-sub get_datev_check_on_ap_transaction {
- my ($self) = @_;
- return $self->{data}->{datev_check_on_ap_transaction};
+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];