Revision cab8b4ae
Von Kivitendo Admin vor fast 8 Jahren hinzugefügt
SL/Controller/CsvImport/Part.pm | ||
---|---|---|
39 | 39 |
sellprice_adjustment_type => 'percent', |
40 | 40 |
article_number_policy => 'update_prices', |
41 | 41 |
shoparticle_if_missing => '0', |
42 |
parts_type => 'part',
|
|
42 |
part_type => 'part',
|
|
43 | 43 |
default_buchungsgruppe => ($bugru ? $bugru->id : undef), |
44 | 44 |
apply_buchungsgruppe => 'all', |
45 | 45 |
); |
... | ... | |
126 | 126 |
|
127 | 127 |
return { map { ( $_ => $self->controller->profile->get($_) ) } qw(apply_buchungsgruppe default_buchungsgruppe article_number_policy |
128 | 128 |
sellprice_places sellprice_adjustment sellprice_adjustment_type |
129 |
shoparticle_if_missing parts_type default_unit) };
|
|
129 |
shoparticle_if_missing part_type default_unit) }; |
|
130 | 130 |
} |
131 | 131 |
|
132 | 132 |
sub init_all_cvar_configs { |
... | ... | |
173 | 173 |
} continue { |
174 | 174 |
$i++; |
175 | 175 |
} |
176 |
$self->add_columns(qw(type)) if $self->settings->{parts_type} eq 'mixed'; |
|
176 |
|
|
177 |
$self->add_columns(qw(part_type)) if $self->settings->{part_type} eq 'mixed'; |
|
177 | 178 |
$self->add_columns(qw(buchungsgruppen_id unit)); |
178 | 179 |
$self->add_columns(map { "${_}_id" } grep { exists $self->controller->data->[0]->{raw_data}->{$_} } qw (price_factor payment partsgroup warehouse bin)); |
179 | 180 |
$self->add_columns(qw(shop)) if $self->settings->{shoparticle_if_missing}; |
... | ... | |
406 | 407 |
sub check_type { |
407 | 408 |
my ($self, $entry) = @_; |
408 | 409 |
|
409 |
my $type = $self->settings->{parts_type};
|
|
410 |
my $type = $self->settings->{part_type}; |
|
410 | 411 |
|
411 | 412 |
if ($type eq 'mixed' && $entry->{raw_data}->{type}) { |
412 |
$type = $entry->{raw_data}->{type} =~ m/^p/i ? 'part' |
|
413 |
: $entry->{raw_data}->{type} =~ m/^s/i ? 'service' |
|
414 |
: $entry->{raw_data}->{type} =~ m/^a/i ? 'assembly' |
|
415 |
: undef; |
|
413 |
$type = $entry->{raw_data}->{part_type} =~ m/^p/i ? 'part' |
|
414 |
: $entry->{raw_data}->{part_type} =~ m/^s/i ? 'service' |
|
415 |
: $entry->{raw_data}->{part_type} =~ m/^a/i ? 'assembly' |
|
416 |
: $entry->{raw_data}->{part_type} =~ m/^assor/i ? 'assortment' |
|
417 |
: undef; |
|
416 | 418 |
} |
417 | 419 |
|
418 | 420 |
# when saving income_accno_id or expense_accno_id use ids from the selected |
scripts/csv-import-from-shell.sh | ||
---|---|---|
66 | 66 |
# "settings.apply_buchungsgruppe": Buchungsgruppe wo anwenden: |
67 | 67 |
# "never", "all", "missing" |
68 | 68 |
|
69 |
# "settings.parts_type": Artikeltyp: "part", "service", "mixed"
|
|
69 |
# "settings.part_type": Artikeltyp: "part", "service", "mixed" |
|
70 | 70 |
|
71 | 71 |
# "settings.article_number_policy": Artikel mit existierender |
72 | 72 |
# Artikelnummer: "update_prices", "insert_new" |
... | ... | |
127 | 127 |
-F 'settings.default_buchungsgruppe=395' \ |
128 | 128 |
-F 'settings.duplicates=no_check' \ |
129 | 129 |
-F 'settings.numberformat=1.000,00' \ |
130 |
-F 'settings.parts_type=part' \
|
|
130 |
-F 'settings.part_type=part' \ |
|
131 | 131 |
-F 'settings.sellprice_adjustment=0' \ |
132 | 132 |
-F 'settings.sellprice_adjustment_type=percent' \ |
133 | 133 |
-F 'settings.sellprice_places=2' \ |
t/controllers/csvimport/parts.t | ||
---|---|---|
152 | 152 |
sellprice_adjustment_type => 'percent', |
153 | 153 |
article_number_policy => 'update_prices', |
154 | 154 |
shoparticle_if_missing => '0', |
155 |
parts_type => 'part',
|
|
155 |
part_type => 'part',
|
|
156 | 156 |
default_buchungsgruppe => ($bugru ? $bugru->id : undef), |
157 | 157 |
apply_buchungsgruppe => 'all', |
158 | 158 |
}; |
... | ... | |
162 | 162 |
sellprice_adjustment_type => 'percent', |
163 | 163 |
article_number_policy => 'update_parts', |
164 | 164 |
shoparticle_if_missing => '0', |
165 |
parts_type => 'part',
|
|
165 |
part_type => 'part',
|
|
166 | 166 |
default_buchungsgruppe => ($bugru ? $bugru->id : undef), |
167 | 167 |
apply_buchungsgruppe => 'missing', |
168 | 168 |
default_unit => 'Stck', |
t/request/post_multipart.t | ||
---|---|---|
47 | 47 |
'charset' => undef, |
48 | 48 |
'apply_buchungsgruppe' => undef, |
49 | 49 |
'full_preview' => undef, |
50 |
'parts_type' => undef,
|
|
50 |
'part_type' => undef, |
|
51 | 51 |
'default_unit' => undef, |
52 | 52 |
'default_buchungsgruppe' => undef, |
53 | 53 |
'duplicates' => undef, |
... | ... | |
83 | 83 |
'charset' => 'UTF-8', |
84 | 84 |
'apply_buchungsgruppe' => 'all', |
85 | 85 |
'full_preview' => '0', |
86 |
'parts_type' => 'part',
|
|
86 |
'part_type' => 'part', |
|
87 | 87 |
'default_unit' => 'g', |
88 | 88 |
'default_buchungsgruppe' => '815', |
89 | 89 |
'duplicates' => 'no_check', |
t/request/post_multipart_1 | ||
---|---|---|
67 | 67 |
|
68 | 68 |
0 |
69 | 69 |
-----------------------------23281168279961 |
70 |
Content-Disposition: form-data; name="settings.parts_type"
|
|
70 |
Content-Disposition: form-data; name="settings.part_type" |
|
71 | 71 |
|
72 | 72 |
part |
73 | 73 |
-----------------------------23281168279961 |
templates/webpages/csv_import/_form_parts.html | ||
---|---|---|
36 | 36 |
<th align="right">[%- LxERP.t8('Type') %]:</th> |
37 | 37 |
<td colspan="10"> |
38 | 38 |
[% opts = [ [ 'part', LxERP.t8('Parts') ], [ 'service', LxERP.t8('Services') ], [ 'mixed', LxERP.t8('Mixed (requires column "type")') ] ] %] |
39 |
[% L.select_tag('settings.parts_type', opts, default = SELF.profile.get('parts_type'), style = 'width: 300px') %]
|
|
39 |
[% L.select_tag('settings.part_type', opts, default = SELF.profile.get('part_type'), style = 'width: 300px') %]
|
|
40 | 40 |
</td> |
41 | 41 |
</tr> |
42 | 42 |
|
Auch abrufbar als: Unified diff
Part CsvImport - Umbenennung parts_type nach part_type