Merge branch 'master' of github.com:akaunting/akaunting
This commit is contained in:
commit
e0ccf314b2
@ -107,7 +107,7 @@ class Item extends Model
|
|||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $query->whereIn($this->qualifyColumn('type'), $type);
|
return $query->where($this->qualifyColumn('type'), $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -323,8 +323,10 @@ trait Import
|
|||||||
return $contact->id;
|
return $contact->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getItemIdFromName($row, $type = 'product')
|
public function getItemIdFromName($row, $type = null)
|
||||||
{
|
{
|
||||||
|
$type = !empty($type) ? $type : (!empty($row['item_type']) ? $row['item_type'] : 'product');
|
||||||
|
|
||||||
$item_id = Item::type($type)->where('name', $row['item_name'])->pluck('id')->first();
|
$item_id = Item::type($type)->where('name', $row['item_name'])->pluck('id')->first();
|
||||||
|
|
||||||
if (!empty($item_id)) {
|
if (!empty($item_id)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user