mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Update tests.
This commit is contained in:
@@ -85,7 +85,7 @@ class ConvertController extends Controller
|
||||
|
||||
// cannot convert split.
|
||||
if ($journal->transactions()->count() > 2) {
|
||||
Session::flash('error', trans('firefly.cannot_convert_split_journl'));
|
||||
Session::flash('error', trans('firefly.cannot_convert_split_journal'));
|
||||
|
||||
return redirect(route('transactions.show', [$journal->id]));
|
||||
}
|
||||
@@ -134,7 +134,7 @@ class ConvertController extends Controller
|
||||
}
|
||||
|
||||
if ($journal->transactions()->count() > 2) {
|
||||
Session::flash('error', trans('firefly.cannot_convert_split_journl'));
|
||||
Session::flash('error', trans('firefly.cannot_convert_split_journal'));
|
||||
|
||||
return redirect(route('transactions.show', [$journal->id]));
|
||||
}
|
||||
@@ -185,7 +185,7 @@ class ConvertController extends Controller
|
||||
case TransactionType::DEPOSIT . '-' . TransactionType::WITHDRAWAL:
|
||||
case TransactionType::TRANSFER . '-' . TransactionType::WITHDRAWAL:
|
||||
// three and five
|
||||
if ($data['destination_account_expense'] === '') {
|
||||
if ($data['destination_account_expense'] === '' || is_null($data['destination_account_expense'])) {
|
||||
// destination is a cash account.
|
||||
$destination = $accountRepository->getCashAccount();
|
||||
|
||||
@@ -232,7 +232,7 @@ class ConvertController extends Controller
|
||||
case TransactionType::WITHDRAWAL . '-' . TransactionType::DEPOSIT:
|
||||
case TransactionType::TRANSFER . '-' . TransactionType::DEPOSIT:
|
||||
|
||||
if ($data['source_account_revenue'] === '') {
|
||||
if ($data['source_account_revenue'] === '' || is_null($data['source_account_revenue'])) {
|
||||
// destination is a cash account.
|
||||
$destination = $accountRepository->getCashAccount();
|
||||
|
||||
|
@@ -49,9 +49,9 @@ class AttachmentFormRequest extends Request
|
||||
{
|
||||
|
||||
return [
|
||||
'title' => 'between:1,255',
|
||||
'description' => 'between:1,65536',
|
||||
'notes' => 'between:1,65536',
|
||||
'title' => 'between:1,255|nullable',
|
||||
'description' => 'between:1,65536|nullable',
|
||||
'notes' => 'between:1,65536|nullable',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -108,9 +108,9 @@ class JournalFormRequest extends Request
|
||||
'piggy_bank_id' => 'between:1,255',
|
||||
|
||||
// foreign currency amounts
|
||||
'native_amount' => 'numeric|more:0',
|
||||
'source_amount' => 'numeric|more:0',
|
||||
'destination_amount' => 'numeric',
|
||||
'native_amount' => 'numeric|more:0|nullable',
|
||||
'source_amount' => 'numeric|more:0|nullable',
|
||||
'destination_amount' => 'numeric|more:0|nullable',
|
||||
];
|
||||
|
||||
// some rules get an upgrade depending on the type of data:
|
||||
|
@@ -57,7 +57,7 @@ class RuleGroupFormRequest extends Request
|
||||
|
||||
return [
|
||||
'title' => $titleRule,
|
||||
'description' => 'between:1,5000',
|
||||
'description' => 'between:1,5000|nullable',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user