akaunting 3.0 (the last dance)
This commit is contained in:
@@ -13,11 +13,19 @@ class Account extends FormRequest
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$type = $this->request->get('type', 'bank');
|
||||
$opening_balance = 'required';
|
||||
|
||||
if ($type == 'bank') {
|
||||
$opening_balance = '|amount:0';
|
||||
}
|
||||
|
||||
return [
|
||||
'type' => 'required|string',
|
||||
'name' => 'required|string',
|
||||
'number' => 'required|string',
|
||||
'currency_code' => 'required|string|currency',
|
||||
'opening_balance' => 'required',
|
||||
'opening_balance' => $opening_balance,
|
||||
'enabled' => 'integer|boolean',
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user