Merge branch 'master' of ssh://git-mbunkus@lx-office.linet-services.de/~/lx-office-erp
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 3 Mar 2010 16:11:55 +0000 (17:11 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 3 Mar 2010 16:11:55 +0000 (17:11 +0100)
SL/Form.pm
bin/mozilla/amtemplates.pl
bin/mozilla/do.pl
bin/mozilla/rp.pl
doc/changelog

index 7e5a443..e020724 100644 (file)
@@ -2973,7 +2973,9 @@ sub lastname_used {
 sub current_date {
   $main::lxdebug->enter_sub();
 
-  my ($self, $myconfig, $thisdate, $days) = @_;
+  my $self              = shift;
+  my $myconfig          = shift  || \%::myconfig;
+  my ($thisdate, $days) = @_;
 
   my $dbh = $self->get_standard_dbh($myconfig);
   my $query;
index 839fbf2..63f20d4 100644 (file)
@@ -135,7 +135,7 @@ sub display_template_form {
 
     my %formname_setup =
       (
-        "balance_sheet" => { "translation" => $locale->text('Balance Sheet'), "html" => 1 },
+#        "balance_sheet" => { "translation" => $locale->text('Balance Sheet'), "html" => 1 },
         "bin_list" => $locale->text('Bin List'),
         "bwa" => { "translation" => $locale->text('BWA'), "html" => 1 },
         "check" => { "translation" => $locale->text('Check'), "html" => 1 },
index 45adf18..1c546e4 100644 (file)
@@ -619,9 +619,23 @@ sub save {
   }
 
   $form->{id} = 0 if $form->{saveasnew};
-
+  # best case fix für bug 1079. Einkaufsrabatt wird nicht richtig
+  # aus Lieferantenauftrag -> Lieferschein -> Rechnung übernommen
+  # Tritt nur auf, wenn man direkt über Lieferschein -> speichern ->
+  # Workflow Rechnung geht (beim Aufruf über edit() i.O.)
+  # Gut. DO-save() speichert den Discount im DB-Format 0.12 für
+  # 12%, die Konvertierung wird leider in $form gemacht und daher
+  # 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"};
+  };
   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};
index 45bbb4d..f618c5b 100644 (file)
@@ -1112,46 +1112,40 @@ sub generate_income_statement {
 }
 
 sub generate_balance_sheet {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('report');
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-  my $locale   = $main::locale;
+  $::lxdebug->enter_sub;
+  $::auth->assert('report');
 
-  $form->{decimalplaces} = $form->{decimalplaces} * 1 || 2;
-  $form->{padding} = "&nbsp;&nbsp;";
-  $form->{bold}    = "<b>";
-  $form->{endbold} = "</b>";
-  $form->{br}      = "<br>";
+  $::form->{decimalplaces} = $::form->{decimalplaces} * 1 || 2;
+  $::form->{padding}       = "&nbsp;&nbsp;";
+  $::form->{bold}          = "<b>";
+  $::form->{endbold}       = "</b>";
+  $::form->{br}            = "<br>";
 
-  my $data = RP->balance_sheet(\%myconfig, \%$form);
+  my $data = RP->balance_sheet(\%::myconfig, $::form);
 
-  $form->{asofdate} = $form->current_date(\%myconfig) unless $form->{asofdate};
-  $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1);
+  $::form->{asofdate} ||= $::form->current_date;
+  $::form->{period}     = $::locale->date(\%::myconfig, $::form->current_date, 1);
 
-  ($form->{department}) = split /--/, $form->{department};
+  ($::form->{department}) = split /--/, $::form->{department};
 
   # define Current Earnings account
-  my $padding = ($form->{l_heading}) ? $form->{padding} : "";
-  push(@{ $form->{equity_account} }, $padding . $locale->text('Current Earnings'));
+  my $padding = $::form->{l_heading} ? $::form->{padding} : "";
+  push @{ $::form->{equity_account} }, $padding . $::locale->text('Current Earnings');
 
-  $form->{this_period} = $locale->date(\%myconfig, $form->{asofdate}, 0);
-  $form->{last_period} = $locale->date(\%myconfig, $form->{compareasofdate}, 0);
+  $::form->{this_period} = $::locale->date(\%::myconfig, $::form->{asofdate}, 0);
+  $::form->{last_period} = $::locale->date(\%::myconfig, $::form->{compareasofdate}, 0);
 
-  $form->{IN} = "balance_sheet.html";
+#  $::form->{IN} = "balance_sheet.html";
 
   # setup company variables for the form
-  map { $form->{$_} = $myconfig{$_}; } (qw(company address businessnumber nativecurr));
+  map { $::form->{$_} = $::myconfig{$_} } qw(company address businessnumber nativecurr);
 
-  $form->{templates} = $myconfig{templates};
+  $::form->{templates} = $::myconfig{templates};
 
-  $form->header();
-  print $form->parse_html_template('rp/balance_sheet', $data);
-#  $form->parse_template();
+  $::form->header;
+  print $::form->parse_html_template('rp/balance_sheet', $data);
 
-  $main::lxdebug->leave_sub();
+  $::lxdebug->leave_sub;
 }
 
 sub generate_projects {
@@ -2715,7 +2709,7 @@ sub generate_bwa {
     }
   } else {
     # die konvertierungen nur dann durchführen, wenn auch daten gesetzt sind.
-    # ansonsten ist die prüfung in RP.pm 
+    # ansonsten ist die prüfung in RP.pm
     # if (defined ($form->{fromdate|todate}=='..'))
     # immer wahr
     if ($form->{fromdate}){
index c31cf8f..3832d06 100644 (file)
 
   Liste gefixter Bugs aus dem Bugtracker:
 
-  922 940 1024 1025 1028 1030 1031 1034 1035 1037 1040 1043 1044 1046
-  1051 1055 1057 1058 1072 1073 1077 1081 1082 1095 1098 1100 1101
-  1108 1110 1118 1125 1127 1130 1133 1135 1136 1138 1144 1146 1147
-  1150 1151 1155 1164 1173 1177 1186 1188 1190 1191 1195 1197 1199
-  1201
+  922 940 1017 1024 1025 1028 1030 1031 1034 1035 1036 1037 1040 1043
+  1044 1046 1051 1055 1057 1058 1072 1073 1077 1079 1081 1082 1095 1098
+  1100 1101 1108 1110 1118 1125 1127 1130 1133 1135 1136 1138 1144
+  1146 1147 1150 1151 1155 1164 1173 1177 1186 1188 1190 1191 1195
+  1197 1199 1201
 
 
 2009-06-02 - Version 2.6.0