mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Force a currency for vendors
This commit is contained in:
parent
3df49b04ed
commit
454359d253
@ -49,6 +49,9 @@ class StoreVendorRequest extends Request
|
||||
// $rules['id_number'] = Rule::unique('vendors')->where('company_id', auth()->user()->company()->id);
|
||||
// }
|
||||
|
||||
$rules['currency_id'] = 'bail|required|exists:currencies,id';
|
||||
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
@ -56,6 +59,10 @@ class StoreVendorRequest extends Request
|
||||
{
|
||||
$input = $this->all();
|
||||
|
||||
if(!array_key_exists('currency_id', $input)){
|
||||
$input['currency_id'] = auth()->user()->company()->settings->currency_id;
|
||||
}
|
||||
|
||||
$input = $this->decodePrimaryKeys($input);
|
||||
|
||||
$this->replace($input);
|
||||
|
@ -42,6 +42,7 @@ class UpdateVendorRequest extends Request
|
||||
}
|
||||
|
||||
$rules['contacts.*.email'] = 'nullable|distinct';
|
||||
$rules['currency_id'] = 'bail|sometimes|exists:currencies,id';
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user