X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Frp.pl;h=663a20ebc4b4a5dfc24db9d5954e83327e4ab5e7;hb=0e079eba45bcb834792660358b2e86dcb70e494e;hp=5164b7f10bbd1cc067f15526f7381e237a0f12b0;hpb=9bd3030a376850c427c102c6e0c54f19bd19332e;p=kivitendo-erp.git diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 5164b7f10..663a20ebc 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -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} = "  "; - $form->{bold} = ""; - $form->{endbold} = ""; - $form->{br} = "
"; + $::form->{decimalplaces} = $::form->{decimalplaces} * 1 || 2; + $::form->{padding} = "  "; + $::form->{bold} = ""; + $::form->{endbold} = ""; + $::form->{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 { @@ -1666,8 +1660,8 @@ sub aging { 'invnumber' => { 'text' => $locale->text('Invoice'), }, 'transdate' => { 'text' => $locale->text('Date'), }, 'duedate' => { 'text' => $locale->text('Due'), }, - 'amount' => { 'text' => $locale->text('Amount'), }, - 'open' => { 'text' => $locale->text('Open'), }, + 'amount' => { 'text' => $locale->text('Amount'), }, + 'open' => { 'text' => $locale->text('Open'), }, ); my %column_alignment = ('statement' => 'center', @@ -2714,12 +2708,20 @@ sub generate_bwa { }; } } else { - my ($yy, $mm, $dd) = $locale->parse_date(\%myconfig, $form->{fromdate}); - $form->{fromdate} = "${dd}.${mm}.${yy}"; - ($yy, $mm, $dd) = $locale->parse_date(\%myconfig, $form->{todate}); - $form->{todate} = "${dd}.${mm}.${yy}"; - $form->{comparefromdate} = "01.01.$yy"; - $form->{comparetodate} = $form->{todate}; + # die konvertierungen nur dann durchführen, wenn auch daten gesetzt sind. + # ansonsten ist die prüfung in RP.pm + # if (defined ($form->{fromdate|todate}=='..')) + # immer wahr + if ($form->{fromdate}){ + my ($yy, $mm, $dd) = $locale->parse_date(\%myconfig, $form->{fromdate}); + $form->{fromdate} = "${dd}.${mm}.${yy}"; + $form->{comparefromdate} = "01.01.$yy"; + } + if ($form->{todate}){ + my ($yy, $mm, $dd) = $locale->parse_date(\%myconfig, $form->{todate}); + $form->{todate} = "${dd}.${mm}.${yy}"; + $form->{comparetodate} = $form->{todate}; + } } RP->bwa(\%myconfig, \%$form);