decimals in server price and tax

This commit is contained in:
1Day 2022-07-12 07:17:09 +02:00
parent 4e63d5348f
commit f3269bac57
4 changed files with 35 additions and 3 deletions

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class DecimalsInPrice extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('products', function (Blueprint $table) {
$table->decimal('price',['11','2'])->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('products', function (Blueprint $table) {
$table->integer('price')->change();
});
}
}

View file

@ -64,7 +64,7 @@
<div class="form-group">
<label for="price">{{__('Price in')}} {{CREDITS_DISPLAY_NAME}}</label>
<input value="{{$product->price ?? old('price')}}" id="price" name="price"
<input value="{{$product->price ?? old('price')}}" id="price" name="price" step=".01"
type="number"
class="form-control @error('price') is-invalid @enderror"
required="required">

View file

@ -76,7 +76,7 @@
<div class="form-group">
<label for="price">{{__('Price in')}} {{ CREDITS_DISPLAY_NAME }}</label>
<input value="{{ $product->price }}" id="price" name="price" type="number"
<input value="{{ $product->price }}" id="price" name="price" type="number" step=".01"
class="form-control @error('price') is-invalid @enderror"
required="required">
@error('price')

View file

@ -130,7 +130,7 @@
data-content="Tax Value that will be added to the total price of the order. <br><br> Example: 19 results in (19%)"
class="fas fa-info-circle"></i>
</div>
<input x-model="sales-tax" id="sales-tax" name="sales-tax" type="number"
<input x-model="sales-tax" id="sales-tax" name="sales-tax" type="number" step=".01"
value="{{ config('SETTINGS::PAYMENTS:SALES_TAX') }}"
class="form-control @error('sales-tax') is-invalid @enderror">
</div>