X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/548f4467739c9fea1addee0e0717a89e7be75429..41cedb2da32e79e2ac55533f8d6ab0d1d3950043:/SL/Form.pm diff --git a/SL/Form.pm b/SL/Form.pm index 852c3f953..dbffe1ff7 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1196,6 +1196,7 @@ sub check_exchangerate { $dbh->disconnect(); $exchangerate = 1 if ($exchangerate == 0); + $exchangerate = 1 if ($exchangerate eq ""); $main::lxdebug->leave_sub(); @@ -1696,7 +1697,7 @@ sub _get_customers { $key = "all_customers" unless ($key); - my $query = qq|SELECT * FROM customer ORDER BY name|; + my $query = qq|SELECT * FROM customer WHERE NOT obsolete ORDER BY name|; $self->{$key} = selectall_hashref_query($self, $dbh, $query); @@ -1710,7 +1711,7 @@ sub _get_vendors { $key = "all_vendors" unless ($key); - my $query = qq|SELECT * FROM vendor ORDER BY name|; + my $query = qq|SELECT * FROM vendor WHERE NOT obsolete ORDER BY name|; $self->{$key} = selectall_hashref_query($self, $dbh, $query); @@ -2015,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") { @@ -2032,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}) { @@ -2146,7 +2147,7 @@ sub create_links { # get amounts from individual entries $query = qq|SELECT - c.accno, c.description, c.link, + c.accno, c.description, a.source, a.amount, a.memo, a.transdate, a.cleared, a.project_id, a.taxkey, p.projectnumber, t.rate, t.id @@ -2226,7 +2227,7 @@ sub create_links { } - $dbh->disconnect; + $dbh->disconnect() unless $provided_dbh; $main::lxdebug->leave_sub(); }