From 2b88ba777cb754d5576107db85e7301020e51724 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Fri, 5 Mar 2010 15:26:29 +0100 Subject: [PATCH] =?utf8?q?Endlich=20der=20Bugfix=20f=C3=BCr=201284.=20Kund?= =?utf8?q?enrabatt=20wird=20nicht=20aus=20dem=20Lieferschein=20=C3=BCberno?= =?utf8?q?mmen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DO.pm | 4 ++-- bin/mozilla/do.pl | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/SL/DO.pm b/SL/DO.pm index 73314bc2e..b5faeae8a 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -280,7 +280,7 @@ sub save { $form->{"lastcost_$i"} *= 1; # set values to 0 if nothing entered - $form->{"discount_$i"} = $form->parse_amount($myconfig, $form->{"discount_$i"}) / 100; + $form->{"discount_$i"} = $form->parse_amount($myconfig, $form->{"discount_$i"}); $form->{"sellprice_$i"} = $form->parse_amount($myconfig, $form->{"sellprice_$i"}); $price_factor = $price_factors{ $form->{"price_factor_id_$i"} } || 1; @@ -295,7 +295,7 @@ sub save { @values = (conv_i($item_id), conv_i($form->{id}), conv_i($form->{"id_$i"}), $form->{"description_$i"}, $form->{"longdescription_$i"}, $form->{"qty_$i"}, $baseqty, - $form->{"sellprice_$i"}, $form->{"discount_$i"}, + $form->{"sellprice_$i"}, $form->{"discount_$i"} / 100, $form->{"unit_$i"}, conv_date($reqdate), conv_i($form->{"project_id_$i"}), $form->{"serialnumber_$i"}, $form->{"ordnumber_$i"}, conv_date($form->{"transdate_$i"}), diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 692a4595a..9fa2b9096 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -183,6 +183,8 @@ sub order_links { IR->get_vendor(\%myconfig, \%$form); } else { IS->get_customer(\%myconfig, \%$form); + # OFFEN tritt bug 1284 auch bei vendor auf? + $form->{discount} = $form->{customer_discount}; } $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id)); @@ -628,14 +630,9 @@ sub save { # wird die Maske mit dem falschen Rabatt wieder aufgebaut. # Wie immer: backup_vars verwenden um nichts anderes kaputt zu # machen. jan 03.03.2010 - for my $i (1 .. $form->{rowcount}) { - $form->{"backup_discount_$i"} = $form->{"discount_$i"}; - }; + # nicht mehr notwendig da für bug 1284 der backend aufruf entsprechend + # geändert wurde DO->save(); - for my $i (1 .. $form->{rowcount}) { - $form->{"discount_$i"} = $form->{"backup_discount_$i"}; - delete $form->{"backup_discount_$i"}; - }; # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|donumber_| . $form->{donumber}; @@ -734,6 +731,11 @@ sub invoice { } for my $i (1 .. $form->{rowcount}) { + # für bug 1284 + if ($form->{discount}){ # Falls wir einen Kundenrabatt haben + # und keinen anderen discount wert an $i ... + $form->{"discount_$i"} ||= $form->{discount}*100; # ... nehmen wir den kundenrabatt + } map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice listprice basefactor); } -- 2.20.1