Skip to content

Commit

Permalink
Add additional condition
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmoore committed Apr 26, 2024
1 parent 30bd920 commit 2a71877
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Http/Requests/StoreAssetRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Models\Asset;
use App\Models\Company;
use App\Models\Setting;
use Carbon\Carbon;
use Carbon\Exceptions\InvalidFormatException;
use Illuminate\Support\Facades\Gate;
Expand Down Expand Up @@ -47,7 +48,7 @@ public function rules(): array
{
$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
Expand Down

0 comments on commit 2a71877

Please sign in to comment.