added scope for collection export
This commit is contained in:
@@ -9,13 +9,7 @@ class BillHistories extends Export
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
$model = Model::bill()->with('document')->usingSearchString(request('search'));
|
||||
|
||||
if (!empty($this->ids)) {
|
||||
$model->whereIn('document_id', (array) $this->ids);
|
||||
}
|
||||
|
||||
return $model->cursor();
|
||||
return Model::with('document')->bill()->collectForExport($this->ids, null, 'document_id');
|
||||
}
|
||||
|
||||
public function map($model): array
|
||||
|
||||
@@ -9,13 +9,7 @@ class BillItemTaxes extends Export
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
$model = Model::bill()->with('document', 'item', 'tax')->usingSearchString(request('search'));
|
||||
|
||||
if (!empty($this->ids)) {
|
||||
$model->whereIn('document_id', (array) $this->ids);
|
||||
}
|
||||
|
||||
return $model->cursor();
|
||||
return Model::with('document', 'item', 'tax')->bill()->collectForExport($this->ids, null, 'document_id');
|
||||
}
|
||||
|
||||
public function map($model): array
|
||||
|
||||
@@ -9,13 +9,7 @@ class BillItems extends Export
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
$model = Model::bill()->with('document', 'item')->usingSearchString(request('search'));
|
||||
|
||||
if (!empty($this->ids)) {
|
||||
$model->whereIn('document_id', (array) $this->ids);
|
||||
}
|
||||
|
||||
return $model->cursor();
|
||||
return Model::with('document', 'item')->bill()->collectForExport($this->ids, null, 'document_id');
|
||||
}
|
||||
|
||||
public function map($model): array
|
||||
|
||||
@@ -9,13 +9,7 @@ class BillTotals extends Export
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
$model = Model::bill()->with('document')->usingSearchString(request('search'));
|
||||
|
||||
if (!empty($this->ids)) {
|
||||
$model->whereIn('document_id', (array) $this->ids);
|
||||
}
|
||||
|
||||
return $model->cursor();
|
||||
return Model::with('document')->bill()->collectForExport($this->ids, null, 'document_id');
|
||||
}
|
||||
|
||||
public function map($model): array
|
||||
|
||||
@@ -11,13 +11,7 @@ class BillTransactions extends Export implements WithColumnFormatting
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
$model = Model::with('account', 'category', 'contact', 'document')->expense()->isDocument()->usingSearchString(request('search'));
|
||||
|
||||
if (!empty($this->ids)) {
|
||||
$model->whereIn('document_id', (array) $this->ids);
|
||||
}
|
||||
|
||||
return $model->cursor();
|
||||
return Model::with('account', 'category', 'contact', 'document')->expense()->isDocument()->collectForExport($this->ids, ['paid_at' => 'desc'], 'document_id');
|
||||
}
|
||||
|
||||
public function map($model): array
|
||||
|
||||
@@ -11,13 +11,7 @@ class Bills extends Export implements WithColumnFormatting
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
$model = Model::bill()->with('category')->usingSearchString(request('search'));
|
||||
|
||||
if (!empty($this->ids)) {
|
||||
$model->whereIn('id', (array) $this->ids);
|
||||
}
|
||||
|
||||
return $model->cursor();
|
||||
return Model::with('category')->bill()->collectForExport($this->ids, ['document_number' => 'desc']);
|
||||
}
|
||||
|
||||
public function map($model): array
|
||||
|
||||
Reference in New Issue
Block a user