Fix some tests.

This commit is contained in:
James Cole
2018-03-23 05:31:45 +01:00
parent fb0a0c3fb5
commit 3e22c9860e
3 changed files with 68 additions and 48 deletions

View File

@@ -65,10 +65,10 @@ class SplitJournalFormRequest extends Request
switch ($data['type']) {
case 'withdrawal':
$sourceId = $this->integer('journal_source_account_id');
$destinationName = $transaction['destination_name'];
$destinationName = $transaction['destination_name'] ?? '';
break;
case 'deposit':
$sourceName = $transaction['source_name'];
$sourceName = $transaction['source_name'] ?? '';
$destinationId = $this->integer('journal_destination_account_id');
break;
case 'transfer':

View File

@@ -150,7 +150,7 @@ class AccountTransformer extends TransformerAbstract
if (strlen($role) === 0 || $type !== AccountType::ASSET) {
$role = null;
}
$currencyId = (int)$this->repository->getMetaValue($account, 'currency_id');
$currencyId = intval($this->repository->getMetaValue($account, 'currency_id'));
$currencyCode = null;
$decimalPlaces = 2;
if ($currencyId > 0) {
@@ -197,7 +197,7 @@ class AccountTransformer extends TransformerAbstract
'currency_code' => $currencyCode,
'current_balance' => round(app('steam')->balance($account, $date), $decimalPlaces),
'current_balance_date' => $date->format('Y-m-d'),
'notes' => $this->repository->getNote($account),
'notes' => $this->repository->getNoteText($account),
'monthly_payment_date' => $monthlyPaymentDate,
'credit_card_type' => $creditCardType,
'account_number' => $this->repository->getMetaValue($account, 'accountNumber'),