sub get_coa {
- my ( $self, $form, $myconfig) = @_;
-
- my $query = q{ SELECT coa FROM defaults };
-
- my $dbh = $form->dbconnect($myconfig);
- my $sth = $dbh->prepare($query);
- $sth->execute() || $form->dberror($query);
-
- my ($coa) = selectrow_query($form, $dbh, $query);
-
- $sth->finish;
- $dbh->disconnect;
+ my ( $self, $form ) = @_;
+ my $coa = $::instance_conf->get_coa;
$form->{coa} = $coa;
$form->{"COA_$coa"} = '1';
$form->{COA_Germany} = '1' if ($coa =~ m/^germany/i);
foreach my $item (@category_euro) {
$form->{"$item"} = 0;
}
- my $coa_name = coa_get($dbh);
+ my $coa_name = $::instance_conf->get_coa;
$form->{coa} = $coa_name;
# Controlvariable for templates
$main::lxdebug->leave_sub();
}
-sub coa_get {
-
- my ($dbh) = @_;
- my $form = $main::form;
-
- my $query= qq|SELECT coa FROM defaults|;
-
- my $sth = $dbh->prepare($query);
-
- $sth->execute || $form->dberror($query);
-
- my ($ref) = $sth->fetchrow_array;
-
- return $ref;
-
-};
-
sub get_accounts_ustva {
$main::lxdebug->enter_sub();
# Which COA is in use?
- $ustva->get_coa($form, \%myconfig);
+ $ustva->get_coa($form); # fetches coa and modifies some form variables
my $template_ref = {
openings => $openings,
# Which COA is in use?
- $ustva->get_coa($::form, \%::myconfig);
+ $ustva->get_coa($::form); # fetches coa and modifies some form variables
# hä? kann die weg?
my $steuernummer_new = '';
$form->{FA_Oeffnungszeiten} =~ s/\\\\n/\n/g;
- $ustva->get_coa($form, \%myconfig);
+ $ustva->get_coa($form); # fetches coa and modifies some form variables
my $input_steuernummer = $ustva->steuernummer_input(
$form->{elsterland},