From: G. Richardson Date: Thu, 23 Jun 2016 09:09:07 +0000 (+0200) Subject: Bugfix #182: Auftrag aus Rechnung erstellen X-Git-Tag: release-3.4.1~25 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c2688215ecb6f1122edd0d436081dd8dc966fdb9;p=kivitendo-erp.git Bugfix #182: Auftrag aus Rechnung erstellen Ticket #182 behoben, + Kommentare. --- diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 5da2dbe59..01ae32960 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -889,6 +889,21 @@ sub order { $form->{old_salesman_id} = $form->{salesman_id}; delete $form->{$_} foreach (qw(printed emailed queued)); + + # When creating a new sales order from a saved sales invoice, reset id, + # ordnumber, transdate and deliverydate as we are creating a new order. This + # workflow is probably mainly used as a template mechanism for creating new + # orders from existing invoices, so we probably don't want to link the items. + # Is this order function called anywhere else? + # The worksflows in oe already call sales_order and purchase_order in oe, not + # this general function which now only seems to be called from saved sales + # invoices + # Why is ordnumber set to invnumber above, does this ever make sense? + + if ( $form->{script} eq 'is.pl' && $form->{type} eq 'invoice' ) { + delete $form->{$_} foreach (qw(ordnumber id transdate deliverydate)); + }; + my $buysell; if ($form->{script} eq 'ir.pl' || $form->{type} eq 'request_quotation') { $form->{title} = $locale->text('Add Purchase Order');