Revision b56c0cd7
Von Bernd Blessmann vor etwa 13 Jahren hinzugefügt
SL/IR.pm | ||
---|---|---|
499 | 499 |
|
500 | 500 |
# record payments and offsetting AP |
501 | 501 |
for my $i (1 .. $form->{paidaccounts}) { |
502 |
if ($form->{"acc_trans_id_$i"} |
|
503 |
&& $payments_only |
|
504 |
&& ($::lx_office_conf{features}->{payments_changeable} == 0)) { |
|
505 |
next; |
|
506 |
} |
|
507 |
|
|
502 | 508 |
next if $form->{"paid_$i"} == 0; |
503 | 509 |
|
504 | 510 |
my ($accno) = split /--/, $form->{"AP_paid_$i"}; |
... | ... | |
518 | 524 |
} |
519 | 525 |
|
520 | 526 |
# record payment |
521 |
$query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, memo, taxkey, project_id) |
|
522 |
VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, |
|
527 |
my $gldate = (conv_date($form->{"gldate_$i"}))? conv_date($form->{"gldate_$i"}) : conv_date($form->current_date($myconfig)); |
|
528 |
|
|
529 |
$query = |
|
530 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, taxkey, project_id) |
|
531 |
VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, |
|
523 | 532 |
(SELECT taxkey_id FROM chart WHERE accno = ?), ?)|; |
524 | 533 |
@values = (conv_i($form->{id}), $accno, $form->{"paid_$i"}, $form->{"datepaid_$i"}, |
525 |
$form->{"source_$i"}, $form->{"memo_$i"}, $accno, $project_id); |
|
534 |
$gldate, $form->{"source_$i"}, $form->{"memo_$i"}, $accno, $project_id);
|
|
526 | 535 |
do_query($form, $dbh, $query, @values); |
527 | 536 |
|
528 | 537 |
$exchangerate = 0; |
... | ... | |
1394 | 1403 |
$old_form = save_form(); |
1395 | 1404 |
|
1396 | 1405 |
# Delete all entries in acc_trans from prior payments. |
1397 |
$self->_delete_payments($form, $dbh); |
|
1406 |
if ($::lx_office_conf{features}->{payments_changeable} != 0) { |
|
1407 |
$self->_delete_payments($form, $dbh); |
|
1408 |
} |
|
1398 | 1409 |
|
1399 | 1410 |
# Save the new payments the user made before cleaning up $form. |
1400 |
map { $payments{$_} = $form->{$_} } grep m/^datepaid_\d+$|^memo_\d+$|^source_\d+$|^exchangerate_\d+$|^paid_\d+$|^AP_paid_\d+$|^paidaccounts$/, keys %{ $form }; |
|
1411 |
map { $payments{$_} = $form->{$_} } grep m/^datepaid_\d+$|^gldate_\d+$|^acc_trans_id_\d+$|^memo_\d+$|^source_\d+$|^exchangerate_\d+$|^paid_\d+$|^AP_paid_\d+$|^paidaccounts$/, keys %{ $form };
|
|
1401 | 1412 |
|
1402 | 1413 |
# Clean up $form so that old content won't tamper the results. |
1403 | 1414 |
%keep_vars = map { $_, 1 } qw(login password id); |
Auch abrufbar als: Unified diff
Änderbarkeit bei Zahlungen f. Einkaufsrechnungen konfigurierbar.
Nie, immer oder am selben Tag, einstellbar in der lx_office.conf