Revision 67f3e4cd
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
scripts/import_variant_csv.pl | ||
---|---|---|
use SL::DB::VariantPropertyValue;
|
||
use SL::DB::Warehouse;
|
||
use SL::DB::Inventory;
|
||
use SL::DB::Buchungsgruppe;
|
||
|
||
use feature "say";
|
||
|
||
... | ... | |
my $transfer_type = SL::DB::Manager::TransferType->find_by(
|
||
direction => 'in',
|
||
description => 'stock',
|
||
) or die "Could no find transfer_type";
|
||
) or die "Could not find transfer_type";
|
||
|
||
my $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(
|
||
description => 'Standard 19%',
|
||
) or die "Could not find buchungsgruppe";
|
||
|
||
SL::DB->client->with_transaction(sub {
|
||
my @errors;
|
||
... | ... | |
%parent_variant_fix_att
|
||
);
|
||
$parent_variant->update_attributes(
|
||
description => $description,
|
||
sellprice => $best_sellprice,
|
||
partsgroup => $partsgroup,
|
||
warehouse => $warehouse,
|
||
bin => $warehouse->bins->[0],
|
||
unit => 'Stck',
|
||
description => $description,
|
||
sellprice => $best_sellprice,
|
||
partsgroup => $partsgroup,
|
||
warehouse => $warehouse,
|
||
bin => $warehouse->bins->[0],
|
||
unit => 'Stck',
|
||
buchungsgruppen_id => $buchungsgruppe->id,
|
||
);
|
||
|
||
unless (scalar @{$parent_variant->makemodels}) {
|
Auch abrufbar als: Unified diff
kuw: CSV-Import-Script: Buchungsgruppe hinzufügen