Revision e0f7d45d
Von Sven Schöling vor fast 18 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
1128 | 1128 |
|
1129 | 1129 |
$query = qq|DELETE FROM acc_trans WHERE trans_id = ? AND chart_id = (SELECT c.id FROM chart c WHERE c.accno = ?) AND amount = ? AND transdate = ?|; |
1130 | 1130 |
do_query($form, $dbh, $query, $form->{id}, $form->{AR}, $amount, $form->{"datepaid_$i"}); |
1131 |
$query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id) VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), ?, ?, ?)|; |
|
1132 |
do_query($form, $dbh, $query, $form->{id}, $form->{AR}, $amount, $form->{"datepaid_$i"}, conv_i($form->{"globalproject_id"})); |
|
1131 |
$query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey) |
|
1132 |
VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, (SELECT taxkey_id FROM chart WHERE accno = ?))|; |
|
1133 |
do_query($form, $dbh, $query, $form->{id}, $form->{AR}, $amount, $form->{"datepaid_$i"}, conv_i($form->{"globalproject_id"}), $accno); |
|
1133 | 1134 |
|
1134 | 1135 |
# record payment |
1135 | 1136 |
$form->{"paid_$i"} *= -1; |
1136 | 1137 |
|
1137 | 1138 |
$query = qq|DELETE FROM acc_trans WHERE trans_id = ? AND chart_id = (SELECT c.id FROM chart c WHERE c.accno = ?) AND amount = ? AND transdate = ? AND source = ? AND memo = ?|; |
1138 | 1139 |
do_query($form, $dbh, $query, $form->{id}, $accno, $form->{"paid_$i"}, $form->{"datepaid_$i"}, $form->{"source_$i"}, $form->{"memo_$i"}); |
1139 |
$query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, memo, project_id) VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), ?, ?, ?, ?, ?)|; |
|
1140 |
do_query($form, $dbh, $query, $form->{id}, $accno, $form->{"paid_$i"}, $form->{"datepaid_$i"}, $form->{"source_$i"}, $form->{"memo_$i"}, conv_i($form->{"globalproject_id"})); |
|
1140 |
$query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, memo, project_id, taxkey) |
|
1141 |
VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), ?, ?, ?, ?, ?, (SELECT taxkey_id FROM chart WHERE accno = ?))|; |
|
1142 |
do_query($form, $dbh, $query, $form->{id}, $accno, $form->{"paid_$i"}, $form->{"datepaid_$i"}, $form->{"source_$i"}, $form->{"memo_$i"}, |
|
1143 |
conv_i($form->{"globalproject_id"}), $accno); |
|
1141 | 1144 |
|
1142 | 1145 |
# gain/loss |
1143 | 1146 |
$amount = $form->{"paid_$i"} * $form->{exchangerate} - $form->{"paid_$i"} * $form->{"exchangerate_$i"}; |
... | ... | |
1161 | 1164 |
$query = qq|DELETE FROM acc_trans WHERE trans_id = ? AND chart_id = (SELECT c.id FROM chart c WHERE c.accno = ?) |
1162 | 1165 |
AND amount = ? AND transdate = ? AND cleared = ? AND fx_transaction = ?|; |
1163 | 1166 |
do_query($form, $dbh, $query, $form->{id}, $accno, $form->{fx}{$accno}{$transdate}, $transdate, 0, 1); |
1164 |
$query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, cleared, fx_transaction, project_id) |
|
1165 |
VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), ?, ?, ?, ?, ?)|; |
|
1166 |
do_query($form, $dbh, $query, $form->{id}, $accno, $form->{fx}{$accno}{$transdate}, $transdate, 0, 1, conv_i($form->{"globalproject_id"})); |
|
1167 |
$query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, cleared, fx_transaction, project_id, taxkey)
|
|
1168 |
VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), ?, ?, ?, ?, ?, (SELECT taxkey_id FROM chart WHERE accno = ?))|;
|
|
1169 |
do_query($form, $dbh, $query, $form->{id}, $accno, $form->{fx}{$accno}{$transdate}, $transdate, 0, 1, conv_i($form->{"globalproject_id"}), $accno);
|
|
1167 | 1170 |
} |
1168 | 1171 |
|
1169 | 1172 |
} |
Auch abrufbar als: Unified diff
Bei Buchungen mit IS::post_payment taxkey mitbuchen.
Fix fuer Bug 583.