Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8001c18b

Von Sven Schöling vor fast 15 Jahren hinzugefügt

  • ID 8001c18b8b8a78b30bdf61c3fbcab2afc1585c3c
  • Vorgänger 2805f410
  • Nachfolger 3717c589

code verbesserungen für balance_sheet, form->current_date kommt nun ohne myconfig aus.

Unterschiede anzeigen:

SL/Form.pm
2966 2966
sub current_date {
2967 2967
  $main::lxdebug->enter_sub();
2968 2968

  
2969
  my ($self, $myconfig, $thisdate, $days) = @_;
2969
  my $self              = shift;
2970
  my $myconfig          = shift  || \%::myconfig;
2971
  my ($thisdate, $days) = @_;
2970 2972

  
2971 2973
  my $dbh = $self->get_standard_dbh($myconfig);
2972 2974
  my $query;
bin/mozilla/rp.pl
1112 1112
}
1113 1113

  
1114 1114
sub generate_balance_sheet {
1115
  $main::lxdebug->enter_sub();
1116

  
1117
  $main::auth->assert('report');
1118

  
1119
  my $form     = $main::form;
1120
  my %myconfig = %main::myconfig;
1121
  my $locale   = $main::locale;
1115
  $::lxdebug->enter_sub;
1116
  $::auth->assert('report');
1122 1117

  
1123
  $form->{decimalplaces} = $form->{decimalplaces} * 1 || 2;
1124
  $form->{padding} = "  ";
1125
  $form->{bold}    = "<b>";
1126
  $form->{endbold} = "</b>";
1127
  $form->{br}      = "<br>";
1118
  $::form->{decimalplaces} = $::form->{decimalplaces} * 1 || 2;
1119
  $::form->{padding}       = "&nbsp;&nbsp;";
1120
  $::form->{bold}          = "<b>";
1121
  $::form->{endbold}       = "</b>";
1122
  $::form->{br}            = "<br>";
1128 1123

  
1129
  my $data = RP->balance_sheet(\%myconfig, \%$form);
1124
  my $data = RP->balance_sheet(\%::myconfig, $::form);
1130 1125

  
1131
  $form->{asofdate} = $form->current_date(\%myconfig) unless $form->{asofdate};
1132
  $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1);
1126
  $::form->{asofdate} ||= $::form->current_date;
1127
  $::form->{period}     = $::locale->date(\%::myconfig, $::form->current_date, 1);
1133 1128

  
1134
  ($form->{department}) = split /--/, $form->{department};
1129
  ($::form->{department}) = split /--/, $::form->{department};
1135 1130

  
1136 1131
  # define Current Earnings account
1137
  my $padding = ($form->{l_heading}) ? $form->{padding} : "";
1138
  push(@{ $form->{equity_account} }, $padding . $locale->text('Current Earnings'));
1132
  my $padding = $::form->{l_heading} ? $::form->{padding} : "";
1133
  push @{ $::form->{equity_account} }, $padding . $::locale->text('Current Earnings');
1139 1134

  
1140
  $form->{this_period} = $locale->date(\%myconfig, $form->{asofdate}, 0);
1141
  $form->{last_period} = $locale->date(\%myconfig, $form->{compareasofdate}, 0);
1135
  $::form->{this_period} = $::locale->date(\%::myconfig, $::form->{asofdate}, 0);
1136
  $::form->{last_period} = $::locale->date(\%::myconfig, $::form->{compareasofdate}, 0);
1142 1137

  
1143
  $form->{IN} = "balance_sheet.html";
1138
#  $::form->{IN} = "balance_sheet.html";
1144 1139

  
1145 1140
  # setup company variables for the form
1146
  map { $form->{$_} = $myconfig{$_}; } (qw(company address businessnumber nativecurr));
1141
  map { $::form->{$_} = $::myconfig{$_} } qw(company address businessnumber nativecurr);
1147 1142

  
1148
  $form->{templates} = $myconfig{templates};
1143
  $::form->{templates} = $::myconfig{templates};
1149 1144

  
1150
  $form->header();
1151
  print $form->parse_html_template('rp/balance_sheet', $data);
1152
#  $form->parse_template();
1145
  $::form->header;
1146
  print $::form->parse_html_template('rp/balance_sheet', $data);
1153 1147

  
1154
  $main::lxdebug->leave_sub();
1148
  $::lxdebug->leave_sub;
1155 1149
}
1156 1150

  
1157 1151
sub generate_projects {
......
2715 2709
    }
2716 2710
  } else {
2717 2711
    # die konvertierungen nur dann durchführen, wenn auch daten gesetzt sind.
2718
    # ansonsten ist die prüfung in RP.pm 
2712
    # ansonsten ist die prüfung in RP.pm
2719 2713
    # if (defined ($form->{fromdate|todate}=='..'))
2720 2714
    # immer wahr
2721 2715
    if ($form->{fromdate}){

Auch abrufbar als: Unified diff