Revision e0bac67f
Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt
SL/DO.pm | ||
---|---|---|
268 | 268 |
|
269 | 269 |
my $sth = prepare_query($form, $dbh, $query); |
270 | 270 |
|
271 |
|
|
272 |
my ($items_query, $items_sth); |
|
273 |
if ($form->{l_items}) { |
|
274 |
$items_query = |
|
275 |
qq|SELECT id |
|
276 |
FROM delivery_order_items |
|
277 |
WHERE delivery_order_id = ? |
|
278 |
ORDER BY position|; |
|
279 |
|
|
280 |
$items_sth = prepare_query($form, $dbh, $items_query); |
|
281 |
} |
|
282 |
|
|
271 | 283 |
foreach my $dord (@{ $form->{DO} }) { |
284 |
if ($form->{l_items}) { |
|
285 |
do_statement($form, $items_sth, $items_query, $dord->{id}); |
|
286 |
$dord->{item_ids} = $dbh->selectcol_arrayref($items_sth); |
|
287 |
} |
|
288 |
|
|
272 | 289 |
next unless ($dord->{ordnumber}); |
273 | 290 |
do_statement($form, $sth, $query, $dord->{ordnumber}); |
274 | 291 |
($dord->{oe_id}) = $sth->fetchrow_array(); |
275 | 292 |
} |
276 | 293 |
|
277 | 294 |
$sth->finish(); |
295 |
$items_sth->finish() if $form->{l_items}; |
|
278 | 296 |
} |
279 | 297 |
|
280 | 298 |
$main::lxdebug->leave_sub(); |
Auch abrufbar als: Unified diff
Belegberichte (Lieferscheine) mit Positionsdetails