Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 165a97b3

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID 165a97b3d1d6190ae2a89a853bb62b58bf698308
  • Vorgänger cb253140
  • Nachfolger 461b6311

In Einkaufsbelegen Übersetzungen von Artikeln berücksichtigen

Fix für Bug 1677.

Unterschiede anzeigen:

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',

Auch abrufbar als: Unified diff