38 |
38 |
use SL::IO;
|
39 |
39 |
use SL::MoreCommon;
|
40 |
40 |
|
|
41 |
use Data::Dumper;
|
|
42 |
|
41 |
43 |
use strict;
|
42 |
44 |
|
43 |
45 |
sub post_transaction {
|
... | ... | |
68 |
70 |
(split(/--/, $form->{"AP_amount_$i"}))[0];
|
69 |
71 |
}
|
70 |
72 |
($form->{AP_amounts}{payables}) = split(/--/, $form->{APselected});
|
71 |
|
($form->{AP}{payables}) = split(/--/, $form->{APselected});
|
|
73 |
($form->{AP_payables}) = split(/--/, $form->{APselected});
|
72 |
74 |
|
73 |
75 |
# reverse and parse amounts
|
74 |
76 |
for my $i (1 .. $form->{rowcount}) {
|
... | ... | |
270 |
272 |
|
271 |
273 |
# get paid account
|
272 |
274 |
|
273 |
|
($form->{AP}{"paid_$i"}) = split(/--/, $form->{"AP_paid_$i"});
|
|
275 |
($form->{"AP_paid_account_$i"}) = split(/--/, $form->{"AP_paid_$i"});
|
274 |
276 |
$form->{"datepaid_$i"} = $form->{transdate}
|
275 |
277 |
unless ($form->{"datepaid_$i"});
|
276 |
278 |
|
... | ... | |
287 |
289 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey) | .
|
288 |
290 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, | .
|
289 |
291 |
qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|;
|
290 |
|
@values = ($form->{id}, $form->{AP}{payables}, $amount,
|
|
292 |
@values = ($form->{id}, $form->{AP_payables}, $amount,
|
291 |
293 |
conv_date($form->{"datepaid_$i"}), $project_id,
|
292 |
|
$form->{AP}{payables});
|
|
294 |
$form->{AP_payables});
|
293 |
295 |
do_query($form, $dbh, $query, @values);
|
294 |
296 |
}
|
295 |
297 |
$form->{payables} = $amount;
|
... | ... | |
299 |
301 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, memo, project_id, taxkey) | .
|
300 |
302 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, | .
|
301 |
303 |
qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|;
|
302 |
|
@values = ($form->{id}, $form->{AP}{"paid_$i"}, $form->{"paid_$i"},
|
|
304 |
@values = ($form->{id}, $form->{"AP_paid_account_$i"}, $form->{"paid_$i"},
|
303 |
305 |
conv_date($form->{"datepaid_$i"}), $form->{"source_$i"},
|
304 |
|
$form->{"memo_$i"}, $project_id, $form->{AP}{"paid_$i"});
|
|
306 |
$form->{"memo_$i"}, $project_id, $form->{"AP_paid_account_$i"});
|
305 |
307 |
do_query($form, $dbh, $query, @values);
|
306 |
308 |
|
307 |
309 |
# add exchange rate difference
|
... | ... | |
313 |
315 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey) | .
|
314 |
316 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, | .
|
315 |
317 |
qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|;
|
316 |
|
@values = ($form->{id}, $form->{AP}{"paid_$i"}, $amount,
|
|
318 |
@values = ($form->{id}, $form->{"AP_paid_account_$i"}, $amount,
|
317 |
319 |
conv_date($form->{"datepaid_$i"}), $project_id,
|
318 |
|
$form->{AP}{"paid_$i"});
|
|
320 |
$form->{"AP_paid_account_$i"});
|
319 |
321 |
do_query($form, $dbh, $query, @values);
|
320 |
322 |
}
|
321 |
323 |
|
Einkaufsrechnung -> Zahlung buchen: sinnlosen Quark gefixt.
Eine Variable, in der HTML Code fürs Frontend steht, erst zu löschen,
dann unter Umständen wieder mit HTML zu befüllen und dann als
symbolische Referenz auf ein Zahlungsobjekt zu nehmen ist einfach nur
Quark.