1 package SL::Controller::CsvImport::Shipto;
7 use parent qw(SL::Controller::CsvImport::Base);
9 use Rose::Object::MakeMethods::Generic
11 scalar => [ qw(table) ],
16 $self->class('SL::DB::Shipto');
22 $self->controller->track_progress(phase => 'building data', progress => 0);
25 my $num_data = scalar @{ $self->controller->data };
26 foreach my $entry (@{ $self->controller->data }) {
27 $self->controller->track_progress(progress => $i/$num_data * 100) if $i % 100 == 0;
29 $self->check_vc($entry, 'trans_id');
30 $entry->{object}->module('CT');
35 $self->add_info_columns({ header => $::locale->text('Customer/Vendor'), method => 'vc_name' });
38 sub get_duplicate_check_fields {
40 shiptoname_and_shiptostreet => {
41 label => $::locale->text('Name and Street'),
49 { s/[\s,\.\-]//g; $_ }
58 label => $::locale->text('Name'),
66 { s/[\s,\.\-]//g; $_ }
74 label => $::locale->text('Street'),
82 { s/[\s,\.\-]//g; $_ }
92 return ( shiptoname => 75,
93 shiptodepartment_1 => 75,
94 shiptodepartment_2 => 75,
108 my $profile = $self->SUPER::init_profile;
109 delete @{$profile}{qw(module)};
114 sub setup_displayable_columns {
117 $self->SUPER::setup_displayable_columns;
119 $self->add_displayable_columns({ name => 'shiptocity', description => $::locale->text('City') },
120 { name => 'shiptocontact', description => $::locale->text('Contact') },
121 { name => 'shiptocountry', description => $::locale->text('Country') },
122 { name => 'shiptodepartment_1', description => $::locale->text('Department 1') },
123 { name => 'shiptodepartment_2', description => $::locale->text('Department 2') },
124 { name => 'shiptoemail', description => $::locale->text('E-mail') },
125 { name => 'shiptofax', description => $::locale->text('Fax') },
126 { name => 'shiptoname', description => $::locale->text('Name') },
127 { name => 'shiptophone', description => $::locale->text('Phone') },
128 { name => 'shiptostreet', description => $::locale->text('Street') },
129 { name => 'shiptozipcode', description => $::locale->text('Zipcode') },
130 { name => 'trans_id', description => $::locale->text('Customer/Vendor (database ID)') },
131 { name => 'customer', description => $::locale->text('Customer (name)') },
132 { name => 'customernumber', description => $::locale->text('Customer Number') },
133 { name => 'vendor', description => $::locale->text('Vendor (name)') },
134 { name => 'vendornumber', description => $::locale->text('Vendor Number') },