From: Jan Büren Date: Fri, 23 Jan 2015 07:53:11 +0000 (+0100) Subject: Positionen verknüpfen Auftrag -> Lieferschein X-Git-Tag: release-3.2.0beta~46 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0b6157e266cfcee02eb7c8a127b1e502081aa119;p=kivitendo-erp.git Positionen verknüpfen Auftrag -> Lieferschein - from_table -> to_table (tabelleneintrag) i.O. - delete trigger i.O. - mittlere position löschen (vor speichern) i.O. - update sicher in form i.O. - mehrfach speichern i.O. --- diff --git a/SL/DO.pm b/SL/DO.pm index 8fad24ce0..5309c15a5 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -403,6 +403,17 @@ SQL name_prefix => 'ic_', name_postfix => "_$i", dbh => $dbh); + # link order items with doi + if ($form->{"converted_from_order_orderitems_id_$i"}) { + RecordLinks->create_links('dbh' => $dbh, + 'mode' => 'ids', + 'from_table' => 'orderitems', + 'from_ids' => $form->{"converted_from_order_orderitems_id_$i"}, + 'to_table' => 'delivery_order_items', + 'to_id' => $form->{"delivery_order_items_id_$i"}, + ); + delete $form->{"converted_from_order_orderitems_id_$i"}; + } } # 1. search for orphaned dois; processed_dois may be empty (no transfer) TODO: be supersafe and alter same statement for doi and oi diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 9a1da4a39..09eb52af7 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1893,11 +1893,11 @@ sub delivery_order { # reset delete @{$form}{qw(id subject message cc bcc printed emailed queued creditlimit creditremaining discount tradediscount oldinvtotal closed delivered)}; - delete $form->{"orderitems_id_$_"} for 1 .. $form->{"rowcount"}; for my $i (1 .. $form->{rowcount}) { map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if ($form->{"${_}_${i}"}) } qw(ship qty sellprice listprice lastcost basefactor discount); - $form->{"converted_from_order_orderitems_id_$_"} = $form->{"orderitems_id_$_"} for 1 .. $form->{"rowcount"}; + $form->{"converted_from_order_orderitems_id_$i"} = $form->{"orderitems_id_$i"}; + delete $form->{"orderitems_id_$i"}; # even if they don't exist in form. cvars checks them before display_row } my %old_values = map { $_ => $form->{$_} } qw(customer_id oldcustomer customer vendor_id oldvendor vendor shipto_id);