]> wagnertech.de Git - mfinanz.git/blobdiff - bin/mozilla/rp.pl
Merge branch 'kunden-lieferantennummernkreise-in-transnumbergenerator-2138'
[mfinanz.git] / bin / mozilla / rp.pl
index 8062dad90c91a2a90eb7e2c93cdd64dc9e143cfb..87fae36ba56d0eba07ada9ce2a7e173a2dfea291 100644 (file)
@@ -170,8 +170,8 @@ sub report {
     $::form->all_vc(\%::myconfig, $::form->{vc}, $is_sales ? "AR" : "AP");
     $vc .= "<option>$_->{name}--$_->{id}\n" for @{ $::form->{"all_$::form->{vc}"} };
     $vc = ($vc)
-        ? qq|<select name=$::form->{vc}><option>\n$vc</select>|
-        : qq|<input name=$::form->{vc} size=35>|;
+        ? qq|<select name=$::form->{vc} class="initial_focus"><option>\n$vc</select>|
+        : qq|<input name=$::form->{vc} size=35 class="initial_focus">|;
   }
 
   my ($selection, $paymentaccounts);
@@ -375,6 +375,24 @@ sub generate_income_statement {
       . qq| $longcomparetodate|;
   }
 
+  if ( $::instance_conf->get_profit_determination eq 'balance' ) {
+    $form->{income_statement_title} = $locale->text('Income Statement');
+  } elsif ( $::instance_conf->get_profit_determination eq 'income' ) {
+    $form->{income_statement_title} = $locale->text('Net Income Statement');
+  } else {
+    $form->{income_statement_title} = "";
+  };
+
+  if ( $form->{method} eq 'cash' ) {
+    $form->{accounting_method} = $locale->text('Cash accounting');
+  } elsif ( $form->{method} eq 'accrual' ) {
+    $form->{accounting_method} = $locale->text('Accrual accounting');
+  } else {
+    $form->{accounting_method} = "";
+  };
+
+  $::form->{report_date} = $locale->text('Report date') . ": " . $::form->current_date;
+
   $form->{IN} = "income_statement.html";
 
   $form->parse_template;
@@ -397,8 +415,9 @@ sub generate_balance_sheet {
 
   my $data = RP->balance_sheet(\%::myconfig, $::form);
 
-  $::form->{asofdate} ||= $::form->current_date;
-  $::form->{period}     = $::locale->date(\%::myconfig, $::form->current_date, 1);
+  $::form->{asofdate}    ||= $::form->current_date;
+  $::form->{report_title}  = $::locale->text('Balance Sheet');
+  $::form->{report_date} ||= $::form->current_date;
 
   ($::form->{department}) = split /--/, $::form->{department};
 
@@ -409,6 +428,8 @@ sub generate_balance_sheet {
   $::form->{this_period} = $::locale->date(\%::myconfig, $::form->{asofdate}, 0);
   $::form->{last_period} = $::locale->date(\%::myconfig, $::form->{compareasofdate}, 0);
 
+#  balance sheet isn't read from print templates anymore,
+#  instead use template in rp
 #  $::form->{IN} = "balance_sheet.html";
 
   $::form->header;
@@ -577,7 +598,7 @@ sub generate_trial_balance {
   my $attachment_basename = $locale->text('trial_balance');
   my $report              = SL::ReportGenerator->new(\%myconfig, $form);
 
-  my @hidden_variables    = qw(fromdate todate year cash);
+  my @hidden_variables    = qw(fromdate todate year method);
 
   my $href                = build_std_url('action=generate_trial_balance', grep { $form->{$_} } @hidden_variables);