bills import/export
This commit is contained in:
@@ -9,7 +9,7 @@ class BillItems extends Export
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
$model = Model::usingSearchString(request('search'));
|
||||
$model = Model::with(['bill', 'item'])->usingSearchString(request('search'));
|
||||
|
||||
if (!empty($this->ids)) {
|
||||
$model->whereIn('bill_id', (array) $this->ids);
|
||||
@@ -18,12 +18,19 @@ class BillItems extends Export
|
||||
return $model->get();
|
||||
}
|
||||
|
||||
public function map($model): array
|
||||
{
|
||||
$model->bill_number = $model->bill->bill_number;
|
||||
$model->item_name = $model->item->name;
|
||||
|
||||
return parent::map($model);
|
||||
}
|
||||
|
||||
public function fields(): array
|
||||
{
|
||||
return [
|
||||
'bill_id',
|
||||
'item_id',
|
||||
'name',
|
||||
'bill_number',
|
||||
'item_name',
|
||||
'quantity',
|
||||
'price',
|
||||
'total',
|
||||
|
Reference in New Issue
Block a user