X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/6b23fb212fb1cee6e1034601d3ceb22a182e50f0..7cd6d451d97d1f1e7f3c0f9db2de03735dc8c8f0:/SL/DO.pm diff --git a/SL/DO.pm b/SL/DO.pm index 4ba482850..b51fc0f1b 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -25,7 +25,8 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. #====================================================================== # # Delivery Order entry module @@ -745,15 +746,14 @@ sub retrieve { $sth = prepare_execute_query($form, $dbh, $query, $form->{id}); $ref = $sth->fetchrow_hashref("NAME_lc"); - delete $ref->{id}; - map { $form->{$_} = $ref->{$_} } keys %$ref; + $form->{$_} = $ref->{$_} for grep { m{^shipto(?!_id$)} } keys %$ref; $sth->finish(); - if ($form->{shipto_id}) { + if ($ref->{shipto_id}) { my $cvars = CVar->get_custom_variables( dbh => $dbh, module => 'ShipTo', - trans_id => $form->{shipto_id}, + trans_id => $ref->{shipto_id}, ); $form->{"shiptocvar_$_->{name}"} = $_->{value} for @{ $cvars }; } @@ -779,7 +779,7 @@ sub retrieve { # stuff different from the whole will not be overwritten, but saved with a suffix. $query = qq|SELECT doi.id AS delivery_order_items_id, - p.partnumber, p.assembly, p.listprice, doi.description, doi.qty, + p.partnumber, p.part_type, p.listprice, doi.description, doi.qty, doi.sellprice, doi.parts_id AS id, doi.unit, doi.discount, p.notes AS partnotes, doi.reqdate, doi.project_id, doi.serialnumber, doi.lastcost, doi.ordnumber, doi.transdate, doi.cusordnumber, doi.longdescription, @@ -1302,7 +1302,7 @@ sub get_shipped_qty { my @dolinks = RecordLinks->get_links('dbh' => $dbh, 'from_table' => 'oe', 'to_table' => 'delivery_orders', - 'from_id' => @oe_ids); + 'from_id' => \@oe_ids); my @do_ids = map { $_->{to_id} } @dolinks ; if (scalar (@do_ids) == 0) {