From: Sven Schöling Date: Thu, 1 Mar 2012 11:57:22 +0000 (+0100) Subject: Dienstleistungen: makemodels auch speichern X-Git-Tag: release-2.7.0~5 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f0d897b6b9ffbbfe98c0dbc1638ef30c9b798729;p=kivitendo-erp.git Dienstleistungen: makemodels auch speichern Nachtrag zu c6a4a05a9ad2ae02, Dienstleistungen müssen auch korrekt gespeichert und geladen werden. Fix zu Bug 1829 --- diff --git a/SL/IC.pm b/SL/IC.pm index 47c5fea41..79d661837 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -164,28 +164,25 @@ sub get_part { #correct rows $form->{price_rows} = $i - 1; - unless ($form->{item} eq 'service') { - - # get makes - if ($form->{makemodel}) { - #hli - $query = qq|SELECT m.make, m.model,m.lastcost,m.lastcost,m.lastupdate,m.sortorder FROM makemodel m | . - qq|WHERE m.parts_id = ? order by m.sortorder asc|; - my @values = ($form->{id}); - $sth = $dbh->prepare($query); - $sth->execute(@values) || $form->dberror("$query (" . join(', ', @values) . ")"); - - my $i = 1; - - while (($form->{"make_$i"}, $form->{"model_$i"}, $form->{"old_lastcost_$i"}, - $form->{"lastcost_$i"}, $form->{"lastupdate_$i"}, $form->{"sortorder_$i"}) = $sth->fetchrow_array) - { - $i++; - } - $sth->finish; - $form->{makemodel_rows} = $i - 1; - + # get makes + if ($form->{makemodel}) { + #hli + $query = qq|SELECT m.make, m.model,m.lastcost,m.lastcost,m.lastupdate,m.sortorder FROM makemodel m | . + qq|WHERE m.parts_id = ? order by m.sortorder asc|; + my @values = ($form->{id}); + $sth = $dbh->prepare($query); + $sth->execute(@values) || $form->dberror("$query (" . join(', ', @values) . ")"); + + my $i = 1; + + while (($form->{"make_$i"}, $form->{"model_$i"}, $form->{"old_lastcost_$i"}, + $form->{"lastcost_$i"}, $form->{"lastupdate_$i"}, $form->{"sortorder_$i"}) = $sth->fetchrow_array) + { + $i++; } + $sth->finish; + $form->{makemodel_rows} = $i - 1; + } # get translations @@ -330,10 +327,8 @@ sub save { } $sth->finish; - if ($form->{item} ne 'service') { - # delete makemodel records - do_query($form, $dbh, qq|DELETE FROM makemodel WHERE parts_id = ?|, conv_i($form->{id})); - } + # delete makemodel records + do_query($form, $dbh, qq|DELETE FROM makemodel WHERE parts_id = ?|, conv_i($form->{id})); if ($form->{item} eq 'assembly') { # delete assembly records