Revision 0a02b827
Von Sven Schöling vor mehr als 17 Jahren hinzugefügt
SL/AP.pm | ||
---|---|---|
776 | 776 |
do_query($form, $dbh, $query, $id); |
777 | 777 |
|
778 | 778 |
# now copy acc_trans entries |
779 |
$query = qq|SELECT * FROM acc_trans WHERE trans_id = ?|; |
|
780 |
for my $row (@{ selectall_hashref_query($form, $dbh, $query, $id) }) { |
|
781 |
delete @$row{qw(itime mtime)}; |
|
779 |
$query = qq|SELECT a.*, c.link FROM acc_trans a LEFT JOIN chart c ON a.chart_id = c.id WHERE a.trans_id = ?|; |
|
780 |
my $rowref = selectall_hashref_query($form, $dbh, $query, $id); |
|
781 |
|
|
782 |
# kill all entries containing payments, which are the last 2n rows, of which the last has link =~ /paid/ |
|
783 |
while ($rowref->[-1]{link} =~ /paid/) { |
|
784 |
splice(@$rowref, -2); |
|
785 |
} |
|
786 |
|
|
787 |
for my $row (@$rowref) { |
|
788 |
delete @$row{qw(itime mtime link)}; |
|
782 | 789 |
$query = sprintf 'INSERT INTO acc_trans (%s) VALUES (%s)', join(', ', keys %$row), join(', ', map '?', values %$row); |
783 | 790 |
$row->{trans_id} = $new_id; |
784 | 791 |
$row->{amount} *= -1; |
Auch abrufbar als: Unified diff
Storno Fix nr. 29283574983745
Es werden beim Storno jetzt nur noch die urspruenglichen acc_trans Eintraege storniert,
nachtraegliche Zahlungseingaenge bleiben unberuehrt.