Revision 0e60202e
Von Kivitendo Admin vor fast 8 Jahren hinzugefügt
bin/mozilla/ar.pl | ||
---|---|---|
181 | 181 |
(@{ $form->{all_customer} }); |
182 | 182 |
} |
183 | 183 |
|
184 |
# departments |
|
185 |
if (@{ $form->{all_departments} || [] }) { |
|
186 |
$form->{selectdepartment} = "<option>\n"; |
|
187 |
$form->{department} = "$form->{department}--$form->{department_id}"; |
|
188 |
|
|
189 |
map { |
|
190 |
$form->{selectdepartment} .= |
|
191 |
"<option>$_->{description}--$_->{id}\n" |
|
192 |
} (@{ $form->{all_departments} || [] }); |
|
193 |
} |
|
184 |
$form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all; |
|
194 | 185 |
|
195 | 186 |
$form->{employee} = "$form->{employee}--$form->{employee_id}"; |
196 | 187 |
|
... | ... | |
226 | 217 |
$form->{invoice_obj} = _retrieve_invoice_object(); |
227 | 218 |
|
228 | 219 |
my ($title, $readonly, $exchangerate, $rows); |
229 |
my ($notes, $department, $customer, $employee, $amount, $project);
|
|
220 |
my ($notes, $customer, $employee, $amount, $project); |
|
230 | 221 |
my ($ARselected); |
231 | 222 |
|
232 | 223 |
|
... | ... | |
265 | 256 |
$readonly = ($form->{radier}) ? "" : $readonly; |
266 | 257 |
|
267 | 258 |
# set option selected |
268 |
foreach my $item (qw(customer currency department employee)) {
|
|
259 |
foreach my $item (qw(customer currency employee)) { |
|
269 | 260 |
$form->{"select$item"} =~ s/ selected//; |
270 | 261 |
$form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/; |
271 | 262 |
} |
... | ... | |
288 | 279 |
"taxcharts" => { "key" => "ALL_TAXCHARTS", |
289 | 280 |
"module" => "AR" },); |
290 | 281 |
|
282 |
$form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all; |
|
283 |
|
|
291 | 284 |
$_->{link_split} = { map { $_ => 1 } split/:/, $_->{link} } for @{ $form->{ALL_CHARTS} }; |
292 | 285 |
|
293 | 286 |
my %project_labels = map { $_->{id} => $_->{projectnumber} } @{ $form->{"ALL_PROJECTS"} }; |
... | ... | |
700 | 693 |
$form->isblank("duedate", $locale->text('Due Date missing!')); |
701 | 694 |
$form->isblank("customer", $locale->text('Customer missing!')); |
702 | 695 |
|
703 |
if ($myconfig{mandatory_departments} && !$form->{department}) { |
|
696 |
if ($myconfig{mandatory_departments} && !$form->{department_id}) {
|
|
704 | 697 |
$form->{saved_message} = $::locale->text('You have to specify a department.'); |
705 | 698 |
update(); |
706 | 699 |
exit; |
... | ... | |
890 | 883 |
|
891 | 884 |
# Auch in Rechnungsübersicht nach Kundentyp filtern - jan |
892 | 885 |
$form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 }, |
893 |
"departments" => "ALL_DEPARTMENTS", |
|
894 | 886 |
"customers" => "ALL_VC", |
895 | 887 |
"business_types" => "ALL_BUSINESS_TYPES"); |
896 | 888 |
$form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]); |
889 |
$form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all; |
|
897 | 890 |
$form->{SHOW_BUSINESS_TYPES} = scalar @{ $form->{ALL_BUSINESS_TYPES} } > 0; |
898 | 891 |
|
899 | 892 |
$form->{CT_CUSTOM_VARIABLES} = CVar->get_configs('module' => 'CT'); |
... | ... | |
1044 | 1037 |
push @options, $locale->text('Contact Person') . " : $form->{cp_name}"; |
1045 | 1038 |
} |
1046 | 1039 |
|
1047 |
# $form->{department} seems to never be filled, and showing the department_id |
|
1048 |
# at the top of the report doesn't make much sense. |
|
1049 |
# So determine the department name from the id whenever we have a filter for |
|
1050 |
# department |
|
1051 |
if ($form->{department}) { |
|
1052 |
my ($department) = split /--/, $form->{department}; |
|
1053 |
push @options, $locale->text('Department') . " : $department"; |
|
1054 |
} |
|
1055 | 1040 |
if ($form->{department_id}) { |
1056 |
# push @options, $locale->text('Department Id') . " : $form->{department_id}"; |
|
1057 |
unless ($form->{department}) { |
|
1058 |
require SL::DB::Department; |
|
1059 |
my $department = SL::DB::Manager::Department->find_by(id => $::form->{department_id}); |
|
1060 |
push @options, $locale->text('Department') . " : " . $department->description if $department; |
|
1061 |
} |
|
1041 |
my $department = SL::DB::Manager::Department->find_by( id => $form->{department_id} ); |
|
1042 |
push @options, $locale->text('Department') . " : " . $department->description; |
|
1062 | 1043 |
} |
1063 | 1044 |
if ($form->{invnumber}) { |
1064 | 1045 |
push @options, $locale->text('Invoice Number') . " : $form->{invnumber}"; |
Auch abrufbar als: Unified diff
Debitorenbuchung - Abteilung nutzt immer L.select_tag als Dropdown