X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FUSTVA.pm;h=93f83df0e4780209c2f1f52624443b96015fabef;hb=19f44ce2841706aff96243bdd7969cd6cf4241ee;hp=378f48e88cc7133c62cfa6dd93e9e217350d6d57;hpb=4bd1e2f8b588972f10f92728301feacefd5ee4dd;p=kivitendo-erp.git diff --git a/SL/USTVA.pm b/SL/USTVA.pm index 378f48e88..93f83df0e 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); @@ -411,7 +401,7 @@ sub info { |; - ::end_of_request(); + $::dispatcher->end_request; } else { @@ -659,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"; @@ -698,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 @@ -772,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();