Revision 1c7da0cb
Von Bernd Bleßmann vor 6 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 |
} |
locale/de/all | ||
---|---|---|
35 | 35 |
'#1 prices were updated.' => '#1 Preise wurden aktualisiert.', |
36 | 36 |
'#1 proposal(s) saved.' => '#1 Vorschläge gespeichert.', |
37 | 37 |
'#1 proposal(s) with #2 invoice(s) saved.' => '#1 Vorschlag(e) mit #2 Rechnung(en) abgespeichert', |
38 |
'#1 salses orders were converted to #2 delivery orders' => '#1 Auftragsbestätigungen wurden in #2 Lieferscheine umgewandelt', |
|
38 | 39 |
'#1 section(s)' => '#1 Abschnitt(e)', |
39 | 40 |
'#1 text block(s) back' => '#1 Textlock/-blöcke vorne', |
40 | 41 |
'#1 text block(s) front' => '#1 Textblock/-blöcke hinten', |
... | ... | |
841 | 842 |
'Conversion of "birthday" contact person attribute' => 'Umstellung des Kontaktpersonenfeldes "Geburtstag"', |
842 | 843 |
'Conversion to PDF failed: #1' => 'Konvertierung zu PDF schlug fehl: #1', |
843 | 844 |
'Conversion:' => 'Konversion', |
845 |
'Convert to delivery orders' => 'In Lieferscheine umwandeln', |
|
846 |
'Converted delivery orders' => 'Umgewandelte Lieferscheine', |
|
844 | 847 |
'Converting to deliveryorder' => 'Konvertiere zu Lieferschein', |
845 | 848 |
'Copies' => 'Kopien', |
846 | 849 |
'Copy' => 'Kopieren', |
locale/en/all | ||
---|---|---|
35 | 35 |
'#1 prices were updated.' => '', |
36 | 36 |
'#1 proposal(s) saved.' => '', |
37 | 37 |
'#1 proposal(s) with #2 invoice(s) saved.' => '', |
38 |
'#1 salses orders were converted to #2 delivery orders' => '', |
|
38 | 39 |
'#1 section(s)' => '', |
39 | 40 |
'#1 text block(s) back' => '', |
40 | 41 |
'#1 text block(s) front' => '', |
... | ... | |
841 | 842 |
'Conversion of "birthday" contact person attribute' => '', |
842 | 843 |
'Conversion to PDF failed: #1' => '', |
843 | 844 |
'Conversion:' => '', |
845 |
'Convert to delivery orders' => '', |
|
846 |
'Converted delivery orders' => '', |
|
844 | 847 |
'Converting to deliveryorder' => '', |
845 | 848 |
'Copies' => '', |
846 | 849 |
'Copy' => '', |
Auch abrufbar als: Unified diff
Auftragsbericht: mehrere Aufträge in mehrere LS umwandeln können