X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FUSTVA.pm;h=a80372b282e179c36a511d809df1f90dd4720b05;hb=a8b18c65bfd47c845e641fb0fff9587f4122bf9d;hp=b467b427d9b9e73420283cb31f470c7e589e6cf3;hpb=8430a44d0e84ec2608f03b361b96cb1786d8e5c7;p=kivitendo-erp.git diff --git a/SL/USTVA.pm b/SL/USTVA.pm index b467b427d..a80372b28 100644 --- a/SL/USTVA.pm +++ b/SL/USTVA.pm @@ -77,19 +77,9 @@ sub _init { 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); @@ -102,8 +92,6 @@ sub report_variables { # Get all positions for taxreport out of the database # Needs Databaseupdate Pg-upgrade2/USTVA_abstraction.pl - return unless defined wantarray; - my ( $self, $arg_ref) = @_; @@ -661,7 +649,7 @@ sub ustva { my ($self, $myconfig, $form) = @_; # connect to database - my $dbh = $form->dbconnect($myconfig); + my $dbh = $form->get_standard_dbh; my $last_period = 0; my $category = "pos_ustva"; @@ -700,7 +688,7 @@ sub ustva { 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 @@ -774,23 +762,6 @@ sub ustva { $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(); @@ -1032,7 +1003,7 @@ sub get_config { $form->error("Missing Parameter: @_") if !$userspath || !$filename; - $filename = "$form->{login}_$filename"; + $filename = "$::myconfig{login}_$filename"; $filename =~ s|.*/||; $filename = "$userspath/$filename"; open my $FACONF, "<", $filename or do {# Annon Sub