Convert expense type to char, translations for ExpenseType

This commit is contained in:
Nabeel Shahzad
2018-04-01 22:26:20 -05:00
parent 2a01a935c0
commit cfd0853d79
12 changed files with 78 additions and 65 deletions

View File

@@ -44,15 +44,13 @@ class ExpenseExporter extends ImportExport
$ret['airline'] = $expense->airline->icao;
}
$ret['type'] = ExpenseType::convertToCode($ret['type']);
// For the different expense types, instead of exporting
// the ID, export a specific column
if ($expense->ref_model === Expense::class) {
$ret['ref_model'] = '';
$ret['ref_model_id'] = '';
} else {
$obj = $expense->getReference();
$obj = $expense->getReferencedObject();
if(!$obj) { // bail out
return $ret;
}