Fix split edit.

This commit is contained in:
James Cole 2018-04-04 19:15:05 +02:00
parent 3819de4e74
commit 2685256c93
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 4 additions and 4 deletions

View File

@ -267,8 +267,8 @@ class SplitController extends Controller
// take some info from first transaction, that should at least exist.
$array[$index] = $row;
$array[$index]['currency_id'] = $array[0]['transaction_currency_id'];
$array[$index]['currency_code'] = $array[0]['transaction_currency_code'];
$array[$index]['currency_symbol'] = $array[0]['transaction_currency_symbol'];
$array[$index]['currency_code'] = $array[0]['transaction_currency_code'] ?? '';
$array[$index]['currency_symbol'] = $array[0]['transaction_currency_symbol'] ?? '';
$array[$index]['foreign_amount'] = round($array[0]['foreign_destination_amount'] ?? '0', 12);
$array[$index]['foreign_currency_id'] = $array[0]['foreign_currency_id'];
$array[$index]['foreign_currency_code'] = $array[0]['foreign_currency_code'];

View File

@ -90,12 +90,12 @@ class SplitJournalFormRequest extends Request
'identifier' => $index,
'currency_id' => $this->integer('journal_currency_id'),
'currency_code' => null,
'description' => $transaction['transaction_description'],
'description' => $transaction['transaction_description'] ?? '',
'amount' => $transaction['amount'],
'budget_id' => (int)($transaction['budget_id'] ?? 0.0),
'budget_name' => null,
'category_id' => null,
'category_name' => $transaction['category_name'],
'category_name' => $transaction['category_name'] ?? '',
];
$data['transactions'][] = $set;
}