]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Form.pm
Rechnungs- und Gutschriftsnummern werden nun direkt innerhalb der Backend-Routinen...
[mfinanz.git] / SL / Form.pm
index 157bb61b0833a2c6229a8860ed526bf66579cd19..edf5de978038c3254fb921ce745626f5cc6ce1e1 100644 (file)
@@ -2448,9 +2448,14 @@ sub save_status {
 sub update_defaults {
   $main::lxdebug->enter_sub();
 
 sub update_defaults {
   $main::lxdebug->enter_sub();
 
-  my ($self, $myconfig, $fld) = @_;
+  my ($self, $myconfig, $fld, $provided_dbh) = @_;
 
 
-  my $dbh   = $self->dbconnect_noauto($myconfig);
+  my $dbh;
+  if ($provided_dbh) {
+    $dbh = $provided_dbh;
+  } else {
+    $dbh = $self->dbconnect_noauto($myconfig);
+  }
   my $query = qq|SELECT $fld FROM defaults FOR UPDATE|;
   my $sth   = $dbh->prepare($query);
 
   my $query = qq|SELECT $fld FROM defaults FOR UPDATE|;
   my $sth   = $dbh->prepare($query);
 
@@ -2464,8 +2469,10 @@ sub update_defaults {
               SET $fld = '$var'|;
   $dbh->do($query) || $self->dberror($query);
 
               SET $fld = '$var'|;
   $dbh->do($query) || $self->dberror($query);
 
-  $dbh->commit;
-  $dbh->disconnect;
+  if (!$provided_dbh) {
+    $dbh->commit;
+    $dbh->disconnect;
+  }
 
   $main::lxdebug->leave_sub();
 
 
   $main::lxdebug->leave_sub();