Skip to content

Commit

Permalink
Fix Balance Sheet & Income Tax comparisons report by dates
Browse files Browse the repository at this point in the history
  • Loading branch information
ylavoie committed Apr 20, 2024
1 parent 15876c3 commit d959551
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/LedgerSMB/Report/Balance_Sheet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ sub run_report {

my $col_id = $self->cheads->map_path($self->column_path_prefix);
$self->cheads->id_props($col_id,
{ description => $self->date_to->to_output,
to_date => $self->date_to->to_output,
{ description => $self->date_to->to_output($self->{formatter_options}),
to_date => $self->date_to->to_output($self->{formatter_options}),
});

for my $line (@lines) {
Expand Down
4 changes: 2 additions & 2 deletions lib/LedgerSMB/Report/Dates.pm
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ sub _collect_dates_comparisons {

foreach my $i (1 .. $args{comparison_periods}) {
push @dates, {
from_date => LedgerSMB::PGDate->from_input($args{"from_date_$i"}),
to_date => LedgerSMB::PGDate->from_input($args{"to_date_$i"}),
from_date => LedgerSMB::PGDate->from_input($args{"from_date_$i"},$args{formatter_options}),
to_date => LedgerSMB::PGDate->from_input($args{"to_date_$i"},$args{formatter_options}),
column_path_prefix => [ $i ]
};
}
Expand Down
10 changes: 6 additions & 4 deletions lib/LedgerSMB/Report/PNL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,16 @@ sub run_report {


my $col_id = $self->cheads->map_path($self->column_path_prefix);
my $_from_date = $self->from_date->to_output($self->{formatter_options});
my $_to_date = $self->to_date->to_output($self->{formatter_options});
$self->cheads->id_props($col_id,
{ description =>
$self->Text(
"[_1]\n[_2]",
$self->from_date->to_output,
$self->to_date->to_output),
from_date => $self->from_date->to_output,
to_date => $self->to_date->to_output,
$_from_date,
$_to_date),
from_date => $_from_date,
to_date => $_to_date
});

for my $line (@lines) {
Expand Down
4 changes: 3 additions & 1 deletion lib/LedgerSMB/Scripts/pnl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ sub generate_income_statement {

for my $cmp_dates (@{$rpt->comparisons}) {
my $cmp = LedgerSMB::Report::PNL::Income_Statement->new(
%$request, %$cmp_dates);
%$request,
formatter_options => $request->formatter_options,
%$cmp_dates);
$cmp->run_report($request);
$rpt->add_comparison($cmp);
}
Expand Down
4 changes: 3 additions & 1 deletion lib/LedgerSMB/Scripts/reports.pm
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ sub generate_balance_sheet {

for my $cmp_dates (@{$rpt->comparisons}) {
my $cmp = LedgerSMB::Report::Balance_Sheet->new(
%$request, %$cmp_dates);
%$request,
formatter_options => $request->formatter_options,
%$cmp_dates);
$cmp->run_report($request);
$rpt->add_comparison($cmp);
}
Expand Down

0 comments on commit d959551

Please sign in to comment.