Fixes on prices & add ArticlePriceGeneric

This commit is contained in:
Ludovic CANDELLIER
2020-07-31 00:21:49 +02:00
parent ef791fbcf2
commit 1e685cfefb
18 changed files with 374 additions and 52 deletions

View File

@@ -0,0 +1,64 @@
<div class="row">
<div class="col-md-4">
{{ Form::label('name', 'Nom') }}
@include('components.input', ['name' => 'name', 'value' => $generic['name'] ?? null, 'required' => true])
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="row">
<div class="col-4">
{{ Form::label('tax_id', 'TVA') }}
@include('components.select', ['name' => 'tax_id', 'value' => $generic['tax_id'] ?? null, 'list' => $taxes ?? null, 'class' => 'tva', 'required' => true])
</div>
<div class="col-4">
{{ Form::label('price', 'Prix HT') }}
@include('components.input', ['name' => 'price', 'value' => $generic['price'] ?? null, 'class' => 'price', 'required' => true])
</div>
<div class="col-4">
{{ Form::label('price_taxed', 'Prix TTC') }}
@include('components.input', ['name' => 'price_taxed', 'value' => $generic['price_taxed'] ?? null, 'class' => 'price_taxed', 'required' => true])
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="float-right mt-3">
@include('components.button-save')
</div>
</div>
</div>
@push('js')
<script>
function set_price(item) {
$row = $(item).parent();
tva = $row.find('.tva').val();
price_taxed = $row.find('.price_taxed').val();
console.log(tva);
console.log(price_taxed);
}
function set_price_taxed(item) {
$row = $(item).parent();
tva = $row.find('.tva').val();
price = $row.find('.price').val();
console.log(tva);
console.log(price);
}
$('.price_taxed').change(function() {
set_price(this);
});
$('.price').change(function() {
set_price_taxed(this);
});
</script>
@endpush