minor fixes
This commit is contained in:
@@ -13,10 +13,18 @@ class CustomersDataTable extends DataTable
|
|||||||
public function query(Customer $model)
|
public function query(Customer $model)
|
||||||
{
|
{
|
||||||
$model = $model->with('addresses');
|
$model = $model->with('addresses');
|
||||||
|
$model = self::filterBySaleChannel($model);
|
||||||
|
|
||||||
return $this->buildQuery($model);
|
return $this->buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function filterBySaleChannel($model, $sale_channel_id = false)
|
||||||
|
{
|
||||||
|
$sale_channel_id = $sale_channel_id ? $sale_channel_id : self::isFilteredByField('sale_channel_id');
|
||||||
|
|
||||||
|
return $sale_channel_id ? $model->bySaleChannel($sale_channel_id) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
protected function getColumns()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -13,10 +13,18 @@ class DeliveriesDataTable extends DataTable
|
|||||||
public function query(Delivery $model)
|
public function query(Delivery $model)
|
||||||
{
|
{
|
||||||
$model = $model->with('sale_channel');
|
$model = $model->with('sale_channel');
|
||||||
|
$model = self::filterBySaleChannel($model);
|
||||||
|
|
||||||
return $this->buildQuery($model);
|
return $this->buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function filterBySaleChannel($model, $sale_channel_id = false)
|
||||||
|
{
|
||||||
|
$sale_channel_id = $sale_channel_id ? $sale_channel_id : self::isFilteredByField('sale_channel_id');
|
||||||
|
|
||||||
|
return $sale_channel_id ? $model->bySaleChannel($sale_channel_id) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
public function modifier($datatables)
|
public function modifier($datatables)
|
||||||
{
|
{
|
||||||
$datatables
|
$datatables
|
||||||
@@ -26,7 +34,7 @@ class DeliveriesDataTable extends DataTable
|
|||||||
'on' => __('active'),
|
'on' => __('active'),
|
||||||
'off' => __('inactive'),
|
'off' => __('inactive'),
|
||||||
'meta' => 'data-id='.$delivery->id,
|
'meta' => 'data-id='.$delivery->id,
|
||||||
'size' => 'sm',
|
'size' => 'xs',
|
||||||
]);
|
]);
|
||||||
})
|
})
|
||||||
->editColumn('is_public', function (Delivery $delivery) {
|
->editColumn('is_public', function (Delivery $delivery) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class SaleChannelsDataTable extends DataTable
|
|||||||
|
|
||||||
public function query(SaleChannel $model)
|
public function query(SaleChannel $model)
|
||||||
{
|
{
|
||||||
$model = $model->withCount(['deliveries', 'tariffs']);
|
$model = $model->withCount(['customers', 'deliveries', 'tariffs']);
|
||||||
|
|
||||||
return $this->buildQuery($model);
|
return $this->buildQuery($model);
|
||||||
}
|
}
|
||||||
@@ -22,6 +22,7 @@ class SaleChannelsDataTable extends DataTable
|
|||||||
return [
|
return [
|
||||||
Column::make('code')->title('Code abrégé')->width(100),
|
Column::make('code')->title('Code abrégé')->width(100),
|
||||||
Column::make('name')->title('Nom'),
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('customers_count')->title('#Clients')->searchable(false)->class('text-right'),
|
||||||
Column::make('deliveries_count')->title('#Distrib')->searchable(false)->class('text-right'),
|
Column::make('deliveries_count')->title('#Distrib')->searchable(false)->class('text-right'),
|
||||||
Column::make('tariffs_count')->title('#Tarifs')->searchable(false)->class('text-right'),
|
Column::make('tariffs_count')->title('#Tarifs')->searchable(false)->class('text-right'),
|
||||||
$this->makeColumnButtons(),
|
$this->makeColumnButtons(),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Admin\Shop;
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
use App\Datatables\Shop\CustomerAddressesDataTable;
|
use App\Datatables\Admin\Shop\CustomerAddressesDataTable;
|
||||||
use App\Repositories\Shop\CustomerAddresses;
|
use App\Repositories\Shop\CustomerAddresses;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
|||||||
@@ -5,21 +5,20 @@ namespace App\Http\Controllers\Admin\Shop;
|
|||||||
use App\Datatables\Admin\Shop\CustomerAddressesDataTable;
|
use App\Datatables\Admin\Shop\CustomerAddressesDataTable;
|
||||||
use App\Datatables\Admin\Shop\CustomersDataTable;
|
use App\Datatables\Admin\Shop\CustomersDataTable;
|
||||||
use App\Repositories\Shop\Customers;
|
use App\Repositories\Shop\Customers;
|
||||||
use App\Repositories\Shop\Deliveries;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class CustomerController extends Controller
|
class CustomerController extends Controller
|
||||||
{
|
{
|
||||||
public function index(CustomersDataTable $dataTable)
|
public function index(CustomersDataTable $dataTable)
|
||||||
{
|
{
|
||||||
$data = [];
|
$data = Customers::init();
|
||||||
|
|
||||||
return $dataTable->render('Admin.Shop.Customers.list', $data);
|
return $dataTable->render('Admin.Shop.Customers.list', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
$data['deliveries'] = Deliveries::getOptions();
|
$data = Customers::init();
|
||||||
|
|
||||||
return view('Admin.Shop.Customers.create', $data);
|
return view('Admin.Shop.Customers.create', $data);
|
||||||
}
|
}
|
||||||
@@ -40,8 +39,8 @@ class CustomerController extends Controller
|
|||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
|
$data = Customers::init();
|
||||||
$data['customer'] = Customers::edit($id);
|
$data['customer'] = Customers::edit($id);
|
||||||
$data['deliveries'] = Deliveries::getOptions();
|
|
||||||
$model = new CustomerAddressesDataTable();
|
$model = new CustomerAddressesDataTable();
|
||||||
$data['customer_addresses'] = $model->html();
|
$data['customer_addresses'] = $model->html();
|
||||||
|
|
||||||
|
|||||||
@@ -4,21 +4,20 @@ namespace App\Http\Controllers\Admin\Shop;
|
|||||||
|
|
||||||
use App\Datatables\Admin\Shop\DeliveriesDataTable;
|
use App\Datatables\Admin\Shop\DeliveriesDataTable;
|
||||||
use App\Repositories\Shop\Deliveries;
|
use App\Repositories\Shop\Deliveries;
|
||||||
use App\Repositories\Shop\SaleChannels;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class DeliveryController extends Controller
|
class DeliveryController extends Controller
|
||||||
{
|
{
|
||||||
public function index(DeliveriesDataTable $dataTable)
|
public function index(DeliveriesDataTable $dataTable)
|
||||||
{
|
{
|
||||||
return $dataTable->render('Admin.Shop.Deliveries.list');
|
$data = Deliveries::init();
|
||||||
|
|
||||||
|
return $dataTable->render('Admin.Shop.Deliveries.list', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
$data = [
|
$data = Deliveries::init();
|
||||||
'sale_channels' => SaleChannels::getOptions(),
|
|
||||||
];
|
|
||||||
|
|
||||||
return view('Admin.Shop.Deliveries.create', $data);
|
return view('Admin.Shop.Deliveries.create', $data);
|
||||||
}
|
}
|
||||||
@@ -41,10 +40,8 @@ class DeliveryController extends Controller
|
|||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$data = [
|
$data = Deliveries::init();
|
||||||
'delivery' => Deliveries::get($id)->toArray(),
|
$data['delivery'] = Deliveries::getArray($id);
|
||||||
'sale_channels' => SaleChannels::getOptions(),
|
|
||||||
];
|
|
||||||
|
|
||||||
return view('Admin.Shop.Deliveries.edit', $data);
|
return view('Admin.Shop.Deliveries.edit', $data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Admin\Shop;
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
use App\Datatables\Admin\Shop\InvoicesDataTable;
|
|
||||||
use App\Datatables\Admin\Shop\InvoicePaymentsDataTable;
|
use App\Datatables\Admin\Shop\InvoicePaymentsDataTable;
|
||||||
|
use App\Datatables\Admin\Shop\InvoicesDataTable;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Repositories\Shop\Invoices;
|
use App\Repositories\Shop\Invoices;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|||||||
@@ -5,9 +5,6 @@ namespace App\Http\Controllers\Admin\Shop;
|
|||||||
use App\Datatables\Admin\Shop\PriceListsDataTable;
|
use App\Datatables\Admin\Shop\PriceListsDataTable;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Repositories\Shop\PriceLists;
|
use App\Repositories\Shop\PriceLists;
|
||||||
use App\Repositories\Shop\SaleChannels;
|
|
||||||
use App\Repositories\Shop\Tariffs;
|
|
||||||
use App\Repositories\Shop\Taxes;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class PriceListController extends Controller
|
class PriceListController extends Controller
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Admin\Shop;
|
|||||||
|
|
||||||
use App\Datatables\Admin\Shop\ProducersDataTable;
|
use App\Datatables\Admin\Shop\ProducersDataTable;
|
||||||
use App\Repositories\Shop\Producers;
|
use App\Repositories\Shop\Producers;
|
||||||
use App\Repositories\Shop\TagGroups;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class ProducerController extends Controller
|
class ProducerController extends Controller
|
||||||
|
|||||||
@@ -2,11 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Admin\Shop;
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
use App\Datatables\Admin\Shop\PriceListsDataTable;
|
|
||||||
use App\Datatables\Admin\Shop\TariffsDataTable;
|
use App\Datatables\Admin\Shop\TariffsDataTable;
|
||||||
use App\Repositories\Shop\SaleChannels;
|
|
||||||
use App\Repositories\Shop\Tariffs;
|
use App\Repositories\Shop\Tariffs;
|
||||||
use App\Repositories\Shop\TariffUnities;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class TariffController extends Controller
|
class TariffController extends Controller
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ namespace App\Http\Controllers\Admin\Shop;
|
|||||||
|
|
||||||
use App\Datatables\Admin\Shop\VariationsDataTable;
|
use App\Datatables\Admin\Shop\VariationsDataTable;
|
||||||
use App\Http\Requests\Admin\Shop\StoreVariationPost;
|
use App\Http\Requests\Admin\Shop\StoreVariationPost;
|
||||||
use App\Repositories\Shop\Packages;
|
|
||||||
use App\Repositories\Shop\Unities;
|
|
||||||
use App\Repositories\Shop\Variations;
|
use App\Repositories\Shop\Variations;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ namespace App\Http\Controllers\Shop;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Repositories\Core\User\ShopCart;
|
use App\Repositories\Core\User\ShopCart;
|
||||||
use App\Repositories\Shop\Baskets;
|
use App\Repositories\Shop\Baskets;
|
||||||
use App\Repositories\Shop\Customers;
|
|
||||||
use App\Repositories\Shop\Offers;
|
use App\Repositories\Shop\Offers;
|
||||||
use App\Repositories\Shop\Orders;
|
use App\Repositories\Shop\Orders;
|
||||||
use App\Repositories\Users;
|
use App\Repositories\Users;
|
||||||
|
|||||||
@@ -3,11 +3,8 @@
|
|||||||
namespace App\Http\Controllers\Shop;
|
namespace App\Http\Controllers\Shop;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Repositories\Shop\ArticleNatures;
|
|
||||||
use App\Repositories\Shop\Articles;
|
|
||||||
use App\Repositories\Shop\Categories;
|
use App\Repositories\Shop\Categories;
|
||||||
use App\Repositories\Shop\Shelves;
|
use App\Repositories\Shop\Shelves;
|
||||||
use App\Repositories\Shop\TagGroups;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class CategoryController extends Controller
|
class CategoryController extends Controller
|
||||||
|
|||||||
@@ -2,10 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Shop;
|
namespace App\Http\Controllers\Shop;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
use App\Repositories\Shop\Customers;
|
use App\Repositories\Shop\Customers;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class CustomerController extends Controller
|
class CustomerController extends Controller
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class ArticleNature extends Model implements HasMedia
|
|||||||
return $query->whereIn($this->table.'.id', $ids);
|
return $query->whereIn($this->table.'.id', $ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function registerMediaConversions(Media $media = null): void
|
public function registerMediaConversions(?Media $media = null): void
|
||||||
{
|
{
|
||||||
$this->addMediaConversion('thumb')->fit(Manipulations::FIT_MAX, 60, 32)->keepOriginalImageFormat()->nonQueued();
|
$this->addMediaConversion('thumb')->fit(Manipulations::FIT_MAX, 60, 32)->keepOriginalImageFormat()->nonQueued();
|
||||||
$this->addMediaConversion('normal')->fit(Manipulations::FIT_MAX, 360, 192)->keepOriginalImageFormat()->nonQueued();
|
$this->addMediaConversion('normal')->fit(Manipulations::FIT_MAX, 360, 192)->keepOriginalImageFormat()->nonQueued();
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ class Customer extends Authenticatable
|
|||||||
|
|
||||||
protected $casts = ['email_verified_at' => 'datetime'];
|
protected $casts = ['email_verified_at' => 'datetime'];
|
||||||
|
|
||||||
|
|
||||||
public function delivery_addresses()
|
public function delivery_addresses()
|
||||||
{
|
{
|
||||||
return $this->addresses()->byDelivery();
|
return $this->addresses()->byDelivery();
|
||||||
@@ -32,7 +31,6 @@ class Customer extends Authenticatable
|
|||||||
return $this->addresses()->byInvoicing();
|
return $this->addresses()->byInvoicing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function addresses()
|
public function addresses()
|
||||||
{
|
{
|
||||||
return $this->hasMany(CustomerAddress::class);
|
return $this->hasMany(CustomerAddress::class);
|
||||||
@@ -43,11 +41,21 @@ class Customer extends Authenticatable
|
|||||||
return $this->hasMany(CustomerDelivery::class);
|
return $this->hasMany(CustomerDelivery::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function customer_sale_channels()
|
||||||
|
{
|
||||||
|
return $this->hasMany(CustomerSaleChannel::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function deliveries()
|
public function deliveries()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(Delivery::class, CustomerDelivery::class);
|
return $this->belongsToMany(Delivery::class, CustomerDelivery::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sale_channels()
|
||||||
|
{
|
||||||
|
return $this->belongsToMany(SaleChannel::class, CustomerSaleChannel::class)->wherePivotNull('deleted_at');
|
||||||
|
}
|
||||||
|
|
||||||
public function invoices()
|
public function invoices()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Invoice::class);
|
return $this->hasMany(Invoice::class);
|
||||||
@@ -58,6 +66,13 @@ class Customer extends Authenticatable
|
|||||||
return $this->hasMany(Order::class);
|
return $this->hasMany(Order::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function scopeBySaleChannel($query, $saleChannelId)
|
||||||
|
{
|
||||||
|
return $query->whereHas('sale_channels', function ($query) use ($saleChannelId) {
|
||||||
|
return $query->byId($saleChannelId);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public function sendEmailVerificationNotification()
|
public function sendEmailVerificationNotification()
|
||||||
{
|
{
|
||||||
if (config('boilerplate.auth.verify_email')) {
|
if (config('boilerplate.auth.verify_email')) {
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ class CustomerDelivery extends Model
|
|||||||
return $this->belongsTo(Delivery::class);
|
return $this->belongsTo(Delivery::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeByCustomer($query, $customer_id)
|
public function scopeByCustomer($query, $customerId)
|
||||||
{
|
{
|
||||||
return $query->where($this->table.'.customer_id', $customer_id);
|
return $query->where($this->table.'.customer_id', $customerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeByDelivery($query, $customer_id)
|
public function scopeByDelivery($query, $deliveryId)
|
||||||
{
|
{
|
||||||
return $query->where($this->table.'.delivery_id', $customer_id);
|
return $query->where($this->table.'.delivery_id', $deliveryId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
36
app/Models/Shop/CustomerSaleChannel.php
Normal file
36
app/Models/Shop/CustomerSaleChannel.php
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
use Wildside\Userstamps\Userstamps;
|
||||||
|
|
||||||
|
class CustomerSaleChannel extends Model
|
||||||
|
{
|
||||||
|
use SoftDeletes, Userstamps;
|
||||||
|
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
|
||||||
|
protected $table = 'shop_customer_sale_channels';
|
||||||
|
|
||||||
|
public function customer()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Customer::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function sale_channel()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(SaleChannel::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function scopeByCustomer($query, $customerId)
|
||||||
|
{
|
||||||
|
return $query->where($this->table.'.customer_id', $customerId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function scopeBySaleChannel($query, $saleChannelId)
|
||||||
|
{
|
||||||
|
return $query->where($this->table.'.sale_channel_id', $saleChannelId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -67,6 +67,11 @@ class Delivery extends Model
|
|||||||
return $query->where($this->table.'.at_house', 1);
|
return $query->where($this->table.'.at_house', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function scopeBySaleChannel($query)
|
||||||
|
{
|
||||||
|
return $query->where($this->table.'.sale_channel_id', 1);
|
||||||
|
}
|
||||||
|
|
||||||
public function scopeManaged($query)
|
public function scopeManaged($query)
|
||||||
{
|
{
|
||||||
return $query->byPublic(0);
|
return $query->byPublic(0);
|
||||||
|
|||||||
@@ -10,6 +10,16 @@ class SaleChannel extends Model
|
|||||||
|
|
||||||
protected $table = 'shop_sale_channels';
|
protected $table = 'shop_sale_channels';
|
||||||
|
|
||||||
|
public function customer_sale_channels()
|
||||||
|
{
|
||||||
|
return $this->hasMany(CustomerSaleChannel::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function customers()
|
||||||
|
{
|
||||||
|
return $this->belongsToMany(Customer::class, CustomerSaleChannel::class)->wherePivotNull('deleted_at');
|
||||||
|
}
|
||||||
|
|
||||||
public function deliveries()
|
public function deliveries()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Delivery::class);
|
return $this->hasMany(Delivery::class);
|
||||||
@@ -29,4 +39,9 @@ class SaleChannel extends Model
|
|||||||
{
|
{
|
||||||
return $query->where($this->table.'.code', $code);
|
return $query->where($this->table.'.code', $code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function scopeById($query, $id)
|
||||||
|
{
|
||||||
|
return $query->where($this->table.'.id', $id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ namespace App\Repositories\Shop;
|
|||||||
|
|
||||||
use App\Models\Shop\Article;
|
use App\Models\Shop\Article;
|
||||||
use App\Models\Shop\Merchandise;
|
use App\Models\Shop\Merchandise;
|
||||||
use App\Traits\Model\Basic;
|
|
||||||
use App\Repositories\Botanic\Species;
|
use App\Repositories\Botanic\Species;
|
||||||
use App\Repositories\Botanic\Varieties;
|
use App\Repositories\Botanic\Varieties;
|
||||||
use App\Repositories\Core\Comments;
|
use App\Repositories\Core\Comments;
|
||||||
use App\Repositories\Core\Tag;
|
use App\Repositories\Core\Tag;
|
||||||
|
use App\Traits\Model\Basic;
|
||||||
use App\Traits\Repository\Imageable;
|
use App\Traits\Repository\Imageable;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
|||||||
21
app/Repositories/Shop/CustomerSaleChannels.php
Normal file
21
app/Repositories/Shop/CustomerSaleChannels.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
|
use App\Models\Shop\CustomerSaleChannel;
|
||||||
|
use App\Traits\Model\Basic;
|
||||||
|
|
||||||
|
class CustomerSaleChannels
|
||||||
|
{
|
||||||
|
use Basic;
|
||||||
|
|
||||||
|
public static function destroyByCustomerAndSaleChannel($customerId, $saleChannelId)
|
||||||
|
{
|
||||||
|
return CustomerSaleChannel::byCustomer($customerId)->bySaleChannel($saleChannelId)->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getModel()
|
||||||
|
{
|
||||||
|
return CustomerSaleChannel::query();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,6 +14,27 @@ class Customers
|
|||||||
{
|
{
|
||||||
use Basic;
|
use Basic;
|
||||||
|
|
||||||
|
public static function init()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'sale_channels' => SaleChannels::getOptions(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getSaleChannelIds($customerId = false)
|
||||||
|
{
|
||||||
|
$channels = self::getSaleChannels($customerId);
|
||||||
|
|
||||||
|
return $channels ? $channels->pluck('id')->toArray() : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getSaleChannels($customerId = false)
|
||||||
|
{
|
||||||
|
$customer = $customerId ? self::get($customerId) : self::getAuth();
|
||||||
|
|
||||||
|
return $customer ? $customer->sale_channels : SaleChannels::getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
public static function getSaleChannel()
|
public static function getSaleChannel()
|
||||||
{
|
{
|
||||||
return SaleChannels::getDefault();
|
return SaleChannels::getDefault();
|
||||||
@@ -129,22 +150,25 @@ class Customers
|
|||||||
|
|
||||||
public static function edit($id)
|
public static function edit($id)
|
||||||
{
|
{
|
||||||
$customer = self::get($id, ['delivery_addresses', 'invoice_addresses']);
|
$customer = self::get($id, ['delivery_addresses', 'invoice_addresses', 'sale_channels']);
|
||||||
$data = $customer->toArray();
|
$data = $customer->toArray();
|
||||||
$data['deliveries'] = $customer->deliveries->pluck('id')->toArray();
|
$data['sale_channels'] = $customer->sale_channels->pluck('id')->toArray();
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function storeFull($data)
|
public static function storeFull($data)
|
||||||
{
|
{
|
||||||
$deliveries = $data['deliveries'];
|
// $invoices = $data['invoices'];
|
||||||
$invoices = $data['invoices'];
|
$saleChannels = $data['sale_channels'];
|
||||||
unset($data['deliveries']);
|
// unset($data['invoices']);
|
||||||
unset($data['invoices']);
|
unset($data['sale_channels']);
|
||||||
$customer = self::store($data);
|
$customer = self::store($data);
|
||||||
self::storeAddresses($customer, $deliveries);
|
if ($customer) {
|
||||||
self::storeAddresses($customer, $invoices);
|
// self::storeAddresses($customer->id, $deliveries);
|
||||||
|
// self::storeAddresses($customer->id, $invoices);
|
||||||
|
self::storeSaleChannels($customer->id, $saleChannels);
|
||||||
|
}
|
||||||
|
|
||||||
return $customer->id;
|
return $customer->id;
|
||||||
}
|
}
|
||||||
@@ -163,31 +187,37 @@ class Customers
|
|||||||
return $customer->deliveries()->sync($deliveries);
|
return $customer->deliveries()->sync($deliveries);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function storeAddresses($customer, $addresses)
|
public static function storeAddresses($customerId, $addresses)
|
||||||
{
|
{
|
||||||
foreach ($addresses as $address) {
|
foreach ($addresses as $address) {
|
||||||
$address['customer_id'] = $customer->id;
|
$address['customer_id'] = $customerId;
|
||||||
CustomerAddresses::store($address);
|
CustomerAddresses::store($address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function storeSaleChannels($customerId, $saleChannels)
|
||||||
|
{
|
||||||
|
$oldSaleChannels = self::getSaleChannelIds($customerId);
|
||||||
|
$deleteSaleChannels = array_diff($oldSaleChannels, $saleChannels);
|
||||||
|
$newSaleChannels = array_diff($saleChannels, $oldSaleChannels);
|
||||||
|
|
||||||
|
$data = ['customer_id' => $customerId];
|
||||||
|
foreach ($newSaleChannels as $saleChannelId) {
|
||||||
|
$data['sale_channel_id'] = $saleChannelId;
|
||||||
|
CustomerSaleChannels::store($data);
|
||||||
|
}
|
||||||
|
foreach ($deleteSaleChannels as $saleChannelId) {
|
||||||
|
CustomerSaleChannels::destroyByCustomerAndSaleChannel($customerId, $saleChannelId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function create($data)
|
public static function create($data)
|
||||||
{
|
{
|
||||||
return Customer::create([
|
$data['uuid'] = Str::uuid();
|
||||||
'uuid' => Str::uuid(),
|
$data['active'] = true;
|
||||||
'active' => true,
|
$data['password'] = bcrypt($data['password']);
|
||||||
'first_name' => $data['first_name'],
|
|
||||||
'last_name' => $data['last_name'],
|
return Customer::create($data);
|
||||||
'company' => $data['company'],
|
|
||||||
'tva' => $data['tva'],
|
|
||||||
'phone' => $data['phone'],
|
|
||||||
'address' => $data['address'],
|
|
||||||
'address2' => $data['address2'],
|
|
||||||
'zipcode' => $data['zipcode'],
|
|
||||||
'city' => $data['city'],
|
|
||||||
'email' => $data['email'],
|
|
||||||
'password' => bcrypt($data['password']),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getStorage($filename = false)
|
public static function getStorage($filename = false)
|
||||||
|
|||||||
@@ -9,6 +9,13 @@ class Deliveries
|
|||||||
{
|
{
|
||||||
use Basic;
|
use Basic;
|
||||||
|
|
||||||
|
public static function init()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'sale_channels' => SaleChannels::getOptions(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public static function getSaleChannelId($deliveryId)
|
public static function getSaleChannelId($deliveryId)
|
||||||
{
|
{
|
||||||
return $deliveryId ? Deliveries::getField($deliveryId, 'sale_channel_id') : SaleChannels::getDefaultID();
|
return $deliveryId ? Deliveries::getField($deliveryId, 'sale_channel_id') : SaleChannels::getDefaultID();
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
namespace App\Repositories\Shop;
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
use App\Models\Shop\Merchandise;
|
use App\Models\Shop\Merchandise;
|
||||||
use App\Traits\Model\Basic;
|
|
||||||
use App\Repositories\Core\Tag;
|
use App\Repositories\Core\Tag;
|
||||||
|
use App\Traits\Model\Basic;
|
||||||
use App\Traits\Repository\Imageable;
|
use App\Traits\Repository\Imageable;
|
||||||
|
|
||||||
class Merchandises
|
class Merchandises
|
||||||
@@ -68,7 +68,6 @@ class Merchandises
|
|||||||
return Tag::storeTags($merchandise, $tags);
|
return Tag::storeTags($merchandise, $tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function getModel()
|
public static function getModel()
|
||||||
{
|
{
|
||||||
return Merchandise::query();
|
return Merchandise::query();
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
namespace App\Repositories\Shop;
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
use App\Models\Shop\Offer;
|
use App\Models\Shop\Offer;
|
||||||
use App\Models\Shop\PriceList;
|
|
||||||
use App\Traits\Model\Basic;
|
use App\Traits\Model\Basic;
|
||||||
|
|
||||||
class Offers
|
class Offers
|
||||||
@@ -30,6 +29,7 @@ class Offers
|
|||||||
{
|
{
|
||||||
return Offer::with('variation')->byIds($ids)->get();
|
return Offer::with('variation')->byIds($ids)->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getWithPricesByIds($ids, $saleChannelId = false)
|
public static function getWithPricesByIds($ids, $saleChannelId = false)
|
||||||
{
|
{
|
||||||
$saleChannelId = $saleChannelId ? $saleChannelId : SaleChannels::getDefaultID();
|
$saleChannelId = $saleChannelId ? $saleChannelId : SaleChannels::getDefaultID();
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class Orders
|
|||||||
$data = $order->toArray();
|
$data = $order->toArray();
|
||||||
$data['payment_type'] = InvoicePayments::getPaymentType($order->payment_type);
|
$data['payment_type'] = InvoicePayments::getPaymentType($order->payment_type);
|
||||||
$data['status'] = Orders::getStatus($order->status);
|
$data['status'] = Orders::getStatus($order->status);
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ class PriceLists
|
|||||||
return PriceList::byTariff($id)->get();
|
return PriceList::byTariff($id)->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function edit($id)
|
public static function edit($id)
|
||||||
{
|
{
|
||||||
$price_list = self::getFull($id)->toArray();
|
$price_list = self::getFull($id)->toArray();
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Repositories\Shop;
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
use App\Models\Shop\Category;
|
|
||||||
use App\Repositories\Core\Categories as CategoryTrees;
|
|
||||||
use App\Repositories\Core\Tag;
|
|
||||||
|
|
||||||
class Shelves
|
class Shelves
|
||||||
{
|
{
|
||||||
public static function getOffersByCategoryAndNature($categoryId, $articleNatureId = false, $tags = [], $articleNature = false, $displayByRows = false)
|
public static function getOffersByCategoryAndNature($categoryId, $articleNatureId = false, $tags = [], $articleNature = false, $displayByRows = false)
|
||||||
@@ -29,6 +25,7 @@ class Shelves
|
|||||||
$productType = ArticleNatures::getProductTypeBySlug($articleNature);
|
$productType = ArticleNatures::getProductTypeBySlug($articleNature);
|
||||||
$articleNatureId = ArticleNatures::getIdBySlug($articleNature);
|
$articleNatureId = ArticleNatures::getIdBySlug($articleNature);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'category' => Categories::getFull($categoryId),
|
'category' => Categories::getFull($categoryId),
|
||||||
'breadcrumb' => Categories::getAncestorsByCategory($categoryId),
|
'breadcrumb' => Categories::getAncestorsByCategory($categoryId),
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class Tariffs
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function autocomplete($str)
|
public static function autocomplete($str)
|
||||||
{
|
{
|
||||||
$data = Tariff::byAutocomplete($str)->orderBy('name')->limit(30)->get()->pluck('name', 'id');
|
$data = Tariff::byAutocomplete($str)->orderBy('name')->limit(30)->get()->pluck('name', 'id');
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class Variations
|
|||||||
'unities' => Unities::getOptions(),
|
'unities' => Unities::getOptions(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function autocomplete($str)
|
public static function autocomplete($str)
|
||||||
{
|
{
|
||||||
$data = Variation::where('name', 'LIKE', "%${str}%")->orderBy('name')->limit(30)->get()->pluck('name', 'id');
|
$data = Variation::where('name', 'LIKE', "%${str}%")->orderBy('name')->limit(30)->get()->pluck('name', 'id');
|
||||||
@@ -57,7 +58,6 @@ class Variations
|
|||||||
return Packages::getName($data['package_id']).' '.$data['quantity'].' '.Unities::getName($data['unity_id']);
|
return Packages::getName($data['package_id']).' '.$data['quantity'].' '.Unities::getName($data['unity_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function getFull($id)
|
public static function getFull($id)
|
||||||
{
|
{
|
||||||
return Variation::with(['package', 'unity'])->findOrFail($id);
|
return Variation::with(['package', 'unity'])->findOrFail($id);
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ trait Basic
|
|||||||
if ($stopStamping) {
|
if ($stopStamping) {
|
||||||
$model->stopUserstamping();
|
$model->stopUserstamping();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $model;
|
return $model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ trait Imageable
|
|||||||
return $this->hasOne(Media::class, 'model_id')->where('model_type', get_class($this))->latest();
|
return $this->hasOne(Media::class, 'model_id')->where('model_type', get_class($this))->latest();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function registerMediaConversions(Media $media = null): void
|
public function registerMediaConversions(?Media $media = null): void
|
||||||
{
|
{
|
||||||
$watermark = public_path('img/watermark.png');
|
$watermark = public_path('img/watermark.png');
|
||||||
|
|
||||||
|
|||||||
@@ -46,10 +46,9 @@
|
|||||||
"kmlaravel/laravel-geographical-calculator": "^2.1",
|
"kmlaravel/laravel-geographical-calculator": "^2.1",
|
||||||
"knplabs/knp-snappy": "^1.2",
|
"knplabs/knp-snappy": "^1.2",
|
||||||
"laracasts/utilities": "^3.0",
|
"laracasts/utilities": "^3.0",
|
||||||
"laracraft-tech/laravel-date-scopes": "^1.1",
|
"laracraft-tech/laravel-date-scopes": "^2.0",
|
||||||
"laravel/framework": "^9.0",
|
"laravel/framework": "^9.0",
|
||||||
"laravel/helpers": "^1.1",
|
"laravel/helpers": "^1.1",
|
||||||
"laravel/pint": "^1.10",
|
|
||||||
"laravel/scout": "^9.1",
|
"laravel/scout": "^9.1",
|
||||||
"laravel/tinker": "^2.5",
|
"laravel/tinker": "^2.5",
|
||||||
"laravel/ui": "^3.0",
|
"laravel/ui": "^3.0",
|
||||||
@@ -70,7 +69,7 @@
|
|||||||
"proengsoft/laravel-jsvalidation": "^4.5",
|
"proengsoft/laravel-jsvalidation": "^4.5",
|
||||||
"protonemedia/laravel-cross-eloquent-search": "^3.0",
|
"protonemedia/laravel-cross-eloquent-search": "^3.0",
|
||||||
"rahul900day/laravel-captcha": "^1.0",
|
"rahul900day/laravel-captcha": "^1.0",
|
||||||
"ralphjsmit/laravel-seo": "^1.0",
|
"ralphjsmit/laravel-seo": "^1.4",
|
||||||
"reedware/laravel-relation-joins": "^3.0",
|
"reedware/laravel-relation-joins": "^3.0",
|
||||||
"respect/validation": "^2.2",
|
"respect/validation": "^2.2",
|
||||||
"rinvex/laravel-categories": "^6.0",
|
"rinvex/laravel-categories": "^6.0",
|
||||||
@@ -114,6 +113,7 @@
|
|||||||
"fossbarrow/laravel-phpcs": "dev-main",
|
"fossbarrow/laravel-phpcs": "dev-main",
|
||||||
"kevincobain2000/laravel-erd": "^1.3",
|
"kevincobain2000/laravel-erd": "^1.3",
|
||||||
"kitloong/laravel-migrations-generator": "^6.0",
|
"kitloong/laravel-migrations-generator": "^6.0",
|
||||||
|
"laravel/pint": "^1.13",
|
||||||
"mockery/mockery": "^1.4.2",
|
"mockery/mockery": "^1.4.2",
|
||||||
"nunomaduro/collision": "^7.0",
|
"nunomaduro/collision": "^7.0",
|
||||||
"nunomaduro/larastan": "^2.6",
|
"nunomaduro/larastan": "^2.6",
|
||||||
|
|||||||
@@ -173,17 +173,17 @@ return [
|
|||||||
'confirmdelete' => 'Confirmez-vous la suppression de l\'offre ?',
|
'confirmdelete' => 'Confirmez-vous la suppression de l\'offre ?',
|
||||||
],
|
],
|
||||||
'packages' => [
|
'packages' => [
|
||||||
'title' => 'Déclinaisons',
|
'title' => 'Packages',
|
||||||
'name' => 'Déclinaison',
|
'name' => 'Package',
|
||||||
'description' => 'Gérer les déclinaisons',
|
'description' => 'Gérer les packages',
|
||||||
'add' => 'Ajouter une déclinaison',
|
'add' => 'Ajouter un package',
|
||||||
'edit' => 'Editer une déclinaison',
|
'edit' => 'Editer un package',
|
||||||
'del' => 'Effacer une déclinaison',
|
'del' => 'Effacer un package',
|
||||||
'list' => 'Liste des déclinaisons',
|
'list' => 'Liste des packages',
|
||||||
'successadd' => 'La déclinaison été correctement ajoutée',
|
'successadd' => 'Le package été correctement ajouté',
|
||||||
'successmod' => 'La déclinaison a été correctement modifiée',
|
'successmod' => 'Le package a été correctement modifié',
|
||||||
'successdel' => 'La déclinaison a été correctement effacée',
|
'successdel' => 'Le package a été correctement effacé',
|
||||||
'confirmdelete' => 'Confirmez-vous la suppression de la déclinaison ?',
|
'confirmdelete' => 'Confirmez-vous la suppression du package ?',
|
||||||
],
|
],
|
||||||
'producers' => [
|
'producers' => [
|
||||||
'title' => 'Producteurs',
|
'title' => 'Producteurs',
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.articles.title'),
|
'title' => __('shop.articles.title'),
|
||||||
'subtitle' => __('shop.articles.list'),
|
'subtitle' => __('shop.articles.list'),
|
||||||
'breadcrumb' => [__('shop.articles.title')]
|
'breadcrumb' => [__('shop.articles.title')],
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@component('components.card')
|
<x-card>
|
||||||
@include('components.datatable', [
|
@include('components.datatable', [
|
||||||
'route' => route('Admin.Shop.Articles.index'),
|
'route' => route('Admin.Shop.Articles.index'),
|
||||||
'model' => 'articles',
|
'model' => 'articles',
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-articles-filters'])
|
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-articles-filters'])
|
||||||
@include('Admin.Shop.Articles.partials.filters', ['model' => 'articles'])
|
@include('Admin.Shop.Articles.partials.filters', ['model' => 'articles'])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
@endcomponent
|
</x-card>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@include('load.form.select2')
|
@include('load.form.select2')
|
||||||
|
|||||||
@@ -1,121 +1,123 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-6">
|
||||||
|
<x-card>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
{{ Form::label('first_name', 'Prénom') }}
|
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'name' => 'first_name',
|
'name' => 'first_name',
|
||||||
'value' => $customer['first_name'] ?? null,
|
'value' => $customer['first_name'] ?? null,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
'label' => 'Prénom',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
{{ Form::label('last_name', 'Nom') }}
|
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'name' => 'last_name',
|
'name' => 'last_name',
|
||||||
'value' => $customer['last_name'] ?? null,
|
'value' => $customer['last_name'] ?? null,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
'label' => 'Nom',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
{{ Form::label('company', 'Société') }}
|
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'name' => 'company',
|
'name' => 'company',
|
||||||
'value' => $customer['company'] ?? null,
|
'value' => $customer['company'] ?? null,
|
||||||
|
'label' => 'Société',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
{{ Form::label('tva', 'TVA') }}
|
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'name' => 'tva',
|
'name' => 'tva',
|
||||||
'value' => $customer['tva'] ?? null,
|
'value' => $customer['tva'] ?? null,
|
||||||
|
'label' => 'TVA',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
{{ Form::label('email', 'Email') }}
|
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'name' => 'email',
|
'name' => 'email',
|
||||||
'value' => $customer['email'] ?? null,
|
'value' => $customer['email'] ?? null,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
'label' => 'Email',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
{{ Form::label('phone', 'Téléphone') }}
|
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'name' => 'phone',
|
'name' => 'phone',
|
||||||
'value' => $customer['phone'] ?? null,
|
'value' => $customer['phone'] ?? null,
|
||||||
|
'label' => 'Téléphone',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
{{ Form::label('address', 'Adresse') }}
|
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'name' => 'address',
|
'name' => 'address',
|
||||||
'value' => $customer['address'] ?? null,
|
'value' => $customer['address'] ?? null,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
'label' => 'Adresse',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row mb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
{{ Form::label('address2', 'Adresse complémentaire') }}
|
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'name' => 'address2',
|
'name' => 'address2',
|
||||||
'value' => $customer['address2'] ?? null,
|
'value' => $customer['address2'] ?? null,
|
||||||
|
'label' => 'Adresse complémentaire',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
{{ Form::label('zipcode', 'Code postal') }}
|
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'name' => 'zipcode',
|
'name' => 'zipcode',
|
||||||
'value' => $customer['zipcode'] ?? null,
|
'value' => $customer['zipcode'] ?? null,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
'label' => 'Code postal',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
{{ Form::label('city', 'Ville') }}
|
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'name' => 'city',
|
'name' => 'city',
|
||||||
'value' => $customer['city'] ?? null,
|
'value' => $customer['city'] ?? null,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
'label' => 'Ville',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-6">
|
<div class="col-12">
|
||||||
{{ Form::label('sale_delivery_id', __('shop.deliveries.name')) }}
|
|
||||||
@include('components.form.select', [
|
@include('components.form.select', [
|
||||||
'name' => 'deliveries[]',
|
'name' => 'sale_channels[]',
|
||||||
'list' => $deliveries ?? [],
|
'list' => $sale_channels ?? [],
|
||||||
'values' => $customer['deliveries'] ?? null,
|
'values' => $customer['sale_channels'] ?? null,
|
||||||
'with_empty' => '',
|
'with_empty' => '',
|
||||||
'class' => 'select2',
|
'class' => 'select2',
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
'label' => __('shop.sale_channels.name'),
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</x-card>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-6">
|
||||||
@component('components.layout.box-collapse', ['title' => __('Adresses'), 'id' => 'form-customer-address'])
|
<x-layout.box-collapse title='Adresses' id='form-customer-address'>
|
||||||
@include('Admin.Shop.CustomerAddresses.list', ['dataTable' => $customer_addresses])
|
@include('Admin.Shop.CustomerAddresses.list', ['dataTable' => $customer_addresses])
|
||||||
@endcomponent
|
</x-layout.box-collapse>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@include('components.save')
|
<x-save />
|
||||||
|
|
||||||
@include('load.form.save')
|
@include('load.form.save')
|
||||||
@include('load.form.select2')
|
@include('load.form.select2')
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.customers.title'),
|
'title' => __('shop.customers.title'),
|
||||||
'subtitle' => __('shop.customers.list'),
|
'subtitle' => __('shop.customers.list'),
|
||||||
'breadcrumb' => [__('shop.customers.title')]
|
'breadcrumb' => [__('shop.customers.title')],
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@component('components.card')
|
<x-card>
|
||||||
@include('components.datatable', ['route' => route('Admin.Shop.Customers.index'), 'model' => 'customers'])
|
@include('components.datatable', [
|
||||||
@endcomponent
|
'route' => route('Admin.Shop.Customers.index'),
|
||||||
|
'model' => 'customers',
|
||||||
|
'with_filters' => true,
|
||||||
|
])
|
||||||
|
<x-layout.modal title="Filtres" id="modal-customers-filters">
|
||||||
|
@include('Admin.Shop.Customers.partials.filters', ['model' => 'customers'])
|
||||||
|
</x-layout.modal>
|
||||||
|
</x-card>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<form id="{{ $model }}-filters">
|
||||||
|
<div class="row mb-3">
|
||||||
|
<label class="col-4">{{ __('shop.sale_channels.name') }}</label>
|
||||||
|
<div class="col-8">
|
||||||
|
@include('components.form.select', [
|
||||||
|
'name' => 'sale_channel_id',
|
||||||
|
'list' => $sale_channels ?? [],
|
||||||
|
'value' => $filters['sale_channel_id'] ?? null,
|
||||||
|
'with_empty' => '',
|
||||||
|
'class' => 'select2',
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
@@ -1,13 +1,21 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.deliveries.title'),
|
'title' => __('shop.deliveries.title'),
|
||||||
'subtitle' => __('shop.deliveries.list'),
|
'subtitle' => __('shop.deliveries.list'),
|
||||||
'breadcrumb' => [__('shop.deliveries.title')]
|
'breadcrumb' => [__('shop.deliveries.title')],
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@component('components.card')
|
<x-card>
|
||||||
@include('components.datatable', ['route' => route('Admin.Shop.Deliveries.index'), 'model' => 'deliveries', 'callback' => 'handleDelivery();'])
|
@include('components.datatable', [
|
||||||
|
'route' => route('Admin.Shop.Deliveries.index'),
|
||||||
|
'model' => 'deliveries',
|
||||||
|
'with_filters' => true,
|
||||||
|
'callback' => 'handleDelivery();',
|
||||||
|
])
|
||||||
|
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-deliveries-filters'])
|
||||||
|
@include('Admin.Shop.Deliveries.partials.filters', ['model' => 'deliveries'])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
</x-card>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@include('load.form.select2')
|
@include('load.form.select2')
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
<form id="{{ $model }}-filters">
|
<form id="{{ $model }}-filters">
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
|
<label class="col-4">{{ __('shop.sale_channels.name') }}</label>
|
||||||
|
<div class="col-8">
|
||||||
|
@include('components.form.select', [
|
||||||
|
'name' => 'sale_channel_id',
|
||||||
|
'list' => $sale_channels ?? [],
|
||||||
|
'value' => $filters['sale_channel_id'] ?? null,
|
||||||
|
'with_empty' => '',
|
||||||
|
'class' => 'select2',
|
||||||
|
])
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
<div class="row">
|
<div class="row mb-3">
|
||||||
|
<div class="col-6">
|
||||||
|
@include('components.form.datepicker', [
|
||||||
|
'label' => 'Date',
|
||||||
|
'name' => 'date',
|
||||||
|
'value' => $invoice_payment['date'] ?? null,
|
||||||
|
])
|
||||||
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
@include('components.form.select', [
|
@include('components.form.select', [
|
||||||
'label' => 'Règlement',
|
'label' => 'Règlement',
|
||||||
@@ -8,8 +15,10 @@
|
|||||||
'class' => 'select2',
|
'class' => 'select2',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-3">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
@include('components.form.input', [
|
@include('components.form.inputs.money', [
|
||||||
'label' => 'Montant',
|
'label' => 'Montant',
|
||||||
'name' => 'amount',
|
'name' => 'amount',
|
||||||
'value' => $invoice_payment['amount'] ?? null,
|
'value' => $invoice_payment['amount'] ?? null,
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.packages.title'),
|
'title' => __('shop.packages.title'),
|
||||||
'subtitle' => __('shop.packages.list'),
|
'subtitle' => __('shop.packages.list'),
|
||||||
'breadcrumb' => [__('shop.packages.title')]
|
'breadcrumb' => [__('shop.packages.title')],
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@component('components.card')
|
<x-card>
|
||||||
@include('components.datatable', ['route' => route('Admin.Shop.Packages.index'), 'model' => 'packages', 'with_filters' => true])
|
@include('components.datatable', [
|
||||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-packages-filters'])
|
'route' => route('Admin.Shop.Packages.index'),
|
||||||
|
'model' => 'packages',
|
||||||
|
'with_filters' => true,
|
||||||
|
])
|
||||||
|
@component('components.layout.modal', [
|
||||||
|
'title' => 'Filtres',
|
||||||
|
'id' => 'modal-packages-filters',
|
||||||
|
])
|
||||||
@include('Admin.Shop.Packages.partials.filters')
|
@include('Admin.Shop.Packages.partials.filters')
|
||||||
@endcomponent
|
@endcomponent
|
||||||
@endcomponent
|
</x-card>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
Reference in New Issue
Block a user