31 lines
606 B
PHP
31 lines
606 B
PHP
<?php
|
|
|
|
namespace App\Imports\Purchases\Sheets;
|
|
|
|
use App\Abstracts\Import;
|
|
use App\Models\Purchase\Bill as Model;
|
|
use App\Http\Requests\Purchase\Bill as Request;
|
|
|
|
class Bills extends Import
|
|
{
|
|
public function model(array $row)
|
|
{
|
|
return new Model($row);
|
|
}
|
|
|
|
public function map($row): array
|
|
{
|
|
$row = parent::map($row);
|
|
|
|
$row['category_id'] = $this->getCategoryId($row, 'expense');
|
|
$row['contact_id'] = $this->getContactId($row, 'vendor');
|
|
|
|
return $row;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return (new Request())->rules();
|
|
}
|
|
}
|