Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
[kivitendo-erp.git] / bin / mozilla / invoice_io.pl
index 42e402e..843a32f 100644 (file)
@@ -205,8 +205,7 @@ sub display_form {
     my $numrows    = ++$form->{rowcount};
     my $subroutine = "display_row";
 
-    if ($form->{item} eq 'part') {
-
+    if ($form->{item} =~ /(part|service)/) {
       #set preisgruppenanzahl
       $numrows    = $form->{price_rows};
       $subroutine = "price_row";
@@ -225,20 +224,15 @@ sub display_form {
       $numrows    = ++$form->{makemodel_rows};
       $subroutine = "makemodel_row";
 
+      # assemblies are built from components, they aren't purchased from a vendor
+      # also the lastcost_$i from makemodel conflicted with the component lastcost_$i 
+      # so we don't need the makemodel rows for assemblies 
       # create makemodel rows
-      &{$subroutine}($numrows);
+      &{$subroutine}($numrows);
 
       $numrows    = ++$form->{assembly_rows};
       $subroutine = "assembly_row";
     }
-    if ($form->{item} eq 'service') {
-      $numrows    = $form->{price_rows};
-      $subroutine = "price_row";
-
-      &{$subroutine}($numrows);
-
-      $numrows = 0;
-    }
 
     # create rows
     &{$subroutine}($numrows) if $numrows;