X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/00738f6f4e43355ae9e70cd5350d7c75c1533f5f..94e11003809e9090514026a733e58e72e636a6bb:/SL/OE.pm diff --git a/SL/OE.pm b/SL/OE.pm index e279e4a65..3dd83b768 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -465,6 +465,16 @@ sub save { # save printed, emailed, queued $form->save_status($dbh); + # Link this record to the records it was created from. + RecordLinks->create_links('dbh' => $dbh, + 'mode' => 'ids', + 'from_table' => 'oe', + 'from_ids' => $form->{convert_from_oe_ids}, + 'to_table' => 'oe', + 'to_id' => $form->{id}, + ); + delete $form->{convert_from_oe_ids}; + if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) { if ($form->{vc} eq 'customer') { $form->update_exchangerate($dbh, $form->{currency}, $form->{transdate}, $form->{exchangerate}, 0); @@ -600,6 +610,10 @@ sub retrieve { if ($form->{"multi_id_$_"} and $form->{"trans_id_$_"}) } (1 .. $form->{"rowcount"}); + if ($form->{rowcount} && scalar @ids) { + $form->{convert_from_oe_ids} = join ' ', @ids; + } + # if called in multi id mode, and still only got one id, switch back to single id if ($form->{"rowcount"} and $#ids == 0) { $form->{"id"} = $ids[0];