mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -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\Asset;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
|
use App\Models\Setting;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Carbon\Exceptions\InvalidFormatException;
|
use Carbon\Exceptions\InvalidFormatException;
|
||||||
use Illuminate\Support\Facades\Gate;
|
use Illuminate\Support\Facades\Gate;
|
||||||
|
@ -47,7 +48,7 @@ class StoreAssetRequest extends ImageUploadRequest
|
||||||
{
|
{
|
||||||
$modelRules = (new Asset)->getRules();
|
$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
|
// If purchase_cost was submitted as a string with a comma separator
|
||||||
// then we need to ignore the normal numeric rules.
|
// then we need to ignore the normal numeric rules.
|
||||||
// Since the original rules still live on the model they will be run
|
// Since the original rules still live on the model they will be run
|
||||||
|
|
Loading…
Reference in a new issue