Can now create transfers with different currencies.

This commit is contained in:
James Cole
2017-04-14 22:25:48 +02:00
parent e2fe8cfb75
commit a27f5d2474
6 changed files with 165 additions and 29 deletions

View File

@@ -67,8 +67,10 @@ class JournalFormRequest extends Request
'destination_account_name' => $this->string('destination_account_name'),
'piggy_bank_id' => $this->integer('piggy_bank_id'),
// native amount
// native amount and stuff like that:
'native_amount' => $this->float('native_amount'),
'source_amount' => $this->float('source_amount'),
'destination_amount' => $this->float('destination_amount'),
];
@@ -105,8 +107,10 @@ class JournalFormRequest extends Request
'destination_account_name' => 'between:1,255',
'piggy_bank_id' => 'between:1,255',
// exchange rate data:
'native_amount' => 'numeric|more:0',
// foreign currency amounts
'native_amount' => 'numeric|more:0',
'source_amount' => 'numeric|more:0',
'destination_amount' => 'numeric|more:0',
];
// some rules get an upgrade depending on the type of data: