Revision 1c7da0cb
Von Bernd Bleßmann vor 4 Monaten hinzugefügt
bin/mozilla/oe.pl | ||
---|---|---|
43 | 43 |
use SL::OE; |
44 | 44 |
use SL::IR; |
45 | 45 |
use SL::IS; |
46 |
use SL::Helper::Flash qw(flash_later); |
|
46 | 47 |
use SL::Helper::UserPreferences::DisplayPreferences; |
47 | 48 |
use SL::MoreCommon qw(ary_diff restore_form save_form); |
48 | 49 |
use SL::Presenter::ItemsList; |
... | ... | |
259 | 260 |
$main::lxdebug->leave_sub(); |
260 | 261 |
} |
261 | 262 |
|
263 |
sub convert_to_delivery_orders { |
|
264 |
# collect order ids |
|
265 |
my @multi_ids = map { |
|
266 |
$_ =~ m{^multi_id_(\d+)$} && $::form->{'multi_id_' . $1} && $::form->{'trans_id_' . $1} |
|
267 |
} grep { $_ =~ m{^multi_id_\d+$} } keys %$::form; |
|
268 |
|
|
269 |
# make new delivery orders from given orders |
|
270 |
my @orders = map { SL::DB::Order->new(id => $_)->load } @multi_ids; |
|
271 |
my @delivery_orders = map { $_->convert_to_delivery_order() } @orders; |
|
272 |
|
|
273 |
my @do_ids = map { $_->id } @delivery_orders; |
|
274 |
|
|
275 |
require "bin/mozilla/do.pl"; |
|
276 |
$::form->{script} = 'do.pl'; |
|
277 |
$::form->{type} = 'sales_delivery_order'; |
|
278 |
$::form->{ids} = \@do_ids; |
|
279 |
$::form->{"l_$_"} = 'Y' for qw(donumber ordnumber cusordnumber transdate reqdate name employee); |
|
280 |
$::form->{top_info_text} = $::locale->text('Converted delivery orders'); |
|
281 |
|
|
282 |
flash('info', t8('#1 salses orders were converted to #2 delivery orders', scalar @orders, scalar @delivery_orders)); |
|
283 |
|
|
284 |
orders(); |
|
285 |
} |
|
286 |
|
|
262 | 287 |
sub order_links { |
263 | 288 |
$main::lxdebug->enter_sub(); |
264 | 289 |
|
... | ... | |
501 | 526 |
checks => [ [ 'kivi.check_if_entries_selected', '[name^=multi_id_]' ] ], |
502 | 527 |
accesskey => 'enter', |
503 | 528 |
], |
529 |
action => [ |
|
530 |
t8('Convert to delivery orders'), |
|
531 |
submit => [ '#form', { action => 'convert_to_delivery_orders' } ], |
|
532 |
checks => [ [ 'kivi.check_if_entries_selected', '[name^=multi_id_]' ] ], |
|
533 |
], |
|
504 | 534 |
); |
505 | 535 |
} |
506 | 536 |
} |
Auch abrufbar als: Unified diff
Auftragsbericht: mehrere Aufträge in mehrere LS umwandeln können