sepa_export_items automatisch mit Rechnungen löschen
[kivitendo-erp.git] / bin / mozilla / gl.pl
index 608ae75..ea94a28 100644 (file)
@@ -528,10 +528,9 @@ sub update {
   my $creditcount = 0;
   my ($debitcredit, $amount);
 
-  my $dbh = $form->dbconnect_noauto(\%myconfig);
+  my $dbh = SL::DB->client->dbh;
   my ($notax_id) = selectrow_query($form, $dbh, "SELECT id FROM tax WHERE taxkey = 0 LIMIT 1", );
   my $zerotaxes  = selectall_hashref_query($form, $dbh, "SELECT id FROM tax WHERE rate = 0", );
-  $dbh->disconnect;
 
   my @flds =
     qw(accno debit credit projectnumber fx_transaction source memo tax taxchart);
@@ -902,7 +901,7 @@ sub form_footer {
   my ($follow_ups, $follow_ups_due);
 
   if ($::form->{id}) {
-    $follow_ups     = FU->follow_ups('trans_id' => $::form->{id});
+    $follow_ups     = FU->follow_ups('trans_id' => $::form->{id}, 'not_done' => 1);
     $follow_ups_due = sum map { $_->{due} * 1 } @{ $follow_ups || [] };
   }
 
@@ -998,10 +997,9 @@ sub post_transaction {
   my $debitcredit;
   my %split_safety = ();
 
-  my $dbh = $form->dbconnect_noauto(\%myconfig);
+  my $dbh = SL::DB->client->dbh;
   my ($notax_id) = selectrow_query($form, $dbh, "SELECT id FROM tax WHERE taxkey = 0 LIMIT 1", );
   my $zerotaxes  = selectall_hashref_query($form, $dbh, "SELECT id FROM tax WHERE rate = 0", );
-  $dbh->disconnect;
 
   my @flds = qw(accno debit credit projectnumber fx_transaction source memo tax taxchart);