2020-01-20 02:05:40 +03:00

44 lines
911 B
PHP

<?php
namespace App\Exports\Purchases\Sheets;
use App\Abstracts\Export;
use App\Models\Purchase\Bill as Model;
class Bills extends Export
{
public function collection()
{
$model = Model::usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('id', (array) $this->ids);
}
return $model->get();
}
public function fields(): array
{
return [
'bill_number',
'order_number',
'status',
'billed_at',
'due_at',
'amount',
'currency_code',
'currency_rate',
'category_id',
'contact_id',
'contact_name',
'contact_email',
'contact_tax_number',
'contact_phone',
'contact_address',
'notes',
'footer',
];
}
}