From 82574e78712d71f2012bf6257b2740e2732f66cf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Wed, 6 May 2009 09:40:26 +0000 Subject: [PATCH] Korrektur fuer Bug 817 Rabatte die beim Kunden hinterlegt sind, werden jetzt bei jeder neuen Position automatisch gesetzt in der Angebots/Auftrags-Maske sowie in der Rechnungsmaske (so war dies sicherlich irgendwann mal fruehr SQL-Ledger vor dem fork ...;-)). - Beim Kundenwechsel wird der vorher gesetzte Rabatt nicht ueberschrieben. Ferner heisst die Variable jetzt customer_discount, da discount ueberall und fuer alles verwendet wurde --- SL/IS.pm | 2 +- bin/mozilla/is.pl | 3 ++- bin/mozilla/oe.pl | 9 ++++++--- templates/webpages/oe/form_footer_de.html | 1 + templates/webpages/oe/form_footer_master.html | 1 + 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/SL/IS.pm b/SL/IS.pm index 819259109..73bae3667 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1572,7 +1572,7 @@ sub get_customer { # get customer $query = qq|SELECT - c.id AS customer_id, c.name AS customer, c.discount, c.creditlimit, c.terms, + c.id AS customer_id, c.name AS customer, c.discount as customer_discount, c.creditlimit, c.terms, c.email, c.cc, c.bcc, c.language_id, c.payment_id, c.street, c.zipcode, c.city, c.country, c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index f9fbca6a4..d2f27c925 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -1202,6 +1202,7 @@ if ($form->{type} eq "credit_note") { $cgi->hidden("-name" => "callback", "-value" => $form->{callback}) . $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}]) . $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}]) +. $cgi->hidden('-name' => 'customer_discount', '-value' => [$form->{customer_discount}]) . qq| @@ -1267,7 +1268,7 @@ sub update { $rows = scalar @{ $form->{item_list} }; - $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{discount} * 100); + $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{customer_discount} * 100); if ($rows) { $form->{"qty_$i"} = ($form->{"qty_$i"} * 1) ? $form->{"qty_$i"} : 1; diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 196960825..c14cc85ab 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -41,6 +41,7 @@ use SL::IS; use SL::PE; use SL::ReportGenerator; use List::Util qw(max reduce sum); +use Data::Dumper; require "bin/mozilla/io.pl"; require "bin/mozilla/arap.pl"; @@ -465,6 +466,8 @@ sub update { check_oe_access(); +# $main::lxdebug->message(0, Dumper($form)); + set_headings($form->{"id"} ? "edit" : "add"); map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate) unless $recursive_call; @@ -491,8 +494,8 @@ sub update { && ($form->{"partsgroup_$i"} eq "")) { $form->{creditremaining} += ($form->{oldinvtotal} - $form->{oldtotalpaid}); - &check_form; + &check_form; } else { if ($form->{type} =~ /^sales/) { @@ -502,8 +505,8 @@ sub update { } my $rows = scalar @{ $form->{item_list} }; - - $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{discount} * 100); + # hier ist das problem fuer bug 817 $form->{discount} wird nicht durchgeschliffen + $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{customer_discount} * 100); if ($rows) { $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"}); diff --git a/templates/webpages/oe/form_footer_de.html b/templates/webpages/oe/form_footer_de.html index 2faa2b300..4891bfde0 100644 --- a/templates/webpages/oe/form_footer_de.html +++ b/templates/webpages/oe/form_footer_de.html @@ -158,6 +158,7 @@ + diff --git a/templates/webpages/oe/form_footer_master.html b/templates/webpages/oe/form_footer_master.html index 99127f51f..f21b3fd02 100644 --- a/templates/webpages/oe/form_footer_master.html +++ b/templates/webpages/oe/form_footer_master.html @@ -158,6 +158,7 @@ + -- 2.20.1