Added submitting Transactions (currently breaking on headers)

This commit is contained in:
Finn 2019-07-05 16:52:32 +01:00
parent bf4b092a12
commit 46b5496901
No known key found for this signature in database
GPG key ID: 7455B4B17685B598
3 changed files with 69 additions and 18 deletions

View file

@ -24,21 +24,21 @@ sub import_csv {
sub _row_to_result {
my ( $self, $row ) = @_;
my $addr2 = $row->{post_town};
my $addr2 = $row->{post_town};
my $address = ( defined $addr2 ? ( $row->{"address line 2"} . ' ' . $addr2) : $row->{"address line 2"} );
my $address = ( defined $addr2 ? ( $row->{"address line 2"} . ' ' . $addr2) : $row->{"address line 2"} );
$self->external_result->find_or_create_related('organisations', {
external_id => $row->{supplier_id},
organisation => {
name => $row->{name},
street_name => $row->{"address line 1"},
town => $address,
postcode => $row->{post_code},
country => $row->{country_code},
entity => { type => 'organisation' },
}
});
$self->external_result->find_or_create_related('organisations', {
external_id => $row->{supplier_id},
organisation => {
name => $row->{name},
street_name => $row->{"address line 1"},
town => $address,
postcode => $row->{post_code},
country => $row->{country_code},
entity => { type => 'organisation' },
}
});
}
1;