Revision da413cb1
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
1339 | 1339 |
# need the current dbh to get the not yet committed mtime |
1340 | 1340 |
$form->new_lastmtime('ar', $provided_dbh); |
1341 | 1341 |
|
1342 |
$form->{name} = $form->{customer}; |
|
1343 |
$form->{name} =~ s/--\Q$form->{customer_id}\E//; |
|
1344 |
|
|
1345 | 1342 |
# add shipto |
1346 | 1343 |
if (!$form->{shipto_id}) { |
1347 | 1344 |
$form->add_shipto($dbh, $form->{id}, "AR"); |
bin/mozilla/ir.pl | ||
---|---|---|
36 | 36 |
use SL::IR; |
37 | 37 |
use SL::IS; |
38 | 38 |
use SL::DB::Default; |
39 |
use SL::DB::Department; |
|
39 | 40 |
use SL::DB::PurchaseInvoice; |
40 | 41 |
use List::Util qw(max sum); |
41 | 42 |
use List::UtilsBy qw(sort_by); |
... | ... | |
140 | 141 |
$form->{vendor} = qq|$form->{vendor}--$form->{vendor_id}|; |
141 | 142 |
} |
142 | 143 |
|
143 |
# departments |
|
144 |
if ($form->{all_departments}) { |
|
145 |
$form->{selectdepartment} = "<option>\n"; |
|
146 |
$form->{department} = "$form->{department}--$form->{department_id}"; |
|
147 |
|
|
148 |
map { |
|
149 |
$form->{selectdepartment} .= |
|
150 |
"<option>$_->{description}--$_->{id}\n" |
|
151 |
} (@{ $form->{all_departments} || [] }); |
|
152 |
} |
|
153 |
|
|
154 | 144 |
# forex |
155 | 145 |
$form->{forex} = $form->{exchangerate}; |
156 | 146 |
my $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1; |
... | ... | |
267 | 257 |
my @old_project_ids = ($form->{"globalproject_id"}); |
268 | 258 |
map { push @old_project_ids, $form->{"project_id_$_"} if $form->{"project_id_$_"}; } 1..$form->{"rowcount"}; |
269 | 259 |
|
270 |
$form->get_lists("projects" => { "key" => "ALL_PROJECTS", |
|
271 |
"all" => 0, |
|
272 |
"old_id" => \@old_project_ids }, |
|
273 |
"taxzones" => ($form->{id} ? "ALL_TAXZONES" : "ALL_ACTIVE_TAXZONES"), |
|
260 |
$form->get_lists("taxzones" => ($form->{id} ? "ALL_TAXZONES" : "ALL_ACTIVE_TAXZONES"), |
|
274 | 261 |
"currencies" => "ALL_CURRENCIES", |
275 | 262 |
"vendors" => "ALL_VENDORS", |
276 |
"departments" => "all_departments", |
|
277 | 263 |
"price_factors" => "ALL_PRICE_FACTORS"); |
278 | 264 |
|
265 |
$TMPL_VAR{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted; |
|
279 | 266 |
$TMPL_VAR{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{employee_id}, deleted => 0 ] ]); |
280 | 267 |
$TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all_sorted(query => [ |
281 | 268 |
or => [ |
... | ... | |
286 | 273 |
] |
287 | 274 |
] |
288 | 275 |
]); |
289 |
$TMPL_VAR{department_labels} = sub { "$_[0]->{description}--$_[0]->{id}" }; |
|
290 | 276 |
|
291 | 277 |
# customer |
292 | 278 |
$TMPL_VAR{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" }; |
... | ... | |
341 | 327 |
$TMPL_VAR{payment_terms_obj} = get_payment_terms_for_invoice(); |
342 | 328 |
$form->{duedate} = $TMPL_VAR{payment_terms_obj}->calc_date(reference_date => $form->{invdate}, due_date => $form->{due_due})->to_kivitendo if $TMPL_VAR{payment_terms_obj}; |
343 | 329 |
|
344 |
$::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.Draft kivi.SalesPurchase ckeditor/ckeditor ckeditor/adapters/jquery kivi.io autocomplete_customer autocomplete_part client_js)); |
|
330 |
$::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.Draft kivi.SalesPurchase ckeditor/ckeditor ckeditor/adapters/jquery kivi.io autocomplete_customer autocomplete_part autocomplete_project client_js));
|
|
345 | 331 |
|
346 | 332 |
$form->header(); |
347 | 333 |
|
templates/webpages/ir/form_header.html | ||
---|---|---|
1 | 1 |
[%- USE T8 %] |
2 | 2 |
[%- USE HTML %] |
3 | 3 |
[%- USE LxERP %] |
4 |
[%- USE L %] |
|
4 |
[%- USE L %][%- USE P -%]
|
|
5 | 5 |
<h1>[% title %]</h1> |
6 | 6 |
|
7 | 7 |
[%- SET follow_up_trans_info = invnumber _ ' (' _ vendor_name _ ')' %] |
... | ... | |
116 | 116 |
<input type='hidden' name='taxzone_id' value='[% taxzone_id %]'> |
117 | 117 |
[%- END %] |
118 | 118 |
</tr> |
119 |
[%- IF all_departments %]
|
|
119 |
[%- IF ALL_DEPARTMENTS.as_list.size %]
|
|
120 | 120 |
<tr> |
121 | 121 |
<th align="right" nowrap>[% 'Department' | $T8 %]</th> |
122 |
<td colspan="3"> |
|
123 |
[%- INCLUDE 'generic/multibox.html' |
|
124 |
name = 'department_id', |
|
125 |
style = 'width: 250px', |
|
126 |
DATA = all_departments, |
|
127 |
id_key = 'id', |
|
128 |
label_sub = 'department_labels', |
|
129 |
show_empty = 1 -%] |
|
130 |
</td> |
|
122 |
<td colspan="3">[% P.select_tag("department_id", ALL_DEPARTMENTS, with_empty=1, default=department_id, title_key="description", style="width: 250px") %]</td> |
|
131 | 123 |
</tr> |
132 | 124 |
[%- END %] |
133 | 125 |
[%- IF currencies %] |
... | ... | |
200 | 192 |
</tr> |
201 | 193 |
<tr> |
202 | 194 |
<th align="right" nowrap>[% 'Project Number' | $T8 %]</th> |
203 |
<td> |
|
204 |
[%- INCLUDE 'generic/multibox.html' |
|
205 |
name = 'globalproject_id', |
|
206 |
DATA = ALL_PROJECTS, |
|
207 |
id_key = 'id', |
|
208 |
label_key = 'projectnumber', |
|
209 |
show_empty = 1, |
|
210 |
onChange = "document.getElementById('update_button').click();" -%] |
|
211 |
</td> |
|
195 |
<td>[% P.project_picker('globalproject_id', globalproject_id) %]</td> |
|
212 | 196 |
</tr> |
213 | 197 |
</table> |
214 | 198 |
</td> |
Auch abrufbar als: Unified diff
Einkaufsrechnungen: Abteilungs- & Projektauswahl nicht über Multibox