Fix countries for documents #1p66u4u
This commit is contained in:
@ -22,11 +22,14 @@ class Bills extends Import
|
||||
|
||||
$row = parent::map($row);
|
||||
|
||||
$country = array_search($row['contact_country'], trans('countries'));
|
||||
|
||||
$row['document_number'] = $row['bill_number'];
|
||||
$row['issued_at'] = $row['billed_at'];
|
||||
$row['category_id'] = $this->getCategoryId($row, 'expense');
|
||||
$row['contact_id'] = $this->getContactId($row, 'vendor');
|
||||
$row['type'] = Model::BILL_TYPE;
|
||||
$row['contact_country'] = !empty($country) ? $country : null;
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
@ -17,7 +17,10 @@ class Vendors extends Import
|
||||
{
|
||||
$row = parent::map($row);
|
||||
|
||||
$country = array_search($row['country'], trans('countries'));
|
||||
|
||||
$row['type'] = 'vendor';
|
||||
$row['country'] = !empty($country) ? $country : null;
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
@ -17,7 +17,10 @@ class Customers extends Import
|
||||
{
|
||||
$row = parent::map($row);
|
||||
|
||||
$country = array_search($row['country'], trans('countries'));
|
||||
|
||||
$row['type'] = 'customer';
|
||||
$row['country'] = !empty($country) ? $country : null;
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
@ -22,11 +22,14 @@ class Invoices extends Import
|
||||
|
||||
$row = parent::map($row);
|
||||
|
||||
$country = array_search($row['contact_country'], trans('countries'));
|
||||
|
||||
$row['document_number'] = $row['invoice_number'];
|
||||
$row['issued_at'] = $row['invoiced_at'];
|
||||
$row['category_id'] = $this->getCategoryId($row, 'income');
|
||||
$row['contact_id'] = $this->getContactId($row, 'customer');
|
||||
$row['type'] = Model::INVOICE_TYPE;
|
||||
$row['contact_country'] = !empty($country) ? $country : null;
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
Reference in New Issue
Block a user