Revision fa9d160c
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
scripts/import_variant_csv.pl | ||
---|---|---|
my (
|
||
$opt_user, $opt_client,
|
||
$opt_warengruppen_csv_file, $opt_farben_folder,
|
||
$opt_part_csv_file, $opt_groessen_staffeln_csv_file
|
||
$opt_part_csv_file, $opt_groessen_staffeln_csv_file,
|
||
$opt_test_run,
|
||
);
|
||
our (%myconfig, $form, $user, $employee, $auth, $locale);
|
||
|
||
... | ... | |
$opt_farben_folder = "kuw/Farben";
|
||
$opt_part_csv_file = "kuw/Export_bearbeitet.csv";
|
||
|
||
$opt_test_run = 1;
|
||
|
||
$locale = Locale->new;
|
||
$form = Form->new;
|
||
... | ... | |
my @variant_properties = values %property_name_to_variant_property;
|
||
$parent_variant->variant_properties(@variant_properties);
|
||
|
||
next; # TODO: remove after testing
|
||
next if ($opt_test_run);
|
||
|
||
next if $count_errors_at_start != scalar @errors;
|
||
$parent_variant->save();
|
||
|
||
... | ... | |
if (scalar @errors) {
|
||
say join("\n", @errors);
|
||
die join("\n", @errors);
|
||
} else {
|
||
die "Keine Fehler"; # TODO: remove after testing
|
||
return 1;
|
||
}
|
||
if ($opt_test_run) {
|
||
die "Test Durchlauf Erfolgereich: Keine Fehler in den Daten";
|
||
}
|
||
}) or do {
|
||
if (SL::DB->client->error) {
|
Auch abrufbar als: Unified diff
kuw: CSV-Import-Script: Option für Testdurchlauf hinzugefügt