fixed item import

This commit is contained in:
Denis Duliçi
2021-01-18 11:08:41 +03:00
parent 3ac6bb98ac
commit b820d763d2
4 changed files with 39 additions and 3 deletions

View File

@@ -4,13 +4,17 @@ namespace App\Imports\Common\Sheets;
use App\Abstracts\Import;
use App\Http\Requests\Common\ItemTax as Request;
use App\Models\Common\Item;
use App\Models\Common\ItemTax as Model;
class ItemTaxes extends Import
{
public function model(array $row)
{
// @todo remove after laravel-excel 3.2 release
if ($row['item_name'] === $this->empty_field) {
return null;
}
return new Model($row);
}
@@ -18,6 +22,7 @@ class ItemTaxes extends Import
{
$row = parent::map($row);
$row['item_id'] = $this->getItemIdFromName($row);
$row['tax_id'] = $this->getTaxId($row);
return $row;