2019-11-16 10:21:14 +03:00
|
|
|
<?php
|
|
|
|
|
2019-12-31 15:49:09 +03:00
|
|
|
namespace App\Exports\Purchases\Sheets;
|
2019-11-16 10:21:14 +03:00
|
|
|
|
2020-01-20 02:05:40 +03:00
|
|
|
use App\Abstracts\Export;
|
2019-12-31 15:49:09 +03:00
|
|
|
use App\Models\Purchase\BillItemTax as Model;
|
2019-11-16 10:21:14 +03:00
|
|
|
|
2020-01-20 02:05:40 +03:00
|
|
|
class BillItemTaxes extends Export
|
2019-11-16 10:21:14 +03:00
|
|
|
{
|
|
|
|
public function collection()
|
|
|
|
{
|
|
|
|
$model = Model::usingSearchString(request('search'));
|
|
|
|
|
2020-01-20 02:05:40 +03:00
|
|
|
if (!empty($this->ids)) {
|
|
|
|
$model->whereIn('bill_id', (array) $this->ids);
|
2019-11-16 10:21:14 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return $model->get();
|
|
|
|
}
|
|
|
|
|
2020-01-20 02:05:40 +03:00
|
|
|
public function fields(): array
|
2019-11-16 10:21:14 +03:00
|
|
|
{
|
|
|
|
return [
|
|
|
|
'bill_id',
|
|
|
|
'bill_item_id',
|
|
|
|
'tax_id',
|
|
|
|
'name',
|
|
|
|
'amount',
|
|
|
|
];
|
|
|
|
}
|
2020-01-20 00:21:37 +03:00
|
|
|
}
|