38 |
38 |
use SL::IO;
|
39 |
39 |
use SL::MoreCommon;
|
40 |
40 |
|
41 |
|
use Data::Dumper;
|
42 |
|
|
43 |
41 |
use strict;
|
44 |
42 |
|
45 |
43 |
sub post_transaction {
|
... | ... | |
70 |
68 |
(split(/--/, $form->{"AP_amount_$i"}))[0];
|
71 |
69 |
}
|
72 |
70 |
($form->{AP_amounts}{payables}) = split(/--/, $form->{APselected});
|
73 |
|
($form->{AP_payables}) = split(/--/, $form->{APselected});
|
|
71 |
($form->{AP}{payables}) = split(/--/, $form->{APselected});
|
74 |
72 |
|
75 |
73 |
# reverse and parse amounts
|
76 |
74 |
for my $i (1 .. $form->{rowcount}) {
|
... | ... | |
272 |
270 |
|
273 |
271 |
# get paid account
|
274 |
272 |
|
275 |
|
($form->{"AP_paid_account_$i"}) = split(/--/, $form->{"AP_paid_$i"});
|
|
273 |
($form->{AP}{"paid_$i"}) = split(/--/, $form->{"AP_paid_$i"});
|
276 |
274 |
$form->{"datepaid_$i"} = $form->{transdate}
|
277 |
275 |
unless ($form->{"datepaid_$i"});
|
278 |
276 |
|
... | ... | |
289 |
287 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey) | .
|
290 |
288 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, | .
|
291 |
289 |
qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|;
|
292 |
|
@values = ($form->{id}, $form->{AP_payables}, $amount,
|
|
290 |
@values = ($form->{id}, $form->{AP}{payables}, $amount,
|
293 |
291 |
conv_date($form->{"datepaid_$i"}), $project_id,
|
294 |
|
$form->{AP_payables});
|
|
292 |
$form->{AP}{payables});
|
295 |
293 |
do_query($form, $dbh, $query, @values);
|
296 |
294 |
}
|
297 |
295 |
$form->{payables} = $amount;
|
... | ... | |
301 |
299 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, memo, project_id, taxkey) | .
|
302 |
300 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, | .
|
303 |
301 |
qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|;
|
304 |
|
@values = ($form->{id}, $form->{"AP_paid_account_$i"}, $form->{"paid_$i"},
|
|
302 |
@values = ($form->{id}, $form->{AP}{"paid_$i"}, $form->{"paid_$i"},
|
305 |
303 |
conv_date($form->{"datepaid_$i"}), $form->{"source_$i"},
|
306 |
|
$form->{"memo_$i"}, $project_id, $form->{"AP_paid_account_$i"});
|
|
304 |
$form->{"memo_$i"}, $project_id, $form->{AP}{"paid_$i"});
|
307 |
305 |
do_query($form, $dbh, $query, @values);
|
308 |
306 |
|
309 |
307 |
# add exchange rate difference
|
... | ... | |
315 |
313 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey) | .
|
316 |
314 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, | .
|
317 |
315 |
qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|;
|
318 |
|
@values = ($form->{id}, $form->{"AP_paid_account_$i"}, $amount,
|
|
316 |
@values = ($form->{id}, $form->{AP}{"paid_$i"}, $amount,
|
319 |
317 |
conv_date($form->{"datepaid_$i"}), $project_id,
|
320 |
|
$form->{"AP_paid_account_$i"});
|
|
318 |
$form->{AP}{"paid_$i"});
|
321 |
319 |
do_query($form, $dbh, $query, @values);
|
322 |
320 |
}
|
323 |
321 |
|
Revert "Einkaufsrechnung -> Zahlung buchen: sinnlosen Quark gefixt."
This reverts commit 88e6dce2c094fa468e4397030d2f14289a265e62.
Leider sorgt der besagte Commit dafuer, dass das Buchen von
Kreditorenbuchungen total schief laeuft, weil die Aenderung von
$form->{AP}{amounts_1} auf $form->{AP_amounts_1} mal eben Variablen
aus dem Formular ueberschreibt.
Da ich nicht genau weiss, was Sven hier wie fixen wollte, mache ich es
erst einmal rueckgaengig & spreche mit Sven darueber, wenn er wieder
aus dem Urlaub da ist.