From: Jan Büren Date: Thu, 9 Jun 2016 13:00:45 +0000 (+0200) Subject: Revert "Ticket 29 Verknüpfte Belege -> keine Verknüpfung von Rechnung nach Auftrag" X-Git-Tag: release-3.4.1~82 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f3a02fb642b3320d29955474c733cc953e557293;p=kivitendo-erp.git Revert "Ticket 29 Verknüpfte Belege -> keine Verknüpfung von Rechnung nach Auftrag" This reverts commit 77350196300e930abc7de0df7dbf42e8cd6193b8. Conflicts: SL/OE.pm --- diff --git a/SL/OE.pm b/SL/OE.pm index 2e28f71e4..3666f7d90 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -758,28 +758,21 @@ SQL $form->save_status($dbh); # Link this record to the records it was created from. - # check every record type we may link. i am not happy with converting the string to array back - # should be a array from the start (OE.pm -> retrieve). - # and that i need the local array ref for close_quotation_rfqs. better ideas welcome $form->{convert_from_oe_ids} =~ s/^\s+//; $form->{convert_from_oe_ids} =~ s/\s+$//; my @convert_from_oe_ids = split m/\s+/, $form->{convert_from_oe_ids}; delete $form->{convert_from_oe_ids}; - @{ $form->{convert_from_oe_ids} } = @convert_from_oe_ids; - foreach (qw(ar oe)) { - if (!$form->{useasnew} && $form->{"convert_from_${_}_ids"}) { - RecordLinks->create_links('dbh' => $dbh, - 'mode' => 'ids', - 'from_table' => $_, - 'from_ids' => $form->{"convert_from_${_}_ids"}, - 'to_table' => 'oe', - 'to_id' => $form->{id}, - ); - delete $form->{"convert_from_${_}_ids"}; - } + if (scalar @convert_from_oe_ids) { + RecordLinks->create_links('dbh' => $dbh, + 'mode' => 'ids', + 'from_table' => 'oe', + 'from_ids' => \@convert_from_oe_ids, + 'to_table' => 'oe', + 'to_id' => $form->{id}, + ); $self->_close_quotations_rfqs('dbh' => $dbh, 'from_id' => \@convert_from_oe_ids, - 'to_id' => $form->{id}) if $_ eq 'oe'; + 'to_id' => $form->{id}); } if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) { @@ -927,7 +920,7 @@ sub retrieve { # 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]; + $form->{"id"} = $ids[0]; undef @ids; delete $form->{convert_from_oe_ids}; } diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index d8f53dbc8..cf1428916 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -888,10 +888,7 @@ sub order { $form->{old_employee_id} = $form->{employee_id}; $form->{old_salesman_id} = $form->{salesman_id}; - # link doc invoice -> quotation (single id no multi mode) - $form->{convert_from_ar_ids} = delete $form->{id}; - - delete $form->{$_} foreach (qw(printed emailed queued)); + map { delete $form->{$_} } qw(id printed emailed queued); my $buysell; if ($form->{script} eq 'ir.pl' || $form->{type} eq 'request_quotation') { $form->{title} = $locale->text('Add Purchase Order'); @@ -954,13 +951,10 @@ sub quotation { if ($form->{type} =~ /(sales|purchase)_order/) { $form->{"converted_from_orderitems_id_$_"} = delete $form->{"orderitems_id_$_"} for 1 .. $form->{"rowcount"}; } - # link doc order -> quotation (single id no multi mode) - $form->{convert_from_oe_ids} = delete $form->{id}; - if ($form->{second_run}) { $form->{print_and_post} = 0; } - delete $form->{$_} foreach (qw(printed emailed queued)); + map { delete $form->{$_} } qw(id printed emailed queued); my $buysell; if ($form->{script} eq 'ir.pl' || $form->{type} eq 'purchase_order') { diff --git a/templates/webpages/oe/form_header.html b/templates/webpages/oe/form_header.html index 6a88139e0..a64a87da4 100644 --- a/templates/webpages/oe/form_header.html +++ b/templates/webpages/oe/form_header.html @@ -19,7 +19,6 @@ [%- END %] -