fixed import item issue
This commit is contained in:
parent
492ae7b7f7
commit
cdea7ec070
@ -4,7 +4,6 @@ namespace App\Imports\Common\Sheets;
|
|||||||
|
|
||||||
use App\Abstracts\Import;
|
use App\Abstracts\Import;
|
||||||
use App\Http\Requests\Common\ItemTax as Request;
|
use App\Http\Requests\Common\ItemTax as Request;
|
||||||
use App\Models\Common\Item;
|
|
||||||
use App\Models\Common\ItemTax as Model;
|
use App\Models\Common\ItemTax as Model;
|
||||||
|
|
||||||
class ItemTaxes extends Import
|
class ItemTaxes extends Import
|
||||||
@ -16,14 +15,14 @@ class ItemTaxes extends Import
|
|||||||
|
|
||||||
public function map($row): array
|
public function map($row): array
|
||||||
{
|
{
|
||||||
$row = parent::map($row);
|
if ($this->isEmpty($row, 'item_name')) {
|
||||||
|
|
||||||
$row['item_id'] = (int) Item::where('name', $row['item_name'])->value('id');
|
|
||||||
|
|
||||||
if ($this->isEmpty($row, 'item_id')) {
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$row = parent::map($row);
|
||||||
|
|
||||||
|
$row['item_id'] = $this->getItemId($row);
|
||||||
|
|
||||||
$row['tax_id'] = $this->getTaxId($row);
|
$row['tax_id'] = $this->getTaxId($row);
|
||||||
|
|
||||||
return $row;
|
return $row;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user