X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/c9696e316b4e9e60a5b7ff20680833f0dadb2131..ca12e8dfc4773aabc13818a0398e06e44028e2bc:/SL/IC.pm diff --git a/SL/IC.pm b/SL/IC.pm index 290d02e73..45fcebb1b 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -188,10 +188,12 @@ sub get_part { # get translations $form->{language_values} = ""; - $query = qq|SELECT language_id, translation FROM translation WHERE parts_id = ?|; + $query = qq|SELECT language_id, translation, longdescription + FROM translation + WHERE parts_id = ?|; my $trq = prepare_execute_query($form, $dbh, $query, conv_i($form->{id})); - while ($tr = $trq->fetchrow_hashref(NAME_lc)) { - $form->{language_values} .= "---+++---".$tr->{language_id}."--++--".$tr->{translation}; + while (my $tr = $trq->fetchrow_hashref(NAME_lc)) { + $form->{language_values} .= "---+++---" . join('--++--', @{$tr}{qw(language_id translation longdescription)}); } $trq->finish; @@ -208,7 +210,7 @@ sub get_part { $sth->finish; # is it an orphan - my @referencing_tables = qw(invoice orderitems invoice inventory rmaitems); + my @referencing_tables = qw(invoice orderitems inventory rmaitems); my %column_map = ( ); my $parts_id = conv_i($form->{id}); @@ -778,10 +780,10 @@ sub all_parts { ) AS ioi ON ioi.parts_id = p.id|, apoe => q|LEFT JOIN ( - SELECT id, transdate, 'ir' AS module, ordnumber, quonumber, invnumber, FALSE AS quotation, NULL AS customer_id, vendor_id, NULL AS deliverydate FROM ap UNION - SELECT id, transdate, 'is' AS module, ordnumber, quonumber, invnumber, FALSE AS quotation, customer_id, NULL AS vendor_id, deliverydate FROM ar UNION - SELECT id, transdate, 'oe' AS module, ordnumber, quonumber, NULL AS invnumber, quotation, customer_id, vendor_id, NULL AS deliverydate FROM oe - ) AS apoe ON ioi.trans_id = apoe.id|, + SELECT id, transdate, 'ir' AS module, ordnumber, quonumber, invnumber, FALSE AS quotation, NULL AS customer_id, vendor_id, NULL AS deliverydate, 'invoice' AS ioi FROM ap UNION + SELECT id, transdate, 'is' AS module, ordnumber, quonumber, invnumber, FALSE AS quotation, customer_id, NULL AS vendor_id, deliverydate, 'invoice' AS ioi FROM ar UNION + SELECT id, transdate, 'oe' AS module, ordnumber, quonumber, NULL AS invnumber, quotation, customer_id, vendor_id, NULL AS deliverydate, 'orderitems' AS ioi FROM oe + ) AS apoe ON ((ioi.trans_id = apoe.id) AND (ioi.ioi = apoe.ioi))|, cv => q|LEFT JOIN ( SELECT id, name, 'customer' AS cv FROM customer UNION @@ -1780,18 +1782,6 @@ sub get_basic_part_info { my $info = selectall_hashref_query($form, $dbh, $query, map { conv_i($_) } @ids); - if ($params{vendor_id}) { - $query = qq|SELECT * FROM parts_vendor WHERE (parts_id = ?) AND (vendor_id = ?)|; - my $sth = prepare_query($form, $dbh, $query); - - foreach my $part (@{ $info }) { - do_statement($form, $sth, $query, $part->{id}, conv_i($params{vendor_id})); - $part->{vendor_info} = $sth->fetchrow_hashref(); - } - - $sth->finish(); - } - if ('' eq ref $params{id}) { $info = $info->[0] || { };