akaunting/app/Exports/Sales/Revenues.php

39 lines
791 B
PHP
Raw Normal View History

2019-11-16 10:21:14 +03:00
<?php
2019-12-31 15:49:09 +03:00
namespace App\Exports\Sales;
2019-11-16 10:21:14 +03:00
2020-01-20 02:05:40 +03:00
use App\Abstracts\Export;
2019-11-16 10:21:14 +03:00
use App\Models\Banking\Transaction as Model;
2020-01-20 02:05:40 +03:00
class Revenues extends Export
2019-11-16 10:21:14 +03:00
{
public function collection()
{
$model = Model::type('income')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('id', (array) $this->ids);
}
return $model->get();
}
2020-01-20 02:05:40 +03:00
public function fields(): array
2019-11-16 10:21:14 +03:00
{
return [
'paid_at',
'amount',
'currency_code',
'currency_rate',
2020-01-20 00:21:37 +03:00
'account_id',
2019-11-16 10:21:14 +03:00
'document_id',
'contact_id',
2020-01-20 00:21:37 +03:00
'category_id',
'description',
2019-11-16 10:21:14 +03:00
'payment_method',
2020-01-20 00:21:37 +03:00
'reference',
2019-11-16 10:21:14 +03:00
'reconciled',
];
}
2020-01-20 00:21:37 +03:00
}