Revision 79b83b02
Von Bernd Blessmann vor etwa 13 Jahren hinzugefügt
SL/AP.pm | ||
---|---|---|
288 | 288 |
$form->{payables} = $amount; |
289 | 289 |
|
290 | 290 |
# add payment |
291 |
my $gldate = (conv_date($form->{"gldate_$i"}))? conv_date($form->{"gldate_$i"}) : conv_date($form->{"gldate"}); |
|
291 | 292 |
$query = |
292 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, memo, project_id, taxkey) | . |
|
293 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, | . |
|
293 |
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, project_id, taxkey) | .
|
|
294 |
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, ?, | .
|
|
294 | 295 |
qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|; |
295 | 296 |
@values = ($form->{id}, $form->{"AP_paid_account_$i"}, $form->{"paid_$i"}, |
296 |
conv_date($form->{"datepaid_$i"}), $form->{"source_$i"}, |
|
297 |
conv_date($form->{"datepaid_$i"}), $gldate, $form->{"source_$i"},
|
|
297 | 298 |
$form->{"memo_$i"}, $project_id, $form->{"AP_paid_account_$i"}); |
298 | 299 |
do_query($form, $dbh, $query, @values); |
299 | 300 |
|
... | ... | |
568 | 569 |
$self->_delete_payments($form, $dbh); |
569 | 570 |
|
570 | 571 |
# Save the new payments the user made before cleaning up $form. |
571 |
my $payments_re = '^datepaid_\d+$|^memo_\d+$|^source_\d+$|^exchangerate_\d+$|^paid_\d+$|^paid_project_id_\d+$|^AP_paid_\d+$|^paidaccounts$'; |
|
572 |
my $payments_re = '^datepaid_\d+$|^gldate_\d+$|^memo_\d+$|^source_\d+$|^exchangerate_\d+$|^paid_\d+$|^paid_project_id_\d+$|^AP_paid_\d+$|^paidaccounts$';
|
|
572 | 573 |
map { $payments{$_} = $form->{$_} } grep m/$payments_re/, keys %{ $form }; |
573 | 574 |
|
574 | 575 |
# Clean up $form so that old content won't tamper the results. |
... | ... | |
649 | 650 |
$form->{"AP_paid_$j"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}"; |
650 | 651 |
$form->{"paid_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{amount}; |
651 | 652 |
$form->{"datepaid_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{transdate}; |
653 |
$form->{"gldate_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{gldate}; |
|
652 | 654 |
$form->{"source_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{source}; |
653 | 655 |
$form->{"memo_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{memo}; |
654 | 656 |
|
Auch abrufbar als: Unified diff
Zahlungen bei Kreditorenbuchungen nur am selben Tag löschbar machen.
Siehe auch Bug 1640. Ändert zwar nichts am Bug, steht da aber als
Anregung drin.