X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=c97460877ea9db3500d9e424979d66d3592d8ad7;hb=b02735f55360e5a4e02dca40458b48cf057ecd7b;hp=d90b06209fe8590d6b40b4383fdc8a3686df71a0;hpb=79b83b02cf67cf4b701eb1654fa274095d84745a;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index d90b06209..c97460877 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -684,18 +684,26 @@ $jsscript # format amounts if ($form->{"paid_$i"}) { $form->{"paid_$i"} = - $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2); + $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2); } - $form->{"exchangerate_$i"} = - $form->format_amount(\%myconfig, $form->{"exchangerate_$i"}); if ($form->{"exchangerate_$i"} == 0) { $form->{"exchangerate_$i"} = ""; + } else { + $form->{"exchangerate_$i"} = + $form->format_amount(\%myconfig, $form->{"exchangerate_$i"}); } + print qq|{"acc_trans_id_$i"}>\n|; print qq|{"gldate_$i"}>\n|; - my $changeable = (($form->{"gldate_$i"} eq '') || $form->current_date(\%myconfig) eq $form->{"gldate_$i"}); - $form->{"payment_readonly_$i"} = ($changeable)? 0 : 1; - print qq|{"payment_readonly_$i"}>\n|; + my $changeable = 1; + if ($::lx_office_conf{features}->{payments_changeable} == 0) { + # never + $changeable = ($form->{"acc_trans_id_$i"})? 0 : 1; + } + if ($::lx_office_conf{features}->{payments_changeable} == 2) { + # on the same day + $changeable = (($form->{"gldate_$i"} eq '') || $form->current_date(\%myconfig) eq $form->{"gldate_$i"}); + } $exchangerate = qq| |; if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) { @@ -1182,7 +1190,7 @@ sub use_as_template { $main::auth->assert('general_ledger'); - map { delete $form->{$_} } qw(printed emailed queued invnumber invdate deliverydate id datepaid_1 gldate_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno); + map { delete $form->{$_} } qw(printed emailed queued invnumber invdate deliverydate id datepaid_1 gldate_1 acc_trans_id_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno); $form->{paidaccounts} = 1; $form->{rowcount}--; $form->{invdate} = $form->current_date(\%myconfig);