1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00

Improve export CSV import

This commit is contained in:
Hillel Coren 2017-01-08 16:03:23 +02:00
parent 2ee346ddee
commit 7a2ff46c89

View File

@ -287,10 +287,9 @@ class ImportService
$this->addExpenseCategoryToMaps($category);
}
}
if ( ! empty($row->vendor)) {
$vendorId = $transformer->getVendorId($row->vendor);
if ( ! $vendorId) {
$vendor = $this->vendorRepo->save(['name' => $row->vendor, 'vendor_contact' => []]);
if ( ! empty($row->vendor) && ($vendorName = trim($row->vendor))) {
if ( ! $transformer->getVendorId($vendorName)) {
$vendor = $this->vendorRepo->save(['name' => $vendorName, 'vendor_contact' => []]);
$this->addVendorToMaps($vendor);
}
}