]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/Form.pm
Die Funktion "Zahlung buchen" bei Debitorenrechnungen komplett umgeschrieben. Sie...
[kivitendo-erp.git] / SL / Form.pm
index c6e146468928d3432eca36cdf9ba4fb9f31d28b5..a1e6a4d9def264144d5d9700ae02b824a31760cc 100644 (file)
@@ -2016,7 +2016,7 @@ sub all_departments {
 sub create_links {
   $main::lxdebug->enter_sub();
 
-  my ($self, $module, $myconfig, $table) = @_;
+  my ($self, $module, $myconfig, $table, $provided_dbh) = @_;
 
   my ($fld, $arap);
   if ($table eq "customer") {
@@ -2033,7 +2033,7 @@ sub create_links {
   # get last customers or vendors
   my ($query, $sth, $ref);
 
-  my $dbh = $self->dbconnect($myconfig);
+  my $dbh = $provided_dbh ? $provided_dbh : $self->dbconnect($myconfig);
   my %xkeyref = ();
 
   if (!$self->{id}) {
@@ -2227,7 +2227,7 @@ sub create_links {
 
   }
 
-  $dbh->disconnect;
+  $dbh->disconnect() unless $provided_dbh;
 
   $main::lxdebug->leave_sub();
 }