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,28 @@
@extends('layout.index', [
'title' => __('article_price_generics.title'),
'subtitle' => __('article_price_generics.create.title'),
'breadcrumb' => [__('article_price_generics.title'), __('article_price_generics.create.title')]
])
@include('boilerplate::load.fileinput')
@section('content')
{{ Form::open(['route' => 'Shop.Admin.ArticlePriceGenerics.store', 'id' => 'article-price-generic-form', 'autocomplete' => 'off', 'files' => true]) }}
<div class="row">
<div class="col-sm-12 mbl">
<a href="{{ route("Shop.Admin.ArticlePriceGenerics.index") }}" class="btn btn-default">
{{ __('article_price_generics.list.title') }}
</a>
<span class="btn-group pull-right">
@include('components.button-save')
</span>
</div>
</div>
@include('Shop.Admin.ArticlePriceGenerics.form')
</form>
@endsection

View File

@@ -0,0 +1,14 @@
@extends('layout.index', [
'title' => __('article_price_generics.title'),
'subtitle' => __('article_price_generics.edit.title'),
'breadcrumb' => [__('article_price_generics.title'), __('article_price_generics.edit.title')]
])
@section('content')
{{ Form::open(['route' => 'Shop.Admin.ArticlePriceGenerics.update', 'id' => 'article-price-generic-form', 'autocomplete' => 'off', 'files' => true]) }}
<input type="hidden" name="id" value="{{ $generic['id'] }}">
@include('Shop.Admin.ArticlePriceGenerics.form')
</form>
@endsection

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

View File

@@ -0,0 +1,8 @@
@extends('layout.index', [
'title' => __('article_price_generics.title'),
'subtitle' => __('article_price_generics.list.title'),
'breadcrumb' => [__('article_price_generics.title')]
])
@section('content')
@include('components.datatable', ['route' => route('Shop.Admin.ArticlePriceGenerics.index'), 'model' => 'article-price-generics'])
@endsection

View File

@@ -0,0 +1,36 @@
@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