Revision 1d78de40
Von Bernd Bleßmann vor fast 11 Jahren hinzugefügt
SL/Controller/CsvImport/Order.pm | ||
---|---|---|
93 | 93 |
); |
94 | 94 |
|
95 | 95 |
$self->add_displayable_columns('OrderItem', |
96 |
{ name => 'parts_id', description => $::locale->text('Part (database ID)') }, |
|
97 |
{ name => 'partnumber', description => $::locale->text('Part Number') }, |
|
96 |
{ name => 'parts_id', description => $::locale->text('Part (database ID)') }, |
|
97 |
{ name => 'partnumber', description => $::locale->text('Part Number') }, |
|
98 |
{ name => 'project_id', description => $::locale->text('Project (database ID)') }, |
|
99 |
{ name => 'projectnumber', description => $::locale->text('Project (number)') }, |
|
100 |
{ name => 'project', description => $::locale->text('Project (description)') }, |
|
98 | 101 |
); |
99 | 102 |
} |
100 | 103 |
|
... | ... | |
245 | 248 |
|
246 | 249 |
$self->add_info_columns($self->settings->{'order_column'}, |
247 | 250 |
{ header => $::locale->text('Customer/Vendor'), method => 'vc_name' }); |
251 |
# Todo: access via ->[0] ok? Better: search first order column and use this |
|
248 | 252 |
$self->add_columns($self->settings->{'order_column'}, |
249 | 253 |
map { "${_}_id" } grep { exists $self->controller->data->[0]->{raw_data}->{$_} } qw(payment language department globalproject taxzone)); |
250 | 254 |
$self->add_columns($self->settings->{'order_column'}, 'globalproject_id') if exists $self->controller->data->[0]->{raw_data}->{globalprojectnumber}; |
... | ... | |
264 | 268 |
# set to 0 if not given |
265 | 269 |
$entry->{object}->discount(0) unless $entry->{object}->discount; |
266 | 270 |
$entry->{object}->ship(0) unless $entry->{object}->ship; |
271 |
|
|
272 |
$self->check_project($entry, global => 0); |
|
267 | 273 |
} |
268 | 274 |
} |
269 | 275 |
|
270 | 276 |
$self->add_info_columns($self->settings->{'item_column'}, |
271 | 277 |
{ header => $::locale->text('Part Number'), method => 'partnumber' }); |
278 |
# Todo: access via ->[1] ok? Better: search first item column and use this |
|
279 |
$self->add_columns($self->settings->{'item_column'}, |
|
280 |
map { "${_}_id" } grep { exists $self->controller->data->[1]->{raw_data}->{$_} } qw(project)); |
|
281 |
$self->add_columns($self->settings->{'item_column'}, 'project_id') if exists $self->controller->data->[1]->{raw_data}->{projectnumber}; |
|
272 | 282 |
|
273 | 283 |
# add orderitems to order |
274 | 284 |
my $order_entry; |
... | ... | |
330 | 340 |
} ); |
331 | 341 |
|
332 | 342 |
foreach my $tv (@to_verify) { |
343 |
# Todo: access via ->[0] ok? Better: search first order column and use this |
|
333 | 344 |
if (exists $self->controller->data->[0]->{raw_data}->{ $tv->{raw_column} }) { |
334 | 345 |
$self->add_raw_data_columns($self->settings->{'order_column'}, $tv->{raw_column}); |
335 | 346 |
$self->add_info_columns($self->settings->{'order_column'}, |
Auch abrufbar als: Unified diff
Projekte pro Position behandeln.