Upgrade boilerplate

This commit is contained in:
Ludovic CANDELLIER
2021-09-22 21:01:43 +02:00
parent ffb9f81353
commit e98266e556
56 changed files with 1477 additions and 701 deletions

View File

@@ -7,6 +7,12 @@
@include('components.number', ['name' => 'price_list_values[' . $index . '][quantity]', 'value' => $price_list_value['quantity'] ?? null, 'required' => true, 'meta' => "step = '.01'"])
</td>
<td>
@include('components.money', ['name' => 'price_list_values[' . $index . '][price]', 'value' => $price_list_value['price'] ?? null, 'required' => true])
@include('components.money', ['name' => 'price_list_values[' . $index . '][price]', 'value' => $price_list_value['price'] ?? null, 'required' => true, 'class' => 'price'])
</td>
<td>
@include('components.select', ['name' => 'price_list_values[' . $index . '][tax_id]', 'list' => $taxes ?? [], 'value' => $price_list_value['tax_id'] ?? null, 'required' => true, 'class' => 'tax'])
</td>
<td>
@include('components.money', ['name' => 'price_list_values[' . $index . '][price_taxed]', 'value' => $price_list_value['price_taxed'] ?? null, 'required' => true, 'class' => 'price_taxed'])
</td>
</tr>

View File

@@ -1,36 +0,0 @@
@extends('layout.index', [
'title' => __('products.title'),
'subtitle' => __('products.title'),
'breadcrumb' => [__('products.title')]
])
@section('content')
<form action="{{ route('Shop.Products') }}" method="GET">
<div class="row">
<div class="col-md-offset-2 col-md-8">
<div class="box box-info">
<div class="box-body">
<div class="col-md-6">
<h3>{{ name }}</h3>
<h4>
{{ $product.section.name }}<br>
</h4>
</div>
<div class="col-md-6 text-right">
<h2>{{ $prix_total }} </h2>
<h4>{{ $residence['type_produit']['name'] }}</h4>
</div>
<div class="col-md-12">
@include('Hestimmo.modules.Lot.partials.carousel')
</div>
</div>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -27,7 +27,9 @@
<tr>
<th>Code</th>
<th>Seuil</th>
<th>Prix Unit.</th>
<th>Unit. HT</th>
<th>TVA</th>
<th>Unit. TTC</th>
</tr>
</thead>
<tbody>
@@ -58,11 +60,49 @@
$.get("{{ route('Admin.Shop.PriceListValues.addPrice') }}/" + index, function(data) {
$("#prices-table").append(data);
})
handlePrices();
})
}
function handle_prices() {
$('.price').change(function() {
$col_tax = $(this).parent().parent().find('.tax')();
tax_selected = $col_tax.find('select option:selected').text();
price_taxed = $(this).val() * (1 + (tax_selected / 100));
price_taxed = price_taxed.toFixed(2);
$(this).parent().parent().find('.price_taxed').val(price_taxed);
})
}
function handle_taxes() {
$('.tax').change(function() {
tax_selected = $(this).text();
price = $(this).parent().parent().find('.price').val();
price_taxed = price * (1 + (tax_selected / 100));
price_taxed = price_taxed.toFixed(2);
$(this).parent().parent().find('.price_taxed').val(price_taxed);
})
}
function handle_prices_taxed() {
$('.price_taxed').change(function() {
$col_tax = $(this).parent().parent().find('.tax')();
tax_selected = $col_tax.find('select option:selected').text();
price = $(this).val() / (1 + (tax_selected / 100));
price = price.toFixed(2);
$(this).parent().parent().find('.price').val(price);
})
}
function handlePrices() {
handle_prices();
handle_taxes();
handle_prices_taxed();
}
$(function() {
handleAddPrice();
handlePrices();
});
</script>

View File

@@ -3,10 +3,7 @@
<tr>
@foreach ($prices as $price)
<td>
{{ $price['quantity'] ?? null }}
</td>
<td>
{{ $price['price'] ?? null }}
{{ $price['quantity'] ?? null }} : {{ $price['price'] ?? null }}
</td>
@endforeach
</tr>