Revision 4654d993
Von Philip Reetz vor mehr als 15 Jahren hinzugefügt
SL/RP.pm | ||
---|---|---|
37 | 37 |
use SL::DBUtils; |
38 | 38 |
use Data::Dumper; |
39 | 39 |
use List::Util qw(sum); |
40 |
use strict; |
|
41 |
use warnings; |
|
40 |
# use strict;
|
|
41 |
# use warnings;
|
|
42 | 42 |
|
43 | 43 |
|
44 | 44 |
# new implementation of balance sheet |
... | ... | |
700 | 700 |
if ($ref->{amount} != 0 || $form->{all_accounts}) { |
701 | 701 |
$trb{ $ref->{accno} }{description} = $ref->{description}; |
702 | 702 |
$trb{ $ref->{accno} }{charttype} = 'A'; |
703 |
$trb{ $ref->{accno} }{beginning_balance} = $ref->{amount}; |
|
703 | 704 |
|
704 | 705 |
if ($ref->{amount} > 0) { |
705 | 706 |
$trb{ $ref->{accno} }{haben_eb} = $ref->{amount}; |
... | ... | |
941 | 942 |
WHERE $saldowhere |
942 | 943 |
$dpt_where |
943 | 944 |
$project |
944 |
AND c.accno = ?) AS saldo, |
|
945 |
AND c.accno = ? AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL)) AS saldo,
|
|
945 | 946 |
|
946 | 947 |
(SELECT SUM(ac.amount) |
947 | 948 |
FROM acc_trans ac |
... | ... | |
1009 | 1010 |
WHERE $saldowhere |
1010 | 1011 |
$dpt_where |
1011 | 1012 |
$project |
1012 |
AND c.accno = ?) AS saldo, |
|
1013 |
AND c.accno = ? AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL)) AS saldo,
|
|
1013 | 1014 |
|
1014 | 1015 |
(SELECT SUM(ac.amount) |
1015 | 1016 |
FROM acc_trans ac |
... | ... | |
1052 | 1053 |
|
1053 | 1054 |
$ref->{accno} = $accno; |
1054 | 1055 |
map { $ref->{$_} = $trb{$accno}{$_} } |
1055 |
qw(description category charttype amount soll_eb haben_eb); |
|
1056 |
qw(description category charttype amount soll_eb haben_eb beginning_balance);
|
|
1056 | 1057 |
|
1057 | 1058 |
$ref->{balance} = $form->round_amount($balance{ $ref->{accno} }, 2); |
1058 | 1059 |
|
... | ... | |
1100 | 1101 |
|
1101 | 1102 |
$ref->{debit} = $form->round_amount($ref->{debit}, 2); |
1102 | 1103 |
$ref->{credit} = $form->round_amount($ref->{credit}, 2); |
1103 |
$ref->{haben_saldo} = $form->round_amount($ref->{haben_saldo}, 2); |
|
1104 |
|
|
1105 |
if ($ref->{haben_saldo} != 0) { |
|
1106 |
$ref->{haben_saldo} = $ref->{haben_saldo} + $ref->{beginning_balance}; |
|
1107 |
if ($ref->{haben_saldo} < 0) { |
|
1108 |
$ref->{soll_saldo} = $form->round_amount(($ref->{haben_saldo} *- 1), 2); |
|
1109 |
$ref->{haben_saldo} = 0; |
|
1110 |
} |
|
1111 |
} elsif ($ref->{soll_saldo} != 0) { |
|
1112 |
$ref->{soll_saldo} = $ref->{soll_saldo} - $ref->{beginning_balance}; |
|
1113 |
if ($ref->{soll_saldo} < 0) { |
|
1114 |
$ref->{haben_saldo} = $form->round_amount(($ref->{haben_saldo} * -1), 2); |
|
1115 |
$ref->{soll_saldo} = 0; |
|
1116 |
} |
|
1117 |
} |
|
1118 |
$ref->{haben_saldo} = $form->round_amount($ref->{haben_saldo}, 2); |
|
1104 | 1119 |
$ref->{soll_saldo} = $form->round_amount($ref->{soll_saldo}, 2); |
1105 | 1120 |
$ref->{haben_kumuliert} = $form->round_amount($ref->{haben_kumuliert}, 2); |
1106 | 1121 |
$ref->{soll_kumuliert} = $form->round_amount($ref->{soll_kumuliert}, 2); |
Auch abrufbar als: Unified diff
Berichte Kontenblatt und SuSa auch fuer Zeitraueme ueber eine Jahr hinaus fit gemacht