From: Bernd Bleßmann Date: Mon, 7 Dec 2015 11:45:38 +0000 (+0100) Subject: FlattenToForm: item_ids berücksichtigen. X-Git-Tag: release-3.4.1~554 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=995e58424f9ed6d45ce5cd03ec8120f98c06df1e;p=kivitendo-erp.git FlattenToForm: item_ids berücksichtigen. --- diff --git a/SL/DB/Helper/FlattenToForm.pm b/SL/DB/Helper/FlattenToForm.pm index 6a0bdc232..8beccf22e 100644 --- a/SL/DB/Helper/FlattenToForm.pm +++ b/SL/DB/Helper/FlattenToForm.pm @@ -49,6 +49,11 @@ sub flatten_to_form { $form->{department} = $self->department->description if _has($self, 'department_id'); $form->{rowcount} = scalar(@{ $self->items }); + my $items_name = ref($self) eq 'SL::DB::Order' ? 'orderitems' + : ref($self) eq 'SL::DB::DeliveryOrder' ? 'delivery_order_items' + : ref($self) eq 'SL::DB::Invoice' ? 'invoice' + : ''; + my $idx = 0; my $format_amounts = $params{format_amounts} ? 1 : 0; my $format_notnull = $params{format_amounts} ? 2 : 0; @@ -60,6 +65,7 @@ sub flatten_to_form { $idx++; $form->{"partsgroup_${idx}"} = $item->part->partsgroup->partsgroup if _has($item->part, 'partsgroup_id'); + _copy($item, $form, "${items_name}_", "_${idx}", 0, qw(id)) if $items_name; _copy($item->part, $form, '', "_${idx}", 0, qw(id partnumber weight)); _copy($item->part, $form, '', "_${idx}", 0, qw(listprice)); _copy($item, $form, '', "_${idx}", 0, qw(description project_id ship serialnumber pricegroup_id ordnumber donumber cusordnumber unit