Revision 4e3a21dc
Von Bernd Bleßmann vor 6 Monaten hinzugefügt
bin/mozilla/oe.pl | ||
---|---|---|
35 | 35 |
|
36 | 36 |
use Carp; |
37 | 37 |
use POSIX qw(strftime); |
38 |
use Try::Tiny; |
|
38 | 39 |
|
39 | 40 |
use SL::DB::Order; |
40 | 41 |
use SL::DB::OrderItem; |
... | ... | |
267 | 268 |
} grep { $_ =~ m{^multi_id_\d+$} } keys %$::form; |
268 | 269 |
|
269 | 270 |
# 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; |
|
271 |
my @orders = map { SL::DB::Order->new(id => $_)->load } @multi_ids; |
|
272 |
my @do_ids; |
|
273 |
my @failed; |
|
274 |
foreach my $order (@orders) { |
|
275 |
my $delivery_order; |
|
276 |
try { |
|
277 |
$delivery_order = $order->convert_to_delivery_order(); |
|
278 |
} catch { |
|
279 |
push @failed, {ordnumber => $order->ordnumber, error => $_}; |
|
280 |
}; |
|
281 |
push @do_ids, $delivery_order->id if $delivery_order; |
|
282 |
} |
|
274 | 283 |
|
275 | 284 |
require "bin/mozilla/do.pl"; |
276 | 285 |
$::form->{script} = 'do.pl'; |
... | ... | |
279 | 288 |
$::form->{"l_$_"} = 'Y' for qw(donumber ordnumber cusordnumber transdate reqdate name employee); |
280 | 289 |
$::form->{top_info_text} = $::locale->text('Converted delivery orders'); |
281 | 290 |
|
282 |
flash('info', t8('#1 salses orders were converted to #2 delivery orders', scalar @orders, scalar @delivery_orders)); |
|
291 |
flash('info', t8('#1 salses orders were converted to #2 delivery orders', scalar @orders, scalar @do_ids)); |
|
292 |
if (@failed) { |
|
293 |
flash('error', t8('The following orders could not be converted to delivery orders:')); |
|
294 |
flash('error', $_->{ordnumber} . ': ' . $_->{error}) for @failed; |
|
295 |
} |
|
283 | 296 |
|
284 | 297 |
orders(); |
285 | 298 |
} |
locale/de/all | ||
---|---|---|
4129 | 4129 |
'The following is only a preview.' => 'Das Folgende ist nur eine Vorschau.', |
4130 | 4130 |
'The following list has been generated automatically from existing users collapsing users with identical settings into a single entry.' => 'Die folgende Liste wurde automatisch aus den im System vorhandenen Benutzern zusammengestellt, wobei identische Einstellungen zu einem Eintrag zusammengefasst wurden.', |
4131 | 4131 |
'The following old files whose settings have to be merged manually into the new configuration file "config/kivitendo.conf" still exist:' => 'Es existieren noch die folgenden alten Dateien, deren Einstellungen manuell in die neue Konfiguratsdatei "config/kivitendo.conf" migriert werden müssen:', |
4132 |
'The following orders could not be converted to delivery orders:' => 'Folgende Aufträge konnten nicht in Lieferscheine konvertiert werden:', |
|
4132 | 4133 |
'The following parts could not be allocated:' => 'Die folgenden Artikel konnten nicht für die Produktion belegt werden:', |
4133 | 4134 |
'The following transaction contains wrong taxes:' => 'Die folgende Buchung enthält falsche Steuern:', |
4134 | 4135 |
'The following transaction contains wrong taxkeys:' => 'Die folgende Buchung enthält falsche Steuerschlüssel:', |
locale/en/all | ||
---|---|---|
4127 | 4127 |
'The following is only a preview.' => '', |
4128 | 4128 |
'The following list has been generated automatically from existing users collapsing users with identical settings into a single entry.' => '', |
4129 | 4129 |
'The following old files whose settings have to be merged manually into the new configuration file "config/kivitendo.conf" still exist:' => '', |
4130 |
'The following orders could not be converted to delivery orders:' => '', |
|
4130 | 4131 |
'The following parts could not be allocated:' => '', |
4131 | 4132 |
'The following transaction contains wrong taxes:' => '', |
4132 | 4133 |
'The following transaction contains wrong taxkeys:' => '', |
Auch abrufbar als: Unified diff
Auftragsbericht: Umwandeln in LS: Fehler abfangen