Revision cade7ecd
Von Jan Büren vor etwa 2 Jahren hinzugefügt
SL/Controller/BankTransaction.pm | ||
---|---|---|
886 | 886 |
die ("invalid type") unless $type =~ m/^(ar|ap)$/; |
887 | 887 |
|
888 | 888 |
# recalc and set paid via database query |
889 |
# add: fx_gain and fx_loss |
|
889 | 890 |
my $query = qq|UPDATE $type SET paid = |
890 | 891 |
(SELECT COALESCE(abs(sum(amount)),0) FROM acc_trans |
891 | 892 |
WHERE trans_id = ? |
892 |
AND chart_link ilike '%paid%') |
|
893 |
WHERE id = ?|; |
|
893 |
AND (chart_link ilike '%paid%' |
|
894 |
OR chart_id IN (SELECT fxgain_accno_id from defaults) |
|
895 |
OR chart_id IN (SELECT fxloss_accno_id from defaults) |
|
896 |
) |
|
897 |
WHERE id = ?|; |
|
894 | 898 |
|
895 | 899 |
die if (do_query($::form, $bank_transaction->db->dbh, $query, $trans_id, $trans_id) == -1); |
896 | 900 |
} |
Auch abrufbar als: Unified diff
Bankauszug verbuchen rückgängig, beim Nebenbuch auch fxgain oder fxloss berücksichtigen