From 822b71c22ca6dbe4fe024babaf6a8f0be8d3c4e9 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Thu, 26 Jul 2012 20:27:18 +0200 Subject: [PATCH] =?utf8?q?Erzeugnis:=20lastcost-Konflikt=20f=C3=BCr=20make?= =?utf8?q?model=20und=20Komponenten?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sowohl die EK-Preise der Erzeugnis-Komponenten als auch die EK-Preise der makemodel-Versionen werden in $form->{lastcost_$i} gespeichert und überlagern sich damit. Und da diese auch noch im Hintergrund unterschiedlich formatiert/geparsed werden kam es bei den Erzeugnis-EK-Preisen nach dem Erneuern zu Formatierungsfehlern. Da Erzeugnisse aber produziert und nicht eingekauft werden ist hier auch kein makemodel nötig, so daß es für Erzeugnisse entfernt wurde. --- bin/mozilla/ic.pl | 7 +++++-- bin/mozilla/invoice_io.pl | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 249c99ea0..0eb7995b2 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1752,8 +1752,11 @@ sub update { # parse pricegroups. and no, don't rely on check_form for this... map { $form->{"price_$_"} = $form->parse_amount(\%myconfig, $form->{"price_$_"}) } 1 .. $form->{price_rows}; - # same for lastcosts - map { $form->{"lastcost_$_"} = $form->parse_amount(\%myconfig, $form->{"lastcost_$_"}) } 1 .. $form->{"makemodel_rows"}; + # same for makemodel lastcosts + # but parse_amount not necessary for assembly component lastcosts + unless ($form->{item} eq "assembly") { + map { $form->{"lastcost_$_"} = $form->parse_amount(\%myconfig, $form->{"lastcost_$_"}) } 1 .. $form->{"makemodel_rows"}; + }; if ($form->{item} eq "assembly") { my $i = $form->{assembly_rows}; diff --git a/bin/mozilla/invoice_io.pl b/bin/mozilla/invoice_io.pl index 5f6c1414e..843a32f68 100644 --- a/bin/mozilla/invoice_io.pl +++ b/bin/mozilla/invoice_io.pl @@ -224,8 +224,11 @@ 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"; -- 2.20.1