From debf6f14125467bae667bebb2584745bf1a7e718 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 9 May 2007 07:29:14 +0000 Subject: [PATCH] =?utf8?q?Beim=20Speichern=20einfach=20in=20allen=20Einhei?= =?utf8?q?ten=20nach=20der=20ausgew=C3=A4hlten=20Einheit=20suchen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/IR.pm | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/SL/IR.pm b/SL/IR.pm index 81c5fe75e..8bc228b64 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -54,8 +54,7 @@ sub post_invoice { my $taxdiff; my $item; - my $service_units = AM->retrieve_units($myconfig,$form,"service"); - my $part_units = AM->retrieve_units($myconfig,$form,"dimension"); + my $all_units = AM->retrieve_units($myconfig, $form); if ($form->{id}) { @@ -124,21 +123,14 @@ sub post_invoice { my ($item_unit) = $sth->fetchrow_array(); $sth->finish; - if ($form->{"inventory_accno_$i"}) { - if (defined($part_units->{$item_unit}->{factor}) && $part_units->{$item_unit}->{factor} ne '' && $part_units->{$item_unit}->{factor} ne '0') { - $basefactor = $part_units->{$form->{"unit_$i"}}->{factor} / $part_units->{$item_unit}->{factor}; - } else { - $basefactor = 1; - } - $baseqty = $form->{"qty_$i"} * $basefactor; + if (defined($all_units->{$item_unit}->{factor}) + && ($all_units->{$item_unit}->{factor} ne '') + && ($all_units->{$item_unit}->{factor} * 1 != 0)) { + $basefactor = $all_units->{$form->{"unit_$i"}}->{factor} / $all_units->{$item_unit}->{factor}; } else { - if (defined($service_units->{$item_unit}->{factor}) && $service_units->{$item_unit}->{factor} ne '' && $service_units->{$item_unit}->{factor} ne '0') { - $basefactor = $service_units->{$form->{"unit_$i"}}->{factor} / $service_units->{$item_unit}->{factor}; - } else { - $basefactor = 1; - } - $baseqty = $form->{"qty_$i"} * $basefactor; + $basefactor = 1; } + $baseqty = $form->{"qty_$i"} * $basefactor; map { $form->{"${_}_$i"} =~ s/\'/\'\'/g } qw(partnumber description unit); -- 2.20.1