mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-23 12:44:12 -08:00
Add additional condition
This commit is contained in:
parent
30bd920497
commit
2a71877bec
|
@ -4,6 +4,7 @@ namespace App\Http\Requests;
|
|||
|
||||
use App\Models\Asset;
|
||||
use App\Models\Company;
|
||||
use App\Models\Setting;
|
||||
use Carbon\Carbon;
|
||||
use Carbon\Exceptions\InvalidFormatException;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
@ -47,7 +48,7 @@ class StoreAssetRequest extends ImageUploadRequest
|
|||
{
|
||||
$modelRules = (new Asset)->getRules();
|
||||
|
||||
if (is_string($this->input('purchase_cost'))) {
|
||||
if (Setting::getSettings()->digit_separator === '1.234,56' && is_string($this->input('purchase_cost'))) {
|
||||
// If purchase_cost was submitted as a string with a comma separator
|
||||
// then we need to ignore the normal numeric rules.
|
||||
// Since the original rules still live on the model they will be run
|
||||
|
|
Loading…
Reference in a new issue