Skip to content

Commit

Permalink
Fix Balance Sheet & Income Tax comparisons report initial values
Browse files Browse the repository at this point in the history
  • Loading branch information
ylavoie committed Jun 6, 2024
1 parent d5c5efd commit 1e7a7e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
4 changes: 0 additions & 4 deletions lib/LedgerSMB/Report/Dates.pm
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ These are the first and last date in acc_trans.
=cut


sub get_bracket_dates {
my ($self) = @_;
my $return_hashref = {};
Expand Down Expand Up @@ -242,9 +241,6 @@ sub _set_lazy_dates {
return;
}




before 'render' => sub {
my ($self) = @_;
# Set lazy attributes
Expand Down
3 changes: 2 additions & 1 deletion lib/LedgerSMB/Scripts/pnl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ sub generate_income_statement {
$rpt = LedgerSMB::Report::PNL::Income_Statement->new(
%$request,
formatter_options => $request->formatter_options,
from_date => $request->{from_date} ? $request->parse_date( $request->{from_date} ) : undef,
to_date => $request->{to_date} ? $request->parse_date( $request->{to_date} ) : undef,
column_path_prefix => [ 0 ]);
#die np $rpt;
$rpt->run_report($request);

for my $key (qw(from_month from_year from_date to_date interval)) {
Expand Down
10 changes: 4 additions & 6 deletions lib/LedgerSMB/Scripts/reports.pm
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,18 @@ Generates a balance sheet
=cut

use Log::Any;
my $logger = Log::Any->get_logger(category => 'LedgerSMB::Scripts::reports');

sub generate_balance_sheet {
my ($request) = @_;
$logger->debug("Stub LedgerSMB::Scripts::reports->generate_balance_sheet\n");
my $rpt = LedgerSMB::Report::Balance_Sheet->new(
%$request,
formatter_options => $request->formatter_options,
from_date => $request->{from_date} ? $request->parse_date( $request->{from_date} ) : undef,
to_date => $request->{to_date} ? $request->parse_date( $request->{to_date} ) : undef,
column_path_prefix => [ 0 ]);
$rpt->run_report($request);

for my $key (qw(from_month from_year from_date to_date internal)) {
delete $request->{$_} for (grep { /^$key/ } keys %$request);
for my $key (qw(from_date to_date date_from date_to)) {
delete $rpt->{$_} for (grep { /^$key/ } keys %$rpt);
}

for my $cmp_dates (@{$rpt->comparisons}) {
Expand Down

0 comments on commit 1e7a7e6

Please sign in to comment.