Revision 165a97b3
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/IR.pm | ||
---|---|---|
1129 | 1129 |
WHERE $where|; |
1130 | 1130 |
my $sth = prepare_execute_query($form, $dbh, $query, @values); |
1131 | 1131 |
|
1132 |
my @translation_queries = ( [ qq|SELECT tr.translation, tr.longdescription |
|
1133 |
FROM translation tr |
|
1134 |
WHERE tr.language_id = ? AND tr.parts_id = ?| ], |
|
1135 |
[ qq|SELECT tr.translation, tr.longdescription |
|
1136 |
FROM translation tr |
|
1137 |
WHERE tr.language_id IN |
|
1138 |
(SELECT id |
|
1139 |
FROM language |
|
1140 |
WHERE article_code = (SELECT article_code FROM language WHERE id = ?)) |
|
1141 |
AND tr.parts_id = ? |
|
1142 |
LIMIT 1| ] ); |
|
1143 |
map { push @{ $_ }, prepare_query($form, $dbh, $_->[0]) } @translation_queries; |
|
1144 |
|
|
1132 | 1145 |
$form->{item_list} = []; |
1133 | 1146 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { |
1134 | 1147 |
|
... | ... | |
1178 | 1191 |
$form->{taxaccounts} .= "$ptr->{accno} "; |
1179 | 1192 |
} |
1180 | 1193 |
|
1194 |
if ($form->{language_id}) { |
|
1195 |
for my $spec (@translation_queries) { |
|
1196 |
do_statement($form, $spec->[1], $spec->[0], conv_i($form->{language_id}), conv_i($ref->{id})); |
|
1197 |
my ($translation, $longdescription) = $spec->[1]->fetchrow_array; |
|
1198 |
next unless $translation; |
|
1199 |
$ref->{description} = $translation; |
|
1200 |
$ref->{longdescription} = $longdescription; |
|
1201 |
last; |
|
1202 |
} |
|
1203 |
} |
|
1181 | 1204 |
} |
1182 | 1205 |
|
1183 | 1206 |
$stw->finish(); |
... | ... | |
1190 | 1213 |
} |
1191 | 1214 |
|
1192 | 1215 |
$sth->finish(); |
1216 |
$_->[1]->finish for @translation_queries; |
|
1193 | 1217 |
|
1194 | 1218 |
foreach my $item (@{ $form->{item_list} }) { |
1195 | 1219 |
my $custom_variables = CVar->get_custom_variables(module => 'IC', |
SL/IS.pm | ||
---|---|---|
1848 | 1848 |
WHERE $where|; |
1849 | 1849 |
my $sth = prepare_execute_query($form, $dbh, $query, @values); |
1850 | 1850 |
|
1851 |
my @translation_queries = ( [ qq|SELECT tr.translation, tr.longdescription |
|
1852 |
FROM translation tr |
|
1853 |
WHERE tr.language_id = ? AND tr.parts_id = ?| ], |
|
1854 |
[ qq|SELECT tr.translation, tr.longdescription |
|
1855 |
FROM translation tr |
|
1856 |
WHERE tr.language_id IN |
|
1857 |
(SELECT id |
|
1858 |
FROM language |
|
1859 |
WHERE article_code = (SELECT article_code FROM language WHERE id = ?)) |
|
1860 |
AND tr.parts_id = ? |
|
1861 |
LIMIT 1| ] ); |
|
1862 |
map { push @{ $_ }, prepare_query($form, $dbh, $_->[0]) } @translation_queries; |
|
1863 |
|
|
1851 | 1864 |
while (my $ref = $sth->fetchrow_hashref('NAME_lc')) { |
1852 | 1865 |
|
1853 | 1866 |
# In der Buchungsgruppe ist immer ein Bestandskonto verknuepft, auch wenn |
... | ... | |
1915 | 1928 |
|
1916 | 1929 |
$stw->finish; |
1917 | 1930 |
chop $ref->{taxaccounts}; |
1931 |
|
|
1918 | 1932 |
if ($form->{language_id}) { |
1919 |
$query = |
|
1920 |
qq|SELECT tr.translation, tr.longdescription |
|
1921 |
FROM translation tr |
|
1922 |
WHERE tr.language_id = ? AND tr.parts_id = ?|; |
|
1923 |
@values = (conv_i($form->{language_id}), conv_i($ref->{id})); |
|
1924 |
my ($translation, $longdescription) = selectrow_query($form, $dbh, $query, @values); |
|
1925 |
if ($translation ne "") { |
|
1933 |
for my $spec (@translation_queries) { |
|
1934 |
do_statement($form, $spec->[1], $spec->[0], conv_i($form->{language_id}), conv_i($ref->{id})); |
|
1935 |
my ($translation, $longdescription) = $spec->[1]->fetchrow_array; |
|
1936 |
next unless $translation; |
|
1926 | 1937 |
$ref->{description} = $translation; |
1927 | 1938 |
$ref->{longdescription} = $longdescription; |
1928 |
|
|
1929 |
} else { |
|
1930 |
$query = |
|
1931 |
qq|SELECT tr.translation, tr.longdescription |
|
1932 |
FROM translation tr |
|
1933 |
WHERE tr.language_id IN |
|
1934 |
(SELECT id |
|
1935 |
FROM language |
|
1936 |
WHERE article_code = (SELECT article_code FROM language WHERE id = ?)) |
|
1937 |
AND tr.parts_id = ? |
|
1938 |
LIMIT 1|; |
|
1939 |
@values = (conv_i($form->{language_id}), conv_i($ref->{id})); |
|
1940 |
my ($translation, $longdescription) = selectrow_query($form, $dbh, $query, @values); |
|
1941 |
if ($translation ne "") { |
|
1942 |
$ref->{description} = $translation; |
|
1943 |
$ref->{longdescription} = $longdescription; |
|
1944 |
} |
|
1939 |
last; |
|
1945 | 1940 |
} |
1946 | 1941 |
} |
1947 | 1942 |
|
... | ... | |
1964 | 1959 |
} |
1965 | 1960 |
} |
1966 | 1961 |
$sth->finish; |
1962 |
$_->[1]->finish for @translation_queries; |
|
1967 | 1963 |
|
1968 | 1964 |
foreach my $item (@{ $form->{item_list} }) { |
1969 | 1965 |
my $custom_variables = CVar->get_custom_variables(module => 'IC', |
Auch abrufbar als: Unified diff
In Einkaufsbelegen Übersetzungen von Artikeln berücksichtigen
Fix für Bug 1677.