X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=21bf15f74e970b23c12c588eec21b07cea2da448;hb=c18a652e2cd4409fce9c8383a9fbcc0e31e6a83f;hp=7ff850039eea8e1a4aa282c4a09ca1e1cf380688;hpb=98056ff901abcbbbcf3f0499c3149056628631e8;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index 7ff850039..21bf15f74 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -57,6 +57,7 @@ use SL::DB::Tax; use SL::DB::TaxZone; use SL::TransNumber; use SL::DB; +use SL::Presenter::Part qw(type_abbreviation classification_abbreviation); use Data::Dumper; use strict; @@ -434,7 +435,7 @@ sub invoice_details { } my $tax_rate = $taxrate * 100; push(@{ $form->{TEMPLATE_ARRAYS}->{tax_rate} }, qq|$tax_rate|); - if ($form->{"assembly_$i"}) { + if ($form->{"part_type_$i"} eq 'assembly') { $sameitem = ""; # get parts and push them onto the stack @@ -865,9 +866,9 @@ sub _post_invoice { next if $payments_only; - if ($form->{"inventory_accno_$i"} || $form->{"assembly_$i"}) { + if ($form->{"inventory_accno_$i"} || $form->{"part_type_$i"} eq 'assembly') { - if ($form->{"assembly_$i"}) { + if ($form->{"part_type_$i"} eq 'assembly') { # record assembly item as allocated &process_assembly($dbh, $myconfig, $form, $position, $form->{"id_$i"}, $baseqty); @@ -2157,7 +2158,7 @@ sub get_customer { $ref = selectfirst_hashref_query($form, $dbh, $query, @values); delete $ref->{salesman_id} if !$ref->{salesman_id}; - delete $ref->{payment_id} if $form->{payment_id}; + delete $ref->{payment_id} if !$ref->{payment_id}; map { $form->{$_} = $ref->{$_} } keys %$ref; @@ -2353,8 +2354,8 @@ sub retrieve_item { push @{ $ref->{matches} ||= [] }, $::locale->text('EAN') . ': ' . $ref->{ean}; } - $ref->{type_and_classific} = $::request->presenter->type_abbreviation($ref->{part_type}). - $::request->presenter->classification_abbreviation($ref->{classification_id}); + $ref->{type_and_classific} = type_abbreviation($ref->{part_type}) . + classification_abbreviation($ref->{classification_id}); if (! $ref->{used_for_sale} ) { $has_wrong_pclass = PCLASS_NOTFORSALE ; next; @@ -2436,7 +2437,6 @@ sub retrieve_item { } $ref->{onhand} *= 1; - push @{ $form->{item_list} }, $ref; } $sth->finish;