Merge pull request #1757 from burakcakirel/export-documents

Fix the error when exporting documents
This commit is contained in:
Cüneyt Şentürk 2021-01-14 03:00:38 +03:00 committed by GitHub
commit 4cc74f040c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ class BillTransactions extends Export implements WithColumnFormatting
{ {
public function collection() public function collection()
{ {
$model = Model::with('account', 'category', 'contact', 'document')->bill()->isDocument()->usingSearchString(request('search')); $model = Model::with('account', 'category', 'contact', 'document')->expense()->isDocument()->usingSearchString(request('search'));
if (!empty($this->ids)) { if (!empty($this->ids)) {
$model->whereIn('document_id', (array) $this->ids); $model->whereIn('document_id', (array) $this->ids);

View File

@ -13,7 +13,7 @@ class InvoiceTransactions extends Export implements WithColumnFormatting
{ {
public function collection() public function collection()
{ {
$model = Model::with('account', 'category', 'contact', 'document')->invoice()->isDocument()->usingSearchString(request('search')); $model = Model::with('account', 'category', 'contact', 'document')->income()->isDocument()->usingSearchString(request('search'));
if (!empty($this->ids)) { if (!empty($this->ids)) {
$model->whereIn('document_id', (array) $this->ids); $model->whereIn('document_id', (array) $this->ids);