Korrektur fuer Bug 817 Rabatte die beim Kunden hinterlegt sind, werden jetzt bei...
authorJan Büren <information@richardson-bueren.de>
Wed, 6 May 2009 09:40:26 +0000 (09:40 +0000)
committerJan Büren <information@richardson-bueren.de>
Wed, 6 May 2009 09:40:26 +0000 (09:40 +0000)
SL/IS.pm
bin/mozilla/is.pl
bin/mozilla/oe.pl
templates/webpages/oe/form_footer_de.html
templates/webpages/oe/form_footer_master.html

index 8192591..73bae36 100644 (file)
--- 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,
index f9fbca6..d2f27c9 100644 (file)
@@ -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|
 </form>
 
@@ -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;
index 1969608..c14cc85 100644 (file)
@@ -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"});
index 2faa2b3..4891bfd 100644 (file)
 
 <input type="hidden" name="saved_xyznumber" value="[% HTML.escape(saved_xyznumber) %]">
 <input type="hidden" name="rowcount" value="[% HTML.escape(rowcount) %]">
+<input type="hidden" name="customer_discount" value="[% HTML.escape(customer_discount) %]">
 <input type="hidden" name="callback" value="[% callback %]">
 
 </form>
index 99127f5..f21b3fd 100644 (file)
 
 <input type="hidden" name="saved_xyznumber" value="[% HTML.escape(saved_xyznumber) %]">
 <input type="hidden" name="rowcount" value="[% HTML.escape(rowcount) %]">
+<input type="hidden" name="customer_discount" value="[% HTML.escape(customer_discount) %]">
 <input type="hidden" name="callback" value="[% callback %]">
 
 </form>