Revision affd886b
Von Sven Schöling vor mehr als 4 Jahren hinzugefügt
bin/mozilla/ap.pl | ||
---|---|---|
413 | 413 |
|
414 | 414 |
$form->{creditremaining_plus} = ($form->{creditremaining} =~ /-/) ? "0" : "1"; |
415 | 415 |
|
416 |
my @old_project_ids = (); |
|
417 |
map( |
|
418 |
{ |
|
419 |
if ($form->{"project_id_$_"}) { |
|
420 |
push(@old_project_ids, $form->{"project_id_$_"}); |
|
421 |
} |
|
422 |
} |
|
423 |
(1..$form->{"rowcount"}) |
|
424 |
); |
|
425 |
|
|
426 |
$form->get_lists("projects" => { "key" => "ALL_PROJECTS", |
|
427 |
"all" => 0, |
|
428 |
"old_id" => \@old_project_ids }, |
|
429 |
"charts" => { "key" => "ALL_CHARTS", |
|
416 |
$form->get_lists("charts" => { "key" => "ALL_CHARTS", |
|
430 | 417 |
"transdate" => $form->{transdate} }, |
431 | 418 |
); |
432 | 419 |
|
... | ... | |
437 | 424 |
|
438 | 425 |
$form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted; |
439 | 426 |
|
440 |
my %project_labels = (); |
|
441 |
foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { |
|
442 |
$project_labels{$item->{id}} = $item->{projectnumber}; |
|
443 |
} |
|
427 |
my %project_labels = map { $_->id => $_->projectnumber } @{ SL::DB::Manager::Project->get_all }; |
|
444 | 428 |
|
445 | 429 |
my %charts; |
446 | 430 |
my $default_ap_amount_chart_id; |
... | ... | |
459 | 443 |
my $follow_up_vc = $form->{vendor_id} ? SL::DB::Vendor->load_cached($form->{vendor_id})->name : ''; |
460 | 444 |
my $follow_up_trans_info = "$form->{invnumber} ($follow_up_vc)"; |
461 | 445 |
|
462 |
$::request->layout->add_javascripts("autocomplete_chart.js", "show_vc_details.js", "show_history.js", "follow_up.js", "kivi.Draft.js", "kivi.GL.js", "kivi.RecordTemplate.js", "kivi.File.js", "kivi.AP.js", "kivi.CustomerVendor.js", "kivi.Validator.js"); |
|
446 |
$::request->layout->add_javascripts("autocomplete_chart.js", "show_vc_details.js", "show_history.js", "follow_up.js", "kivi.Draft.js", "kivi.GL.js", "kivi.RecordTemplate.js", "kivi.File.js", "kivi.AP.js", "kivi.CustomerVendor.js", "kivi.Validator.js", "autocomplete_project.js");
|
|
463 | 447 |
# $form->{totalpaid} is used by the action bar setup to determine |
464 | 448 |
# whether or not canceling is allowed. Therefore it must be |
465 | 449 |
# calculated prior to the action bar setup. |
templates/webpages/ap/form_header.html | ||
---|---|---|
170 | 170 |
<tr> |
171 | 171 |
<th align="right" nowrap>[% 'Project Number' | $T8 %]</th> |
172 | 172 |
<td> |
173 |
[% L.select_tag('globalproject_id', ALL_PROJECTS, with_empty = 1, default = globalproject_id, value_key = 'id', title_key = 'projectnumber', onChange = "document.getElementById('update_button').click();") %]
|
|
173 |
[% P.project.picker('globalproject_id', globalproject_id, onchange="document.getElementById('update_button').click();") %]
|
|
174 | 174 |
</td> |
175 | 175 |
</tr> |
176 | 176 |
</table> |
... | ... | |
212 | 212 |
</td> |
213 | 213 |
<td> |
214 | 214 |
[% temp = "project_id_"_ i %] |
215 |
[% L.select_tag(temp, ALL_PROJECTS, with_empty = 1, default = loop.last ? globalproject_id : $temp, value_key = 'id', title_key = 'projectnumber') %]
|
|
215 |
[% P.project.picker(temp, loop.last ? globalproject_id : $temp) %]
|
|
216 | 216 |
</td> |
217 | 217 |
</tr> |
218 | 218 |
[% END %] |
... | ... | |
351 | 351 |
<td align="center"> |
352 | 352 |
[% temp = "paid_project_id_"_ i %] |
353 | 353 |
[% IF( changeable ) %] |
354 |
[% L.select_tag(temp, ALL_PROJECTS, with_empty = 1, default = $temp, value_key = 'id', title_key = 'projectnumber') %]
|
|
354 |
[% P.project.picker(temp, $temp) %]
|
|
355 | 355 |
[% ELSE %] |
356 | 356 |
<input type="hidden" name="[% temp %]" value="[% $temp | html %]"> |
357 | 357 |
[% temp = "label"_ temp %] |
Auch abrufbar als: Unified diff
AP: Project picker in form