X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Far.pl;h=1522339b86247c909f82cd275a39b221368e7bf5;hb=adf1b8cbb7c9b2b49e73256ea66c6fed00e8466e;hp=8ec365ada12d758fcf0dddf84e15c02a51f50ce8;hpb=62ffcb1aa838fa3d4e266aef02918574bc7ca6be;p=kivitendo-erp.git
diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl
index 8ec365ada..1522339b8 100644
--- a/bin/mozilla/ar.pl
+++ b/bin/mozilla/ar.pl
@@ -215,7 +215,7 @@ sub form_header {
my $form = $main::form;
my %myconfig = %main::myconfig;
my $locale = $main::locale;
- my $cgi = $main::cgi;
+ my $cgi = $::request->{cgi};
my ($title, $readonly, $exchangerate, $rows);
my ($taxincluded, $notes, $department, $customer, $employee, $amount, $project);
@@ -734,14 +734,31 @@ $jsscript
$form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
}
+ print qq|{"acc_trans_id_$i"}>\n|;
+ print qq|{"gldate_$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})) {
if ($form->{"forex_$i"}) {
$exchangerate =
qq|{"exchangerate_$i"}>$form->{"exchangerate_$i"}|;
} else {
- $exchangerate =
- qq|{"exchangerate_$i"}>|;
+ if ($changeable) {
+ $exchangerate =
+ qq|{"exchangerate_$i"}>|;
+ } else {
+ $exchangerate =
+ qq|{"exchangerate_$i"}>$form->{"exchangerate_$i"}|;
+ }
}
}
@@ -749,33 +766,78 @@ $jsscript
{"forex_$i"}>
|;
- $column_data{paid} =
- qq|
| |;
- $column_data{AR_paid} =
- qq|${selectAR_paid} | |;
- $column_data{exchangerate} = qq|$exchangerate | |;
- $column_data{datepaid} =
- qq|
+ my $datepaid;
+ if ($changeable) {
+ $datepaid = qq| |
| |;
- $column_data{source} =
- qq| | |;
- $column_data{memo} =
- qq| | |;
+ } else {
+ $datepaid = qq|$form->{"datepaid_$i"} | |.
+ qq|{"datepaid_$i"}>|;
+ }
+
+ my $paid;
+ if ($changeable) {
+ $paid = qq| | |;
+ } else {
+ $paid = qq|$form->{"paid_$i"} | |.
+ qq|{"paid_$i"}>|;
+ }
+
+ my $source;
+ if ($changeable) {
+ $source = qq| | |;
+ } else {
+ $source = qq|$form->{"source_$i"} | |.
+ qq|{"source_$i"}>|;
+ }
+
+ my $memo;
+ if ($changeable) {
+ $memo = qq| | |;
+ } else {
+ $memo = qq|$form->{"memo_$i"} | |.
+ qq|{"memo_$i"}>|;
+ }
+
+ my $AR_paid;
+ if ($changeable) {
+ $AR_paid = qq|${selectAR_paid} | |;
+ } else {
+ $AR_paid = qq|$form->{"AR_paid_$i"} | |.
+ qq|{"AR_paid_$i"}>|;
+ }
- $column_data{paid_project_id} =
+ my $paid_project_id;
+ if ($changeable) {
+ $paid_project_id =
qq||
. NTI($cgi->popup_menu('-name' => "paid_project_id_$i",
'-values' => \@project_values,
'-labels' => \%project_labels,
'-default' => $form->{"paid_project_id_$i"} ))
. qq| | |;
+ } else {
+ my $projectnumber = $project_labels{$form->{"paid_project_id_$i"}};
+ $paid_project_id = qq|$projectnumber | |.
+ qq|{"paid_project_id_$i"}>|;
+ }
+
+ $column_data{paid} = $paid;
+ $column_data{AR_paid} = $AR_paid;
+ $column_data{exchangerate} = qq|$exchangerate | |;
+ $column_data{datepaid} = $datepaid;
+ $column_data{source} = $source;
+ $column_data{memo} = $memo;
+ $column_data{paid_project_id} = $paid_project_id;
map { print qq|$column_data{$_}\n| } @column_index;
print "
";
- push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i");
+ if ($changeable) {
+ push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i");
+ }
}
my $paid_missing = $form->{invtotal_unformatted} - $form->{totalpaid};
@@ -817,7 +879,7 @@ sub form_footer {
my $form = $main::form;
my %myconfig = %main::myconfig;
my $locale = $main::locale;
- my $cgi = $main::cgi;
+ my $cgi = $::request->{cgi};
my ($transdate, $closedto);
@@ -1185,7 +1247,7 @@ sub use_as_template {
my $form = $main::form;
my %myconfig = %main::myconfig;
- map { delete $form->{$_} } qw(printed emailed queued invnumber invdate deliverydate id datepaid_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);
@@ -1270,7 +1332,7 @@ sub search {
my $form = $main::form;
my %myconfig = %main::myconfig;
my $locale = $main::locale;
- my $cgi = $main::cgi;
+ my $cgi = $::request->{cgi};
my ($customer, $department);
my ($jsscript, $button1, $button2, $onload);