Fixed exporting expenses (#877)
This commit is contained in:
parent
5803487d51
commit
c0514b381b
@ -21,10 +21,10 @@ class ExpenseRepository extends Repository implements CacheableInterface
|
|||||||
* Get all of the expenses for a given type, and also
|
* Get all of the expenses for a given type, and also
|
||||||
* include expenses for a given airline ID
|
* include expenses for a given airline ID
|
||||||
*
|
*
|
||||||
* @param $type
|
* @param $type
|
||||||
* @param int $airline_id
|
* @param null $airline_id
|
||||||
* @param string $ref_model
|
* @param null $ref_model
|
||||||
* @param mixed $ref_model_id
|
* @param mixed $ref_model_id
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
|
@ -44,6 +44,10 @@ class ExpenseExporter extends ImportExport
|
|||||||
$ret['airline'] = $expense->airline->icao;
|
$ret['airline'] = $expense->airline->icao;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($ret['flight_type']) {
|
||||||
|
$ret['flight_type'] = $ret['flight_type'][0];
|
||||||
|
}
|
||||||
|
|
||||||
// For the different expense types, instead of exporting
|
// For the different expense types, instead of exporting
|
||||||
// the ID, export a specific column
|
// the ID, export a specific column
|
||||||
if ($expense->ref_model === Expense::class) {
|
if ($expense->ref_model === Expense::class) {
|
||||||
@ -67,6 +71,6 @@ class ExpenseExporter extends ImportExport
|
|||||||
// And convert the ref_model into the shorter name
|
// And convert the ref_model into the shorter name
|
||||||
$ret['ref_model'] = str_replace('App\Models\\', '', $ret['ref_model']);
|
$ret['ref_model'] = str_replace('App\Models\\', '', $ret['ref_model']);
|
||||||
|
|
||||||
return $ret;
|
return array_values($ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user