X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=8b75b2da9122573bc779ef06661572c08bc86413;hb=9d1e95b0eb88a54c083815ffd2db30227c2acf4a;hp=4634cb19d48ffe550a69c89833e23f381c62aa3e;hpb=eaa48aeab931d62b1a14bba95537480758695655;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 4634cb19d..8b75b2da9 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -37,6 +37,7 @@ use SL::PE; use Data::Dumper; require "$form->{path}/arap.pl"; +require "bin/mozilla/common.pl"; 1; @@ -203,6 +204,7 @@ sub create_links { $form->{"forex_$j"} = $form->{"exchangerate_$i"} = $form->{acc_trans}{$key}->[$i - 1]->{exchangerate}; $form->{"AR_paid_$j"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}"; + $form->{"paid_project_id_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{project_id}; $form->{paidaccounts}++; } else { @@ -420,6 +422,21 @@ sub form_header { |; } + my @old_project_ids = (); + map({ push(@old_project_ids, $form->{"project_id_$_"}) + if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"})); + + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 0, + "old_id" => \@old_project_ids }); + + my %project_labels = (); + my @project_values = (""); + foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { + push(@project_values, $item->{"id"}); + $project_labels{$item->{"id"}} = $item->{"projectnumber"}; + } + $form->{fokus} = "arledger.customer"; # use JavaScript Calendar or not @@ -531,7 +548,7 @@ sub form_header { | . $locale->text('Due Date') . qq| $button2 - + @@ -581,6 +598,12 @@ $jsscript qq||; $korrektur_checked = ($form->{"korrektur_$i"} ? 'checked' : ''); + my $projectnumber = + NTI($cgi->popup_menu('-name' => "project_id_$i", + '-values' => \@project_values, + '-labels' => \%project_labels, + '-default' => $form->{"project_id_$i"} )); + print qq| @@ -588,9 +611,7 @@ $jsscript {"tax_$i"}> $tax - - {"project_id_$i"}> - + $projectnumber |; $amount = ""; @@ -636,15 +657,15 @@ $jsscript - |; if ($form->{currency} eq $form->{defaultcurrency}) { - @column_index = qw(datepaid source memo paid AR_paid); + @column_index = qw(datepaid source memo paid AR_paid paid_project_id); } else { - @column_index = qw(datepaid source memo paid exchangerate AR_paid); + @column_index = qw(datepaid source memo paid exchangerate AR_paid paid_project_id); } $column_data{datepaid} = ""; @@ -652,7 +673,8 @@ $jsscript $column_data{exchangerate} = ""; $column_data{AR_paid} = ""; $column_data{source} = ""; - $column_data{memo} = ""; + $column_data{memo} = ""; + $column_data{paid_project_id} = ""; print " @@ -709,6 +731,14 @@ $jsscript $column_data{memo} = qq||; + $column_data{paid_project_id} = + qq||; + map { print qq|$column_data{$_}\n| } @column_index; print " @@ -740,6 +770,8 @@ sub form_footer { print qq| + + {path}> @@ -752,35 +784,32 @@ sub form_footer { $transdate = $form->datetonum($form->{transdate}, \%myconfig); $closedto = $form->datetonum($form->{closedto}, \%myconfig); + print qq| +|; if ($form->{id}) { if ($form->{radier}) { - print qq| - |; - - print qq| + print qq| |; - } - if ($transdate > $closedto) { - print qq| + } + if ($transdate > $closedto) { + print qq| |; - } - print qq| + } + print qq| + . $locale->text('Post Payment') . qq|"> |; - + } else { if ($transdate > $closedto) { print qq| - |; } } @@ -869,8 +898,6 @@ sub update { &check_name(customer); $form->{AR} = $save_AR; - &check_project; - $form->{invtotal} = ($form->{taxincluded}) ? $form->{invtotal} : $form->{invtotal} + $totaltax; @@ -1129,6 +1156,19 @@ sub search { |; } + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 1 }); + + my %labels = (); + my @values = (""); + foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { + push(@values, $item->{"id"}); + $labels{$item->{"id"}} = $item->{"projectnumber"}; + } + my $projectnumber = + NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values, + '-labels' => \%labels)); + $form->{fokus} = "search.customer"; $form->header; @@ -1160,6 +1200,10 @@ sub search { + + + + $button1 @@ -1226,6 +1270,8 @@ sub search { + +
| + | . $locale->text('Incoming Payments') . qq|
" . $locale->text('Date') . "" . $locale->text('Exch') . "" . $locale->text('Account') . "" . $locale->text('Source') . "" . $locale->text('Memo') . "" . $locale->text('Memo') . "" . $locale->text('Project Number') . "
| + . NTI($cgi->popup_menu('-name' => "paid_project_id_$i", + '-values' => \@project_values, + '-labels' => \%project_labels, + '-default' => $form->{"paid_project_id_$i"} )) + . qq| | . $locale->text('Notes') . qq|
| . $locale->text("Project Number") . qq|$projectnumber
| . $locale->text('From') . qq|
| . $locale->text('Subtotal') . qq|| . $locale->text('Project Number') . qq|
@@ -1331,10 +1377,15 @@ sub ar_transactions { $option .= "\n
" if ($option); $option .= $locale->text('Closed'); } + if ($form->{globalproject_id}) { + $callback .= "&globalproject_id=" . E($form->{globalproject_id}); + $href .= "&globalproject_id=" . E($form->{globalproject_id}); + } - @columns = $form->sort_columns( - qw(transdate id type invnumber ordnumber name netamount tax amount paid datepaid due duedate notes employee shippingpoint shipvia) - ); + @columns = + qw(transdate id type invnumber ordnumber name netamount tax amount paid + datepaid due duedate notes employee shippingpoint shipvia + globalprojectnumber); $form->{"l_type"} = "Y"; @@ -1407,6 +1458,8 @@ sub ar_transactions { "" . $locale->text('Ship via') . ""; + $column_header{globalprojectnumber} = + qq|| . $locale->text('Project Number') . qq||; $form->{title} = $locale->text('AR Transactions'); @@ -1505,6 +1558,8 @@ sub ar_transactions { $column_data{shippingpoint} = "$ar->{shippingpoint} "; $column_data{shipvia} = "$ar->{shipvia} "; $column_data{employee} = "$ar->{employee} "; + $column_data{globalprojectnumber} = + "" . H($ar->{globalprojectnumber}) . ""; $i++; $i %= 2;