Revision 70682e3d
Von Philip Reetz vor mehr als 15 Jahren hinzugefügt
bin/mozilla/gl.pl | ||
---|---|---|
530 | 530 |
# add sort to callback |
531 | 531 |
$form->{callback} = "$callback&sort=" . E($form->{sort}) . "&sortdir=" . E($form->{sortdir}); |
532 | 532 |
|
533 |
$form->{balance} *= $ml; |
|
534 |
|
|
535 |
if ($form->{accno} && $form->{balance}) { |
|
536 |
my $row = { |
|
537 |
'balance' => { |
|
538 |
'data' => $form->format_amount(\%myconfig, $form->{balance}, 2), |
|
539 |
'align' => 'right', |
|
540 |
}, |
|
541 |
}; |
|
542 |
|
|
543 |
$report->add_data($row); |
|
544 |
} |
|
545 | 533 |
|
546 | 534 |
my @totals_columns = qw(debit credit debit_tax credit_tax); |
547 | 535 |
my %subtotals = map { $_ => 0 } @totals_columns; |
... | ... | |
549 | 537 |
my $idx = 0; |
550 | 538 |
|
551 | 539 |
foreach $ref (@{ $form->{GL} }) { |
552 |
$form->{balance} *= $ml; |
|
553 | 540 |
|
554 | 541 |
my %rows; |
555 | 542 |
|
... | ... | |
559 | 546 |
my $value = $ref->{$key}->{$idx}; |
560 | 547 |
$subtotals{$key} += $value; |
561 | 548 |
$totals{$key} += $value; |
562 |
$form->{balance} = abs($form->{balance}) - abs($value); |
|
549 |
if ($key =~ /debit.*/) { |
|
550 |
$ml = -1; |
|
551 |
} else { |
|
552 |
$ml = 1; |
|
553 |
} |
|
554 |
$form->{balance} = $form->{balance} + $value * $ml; |
|
563 | 555 |
push @{ $rows{$key} }, $form->format_amount(\%myconfig, $value, 2); |
564 | 556 |
} |
565 | 557 |
} |
... | ... | |
572 | 564 |
my $row = { }; |
573 | 565 |
map { $row->{$_} = { 'data' => '', 'align' => $column_alignment{$_} } } @columns; |
574 | 566 |
|
575 |
$row->{balance}->{data} = $form->format_amount(\%myconfig, $form->{balance}, 2); |
|
567 |
my $sh = ""; |
|
568 |
if ($form->{balance} < 0) { |
|
569 |
$sh = "(S)"; |
|
570 |
$ml = -1; |
|
571 |
} elsif ($form->{balance} > 0) { |
|
572 |
$sh = "(H)"; |
|
573 |
$ml = 1; |
|
574 |
} |
|
575 |
my $data = $form->format_amount(\%myconfig, ($form->{balance} * $ml), 2); |
|
576 |
$data .= $sh; |
|
577 |
|
|
578 |
$row->{balance}->{data} = $data; |
|
576 | 579 |
$row->{projectnumbers}->{data} = join ", ", sort { lc($a) cmp lc($b) } keys %{ $ref->{projectnumbers} }; |
577 | 580 |
|
578 | 581 |
map { $row->{$_}->{data} = $ref->{$_} } qw(id reference description notes); |
... | ... | |
606 | 609 |
my $balanced_ledger = $totals{debit} + $totals{debit_tax} - $totals{credit} - $totals{credit_tax}; |
607 | 610 |
|
608 | 611 |
my $row = create_subtotal_row(\%totals, \@columns, \%column_alignment, [ qw(debit credit debit_tax credit_tax) ], 'listtotal'); |
609 |
$row->{balance} = { |
|
610 |
'data' => $form->format_amount(\%myconfig, $form->{balance} * $ml, 2), |
|
611 |
'align' => 'right', |
|
612 |
'class' => 'listtotal', |
|
613 |
}; |
|
612 |
|
|
613 |
my $sh = ""; |
|
614 |
if ($form->{balance} < 0) { |
|
615 |
$sh = "(S)"; |
|
616 |
$ml = -1; |
|
617 |
} elsif ($form->{balance} > 0) { |
|
618 |
$sh = "(H)"; |
|
619 |
$ml = 1; |
|
620 |
} |
|
621 |
my $data = $form->format_amount(\%myconfig, ($form->{balance} * $ml), 2); |
|
622 |
$data .= $sh; |
|
623 |
|
|
624 |
$row->{balance}->{data} = $data; |
|
625 |
|
|
614 | 626 |
$report->add_data($row); |
615 | 627 |
|
616 | 628 |
my $raw_bottom_info_text; |
Auch abrufbar als: Unified diff
Bug #295 behoben, Darstellung im Buchungsjournal korrigiert wenn nach einem Konto gefiltert wird