flatten_to_form: auch Listenpreis und Warengruppe berücksichtigen.
[kivitendo-erp.git] / SL / DB / Helper / FlattenToForm.pm
index d593d69..5a6751b 100644 (file)
@@ -29,8 +29,9 @@ sub flatten_to_form {
 
   $form->{vc} = $vc if ref($self) =~ /^SL::DB::.*Invoice/;
 
-  my @vc_fields          = (qw(account_number bank bank_code bic business city contact country creditlimit discount
-                               email fax homepage iban language name payment_terms phone street taxnumber zipcode),
+  my @vc_fields          = (qw(account_number bank bank_code bic business city contact country creditlimit
+                               department_1 department_2 discount email fax homepage iban language name
+                               payment_terms phone street taxnumber ustid zipcode),
                             "${vc}number",
                             ($vc eq 'customer')? 'c_vendor_id': 'v_customer_id');
   my @vc_prefixed_fields = qw(email fax notes number phone);
@@ -61,6 +62,8 @@ sub flatten_to_form {
     $form->{"id_${idx}"}         = $item->parts_id;
     $form->{"partnumber_${idx}"} = $item->part->partnumber;
     $form->{"weight_${idx}"}     = $item->part->weight;
+    $form->{"partsgroup_${idx}"} = $item->part->partsgroup->partsgroup if _has($item->part, 'partsgroup_id');
+    _copy($item->part,    $form, '',        "_${idx}", $format_amounts, qw(listprice));
     _copy($item,          $form, '',        "_${idx}", 0,               qw(description project_id ship serialnumber pricegroup_id ordnumber cusordnumber unit
                                                                            subtotal longdescription price_factor_id marge_price_factor approved_sellprice reqdate transdate));
     _copy($item,          $form, '',        "_${idx}", $format_amounts, qw(qty sellprice marge_total marge_percent lastcost));