Revision 0e60202e
Von Kivitendo Admin vor fast 8 Jahren hinzugefügt
SL/AR.pm | ||
---|---|---|
125 | 125 |
} |
126 | 126 |
} |
127 | 127 |
|
128 |
# update department |
|
129 |
($null, $form->{department_id}) = split(/--/, $form->{department}); |
|
130 |
|
|
131 | 128 |
# amount for AR account |
132 | 129 |
$form->{receivables} = $form->round_amount($form->{amount}, 2) * -1; |
133 | 130 |
|
... | ... | |
533 | 530 |
push(@values, $business_id); |
534 | 531 |
} |
535 | 532 |
if ($form->{department_id}) { |
536 |
my $department_id = $form->{department_id}; |
|
537 | 533 |
$where .= " AND a.department_id = ?"; |
538 |
push(@values, $department_id); |
|
539 |
} |
|
540 |
if ($form->{department}) { |
|
541 |
my $department = like($form->{department}); |
|
542 |
$where .= " AND d.description ILIKE ?"; |
|
543 |
push(@values, $department); |
|
534 |
push(@values, $form->{department_id}); |
|
544 | 535 |
} |
545 | 536 |
foreach my $column (qw(invnumber ordnumber cusordnumber notes transaction_description)) { |
546 | 537 |
if ($form->{$column}) { |
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}"; |
templates/webpages/ar/form_header.html | ||
---|---|---|
104 | 104 |
<td>[%- IF forex %][% L.hidden_tag('exchangerate', LxERP.format_amount(exchangerate, 5)) %][% LxERP.format_amount(exchangerate, 5) %][%- ELSE %][% L.input_tag('exchangerate', LxERP.format_amount(exchangerate, 5), size=10) %][%- END %]</td> |
105 | 105 |
[% END %] |
106 | 106 |
</tr> |
107 |
[% department_html %] |
|
108 |
[%- IF selectdepartment %] |
|
109 |
<tr> |
|
110 |
<th align="right" nowrap>[% 'Department' | $T8 %]</th> |
|
111 |
<td colspan=3><select name=department>[% selectdepartment %]</select> |
|
112 |
<input type=hidden name=selectdepartment value="[% selectdepartment | html %]"> |
|
113 |
</td> |
|
114 |
</tr> |
|
115 |
[%- END %] |
|
107 |
[% IF ALL_DEPARTMENTS %] |
|
108 |
<tr> |
|
109 |
<th align="right" nowrap>[% 'Department' | $T8 %]</th> |
|
110 |
<td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1) %]</td> |
|
111 |
</tr> |
|
112 |
[% END %] |
|
116 | 113 |
<tr> |
117 | 114 |
<td align=right>[% L.checkbox_tag('taxincluded', checked=taxincluded) %]</td> |
118 | 115 |
<th align="left" nowrap><label for="taxincluded">[% 'Tax Included' | $T8 %]</label></th> |
templates/webpages/ar/search.html | ||
---|---|---|
32 | 32 |
</tr> |
33 | 33 |
<tr> |
34 | 34 |
<th align=right nowrap>[% 'Department' | $T8 %]</th> |
35 |
<td> |
|
36 |
[%- INCLUDE 'generic/multibox.html' |
|
37 |
name = 'department', |
|
38 |
select_name = 'department_id', |
|
39 |
style = 'width: 250px', |
|
40 |
DATA = ALL_DEPARTMENTS, |
|
41 |
id_key = 'id', |
|
42 |
label_key = 'description', |
|
43 |
show_empty = 1, |
|
44 |
allow_textbox = 0, |
|
45 |
-%] |
|
46 |
</td> |
|
35 |
<td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, title_key = 'description', with_empty = 1, style="width: 200px") %]</td> |
|
47 | 36 |
</tr> |
48 | 37 |
<tr> |
49 | 38 |
<th align=right nowrap>[% 'Invoice Number' | $T8 %]</th> |
Auch abrufbar als: Unified diff
Debitorenbuchung - Abteilung nutzt immer L.select_tag als Dropdown