Revision b8125c17
Von Bernd Bleßmann vor fast 10 Jahren hinzugefügt
SL/IR.pm | ||
---|---|---|
373 | 373 |
dbh => $dbh, |
374 | 374 |
row => $i, |
375 | 375 |
sub_module => 'invoice', |
376 |
may_converted_from => ['delivery_order_items', 'orderitems']); |
|
376 |
may_converted_from => ['delivery_order_items', 'orderitems', 'invoice']);
|
|
377 | 377 |
|
378 | 378 |
if (!$form->{"invoice_id_$i"}) { |
379 | 379 |
# there is no persistent id, therefore create one with all necessary constraints |
... | ... | |
416 | 416 |
name_prefix => 'ic_', |
417 | 417 |
name_postfix => "_$i", |
418 | 418 |
dbh => $dbh); |
419 |
|
|
419 | 420 |
# link previous items with invoice items See IS.pm (no credit note -> no invoice item) |
420 | 421 |
foreach (qw(delivery_order_items orderitems)) { |
421 |
if ($form->{"converted_from_${_}_id_$i"}) { |
|
422 |
if (!$form->{useasnew} && $form->{"converted_from_${_}_id_$i"}) {
|
|
422 | 423 |
RecordLinks->create_links('dbh' => $dbh, |
423 | 424 |
'mode' => 'ids', |
424 | 425 |
'from_table' => $_, |
... | ... | |
426 | 427 |
'to_table' => 'invoice', |
427 | 428 |
'to_id' => $form->{"invoice_id_$i"}, |
428 | 429 |
); |
429 |
delete $form->{"converted_from_${_}_id_$i"}; |
|
430 | 430 |
} |
431 |
delete $form->{"converted_from_${_}_id_$i"}; |
|
431 | 432 |
} |
432 | 433 |
} |
433 | 434 |
|
Auch abrufbar als: Unified diff
Nicht-editierbare CVars bei "als neu speichern/verwenden" richtig setzen.