1 package SL::Controller::CsvImport::Shipto;
7 use parent qw(SL::Controller::CsvImport::Base);
9 use Rose::Object::MakeMethods::Generic
11 scalar => [ qw(table) ],
14 sub set_profile_defaults {
19 $self->class('SL::DB::Shipto');
25 $self->controller->track_progress(phase => 'building data', progress => 0);
28 my $num_data = scalar @{ $self->controller->data };
29 foreach my $entry (@{ $self->controller->data }) {
30 $self->controller->track_progress(progress => $i/$num_data * 100) if $i % 100 == 0;
32 $self->check_vc($entry, 'trans_id');
33 $entry->{object}->module('CT');
38 $self->add_info_columns({ header => $::locale->text('Customer/Vendor'), method => 'vc_name' });
41 sub get_duplicate_check_fields {
43 shiptoname_and_shiptostreet => {
44 label => $::locale->text('Name and Street'),
52 { s/[\s,\.\-]//g; $_ }
61 label => $::locale->text('Name'),
69 { s/[\s,\.\-]//g; $_ }
77 label => $::locale->text('Street'),
85 { s/[\s,\.\-]//g; $_ }
97 my $profile = $self->SUPER::init_profile;
98 delete @{$profile}{qw(module)};
103 sub setup_displayable_columns {
106 $self->SUPER::setup_displayable_columns;
108 $self->add_displayable_columns({ name => 'shiptocity', description => $::locale->text('City') },
109 { name => 'shiptocontact', description => $::locale->text('Contact') },
110 { name => 'shiptocountry', description => $::locale->text('Country') },
111 { name => 'shiptodepartment_1', description => $::locale->text('Department 1') },
112 { name => 'shiptodepartment_2', description => $::locale->text('Department 2') },
113 { name => 'shiptoemail', description => $::locale->text('E-mail') },
114 { name => 'shiptofax', description => $::locale->text('Fax') },
115 { name => 'shiptogln', description => $::locale->text('GLN') },
116 { name => 'shiptoname', description => $::locale->text('Name') },
117 { name => 'shiptophone', description => $::locale->text('Phone') },
118 { name => 'shiptostreet', description => $::locale->text('Street') },
119 { name => 'shiptozipcode', description => $::locale->text('Zipcode') },
120 { name => 'trans_id', description => $::locale->text('Customer/Vendor (database ID)') },
121 { name => 'customer', description => $::locale->text('Customer (name)') },
122 { name => 'customernumber', description => $::locale->text('Customer Number') },
123 { name => 'customer_gln', description => $::locale->text('Customer GLN') },
124 { name => 'vendor', description => $::locale->text('Vendor (name)') },
125 { name => 'vendornumber', description => $::locale->text('Vendor Number') },
126 { name => 'vendor_gln', description => $::locale->text('Vendor GLN') },