Fixes after reading excel files and discuss with eric
This commit is contained in:
@@ -13,16 +13,16 @@ class VarietiesDataTable extends DataTable
|
|||||||
public function query(Variety $model)
|
public function query(Variety $model)
|
||||||
{
|
{
|
||||||
// $model = $model::with('specie')->withCount('Articles')->select('botanic_varieties.*');
|
// $model = $model::with('specie')->withCount('Articles')->select('botanic_varieties.*');
|
||||||
$model = $model::joinRelations('Specie')->select('botanic_varieties.*','botanic_species.name as specie_name')->withCount('Articles');
|
$model = $model::joinRelations('Specie')->select('botanic_varieties.*','botanic_species.name as specie_name')->with('Specie')->withCount('Articles');
|
||||||
return self::buildQuery($model);
|
return self::buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
protected function getColumns()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
Column::make('specie_name')->title('Espèce'),
|
Column::make('Specie.name')->data('specie_name')->title('Espèce'),
|
||||||
Column::make('name')->title('Nom'),
|
Column::make('name')->title('Nom'),
|
||||||
Column::make('articles_count')->title('Nb articles')->class('text-right'),
|
Column::make('articles_count')->title('Nb articles')->class('text-right')->searchable(false),
|
||||||
self::makeColumnButtons(),
|
self::makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class PriceGenericsDataTable extends DataTable
|
|||||||
Column::make('name')->title('Nom'),
|
Column::make('name')->title('Nom'),
|
||||||
Column::make('price_by_unit.price')->title('Prix HT')->class('text-right'),
|
Column::make('price_by_unit.price')->title('Prix HT')->class('text-right'),
|
||||||
Column::make('price_by_unit.price_taxed')->title('Prix TTC')->class('text-right'),
|
Column::make('price_by_unit.price_taxed')->title('Prix TTC')->class('text-right'),
|
||||||
Column::make('prices_count')->title('Nb articles')->class('text-right'),
|
Column::make('prices_count')->title('Nb tarifs')->class('text-right'),
|
||||||
self::makeColumnButtons(),
|
self::makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
64
app/Http/Controllers/Shop/Admin/PackageController.php
Normal file
64
app/Http/Controllers/Shop/Admin/PackageController.php
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Shop\Admin;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
use App\Repositories\Shop\ArticleFamilies;
|
||||||
|
use App\Repositories\Shop\Packages;
|
||||||
|
use App\DataTables\Shop\PackagesDataTable;
|
||||||
|
|
||||||
|
class PackageController extends Controller
|
||||||
|
{
|
||||||
|
public function index(PackagesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data['families'] = ArticleFamilies::getOptions();
|
||||||
|
return $dataTable->render('Shop.Admin.Packages.list', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatable(Request $request)
|
||||||
|
{
|
||||||
|
return Packages::getTables($request->all());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOptionsByFamily(Request $request)
|
||||||
|
{
|
||||||
|
$id = $request->input('family_id');
|
||||||
|
return response()->json(Packages::getSelectByFamily($id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Shop.Admin.Packages.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Packages::store($request->all());
|
||||||
|
return redirect()->route('Shop.Admin.Packages.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = Packages::get($id);
|
||||||
|
return view('Shop.Admin.Packages.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = Packages::get($id);
|
||||||
|
return view('Shop.Admin.Packages.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Packages::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ use App\Models\Shop\PriceGeneric;
|
|||||||
use App\Repositories\Shop\PriceGenerics;
|
use App\Repositories\Shop\PriceGenerics;
|
||||||
use App\Repositories\Shop\PriceGenericCategories;
|
use App\Repositories\Shop\PriceGenericCategories;
|
||||||
use App\Repositories\Shop\Taxes;
|
use App\Repositories\Shop\Taxes;
|
||||||
|
use App\Repositories\Shop\Packages;
|
||||||
use App\Repositories\Shop\Unities;
|
use App\Repositories\Shop\Unities;
|
||||||
use App\DataTables\Shop\PriceGenericsDataTable;
|
use App\DataTables\Shop\PriceGenericsDataTable;
|
||||||
|
|
||||||
@@ -34,8 +35,9 @@ class PriceGenericController extends Controller
|
|||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$data['generic'] = PriceGenerics::get($id)->toArray();
|
$data['generic'] = PriceGenerics::getFull($id)->toArray();
|
||||||
$data['unities'] = Unities::getOptions();
|
$data['packages'] = Packages::getSelectByFamily($data['generic']['category']['article_family_id']);
|
||||||
|
$data['unities'] = ($data['packages']['id'] ?? false) ? Unities::getSelectByPackage($data['packages']['id']) : [];
|
||||||
$data['taxes'] = Taxes::getOptions();
|
$data['taxes'] = Taxes::getOptions();
|
||||||
$data['categories'] = PriceGenericCategories::getOptions();
|
$data['categories'] = PriceGenericCategories::getOptions();
|
||||||
return view('Shop.Admin.PriceGenerics.edit', $data);
|
return view('Shop.Admin.PriceGenerics.edit', $data);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use App\Repositories\Shop\ArticleFamilies;
|
|||||||
use App\Repositories\Shop\Unities;
|
use App\Repositories\Shop\Unities;
|
||||||
use App\DataTables\Shop\UnitiesDataTable;
|
use App\DataTables\Shop\UnitiesDataTable;
|
||||||
|
|
||||||
class UnityValueController extends Controller
|
class UnityController extends Controller
|
||||||
{
|
{
|
||||||
public function index(UnitiesDataTable $dataTable)
|
public function index(UnitiesDataTable $dataTable)
|
||||||
{
|
{
|
||||||
@@ -22,10 +22,10 @@ class UnityValueController extends Controller
|
|||||||
return Unities::getTables($request->all());
|
return Unities::getTables($request->all());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOptionsByFamily(Request $request)
|
public function getOptionsByPackage(Request $request)
|
||||||
{
|
{
|
||||||
$id = $request->input('family_id');
|
$id = $request->input('package_id');
|
||||||
return response()->json(Unities::getSelectByFamily($id));
|
return response()->json(Unities::getSelectByPackage($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
@@ -51,14 +51,13 @@ class UnityValueController extends Controller
|
|||||||
return view('Shop.Admin.Unities.edit', $data);
|
return view('Shop.Admin.Unities.edit', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(Request $request)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
{
|
{
|
||||||
return Unities::destroy($id);
|
return Unities::destroy($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function update($id) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,6 @@ class Variety extends Model implements HasMedia
|
|||||||
|
|
||||||
public function Articles()
|
public function Articles()
|
||||||
{
|
{
|
||||||
return $this->hasMany('App\Models\Shop\Article','model_id','id');
|
return $this->morphMany('App\Models\Shop\Article','product');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
21
app/Models/Shop/Package.php
Normal file
21
app/Models/Shop/Package.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Package extends Model
|
||||||
|
{
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
protected $table = 'shop_packages';
|
||||||
|
|
||||||
|
public function article_family()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('App\Models\Shop\ArticleFamily');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function scopeByFamily($query, $id)
|
||||||
|
{
|
||||||
|
return $query->where('article_family_id', $id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,11 @@ class PriceGenericCategory extends Model
|
|||||||
protected $guarded = ['id'];
|
protected $guarded = ['id'];
|
||||||
protected $table = 'shop_price_generic_categories';
|
protected $table = 'shop_price_generic_categories';
|
||||||
|
|
||||||
|
public function article_family()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('App\Models\Shop\ArticleFamily');
|
||||||
|
}
|
||||||
|
|
||||||
public function price_generics()
|
public function price_generics()
|
||||||
{
|
{
|
||||||
return $this->hasMany('App\Models\Shop\PriceGeneric','category_id');
|
return $this->hasMany('App\Models\Shop\PriceGeneric','category_id');
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ class Unity extends Model
|
|||||||
protected $guarded = ['id'];
|
protected $guarded = ['id'];
|
||||||
protected $table = 'shop_unities';
|
protected $table = 'shop_unities';
|
||||||
|
|
||||||
public function article_family()
|
public function package()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\Models\Shop\ArticleFamily');
|
return $this->belongsTo('App\Models\Shop\Package');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeByFamily($query, $id)
|
public function scopeByPackage($query, $id)
|
||||||
{
|
{
|
||||||
return $query->where('article_family_id');
|
return $query->where('package_id', $id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ class Articles
|
|||||||
$data['price_generics'] = PriceGenericCategories::getOptionsWithChildrens();
|
$data['price_generics'] = PriceGenericCategories::getOptionsWithChildrens();
|
||||||
$data['families_options'] = ArticleFamilies::getOptions();
|
$data['families_options'] = ArticleFamilies::getOptions();
|
||||||
$data['taxes_options'] = Taxes::getOptions();
|
$data['taxes_options'] = Taxes::getOptions();
|
||||||
$data['unities'] = Unities::getSelectByFamily($data['article_family_id']);
|
$data['packages'] = Packages::getSelectByFamily($data['article_family_id']);
|
||||||
|
$data['unities'] = ($data['packages']['id'] ?? false) ? Unities::getSelectByPackage($data['packages']['id']) : [];
|
||||||
$data['tags_list'] = TagGroups::getTreeTags();
|
$data['tags_list'] = TagGroups::getTreeTags();
|
||||||
$data['models_options'] = ['App\Models\Botanic\Specie' => 'Espèces', 'App\Models\Botanic\Variety' => 'Variétés'];
|
$data['models_options'] = ['App\Models\Botanic\Specie' => 'Espèces', 'App\Models\Botanic\Variety' => 'Variétés'];
|
||||||
return $data;
|
return $data;
|
||||||
|
|||||||
63
app/Repositories/Shop/Packages.php
Normal file
63
app/Repositories/Shop/Packages.php
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
use Yajra\DataTables\DataTables;
|
||||||
|
|
||||||
|
use App\Models\Shop\Package;
|
||||||
|
|
||||||
|
class Packages
|
||||||
|
{
|
||||||
|
|
||||||
|
public static function getDatatable()
|
||||||
|
{
|
||||||
|
return Datatables::of($model)->make(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getOptions()
|
||||||
|
{
|
||||||
|
return Package::orderBy('value','asc')->pluck('value','id')->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getSelectByFamily($family_id)
|
||||||
|
{
|
||||||
|
return Package::orderBy('value','asc')->byFamily($family_id)->pluck('value','id')->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getAll()
|
||||||
|
{
|
||||||
|
return Package::orderBy('value','asc')->get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get($id)
|
||||||
|
{
|
||||||
|
return Package::find($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function store($data)
|
||||||
|
{
|
||||||
|
$id = isset($data['id']) ? $data['id'] : false;
|
||||||
|
$item = $id ? self::update($data) : self::create($data);
|
||||||
|
return $item->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function create($data)
|
||||||
|
{
|
||||||
|
return Package::create($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function update($data)
|
||||||
|
{
|
||||||
|
return Package::find($id)->update($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function destroy($id)
|
||||||
|
{
|
||||||
|
return Package::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -43,7 +43,12 @@ class PriceGenerics
|
|||||||
|
|
||||||
public static function get($id)
|
public static function get($id)
|
||||||
{
|
{
|
||||||
return PriceGeneric::with("values")->find($id);
|
return PriceGeneric::find($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getFull($id)
|
||||||
|
{
|
||||||
|
return PriceGeneric::with(['category','prices'])->find($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function store($data)
|
public static function store($data)
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ class Unities
|
|||||||
return Unity::orderBy('value','asc')->get()->pluck('value','id')->toArray();
|
return Unity::orderBy('value','asc')->get()->pluck('value','id')->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getSelectByFamily($family_id)
|
public static function getSelectByPackage($package_id)
|
||||||
{
|
{
|
||||||
$values = Unity::byFamily($family_id)->get();
|
$values = Unity::byPackage($package_id)->get();
|
||||||
$data = [];
|
$data = [];
|
||||||
foreach ($values as $value)
|
foreach ($values as $value)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,28 @@
|
|||||||
@include('components.number', ['name' => "prices[$key][quantity]", 'value' => $price['quantity'] ?? 1, 'required' => true, 'class' => 'form-control-sm'])
|
@include('components.number', ['name' => "prices[$key][quantity]", 'value' => $price['quantity'] ?? 1, 'required' => true, 'class' => 'form-control-sm'])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-3">
|
||||||
|
{{ Form::label('package_id', 'Type Package') }}<br/>
|
||||||
|
@include('components.select', [
|
||||||
|
'name' => "prices[$key][package_id]",
|
||||||
|
'value' => $price['package_id'] ?? null,
|
||||||
|
'list' => $packages ?? null,
|
||||||
|
'required' => true,
|
||||||
|
'class' => 'select2 form-control-sm packages w-100',
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-1">
|
||||||
|
{{ Form::label('package_qty', 'Pack Qté') }}<br/>
|
||||||
|
@include('components.number', [
|
||||||
|
'name' => "prices[$key][package_quantity]",
|
||||||
|
'value' => $price['package_quantity'] ?? null,
|
||||||
|
'required' => true,
|
||||||
|
'class' => 'form-control-sm',
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-3">
|
||||||
{{ Form::label('unity_id', 'Unité') }}<br/>
|
{{ Form::label('unity_id', 'Unité') }}<br/>
|
||||||
@include('components.select', [
|
@include('components.select', [
|
||||||
'name' => "prices[$key][unity_id]",
|
'name' => "prices[$key][unity_id]",
|
||||||
@@ -19,10 +40,11 @@
|
|||||||
'list' => $unities ?? null,
|
'list' => $unities ?? null,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'class' => 'select2 form-control-sm unities w-100',
|
'class' => 'select2 form-control-sm unities w-100',
|
||||||
|
'with_empty' => ''
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-3">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
{{ Form::label('tax_id', 'TVA') }}<br/>
|
{{ Form::label('tax_id', 'TVA') }}<br/>
|
||||||
|
|||||||
@@ -12,7 +12,28 @@
|
|||||||
@include('components.number', ['name' => 'prices[0][quantity]', 'value' => $quantity ?? 1, 'required' => true, 'class' => 'form-control-sm'])
|
@include('components.number', ['name' => 'prices[0][quantity]', 'value' => $quantity ?? 1, 'required' => true, 'class' => 'form-control-sm'])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-3">
|
||||||
|
{{ Form::label('package_id', 'Type Package') }}<br/>
|
||||||
|
@include('components.select', [
|
||||||
|
'name' => "prices[0][package_id]",
|
||||||
|
'value' => $price['package_id'] ?? null,
|
||||||
|
'list' => $packages ?? null,
|
||||||
|
'required' => true,
|
||||||
|
'class' => 'select2 form-control-sm packages w-100',
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-1">
|
||||||
|
{{ Form::label('package_qty', 'Pack Qté') }}<br/>
|
||||||
|
@include('components.number', [
|
||||||
|
'name' => "prices[0][package_quantity]",
|
||||||
|
'value' => $price['package_quantity'] ?? null,
|
||||||
|
'required' => true,
|
||||||
|
'class' => 'form-control-sm',
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-3">
|
||||||
{{ Form::label('unity_id', 'Unité') }}<br/>
|
{{ Form::label('unity_id', 'Unité') }}<br/>
|
||||||
@include('components.select', [
|
@include('components.select', [
|
||||||
'name' => "prices[0][unity_id]",
|
'name' => "prices[0][unity_id]",
|
||||||
@@ -20,10 +41,11 @@
|
|||||||
'list' => $unities ?? null,
|
'list' => $unities ?? null,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'class' => 'select2 form-control-sm unities w-100',
|
'class' => 'select2 form-control-sm unities w-100',
|
||||||
|
'with_empty' => ''
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-3">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@include('Shop.Admin.PriceGenerics.partials.prices', ['prices' => $generic['values'] ?? null ])
|
@include('Shop.Admin.PriceGenerics.partials.prices', ['prices' => $generic['prices'] ?? null ])
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
|
|||||||
@@ -7,30 +7,63 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-2">
|
<div class="col-1">
|
||||||
{{ Form::label('quantity', 'Qté.') }}<br/>
|
{{ Form::label('quantity', 'Qté.') }}<br/>
|
||||||
@include('components.number', ['name' => "prices[$key][quantity]", 'value' => $price['quantity'] ?? 1, 'required' => true, 'class' => 'form-control-sm'])
|
@include('components.number', ['name' => "prices[$key][quantity]", 'value' => $price['quantity'] ?? 1, 'required' => true, 'class' => 'form-control-sm'])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-3">
|
<div class="col-lg-3">
|
||||||
|
{{ Form::label('package_id', 'Type Package') }}<br/>
|
||||||
|
@include('components.select', [
|
||||||
|
'name' => "prices[$key][package_id]",
|
||||||
|
'value' => $price['package_id'] ?? null,
|
||||||
|
'list' => $packages ?? null,
|
||||||
|
'required' => true,
|
||||||
|
'class' => 'select2 form-control-sm packages w-100',
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-1">
|
||||||
|
{{ Form::label('package_qty', 'Pack Qté') }}<br/>
|
||||||
|
@include('components.number', [
|
||||||
|
'name' => "prices[$key][package_quantity]",
|
||||||
|
'value' => $price['package_quantity'] ?? null,
|
||||||
|
'required' => true,
|
||||||
|
'class' => 'form-control-sm',
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-3">
|
||||||
{{ Form::label('unity_id', 'Unité') }}<br/>
|
{{ Form::label('unity_id', 'Unité') }}<br/>
|
||||||
@include('components.select', ['name' => 'prices[0][unity_id]', 'value' => $unity_id ?? null, 'list' => $unities ?? null, 'required' => true, 'class' => 'form-control-sm'])
|
@include('components.select', [
|
||||||
|
'name' => "prices[$key][unity_id]",
|
||||||
|
'value' => $price['unity_id'] ?? null,
|
||||||
|
'list' => $unities ?? null,
|
||||||
|
'required' => true,
|
||||||
|
'class' => 'select2 form-control-sm unities w-100',
|
||||||
|
'with_empty' => ''
|
||||||
|
])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-2">
|
<div class="col-lg-3">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-4">
|
||||||
{{ Form::label('tax_id', 'TVA') }}<br/>
|
{{ Form::label('tax_id', 'TVA') }}<br/>
|
||||||
@include('components.select', ['name' => "prices[$key][tax_id]", 'value' => $price['tax_id'] ?? null, 'list' => $taxes ?? null, 'required' => true, 'class' => 'form-control-sm'])
|
@include('components.select', ['name' => "prices[$key][tax_id]", 'value' => $price['tax_id'] ?? null, 'list' => $taxes_options ?? null, 'required' => true, 'class' => 'form-control form-control-sm'])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-2">
|
<div class="col-4">
|
||||||
{{ Form::label('price', 'Prix HT') }}
|
{{ Form::label('price', 'Prix HT') }}
|
||||||
@include('components.money', ['name' => "prices[$key][price]", 'value' => $price['price'] ?? 0, 'required' => true, 'class' => 'form-control-sm price-item'])
|
@include('components.money', ['name' => "prices[$key][price]", 'value' => $price['price'] ?? 0, 'required' => true, 'class' => 'form-control-sm price-item'])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-2">
|
<div class="col-4">
|
||||||
{{ Form::label('price_taxed', 'Prix TTC') }}
|
{{ Form::label('price_taxed', 'Prix TTC') }}
|
||||||
@include('components.money', ['name' => "prices[$key][price_taxed]", 'value' => $price['price_taxed'] ?? 0, 'required' => true, 'class' => 'form-control-sm price-taxed-item'])
|
@include('components.money', ['name' => "prices[$key][price_taxed]", 'value' => $price['price_taxed'] ?? 0, 'required' => true, 'class' => 'form-control-sm price-taxed-item'])
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="col-1 text-right">
|
<div class="col-1 text-right">
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
<footer id="footer">
|
<footer id="footer">
|
||||||
|
|
||||||
@include("Shop._partials.footer-after")
|
|
||||||
|
|
||||||
|
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<!-- CSRF Token -->
|
<!-- CSRF Token -->
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
<title>{{ config('app.name', 'Laravel') }}</title>
|
<title>{{ config('app.name') }}</title>
|
||||||
<link rel="stylesheet" href="/css/site.min.css">
|
<link rel="stylesheet" href="/css/site.min.css">
|
||||||
@stack('css')
|
@stack('css')
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
18
resources/views/load/functions.blade.php
Normal file
18
resources/views/load/functions.blade.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
@if(!defined('LOAD_FUNCTIONS'))
|
||||||
|
@push('scripts')
|
||||||
|
<script>
|
||||||
|
function delay(callback, ms) {
|
||||||
|
var timer = 0;
|
||||||
|
return function() {
|
||||||
|
var context = this, args = arguments;
|
||||||
|
clearTimeout(timer);
|
||||||
|
timer = setTimeout(function () {
|
||||||
|
callback.apply(context, args);
|
||||||
|
}, ms || 0);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
@php(define('LOAD_FUNCTIONS', true))
|
||||||
|
@endif
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
Route::prefix('Unities')->name('Unities.')->group(function () {
|
Route::prefix('Unities')->name('Unities.')->group(function () {
|
||||||
Route::any('getOptionsByFamily', 'UnityController@getOptionsByFamily')->name('getOptionsByFamily');
|
Route::any('getOptionsByPackage', 'UnityController@getOptionsByPackage')->name('getOptionsByPackage');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::resource('Unities', 'UnityController');
|
Route::resource('Unities', 'UnityController');
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ use Illuminate\Http\Request;
|
|||||||
| is assigned the "api" middleware group. Enjoy building your API!
|
| is assigned the "api" middleware group. Enjoy building your API!
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
Route::middleware('auth:api')->get('/user', function (Request $request) {
|
Route::middleware('auth:api')->get('/user', function (Request $request) {
|
||||||
return $request->user();
|
return $request->user();
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
Reference in New Issue
Block a user