X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/b989d7cfb4bd8de5c3e290b8df0519ad34d5dd0c..fc35d1dd4441b0dd26fe0b1b397cc66508a715f3:/SL/IC.pm diff --git a/SL/IC.pm b/SL/IC.pm index 810e226fa..27af46a50 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -243,7 +243,7 @@ sub save { map { $form->{$_} = $form->parse_amount($myconfig, $form->{$_}) } qw(rop weight listprice sellprice gv lastcost); - my $makemodel = (($form->{make_1}) || ($form->{model_1})) ? 1 : 0; + my $makemodel = ($form->{make_1} || $form->{model_1} || ($form->{makemodel_rows} > 1)) ? 1 : 0; $form->{assembly} = ($form->{item} eq 'assembly') ? 1 : 0; @@ -419,10 +419,9 @@ sub save { $query = qq|INSERT INTO prices (parts_id, pricegroup_id, price) VALUES(?, ?, ?)|; $sth = prepare_query($form, $dbh, $query); - # insert price records only if different to sellprice for my $i (1 .. $form->{price_rows}) { my $price = $form->parse_amount($myconfig, $form->{"price_$i"}); - next unless $price && ($price != $form->{sellprice}); + next unless $price; @values = (conv_i($form->{id}), conv_i($form->{"pricegroup_id_$i"}), $price); do_statement($form, $sth, $query, @values); @@ -1081,7 +1080,7 @@ SQL $main::lxdebug->leave_sub(); - return wantarray ? @{ $form->{parts} } : $form->{parts}; + return @{ $form->{parts} }; } sub _create_filter_for_priceupdate { @@ -1552,9 +1551,9 @@ sub retrieve_accounts { LEFT JOIN chart c1 ON bg.inventory_accno_id = c1.id LEFT JOIN chart c2 ON tc.income_accno_id = c2.id LEFT JOIN chart c3 ON tc.expense_accno_id = c3.id - WHERE - tc.taxzone_id = '$form->{taxzone_id}' - and + WHERE + tc.taxzone_id = '$form->{taxzone_id}' + and p.id IN ($in) SQL