fix shipping
This commit is contained in:
@@ -18,9 +18,9 @@ class DeliveryPackagesDataTable extends DataTable
|
|||||||
protected function getColumns()
|
protected function getColumns()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
Column::make('weight')->title('Poids'),
|
Column::make('weight')->title('Poids')->addClass('text-right'),
|
||||||
Column::make('weight_flyer')->title('Flyer'),
|
Column::make('weight_flyer')->title('Flyer')->addClass('text-right'),
|
||||||
Column::make('weight_packaging')->title('Packaging'),
|
Column::make('weight_packaging')->title('Packaging')->addClass('text-right'),
|
||||||
$this->makeColumnButtons(),
|
$this->makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,16 +11,12 @@ class DeliveryPackageController extends Controller
|
|||||||
{
|
{
|
||||||
public function index(DeliveryPackagesDataTable $dataTable)
|
public function index(DeliveryPackagesDataTable $dataTable)
|
||||||
{
|
{
|
||||||
$data = [];
|
return $dataTable->render('Admin.Shop.DeliveryPackages.list');
|
||||||
|
|
||||||
return $dataTable->render('Admin.Shop.DeliveryPackages.list', $data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
$data['sale_channels'] = SaleChannels::getOptions();
|
return view('Admin.Shop.DeliveryPackages.create');
|
||||||
|
|
||||||
return view('Admin.Shop.DeliveryPackages.create', $data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
@@ -30,17 +26,9 @@ class DeliveryPackageController extends Controller
|
|||||||
return redirect()->route('Admin.Shop.DeliveryPackages.index');
|
return redirect()->route('Admin.Shop.DeliveryPackages.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data['delivery'] = DeliveryPackages::get($id);
|
|
||||||
|
|
||||||
return view('Admin.Shop.DeliveryPackages.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$data['delivery'] = DeliveryPackages::get($id)->toArray();
|
$data['package'] = DeliveryPackages::get($id)->toArray();
|
||||||
$data['sale_channels'] = SaleChannels::getOptions();
|
|
||||||
|
|
||||||
return view('Admin.Shop.DeliveryPackages.edit', $data);
|
return view('Admin.Shop.DeliveryPackages.edit', $data);
|
||||||
}
|
}
|
||||||
@@ -49,11 +37,4 @@ class DeliveryPackageController extends Controller
|
|||||||
{
|
{
|
||||||
return DeliveryPackages::destroy($id);
|
return DeliveryPackages::destroy($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toggleActive(Request $request)
|
|
||||||
{
|
|
||||||
$data = DeliveryPackages::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
|
||||||
|
|
||||||
return response()->json(['error' => 0]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,21 +4,21 @@ namespace App\Http\Controllers\Admin\Shop;
|
|||||||
|
|
||||||
use App\Datatables\Shop\DeliveryTypeCalculationsDataTable;
|
use App\Datatables\Shop\DeliveryTypeCalculationsDataTable;
|
||||||
use App\Repositories\Shop\DeliveryTypeCalculations;
|
use App\Repositories\Shop\DeliveryTypeCalculations;
|
||||||
use App\Repositories\Shop\SaleChannels;
|
use App\Repositories\Shop\DeliveryTypes;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class DeliveryTypeCalculationController extends Controller
|
class DeliveryTypeCalculationController extends Controller
|
||||||
{
|
{
|
||||||
public function index(DeliveryTypeCalculationsDataTable $dataTable)
|
public function index(DeliveryTypeCalculationsDataTable $dataTable)
|
||||||
{
|
{
|
||||||
$data = [];
|
return $dataTable->render('Admin.Shop.DeliveryTypeCalculations.list');
|
||||||
|
|
||||||
return $dataTable->render('Admin.Shop.DeliveryTypeCalculations.list', $data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
$data = [];
|
$data = [
|
||||||
|
'delivery_types' => DeliveryTypes::getOptions(),
|
||||||
|
];
|
||||||
|
|
||||||
return view('Admin.Shop.DeliveryTypeCalculations.create', $data);
|
return view('Admin.Shop.DeliveryTypeCalculations.create', $data);
|
||||||
}
|
}
|
||||||
@@ -30,18 +30,13 @@ class DeliveryTypeCalculationController extends Controller
|
|||||||
return redirect()->route('Admin.Shop.DeliveryTypeCalculations.index');
|
return redirect()->route('Admin.Shop.DeliveryTypeCalculations.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data['delivery'] = DeliveryTypeCalculations::get($id);
|
|
||||||
|
|
||||||
return view('Admin.Shop.DeliveryTypeCalculations.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$data['delivery'] = DeliveryTypeCalculations::get($id)->toArray();
|
$data = [
|
||||||
$data['sale_channels'] = SaleChannels::getOptions();
|
'calcul' => DeliveryTypeCalculations::get($id)->toArray(),
|
||||||
|
'delivery_types' => DeliveryTypes::getOptions(),
|
||||||
|
];
|
||||||
|
|
||||||
return view('Admin.Shop.DeliveryTypeCalculations.edit', $data);
|
return view('Admin.Shop.DeliveryTypeCalculations.edit', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,11 +44,4 @@ class DeliveryTypeCalculationController extends Controller
|
|||||||
{
|
{
|
||||||
return DeliveryTypeCalculations::destroy($id);
|
return DeliveryTypeCalculations::destroy($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toggleActive(Request $request)
|
|
||||||
{
|
|
||||||
$data = DeliveryTypeCalculations::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
|
||||||
|
|
||||||
return response()->json(['error' => 0]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,13 +30,6 @@ class DeliveryTypeController extends Controller
|
|||||||
return redirect()->route('Admin.Shop.DeliveryTypes.index');
|
return redirect()->route('Admin.Shop.DeliveryTypes.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id)
|
|
||||||
{
|
|
||||||
$data['delivery'] = DeliveryTypes::get($id);
|
|
||||||
|
|
||||||
return view('Admin.Shop.DeliveryTypes.view', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$data['delivery'] = DeliveryTypes::get($id)->toArray();
|
$data['delivery'] = DeliveryTypes::get($id)->toArray();
|
||||||
@@ -49,11 +42,4 @@ class DeliveryTypeController extends Controller
|
|||||||
{
|
{
|
||||||
return DeliveryTypes::destroy($id);
|
return DeliveryTypes::destroy($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toggleActive(Request $request)
|
|
||||||
{
|
|
||||||
$data = DeliveryTypes::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
|
||||||
|
|
||||||
return response()->json(['error' => 0]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,24 +15,24 @@ class BasketController extends Controller
|
|||||||
{
|
{
|
||||||
public function getPrice(Request $request)
|
public function getPrice(Request $request)
|
||||||
{
|
{
|
||||||
$offer_id = $request->input('offer_id');
|
$offerId = $request->input('offer_id');
|
||||||
$quantity = $request->input('quantity') ?? 1;
|
$quantity = $request->input('quantity') ?? 1;
|
||||||
$price = Offers::getPrice($offer_id, $quantity)->price_taxed;
|
$price = Offers::getPrice($offerId, $quantity)->price_taxed;
|
||||||
return number_format($quantity * $price, 2);
|
return number_format($quantity * $price, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addBasket(Request $request)
|
public function addBasket(Request $request)
|
||||||
{
|
{
|
||||||
$offer_id = $request->input('offer_id');
|
$offerId = $request->input('offer_id');
|
||||||
$quantity = $request->input('quantity') ?? 1;
|
$quantity = $request->input('quantity') ?? 1;
|
||||||
$update = $request->input('update') ?? false;
|
$update = $request->input('update') ?? false;
|
||||||
return Baskets::addBasket($offer_id, $quantity, $update);
|
return Baskets::addBasket($offerId, $quantity, $update);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function modalBasket($offer_id, $quantity)
|
public function modalBasket($offerId, $quantity)
|
||||||
{
|
{
|
||||||
$data['offer'] = Offers::getFull($offer_id)->toArray();
|
$data['offer'] = Offers::getFull($offerId)->toArray();
|
||||||
$data['basket'] = Baskets::addBasket($offer_id, $quantity);
|
$data['basket'] = Baskets::addBasket($offerId, $quantity);
|
||||||
return view('Shop.Baskets.partials.modalBasket', $data);
|
return view('Shop.Baskets.partials.modalBasket', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ class BasketController extends Controller
|
|||||||
$data = $request->all();
|
$data = $request->all();
|
||||||
unset($data['_token']);
|
unset($data['_token']);
|
||||||
$data['user_id'] = Users::getId();
|
$data['user_id'] = Users::getId();
|
||||||
Orders::newOrder($data);
|
Orders::saveOrder($data);
|
||||||
return response()->json(['code' => '200']);
|
return response()->json(['code' => '200']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,72 +19,72 @@ class CategoryController extends Controller
|
|||||||
return $dataTable->render('Shop.Categories.list');
|
return $dataTable->render('Shop.Categories.list');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show(Request $request, $category_id, $article_nature_id = false)
|
public function show(Request $request, $categoryId, $articleNatureId = false)
|
||||||
{
|
{
|
||||||
if ($article_nature_id) {
|
if ($articleNatureId) {
|
||||||
$product_type = ArticleNatures::getProductType($article_nature_id);
|
$productType = ArticleNatures::getProductType($articleNatureId);
|
||||||
dump($product_type);
|
dump($productType);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
$article_nature = $request->input('article_nature');
|
$articleNature = $request->input('article_nature');
|
||||||
if (!$article_nature) {
|
if (!$articleNature) {
|
||||||
$articleNatures = Articles::getArticleNaturesWithOffers([
|
$articleNatures = Articles::getArticleNaturesWithOffers([
|
||||||
'category_id' => $category_id,
|
'category_id' => $categoryId,
|
||||||
]);
|
]);
|
||||||
if (count($articleNatures) === 1) {
|
if (count($articleNatures) === 1) {
|
||||||
$article_nature = $articleNatures[0];
|
$articleNature = $articleNatures[0];
|
||||||
}
|
}
|
||||||
$productTypes = Articles::getProductTypesWithOffers([
|
$productTypes = Articles::getProductTypesWithOffers([
|
||||||
'category_id' => $category_id,
|
'category_id' => $categoryId,
|
||||||
]);
|
]);
|
||||||
if (count($productTypes) === 1) {
|
if (count($productTypes) === 1) {
|
||||||
$product_type = $productTypes[0];
|
$productType = $productTypes[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($article_nature) {
|
switch ($articleNature) {
|
||||||
case 'semences':
|
case 'semences':
|
||||||
$product_type = 'botanic';
|
$productType = 'botanic';
|
||||||
$article_nature_id = 1;
|
$articleNatureId = 1;
|
||||||
break;
|
break;
|
||||||
case 'plants':
|
case 'plants':
|
||||||
$product_type = 'botanic';
|
$productType = 'botanic';
|
||||||
$article_nature_id = 2;
|
$articleNatureId = 2;
|
||||||
break;
|
break;
|
||||||
case 'legumes':
|
case 'legumes':
|
||||||
$product_type = 'botanic';
|
$productType = 'botanic';
|
||||||
$article_nature_id = 3;
|
$articleNatureId = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!($product_type ?? false)) {
|
if (!($productType ?? false)) {
|
||||||
$product_type = 'botanic';
|
$productType = 'botanic';
|
||||||
$article_nature_id = 1;
|
$articleNatureId = 1;
|
||||||
$article_nature = 'semences';
|
$articleNature = 'semences';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// $product_type = ArticleNatures::getProductType($article_nature_id);
|
// $productType = ArticleNatures::getProductType($articleNatureId);
|
||||||
// dump($product_type);
|
// dump($productType);
|
||||||
// dump($article_nature_id);
|
// dump($articleNatureId);
|
||||||
// exit;
|
// exit;
|
||||||
}
|
}
|
||||||
// exit;
|
// exit;
|
||||||
$data = [
|
$data = [
|
||||||
'category' => Categories::getFull($category_id),
|
'category' => Categories::getFull($categoryId),
|
||||||
'breadcrumb' => Categories::getAncestorsByCategory($category_id),
|
'breadcrumb' => Categories::getAncestorsByCategory($categoryId),
|
||||||
'display_by_rows' => $request->input('display_by_rows') ?? false,
|
'display_by_rows' => $request->input('display_by_rows') ?? false,
|
||||||
'product_type' => $product_type,
|
'product_type' => $productType,
|
||||||
'article_nature' => $article_nature,
|
'article_nature' => $articleNature,
|
||||||
'article_natures' => $articleNatures ?? [],
|
'article_natures' => $articleNatures ?? [],
|
||||||
'product_types' => $productTypes ?? [],
|
'product_types' => $productTypes ?? [],
|
||||||
'tags_selected' => $request->input('tags') ?? [],
|
'tags_selected' => $request->input('tags') ?? [],
|
||||||
'articles' => Articles::getArticlesToSell([
|
'articles' => Articles::getArticlesToSell([
|
||||||
'category_id' => $category_id,
|
'category_id' => $categoryId,
|
||||||
'tags' => $request->input('tags') ?? [],
|
'tags' => $request->input('tags') ?? [],
|
||||||
'product_type' => $product_type ?? false,
|
'product_type' => $productType ?? false,
|
||||||
'article_nature_id' => $article_nature_id ?? false,
|
'article_nature_id' => $articleNatureId ?? false,
|
||||||
]),
|
]),
|
||||||
'tags' => TagGroups::getWithTagsAndCountOffers($category_id),
|
'tags' => TagGroups::getWithTagsAndCountOffers($categoryId),
|
||||||
];
|
];
|
||||||
// dump($data);
|
// dump($data);
|
||||||
// exit;
|
// exit;
|
||||||
|
|||||||
@@ -13,13 +13,25 @@ class Orders
|
|||||||
->activeIfRoute('orders')
|
->activeIfRoute('orders')
|
||||||
->order(1);
|
->order(1);
|
||||||
|
|
||||||
$menu->addTo('orders', 'Commandes', [ 'route' => 'Admin.Shop.Orders.index', 'permission' => 'backend_access' ])
|
$menu->addTo('orders', 'Commandes', [
|
||||||
->activeIfRoute(['Admin.Shop.Orders.*'])->order(1);
|
'route' => 'Admin.Shop.Orders.index',
|
||||||
$menu->addTo('orders', 'Factures', [ 'route' => 'Admin.Shop.Invoices.index', 'permission' => 'backend_access' ])
|
'permission' => 'backend_access',
|
||||||
->activeIfRoute(['Admin.Shop.Invoices.*'])->order(2);
|
])->activeIfRoute(['Admin.Shop.Orders.*'])->order(1);
|
||||||
$menu->addTo('orders', 'Avoirs', [ 'route' => 'Admin.Shop.Invoices.index', 'permission' => 'backend_access' ])
|
|
||||||
->activeIfRoute(['Admin.Shop.Invoices.*'])->order(3);
|
$menu->addTo('orders', 'Factures', [
|
||||||
$menu->addTo('orders', 'Bons de livraison', [ 'route' => 'Admin.Shop.Invoices.index', 'permission' => 'backend_access' ])
|
'route' => 'Admin.Shop.Invoices.index',
|
||||||
->activeIfRoute(['Admin.Shop.Invoices.*'])->order(4);
|
'permission' => 'backend_access',
|
||||||
|
])->activeIfRoute(['Admin.Shop.Invoices.*'])->order(2);
|
||||||
|
/*
|
||||||
|
$menu->addTo('orders', 'Avoirs', [
|
||||||
|
'route' => 'Admin.Shop.Invoices.index',
|
||||||
|
'permission' => 'backend_access',
|
||||||
|
])->activeIfRoute(['Admin.Shop.Invoices.*'])->order(3);
|
||||||
|
|
||||||
|
$menu->addTo('orders', 'Bons de livraison', [
|
||||||
|
'route' => 'Admin.Shop.Invoices.index',
|
||||||
|
'permission' => 'backend_access',
|
||||||
|
])->activeIfRoute(['Admin.Shop.Invoices.*'])->order(4);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,15 +11,21 @@ class Settings
|
|||||||
$menu->add('Paramètres', [ 'permission' => 'backend_access', 'icon' => 'cogs' ])
|
$menu->add('Paramètres', [ 'permission' => 'backend_access', 'icon' => 'cogs' ])
|
||||||
->id('settings')
|
->id('settings')
|
||||||
->activeIfRoute('settings')
|
->activeIfRoute('settings')
|
||||||
->order(1);
|
->order(7);
|
||||||
|
|
||||||
$menu->addTo('settings', __('shop.delivery_types.title'), [ 'route' => 'Admin.Shop.DeliveryTypes.index', 'permission' => 'backend_access' ])
|
$menu->addTo('settings', __('shop.delivery_types.title'), [
|
||||||
->activeIfRoute(['Admin.Shop.DeliveryTypes.*'])->order(1);
|
'route' => 'Admin.Shop.DeliveryTypes.index',
|
||||||
|
'permission' => 'backend_access',
|
||||||
|
])->activeIfRoute(['Admin.Shop.DeliveryTypes.*'])->order(1);
|
||||||
|
|
||||||
$menu->addTo('settings', __('shop.delivery_type_calculations.title'), [ 'route' => 'Admin.Shop.DeliveryTypeCalculations.index', 'permission' => 'backend_access' ])
|
$menu->addTo('settings', __('shop.delivery_type_calculations.title'), [
|
||||||
->activeIfRoute(['Admin.Shop.DeliveryTypeCalculations.*'])->order(2);
|
'route' => 'Admin.Shop.DeliveryTypeCalculations.index',
|
||||||
|
'permission' => 'backend_access',
|
||||||
|
])->activeIfRoute(['Admin.Shop.DeliveryTypeCalculations.*'])->order(2);
|
||||||
|
|
||||||
$menu->addTo('settings', __('shop.delivery_packages.title'), [ 'route' => 'Admin.Shop.DeliveryPackages.index', 'permission' => 'backend_access' ])
|
$menu->addTo('settings', __('shop.delivery_packages.title'), [
|
||||||
->activeIfRoute(['Admin.Shop.DeliveryPackages.*'])->order(3);
|
'route' => 'Admin.Shop.DeliveryPackages.index',
|
||||||
|
'permission' => 'backend_access',
|
||||||
|
])->activeIfRoute(['Admin.Shop.DeliveryPackages.*'])->order(3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,9 +58,9 @@ class Category extends parentCategory
|
|||||||
return $this->tags()->withCount('Articles');
|
return $this->tags()->withCount('Articles');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeByCategory($query, $category_id)
|
public function scopeByCategory($query, $categoryId)
|
||||||
{
|
{
|
||||||
return $query->where('category_id', $category_id);
|
return $query->where('category_id', $categoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeVisible($query)
|
public function scopeVisible($query)
|
||||||
@@ -78,28 +78,28 @@ class Category extends parentCategory
|
|||||||
return $query->where('id', '<>', 1);
|
return $query->where('id', '<>', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeInRange($query, $_lft, $_rgt)
|
public function scopeInRange($query, $left, $right)
|
||||||
{
|
{
|
||||||
return $query->where('_lft', '>=', $_lft)->where('_rgt', '<=', $_rgt);
|
return $query->where('_lft', '>=', $left)->where('_rgt', '<=', $right);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeHasAvailableOffers($query, $sale_channel_id = false)
|
public function scopeHasAvailableOffers($query, $saleChannelId = false)
|
||||||
{
|
{
|
||||||
$sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID();
|
$saleChannelId = $saleChannelId ? $saleChannelId : SaleChannels::getDefaultID();
|
||||||
|
|
||||||
return $query->whereHas('articles', function ($query) use ($sale_channel_id) {
|
return $query->whereHas('articles', function ($query) use ($saleChannelId) {
|
||||||
$query->WithAvailableOffers($sale_channel_id);
|
$query->WithAvailableOffers($saleChannelId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeHasAvailableOffersByCategoryParent($query, $sale_channel_id = false)
|
public function scopeHasAvailableOffersByCategoryParent($query, $saleChannelId = false)
|
||||||
{
|
{
|
||||||
$sale_channel_id = $sale_channel_id ? $sale_channel_id : SaleChannels::getDefaultID();
|
$saleChannelId = $saleChannelId ? $saleChannelId : SaleChannels::getDefaultID();
|
||||||
|
|
||||||
return $query->whereHas('articles', function ($query) use ($sale_channel_id) {
|
return $query->whereHas('articles', function ($query) use ($saleChannelId) {
|
||||||
$query->WithAvailableOffers($sale_channel_id);
|
$query->WithAvailableOffers($saleChannelId);
|
||||||
})->orWhereHas('descendants.articles', function ($query) use ($sale_channel_id) {
|
})->orWhereHas('descendants.articles', function ($query) use ($saleChannelId) {
|
||||||
$query->WithAvailableOffers($sale_channel_id);
|
$query->WithAvailableOffers($saleChannelId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,14 +58,14 @@ class Order extends Model
|
|||||||
return $query->where('uuid', $uuid);
|
return $query->where('uuid', $uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeByCustomer($query, $customer_id)
|
public function scopeByCustomer($query, $customerId)
|
||||||
{
|
{
|
||||||
return $query->where('customer_id', $customer_id);
|
return $query->where('customer_id', $customerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeByDelivery($query, $delivery_id)
|
public function scopeByDelivery($query, $deliveryId)
|
||||||
{
|
{
|
||||||
return $query->where('delivery_id', $delivery_id);
|
return $query->where('delivery_id', $deliveryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopePreparation($query)
|
public function scopePreparation($query)
|
||||||
@@ -88,9 +88,9 @@ class Order extends Model
|
|||||||
return $query->where('status', $status);
|
return $query->where('status', $status);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeByPaymentType($query, $payment_type)
|
public function scopeByPaymentType($query, $paymentType)
|
||||||
{
|
{
|
||||||
return $query->where('payment_type', $payment_type);
|
return $query->where('payment_type', $paymentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeByPeriod($query, $start, $end, $field = 'created_at')
|
public function scopeByPeriod($query, $start, $end, $field = 'created_at')
|
||||||
|
|||||||
@@ -7,13 +7,11 @@ use App\Models\Botanic\Variety;
|
|||||||
use App\Models\Shop\Article;
|
use App\Models\Shop\Article;
|
||||||
use App\Models\Shop\ArticleNature;
|
use App\Models\Shop\ArticleNature;
|
||||||
use App\Models\Shop\Merchandise;
|
use App\Models\Shop\Merchandise;
|
||||||
|
use App\Traits\Model\Basic;
|
||||||
|
|
||||||
class ArticleNatures
|
class ArticleNatures
|
||||||
{
|
{
|
||||||
public static function getOptions()
|
use Basic;
|
||||||
{
|
|
||||||
return ArticleNature::get()->pluck('name', 'id')->toArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getProductType($id)
|
public static function getProductType($id)
|
||||||
{
|
{
|
||||||
@@ -37,12 +35,16 @@ class ArticleNatures
|
|||||||
switch ($model) {
|
switch ($model) {
|
||||||
case Specie::class:
|
case Specie::class:
|
||||||
case Variety::class:
|
case Variety::class:
|
||||||
return 1;
|
$type = 1;
|
||||||
|
break;
|
||||||
case Merchandise::class:
|
case Merchandise::class:
|
||||||
return 2;
|
$type = 2;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$type = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getProductTypes()
|
public static function getProductTypes()
|
||||||
@@ -77,14 +79,9 @@ class ArticleNatures
|
|||||||
return ArticleNature::byProductType($type)->get();
|
return ArticleNature::byProductType($type)->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getByCategory($category_id)
|
public static function getByCategory($categoryId)
|
||||||
{
|
{
|
||||||
return Article::byCategory($category_id)->select('article_nature_id')->distinct()->get();
|
return Article::byCategory($categoryId)->select('article_nature_id')->distinct()->get();
|
||||||
}
|
|
||||||
|
|
||||||
public static function getAll()
|
|
||||||
{
|
|
||||||
return ArticleNature::orderBy('name', 'asc')->get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getNamesByIds($ids)
|
public static function getNamesByIds($ids)
|
||||||
@@ -94,34 +91,8 @@ class ArticleNatures
|
|||||||
return array_map('strtolower', $names);
|
return array_map('strtolower', $names);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get($id)
|
public static function getModel()
|
||||||
{
|
{
|
||||||
return ArticleNature::find($id);
|
return ArticleNature::query();
|
||||||
}
|
|
||||||
|
|
||||||
public static function store($data)
|
|
||||||
{
|
|
||||||
$item = ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
|
||||||
|
|
||||||
return $item->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function create($data)
|
|
||||||
{
|
|
||||||
return ArticleNature::create($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function update($data, $id = false)
|
|
||||||
{
|
|
||||||
$id = $id ? $id : $data['id'];
|
|
||||||
$item = self::get($id);
|
|
||||||
$ret = $item->update($data);
|
|
||||||
|
|
||||||
return $item;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function destroy($id)
|
|
||||||
{
|
|
||||||
return ArticleNature::destroy($id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,30 +3,18 @@
|
|||||||
namespace App\Repositories\Shop;
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
use App\Models\Shop\CustomerAddress;
|
use App\Models\Shop\CustomerAddress;
|
||||||
|
use App\Traits\Model\Basic;
|
||||||
|
|
||||||
class CustomerAddresses
|
class CustomerAddresses
|
||||||
{
|
{
|
||||||
public static function getOptions()
|
use Basic;
|
||||||
{
|
|
||||||
return CustomerAddress::orderBy('name', 'asc')->get()->pluck('name', 'id')->toArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getAll()
|
public static function add($userId, $data)
|
||||||
{
|
|
||||||
return CustomerAddress::orderBy('name', 'asc')->get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function get($id)
|
|
||||||
{
|
|
||||||
return CustomerAddress::find($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function add($user_id, $data)
|
|
||||||
{
|
{
|
||||||
$name = $data['company'] ? $data['company'] : $data['first_name'].' '.$data['last_name'];
|
$name = $data['company'] ? $data['company'] : $data['first_name'].' '.$data['last_name'];
|
||||||
if ($data['use_for_delivery'] ?? false) {
|
if ($data['use_for_delivery'] ?? false) {
|
||||||
return self::store([
|
return self::store([
|
||||||
'customer_id' => $user_id,
|
'customer_id' => $userId,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'address' => $data['delivery_address'],
|
'address' => $data['delivery_address'],
|
||||||
'address2' => $data['delivery_address2'],
|
'address2' => $data['delivery_address2'],
|
||||||
@@ -35,7 +23,7 @@ class CustomerAddresses
|
|||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
return self::store([
|
return self::store([
|
||||||
'customer_id' => $user_id,
|
'customer_id' => $userId,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'address' => $data['address'],
|
'address' => $data['address'],
|
||||||
'address2' => $data['address2'],
|
'address2' => $data['address2'],
|
||||||
@@ -45,35 +33,13 @@ class CustomerAddresses
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function store($data)
|
public static function toggleActive($id, $active)
|
||||||
{
|
|
||||||
$id = $data['id'] ?? false;
|
|
||||||
$item = $id ? self::update($data, $id) : self::create($data);
|
|
||||||
|
|
||||||
return $item->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function create($data)
|
|
||||||
{
|
|
||||||
return CustomerAddress::create($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function update($data, $id = false)
|
|
||||||
{
|
|
||||||
$id = $id ? $id : $data['id'];
|
|
||||||
$delivery = self::get($id);
|
|
||||||
$delivery->update($data);
|
|
||||||
|
|
||||||
return $delivery;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function destroy($id)
|
|
||||||
{
|
|
||||||
return CustomerAddress::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function toggle_active($id, $active)
|
|
||||||
{
|
{
|
||||||
return self::update(['active' => $active], $id);
|
return self::update(['active' => $active], $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getModel()
|
||||||
|
{
|
||||||
|
return CustomerAddress::query();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ class Dashboards
|
|||||||
public static function getStats($start, $end)
|
public static function getStats($start, $end)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'orders_count' => Orders::countByPeriod($start, $end),
|
'orders_count' => OrderMetrics::countByPeriod($start, $end),
|
||||||
'orders_sum' => Orders::sumByPeriod($start, $end, 'total_shipped'),
|
'orders_sum' => OrderMetrics::sumByPeriod($start, $end, 'total_shipped'),
|
||||||
'orders_avg' => Orders::avgByPeriod($start, $end, 'total_shipped'),
|
'orders_avg' => OrderMetrics::avgByPeriod($start, $end, 'total_shipped'),
|
||||||
'offers_count' => Offers::count(),
|
'offers_count' => Offers::count(),
|
||||||
'clients_count' => Customers::count(),
|
'clients_count' => Customers::count(),
|
||||||
'preparationLess24H' => Orders::countInPreparationLess24H(),
|
'preparationLess24H' => OrderMetrics::countInPreparationLess24H(),
|
||||||
'preparationLess48H' => Orders::countInPreparationLess48H(),
|
'preparationLess48H' => OrderMetrics::countInPreparationLess48H(),
|
||||||
'preparationMore48H' => Orders::countInPreparationMore48H(),
|
'preparationMore48H' => OrderMetrics::countInPreparationMore48H(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,42 +3,14 @@
|
|||||||
namespace App\Repositories\Shop;
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
use App\Models\Shop\DeliveryPackage;
|
use App\Models\Shop\DeliveryPackage;
|
||||||
|
use App\Traits\Model\Basic;
|
||||||
|
|
||||||
class DeliveryPackages
|
class DeliveryPackages
|
||||||
{
|
{
|
||||||
public static function getOptions()
|
use Basic;
|
||||||
|
|
||||||
|
public static function getModel()
|
||||||
{
|
{
|
||||||
return DeliveryPackage::pluck('name', 'id');
|
return DeliveryPackage::query();
|
||||||
}
|
|
||||||
|
|
||||||
public static function get($id)
|
|
||||||
{
|
|
||||||
return DeliveryPackage::find($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function store($data)
|
|
||||||
{
|
|
||||||
$item = ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
|
||||||
|
|
||||||
return $item->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function create($data)
|
|
||||||
{
|
|
||||||
return DeliveryPackage::create($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function update($data, $id = false)
|
|
||||||
{
|
|
||||||
$id = $id ? $id : $data['id'];
|
|
||||||
$item = self::get($id);
|
|
||||||
$item->update($data);
|
|
||||||
|
|
||||||
return $item;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function destroy($id)
|
|
||||||
{
|
|
||||||
return DeliveryPackage::destroy($id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,52 +3,14 @@
|
|||||||
namespace App\Repositories\Shop;
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
use App\Models\Shop\DeliveryTypeCalculation;
|
use App\Models\Shop\DeliveryTypeCalculation;
|
||||||
|
use App\Traits\Model\Basic;
|
||||||
|
|
||||||
class DeliveryTypeCalculations
|
class DeliveryTypeCalculations
|
||||||
{
|
{
|
||||||
public static function getByDeliveryType($typeId)
|
use Basic;
|
||||||
|
|
||||||
|
public static function getModel()
|
||||||
{
|
{
|
||||||
return DeliveryTypeCalculation::byDeliveryTpe($typeId)->get();
|
return DeliveryTypeCalculation::query();
|
||||||
}
|
|
||||||
|
|
||||||
public static function getPrice($typeId, $weight)
|
|
||||||
{
|
|
||||||
return DeliveryTypeCalculation::byDeliveryType($typeId)->byWeight($weight)->get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getOptions()
|
|
||||||
{
|
|
||||||
return DeliveryTypeCalculation::pluck('name', 'id');
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function get($id)
|
|
||||||
{
|
|
||||||
return DeliveryTypeCalculation::find($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function store($data)
|
|
||||||
{
|
|
||||||
$item = ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
|
||||||
|
|
||||||
return $item->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function create($data)
|
|
||||||
{
|
|
||||||
return DeliveryTypeCalculation::create($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function update($data, $id = false)
|
|
||||||
{
|
|
||||||
$id = $id ? $id : $data['id'];
|
|
||||||
$item = self::get($id);
|
|
||||||
$item->update($data);
|
|
||||||
|
|
||||||
return $item;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function destroy($id)
|
|
||||||
{
|
|
||||||
return DeliveryTypeCalculation::destroy($id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,42 +3,14 @@
|
|||||||
namespace App\Repositories\Shop;
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
use App\Models\Shop\DeliveryType;
|
use App\Models\Shop\DeliveryType;
|
||||||
|
use App\Traits\Model\Basic;
|
||||||
|
|
||||||
class DeliveryTypes
|
class DeliveryTypes
|
||||||
{
|
{
|
||||||
public static function getOptions()
|
use Basic;
|
||||||
|
|
||||||
|
public static function getModel()
|
||||||
{
|
{
|
||||||
return DeliveryType::pluck('name', 'id');
|
return DeliveryType::query();
|
||||||
}
|
|
||||||
|
|
||||||
public static function get($id)
|
|
||||||
{
|
|
||||||
return DeliveryType::find($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function store($data)
|
|
||||||
{
|
|
||||||
$item = ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
|
||||||
|
|
||||||
return $item->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function create($data)
|
|
||||||
{
|
|
||||||
return DeliveryType::create($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function update($data, $id = false)
|
|
||||||
{
|
|
||||||
$id = $id ? $id : $data['id'];
|
|
||||||
$item = self::get($id);
|
|
||||||
$item->update($data);
|
|
||||||
|
|
||||||
return $item;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function destroy($id)
|
|
||||||
{
|
|
||||||
return DeliveryType::destroy($id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ class Invoices
|
|||||||
return Invoice::byUUID($uuid)->first();
|
return Invoice::byUUID($uuid)->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function saveInvoice($order_id, $data)
|
public static function saveInvoice($orderId, $data)
|
||||||
{
|
{
|
||||||
$data['order_id'] = $order_id;
|
$data['order_id'] = $orderId;
|
||||||
|
|
||||||
return self::store($data);
|
return self::store($data);
|
||||||
}
|
}
|
||||||
@@ -86,9 +86,9 @@ class Invoices
|
|||||||
public static function getNewRef()
|
public static function getNewRef()
|
||||||
{
|
{
|
||||||
$ref = date('ym').'00000';
|
$ref = date('ym').'00000';
|
||||||
$last_ref = Invoice::orderBy('id', 'desc')->first();
|
$lastRef = Invoice::orderBy('id', 'desc')->first();
|
||||||
|
|
||||||
return $last_ref ? $last_ref->ref + 1 : $ref + 1;
|
return $lastRef ? $lastRef->ref + 1 : $ref + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getStatus($id)
|
public static function getStatus($id)
|
||||||
|
|||||||
44
app/Repositories/Shop/OrderMails.php
Normal file
44
app/Repositories/Shop/OrderMails.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
|
use App\Mail\Acheminement;
|
||||||
|
use App\Mail\ConfirmationCommande;
|
||||||
|
use App\Mail\Preparation;
|
||||||
|
use App\Models\Shop\Order;
|
||||||
|
use App\Repositories\Core\DateStats;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Support\Facades\Mail;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class OrderMails
|
||||||
|
{
|
||||||
|
public static function testSend($id)
|
||||||
|
{
|
||||||
|
self::sendPreparation($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendOrderConfirmed($orderId)
|
||||||
|
{
|
||||||
|
$order = Orders::get($orderId, ['customer', 'address']);
|
||||||
|
$mail = new ConfirmationCommande($order);
|
||||||
|
|
||||||
|
return Mail::to($order->customer->email)->send($mail);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendPreparation($orderId)
|
||||||
|
{
|
||||||
|
$order = Orders::get($orderId, ['customer', 'address']);
|
||||||
|
$mail = new Preparation($order);
|
||||||
|
|
||||||
|
return Mail::to($order->customer->email)->send($mail);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function sendShipping($orderId)
|
||||||
|
{
|
||||||
|
$order = Orders::get($orderId, ['customer', 'address']);
|
||||||
|
$mail = new Acheminement($order);
|
||||||
|
|
||||||
|
return Mail::to($order->customer->email)->send($mail);
|
||||||
|
}
|
||||||
|
}
|
||||||
45
app/Repositories/Shop/OrderMetrics.php
Normal file
45
app/Repositories/Shop/OrderMetrics.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
|
use App\Models\Shop\Order;
|
||||||
|
use App\Repositories\Core\DateStats;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
class OrderMetrics
|
||||||
|
{
|
||||||
|
use DateStats;
|
||||||
|
|
||||||
|
public static function countInPreparationLess24H()
|
||||||
|
{
|
||||||
|
$start = Carbon::now()->subHours(24);
|
||||||
|
$end = Carbon::now();
|
||||||
|
|
||||||
|
return Order::preparation()->byPeriod($start, $end, 'updated_at')->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function countInPreparationLess48H()
|
||||||
|
{
|
||||||
|
$start = Carbon::now()->subHours(48);
|
||||||
|
$end = Carbon::now();
|
||||||
|
|
||||||
|
return Order::preparation()->byPeriod($start, $end, 'updated_at')->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function countInPreparationMore48H()
|
||||||
|
{
|
||||||
|
$start = Carbon::now()->subHours(48);
|
||||||
|
|
||||||
|
return Order::preparation()->where('updated_at', '>', $start)->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getTotalByPeriod($start, $end)
|
||||||
|
{
|
||||||
|
return self::sumByPeriod($start, $end, 'total_shipped');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getModel()
|
||||||
|
{
|
||||||
|
return Order::query();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,18 +2,14 @@
|
|||||||
|
|
||||||
namespace App\Repositories\Shop;
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
use App\Mail\Acheminement;
|
|
||||||
use App\Mail\ConfirmationCommande;
|
|
||||||
use App\Mail\Preparation;
|
|
||||||
use App\Models\Shop\Order;
|
use App\Models\Shop\Order;
|
||||||
use App\Repositories\Core\DateStats;
|
use App\Repositories\Core\DateStats;
|
||||||
use Carbon\Carbon;
|
use App\Traits\Model\Basic;
|
||||||
use Illuminate\Support\Facades\Mail;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class Orders
|
class Orders
|
||||||
{
|
{
|
||||||
use DateStats;
|
use Basic, DateStats;
|
||||||
|
|
||||||
public static function getByUUID($uuid)
|
public static function getByUUID($uuid)
|
||||||
{
|
{
|
||||||
@@ -38,68 +34,6 @@ class Orders
|
|||||||
return ($order && $detail) ? Invoices::saveInvoice($order->id, $data) : false;
|
return ($order && $detail) ? Invoices::saveInvoice($order->id, $data) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function testSend($id)
|
|
||||||
{
|
|
||||||
self::sendPreparation($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function sendOrderConfirmed($order_id)
|
|
||||||
{
|
|
||||||
$order = self::get($order_id, ['customer', 'address']);
|
|
||||||
$mail = new ConfirmationCommande($order);
|
|
||||||
|
|
||||||
return Mail::to($order->customer->email)->send($mail);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function sendPreparation($order_id)
|
|
||||||
{
|
|
||||||
$order = self::get($order_id, ['customer', 'address']);
|
|
||||||
$mail = new Preparation($order);
|
|
||||||
|
|
||||||
return Mail::to($order->customer->email)->send($mail);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function sendShipping($order_id)
|
|
||||||
{
|
|
||||||
$order = self::get($order_id, ['customer', 'address']);
|
|
||||||
$mail = new Acheminement($order);
|
|
||||||
|
|
||||||
return Mail::to($order->customer->email)->send($mail);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function count()
|
|
||||||
{
|
|
||||||
return Order::count();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function countInPreparationLess24H()
|
|
||||||
{
|
|
||||||
$start = Carbon::now()->subHours(24);
|
|
||||||
$end = Carbon::now();
|
|
||||||
|
|
||||||
return Order::preparation()->byPeriod($start, $end, 'updated_at')->count();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function countInPreparationLess48H()
|
|
||||||
{
|
|
||||||
$start = Carbon::now()->subHours(48);
|
|
||||||
$end = Carbon::now();
|
|
||||||
|
|
||||||
return Order::preparation()->byPeriod($start, $end, 'updated_at')->count();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function countInPreparationMore48H()
|
|
||||||
{
|
|
||||||
$start = Carbon::now()->subHours(48);
|
|
||||||
|
|
||||||
return Order::preparation()->where('updated_at', '>', $start)->count();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getTotalByPeriod($start, $end)
|
|
||||||
{
|
|
||||||
return self::sumByPeriod($start, $end, 'total_shipped');
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function edit($id)
|
public static function edit($id)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -111,16 +45,6 @@ class Orders
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get($id, $relations = false)
|
|
||||||
{
|
|
||||||
return $relations ? Order::with($relations)->findOrFail($id) : Order::findOrFail($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function store($data)
|
|
||||||
{
|
|
||||||
return ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function create($data)
|
public static function create($data)
|
||||||
{
|
{
|
||||||
OrderStats::increase();
|
OrderStats::increase();
|
||||||
@@ -130,20 +54,6 @@ class Orders
|
|||||||
return Order::create($data);
|
return Order::create($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function update($data, $id = false)
|
|
||||||
{
|
|
||||||
$id = $id ? $id : $data['id'];
|
|
||||||
$item = self::get($id);
|
|
||||||
$item->update($data);
|
|
||||||
|
|
||||||
return $item;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function delete($id)
|
|
||||||
{
|
|
||||||
return Order::destroy($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function download($id)
|
public static function download($id)
|
||||||
{
|
{
|
||||||
dump($id);
|
dump($id);
|
||||||
@@ -180,9 +90,9 @@ class Orders
|
|||||||
public static function getNewRef()
|
public static function getNewRef()
|
||||||
{
|
{
|
||||||
$ref = date('ym').'00000';
|
$ref = date('ym').'00000';
|
||||||
$last_ref = Order::orderBy('id', 'desc')->first();
|
$lastRef = Order::orderBy('id', 'desc')->first();
|
||||||
|
|
||||||
return $last_ref ? $last_ref->ref + 1 : $ref + 1;
|
return $lastRef ? $lastRef->ref + 1 : $ref + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getModel()
|
public static function getModel()
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
namespace App\Traits\Model;
|
namespace App\Traits\Model;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
trait Basic
|
trait Basic
|
||||||
{
|
{
|
||||||
@@ -24,14 +26,38 @@ trait Basic
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getName($id)
|
public static function getName($id, $len = false)
|
||||||
{
|
{
|
||||||
return self::getField($id, 'name');
|
$name = self::getField($id, 'name');
|
||||||
|
|
||||||
|
return $len ? Str::limit($name, $len) : $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getByUUID($uuid)
|
public static function getUUID($id)
|
||||||
{
|
{
|
||||||
return self::getByField('uuid', $uuid)->first();
|
return self::getField($id, 'uuid');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getByUUID($uuid, $relations = [])
|
||||||
|
{
|
||||||
|
return self::getByField('uuid', $uuid, $relations)->first();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getIdByUUID($uuid)
|
||||||
|
{
|
||||||
|
$model = self::getByUUID($uuid);
|
||||||
|
|
||||||
|
return $model ? $model->id : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function generateToken()
|
||||||
|
{
|
||||||
|
return Hash::make(self::generateUUID());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function generateUUID()
|
||||||
|
{
|
||||||
|
return Str::uuid()->toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFields($field)
|
public static function getFields($field)
|
||||||
@@ -39,9 +65,9 @@ trait Basic
|
|||||||
return self::getAll()->pluck($field);
|
return self::getAll()->pluck($field);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getByField($field, $value)
|
public static function getByField($field, $value, $relations = [])
|
||||||
{
|
{
|
||||||
return self::getModel()->where($field, $value);
|
return self::getModel()->with($relations)->where($field, $value)->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getField($id, $field)
|
public static function getField($id, $field)
|
||||||
@@ -58,7 +84,7 @@ trait Basic
|
|||||||
|
|
||||||
public static function store($data)
|
public static function store($data)
|
||||||
{
|
{
|
||||||
return ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
return $data['id'] ?? false ? self::update($data) : self::create($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function create($data)
|
public static function create($data)
|
||||||
@@ -87,25 +113,32 @@ trait Basic
|
|||||||
return self::getModel()->count();
|
return self::getModel()->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function firstOrCreate($search, $data)
|
public static function firstOrCreate($search, $data = false)
|
||||||
{
|
{
|
||||||
return self::getModel()::firstOrCreate($search, $data);
|
return self::getModel()->firstOrCreate($search, $data ? $data : $search);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get($id, $relations = false, $relations_count = false)
|
public static function deleteByField($field, $value)
|
||||||
{
|
{
|
||||||
return self::getModelRelations($relations, $relations_count)->find($id);
|
$model = self::getModel()->where($field, $value);
|
||||||
|
|
||||||
|
return $model ? $model->delete() : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getAll($relations = false, $relations_count = false)
|
public static function get($id, $relations = false, $relationscount = false)
|
||||||
{
|
{
|
||||||
return self::getModelRelations($relations, $relations_count)->get();
|
return self::getModelRelations($relations, $relationscount)->find($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getModelRelations($relations = false, $relations_count = false)
|
public static function getAll($relations = false, $relationscount = false)
|
||||||
|
{
|
||||||
|
return self::getModelRelations($relations, $relationscount)->get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getModelRelations($relations = false, $relationscount = false)
|
||||||
{
|
{
|
||||||
$model = $relations ? self::getModelWithRelations($relations) : false;
|
$model = $relations ? self::getModelWithRelations($relations) : false;
|
||||||
$model = $relations_count ? self::getModelWithCountRelations($relations_count, $model) : $model;
|
$model = $relationscount ? self::getModelWithCountRelations($relationscount, $model) : $model;
|
||||||
|
|
||||||
return $model ? $model : self::getModel();
|
return $model ? $model : self::getModel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,55 +1,78 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-xl-8">
|
<div class="col-xs-12 col-xl-8">
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
{{ Form::label('sale_channel_id', __('shop.sale_channels.name')) }}
|
{{ Form::label('sale_channel_id', __('shop.sale_channels.name')) }}
|
||||||
@include('components.form.select', ['name' => 'sale_channel_id', 'list' => $sale_channels ?? [], 'value' => $delivery['sale_channel_id'] ?? null, 'with_empty' => '', 'class' => 'select2'])
|
@include('components.form.select', [
|
||||||
</div>
|
'name' => 'sale_channel_id',
|
||||||
<div class="col-6">
|
'list' => $sale_channels ?? [],
|
||||||
<div class="row">
|
'value' => $delivery['sale_channel_id'] ?? null,
|
||||||
<div class="col-5">
|
'with_empty' => '',
|
||||||
{{ Form::label('active', __('Actif')) }}<br/>
|
'class' => 'select2'
|
||||||
@include("components.form.toggle", ['name' => 'active', 'value' => $delivery['active'] ?? false, 'on' => __('active'), 'off' => __('inactive')])
|
])
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-6">
|
||||||
{{ Form::label('is_public', __('Type')) }}
|
<div class="row">
|
||||||
@include('components.form.toggle', ['name' => 'is_public', 'value' => $delivery['is_public'] ?? false, 'on' => __('public'), 'off' => __('administré')])
|
<div class="col-5">
|
||||||
</div>
|
{{ Form::label('active', __('Actif')) }}<br/>
|
||||||
<div class="col-4">
|
@include("components.form.toggle", [
|
||||||
{{ Form::label('at_house', __('Défaut')) }}
|
'name' => 'active',
|
||||||
@include('components.form.checkboxes.icheck', ['name' => 'at_house', 'value' => $delivery['at_house'] ?? null])
|
'value' => $delivery['active'] ?? false,
|
||||||
</div>
|
'on' => __('active'),
|
||||||
</div>
|
'off' => __('inactive')
|
||||||
</div>
|
])
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="col-3">
|
||||||
<div class="col-12">
|
{{ Form::label('is_public', __('Type')) }}
|
||||||
{{ Form::label('name', __('Nom')) }}
|
@include('components.form.toggle', [
|
||||||
@include('components.form.input', ['name' => 'name', 'value' => $delivery['name'] ?? null, 'required' => true])
|
'name' => 'is_public',
|
||||||
</div>
|
'value' => $delivery['is_public'] ?? false,
|
||||||
</div>
|
'on' => __('public'),
|
||||||
|
'off' => __('administré')
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
{{ Form::label('at_house', __('Défaut')) }}
|
||||||
|
@include('components.form.checkboxes.icheck', [
|
||||||
|
'name' => 'at_house',
|
||||||
|
'value' => $delivery['at_house'] ?? null
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-12">
|
||||||
|
{{ Form::label('name', __('Nom')) }}
|
||||||
|
@include('components.form.input', [
|
||||||
|
'name' => 'name',
|
||||||
|
'value' => $delivery['name'] ?? null,
|
||||||
|
'required' => true
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
{{ Form::label('', __('Description')) }}
|
{{ Form::label('', __('Description')) }}
|
||||||
<textarea name="description" class="form-control">{{ $delivery['description'] ?? '' }}</textarea>
|
<textarea name="description" class="form-control">{{ $delivery['description'] ?? '' }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@include('components.address', ['with_country' => false])
|
@include('components.address', ['with_country' => false])
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
{{ Form::label('event_date_begin', __('Date de début')) }}
|
{{ Form::label('event_date_begin', __('Date de début')) }}
|
||||||
@include('components.form.datepicker', ['name' => 'event_date_begin', 'value' => $delivery['event_date_begin'] ?? null])
|
@include('components.form.datepicker', ['name' => 'event_date_begin', 'value' => $delivery['event_date_begin'] ?? null])
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
{{ Form::label('event_date_end', __('Date de fin')) }}
|
{{ Form::label('event_date_end', __('Date de fin')) }}
|
||||||
@include('components.form.datepicker', ['name' => 'event_date_end', 'value' => $delivery['event_date_end'] ?? null])
|
@include('components.form.datepicker', ['name' => 'event_date_end', 'value' => $delivery['event_date_end'] ?? null])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@include('components.save')
|
@include('components.save')
|
||||||
@@ -59,11 +82,11 @@
|
|||||||
|
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
initSelect2();
|
initSelect2();
|
||||||
initDatepicker();
|
initDatepicker();
|
||||||
initSaveForm('#delivery-form');
|
initSaveForm('#delivery-form');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.deliveries.title'),
|
'title' => __('shop.delivery_packages.title'),
|
||||||
'subtitle' => __('shop.deliveries.add'),
|
'subtitle' => __('shop.delivery_packages.add'),
|
||||||
'breadcrumb' => [__('shop.deliveries.title'), __('shop.deliveries.add')]
|
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
{{ Form::open(['route' => 'Admin.Shop.Deliveries.store', 'id' => 'delivery-form', 'autocomplete' => 'off']) }}
|
{{ Form::open([
|
||||||
@include('Admin.Shop.Deliveries.form')
|
'route' => 'Admin.Shop.DeliveryPackages.store',
|
||||||
</form>
|
'id' => 'delivery_package-form',
|
||||||
|
'autocomplete' => 'off'
|
||||||
|
]) }}
|
||||||
|
@include('Admin.Shop.DeliveryPackage.form')
|
||||||
|
</form>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.deliveries.title'),
|
'title' => __('shop.delivery_packages.title'),
|
||||||
'subtitle' => __('shop.deliveries.edit'),
|
'subtitle' => __('shop.delivery_packages.edit'),
|
||||||
'breadcrumb' => [__('shop.deliveries.title')]
|
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
{{ Form::open(['route' => 'Admin.Shop.Deliveries.store', 'id' => 'delivery-form', 'autocomplete' => 'off']) }}
|
{{ Form::open([
|
||||||
<input type="hidden" name="id" value="{{ $delivery['id'] }}">
|
'route' => 'Admin.Shop.DeliveryPackages.store',
|
||||||
@include('Admin.Shop.Deliveries.form')
|
'id' => 'delivery_package-form',
|
||||||
</form>
|
'autocomplete' => 'off'
|
||||||
|
]) }}
|
||||||
|
<input type="hidden" name="id" value="{{ $package['id'] }}">
|
||||||
|
@include('Admin.Shop.DeliveryPackages.form')
|
||||||
|
</form>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -1,69 +1,27 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-xl-8">
|
<div class="col-xs-3">
|
||||||
<div class="row mb-3">
|
<x-form.inputs.number name="weight" value="{{ $package['weight'] ?? 0 }}" label="Poids" />
|
||||||
<div class="col-6">
|
</div>
|
||||||
{{ Form::label('sale_channel_id', __('shop.sale_channels.name')) }}
|
<div class="col-xs-3">
|
||||||
@include('components.form.select', ['name' => 'sale_channel_id', 'list' => $sale_channels ?? [], 'value' => $delivery['sale_channel_id'] ?? null, 'with_empty' => '', 'class' => 'select2'])
|
<x-form.inputs.number name="weight_flyer" value="{{ $package['weight_flyer'] ?? 0 }}" label="Poids Flyer" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-xs-3">
|
||||||
<div class="row">
|
<x-form.inputs.number name="weight_packaging" value="{{ $package['weight_packaging'] ?? 0 }}" label="Poids packaging" />
|
||||||
<div class="col-5">
|
</div>
|
||||||
{{ Form::label('active', __('Actif')) }}<br/>
|
<div class="col-xs-3">
|
||||||
@include("components.form.toggle", ['name' => 'active', 'value' => $delivery['active'] ?? false, 'on' => __('active'), 'off' => __('inactive')])
|
<x-form.inputs.number name="weight" value="{{ $package['weight_useful'] ?? 0 }}" label="Poids utile" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
|
||||||
{{ Form::label('is_public', __('Type')) }}
|
|
||||||
@include('components.form.toggle', ['name' => 'is_public', 'value' => $delivery['is_public'] ?? false, 'on' => __('public'), 'off' => __('administré')])
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
{{ Form::label('at_house', __('Défaut')) }}
|
|
||||||
@include('components.form.checkboxes.icheck', ['name' => 'at_house', 'value' => $delivery['at_house'] ?? null])
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-12">
|
|
||||||
{{ Form::label('name', __('Nom')) }}
|
|
||||||
@include('components.form.input', ['name' => 'name', 'value' => $delivery['name'] ?? null, 'required' => true])
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-12">
|
|
||||||
{{ Form::label('', __('Description')) }}
|
|
||||||
<textarea name="description" class="form-control">{{ $delivery['description'] ?? '' }}</textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@include('components.address', ['with_country' => false])
|
|
||||||
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-3">
|
|
||||||
{{ Form::label('event_date_begin', __('Date de début')) }}
|
|
||||||
@include('components.form.datepicker', ['name' => 'event_date_begin', 'value' => $delivery['event_date_begin'] ?? null])
|
|
||||||
</div>
|
|
||||||
<div class="col-3">
|
|
||||||
{{ Form::label('event_date_end', __('Date de fin')) }}
|
|
||||||
@include('components.form.datepicker', ['name' => 'event_date_end', 'value' => $delivery['event_date_end'] ?? null])
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@include('components.save')
|
<x-save />
|
||||||
|
|
||||||
@include('load.form.select2')
|
|
||||||
@include('load.form.save')
|
@include('load.form.save')
|
||||||
|
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
initSelect2();
|
initSaveForm('#delivery_package-form');
|
||||||
initDatepicker();
|
});
|
||||||
initSaveForm('#delivery-form');
|
</script>
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
@endpush
|
||||||
@@ -1,26 +1,23 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.deliveries.title'),
|
'title' => __('shop.delivery_packages.title'),
|
||||||
'subtitle' => __('shop.deliveries.list'),
|
'subtitle' => __('shop.delivery_packages.list'),
|
||||||
'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', [
|
||||||
@endcomponent
|
'route' => route('Admin.Shop.DeliveryPackages.index'),
|
||||||
|
'model' => 'delivery_packages',
|
||||||
|
])
|
||||||
|
</x-card>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@include('load.form.select2')
|
@include('load.form.select2')
|
||||||
@include('load.form.toggle')
|
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
<script>
|
<script>
|
||||||
function handleDelivery() {
|
$(document).ready(function () {
|
||||||
initToggle("{{ route('Admin.Shop.Deliveries.toggleActive') }}");
|
initSelect2();
|
||||||
}
|
});
|
||||||
|
</script>
|
||||||
$(document).ready(function () {
|
@endpush
|
||||||
initSelect2();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -1,11 +1,14 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.deliveries.title'),
|
'title' => __('shop.delivery_type_calculations.title'),
|
||||||
'subtitle' => __('shop.deliveries.add'),
|
'subtitle' => __('shop.delivery_type_calculations.add'),
|
||||||
'breadcrumb' => [__('shop.deliveries.title'), __('shop.deliveries.add')]
|
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
{{ Form::open(['route' => 'Admin.Shop.Deliveries.store', 'id' => 'delivery-form', 'autocomplete' => 'off']) }}
|
{{ Form::open([
|
||||||
@include('Admin.Shop.Deliveries.form')
|
'route' => 'Admin.Shop.DeliveryTypeCalculations.store',
|
||||||
</form>
|
'id' => 'delivery_type_calculation-form',
|
||||||
|
'autocomplete' => 'off'
|
||||||
|
]) }}
|
||||||
|
@include('Admin.Shop.DeliveryTypeCalculations.form')
|
||||||
|
</form>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.deliveries.title'),
|
'title' => __('shop.delivery_type_calculations.title'),
|
||||||
'subtitle' => __('shop.deliveries.edit'),
|
'subtitle' => __('shop.delivery_type_calculations.edit'),
|
||||||
'breadcrumb' => [__('shop.deliveries.title')]
|
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
{{ Form::open(['route' => 'Admin.Shop.Deliveries.store', 'id' => 'delivery-form', 'autocomplete' => 'off']) }}
|
{{ Form::open([
|
||||||
<input type="hidden" name="id" value="{{ $delivery['id'] }}">
|
'route' => 'Admin.Shop.DeliveryTypeCalculations.store',
|
||||||
@include('Admin.Shop.Deliveries.form')
|
'id' => 'delivery_type_calculation-form',
|
||||||
</form>
|
'autocomplete' => 'off'
|
||||||
|
]) }}
|
||||||
|
<input type="hidden" name="id" value="{{ $calcul['id'] ?? null }}">
|
||||||
|
@include('Admin.Shop.DeliveryTypeCalculations.form')
|
||||||
|
</form>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -1,69 +1,34 @@
|
|||||||
<div class="row">
|
<div class="row mb-3">
|
||||||
<div class="col-xs-12 col-xl-8">
|
<div class="col-12">
|
||||||
<div class="row mb-3">
|
@include('components.form.select', [
|
||||||
<div class="col-6">
|
'name' => 'type_id',
|
||||||
{{ Form::label('sale_channel_id', __('shop.sale_channels.name')) }}
|
'value' => $calcul['type_id'] ?? false,
|
||||||
@include('components.form.select', ['name' => 'sale_channel_id', 'list' => $sale_channels ?? [], 'value' => $delivery['sale_channel_id'] ?? null, 'with_empty' => '', 'class' => 'select2'])
|
'list' => $delivery_types ?? [],
|
||||||
</div>
|
'label' => __('shop.delivery_types.name'),
|
||||||
<div class="col-6">
|
])
|
||||||
<div class="row">
|
</div>
|
||||||
<div class="col-5">
|
|
||||||
{{ Form::label('active', __('Actif')) }}<br/>
|
|
||||||
@include("components.form.toggle", ['name' => 'active', 'value' => $delivery['active'] ?? false, 'on' => __('active'), 'off' => __('inactive')])
|
|
||||||
</div>
|
|
||||||
<div class="col-3">
|
|
||||||
{{ Form::label('is_public', __('Type')) }}
|
|
||||||
@include('components.form.toggle', ['name' => 'is_public', 'value' => $delivery['is_public'] ?? false, 'on' => __('public'), 'off' => __('administré')])
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
{{ Form::label('at_house', __('Défaut')) }}
|
|
||||||
@include('components.form.checkboxes.icheck', ['name' => 'at_house', 'value' => $delivery['at_house'] ?? null])
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-12">
|
|
||||||
{{ Form::label('name', __('Nom')) }}
|
|
||||||
@include('components.form.input', ['name' => 'name', 'value' => $delivery['name'] ?? null, 'required' => true])
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-12">
|
|
||||||
{{ Form::label('', __('Description')) }}
|
|
||||||
<textarea name="description" class="form-control">{{ $delivery['description'] ?? '' }}</textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@include('components.address', ['with_country' => false])
|
|
||||||
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-3">
|
|
||||||
{{ Form::label('event_date_begin', __('Date de début')) }}
|
|
||||||
@include('components.form.datepicker', ['name' => 'event_date_begin', 'value' => $delivery['event_date_begin'] ?? null])
|
|
||||||
</div>
|
|
||||||
<div class="col-3">
|
|
||||||
{{ Form::label('event_date_end', __('Date de fin')) }}
|
|
||||||
@include('components.form.datepicker', ['name' => 'event_date_end', 'value' => $delivery['event_date_end'] ?? null])
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@include('components.save')
|
<div class="row mb-3">
|
||||||
|
<div class="col-6">
|
||||||
|
<x-form.inputs.number name="weight" value="{{ $calcul['weight'] ?? 0}}" label="Poids" />
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<x-form.inputs.money name="price" value="{{ $calcul['price'] ?? 0}}" label="Prix" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<x-save />
|
||||||
|
|
||||||
@include('load.form.select2')
|
@include('load.form.select2')
|
||||||
@include('load.form.save')
|
@include('load.form.save')
|
||||||
|
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
initSelect2();
|
initSelect2();
|
||||||
initDatepicker();
|
initSaveForm('#delivery_type_calculation-form');
|
||||||
initSaveForm('#delivery-form');
|
});
|
||||||
});
|
</script>
|
||||||
</script>
|
@endpush
|
||||||
@endpush
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
@include('components.datatable', [
|
@include('components.datatable', [
|
||||||
'route' => route('Admin.Shop.DeliveryTypeCalculations.index'),
|
'route' => route('Admin.Shop.DeliveryTypeCalculations.index'),
|
||||||
'model' => 'delivery_type_calculations',
|
'model' => 'delivery_type_calculations',
|
||||||
|
'with_filters' => true,
|
||||||
])
|
])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
<form id="{{ $model }}-filters">
|
<form id="{{ $model }}-filters">
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
|
@include('components.form.select', [
|
||||||
</div>
|
'name' => 'type_id',
|
||||||
|
'value' => $filters['type_id'] ?? false,
|
||||||
|
'list' => $delivery_types ?? [],
|
||||||
|
'label' => __('shop.delivery_types.name'),
|
||||||
|
])
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -1,115 +1,122 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('shop.orders.title'),
|
'title' => __('shop.orders.title'),
|
||||||
'subtitle' => __('shop.orders.edit'),
|
'subtitle' => __('shop.orders.edit'),
|
||||||
'breadcrumb' => ['Commandes']
|
'breadcrumb' => ['Commandes']
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
{{ Form::open(['route' => 'Admin.Shop.Orders.store', 'id' => 'order-form', 'autocomplete' => 'off']) }}
|
{{ Form::open(['route' => 'Admin.Shop.Orders.store', 'id' => 'order-form', 'autocomplete' => 'off']) }}
|
||||||
<input type="hidden" name="id" value="{{ $order['id'] ?? null }}">
|
<input type="hidden" name="id" value="{{ $order['id'] ?? null }}">
|
||||||
<x-card>
|
<x-card>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<h4>{{ $order['delivery']['name'] }} </h4>
|
<h4>{{ $order['delivery']['name'] }} </h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 text-right">
|
<div class="col-6 text-right">
|
||||||
@include('components.form.buttons.button-save')
|
@include('components.form.buttons.button-save')
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<h3>{{ $order['customer']['last_name'] }} {{ $order['customer']['first_name'] }}</h3>
|
<h3>
|
||||||
<div class="row">
|
{{ $order['customer']['last_name'] }} {{ $order['customer']['first_name'] }}
|
||||||
<div class="col-6">
|
</h3>
|
||||||
<x-card title="Adresse de facturation" classBody="mt-3">
|
<div class="row">
|
||||||
@if ($order['address'])
|
<div class="col-6">
|
||||||
{{ $order['address']['address'] }}<br/>
|
<x-card title="Adresse de facturation" classBody="mt-3">
|
||||||
@isset ($order['address']['address2']) {{ $order['address']['address2'] }}<br/> @endisset
|
@if ($order['address'])
|
||||||
{{ $order['address']['zipcode'] }} {{ $order['address']['city'] }}<br/>
|
{{ $order['address']['address'] }}<br/>
|
||||||
@endif
|
@isset ($order['address']['address2'])
|
||||||
</x-card>
|
{{ $order['address']['address2'] }}<br/>
|
||||||
</div>
|
@endisset
|
||||||
<div class="col-6">
|
{{ $order['address']['zipcode'] }} {{ $order['address']['city'] }}<br/>
|
||||||
<x-card title="Adresse de livraison" classBody="mt-3">
|
@endif
|
||||||
@if ($order['delivery_address'])
|
</x-card>
|
||||||
{{ $order['delivery_address']['address'] }}<br/>
|
</div>
|
||||||
@isset ($order['delivery_address']['address2']) {{ $order['delivery_address']['address2'] }}<br/> @endisset
|
<div class="col-6">
|
||||||
{{ $order['delivery_address']['zipcode'] }} {{ $order['delivery_address']['city'] }}<br/>
|
<x-card title="Adresse de livraison" classBody="mt-3">
|
||||||
@endif
|
@if ($order['delivery_address'])
|
||||||
</x-card>
|
{{ $order['delivery_address']['address'] }}<br/>
|
||||||
</div>
|
@isset ($order['delivery_address']['address2'])
|
||||||
</div>
|
{{ $order['delivery_address']['address2'] }}<br/>
|
||||||
</div>
|
@endisset
|
||||||
<div class="col-6">
|
{{ $order['delivery_address']['zipcode'] }}
|
||||||
<div class="row mb-3">
|
{{ $order['delivery_address']['city'] }}<br/>
|
||||||
<div class="col-6" style="font-size: 1.2em; font-weight: 500;">
|
@endif
|
||||||
Commande <br/>
|
</x-card>
|
||||||
du {{ Carbon\Carbon::parse($order['created_at'])->isoFormat('LLLL') }}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
</div>
|
||||||
@include('components.form.select', [
|
<div class="col-6">
|
||||||
'label' => 'Statut',
|
<div class="row mb-3">
|
||||||
'name' => 'status',
|
<div class="col-6" style="font-size: 1.2em; font-weight: 500;">
|
||||||
'list' => $statuses ?? [],
|
Commande <br/>
|
||||||
'value' => $order['status'],
|
du {{ Carbon\Carbon::parse($order['created_at'])->isoFormat('LLLL') }}
|
||||||
'class' => 'select2',
|
</div>
|
||||||
])
|
<div class="col-6">
|
||||||
</div>
|
@include('components.form.select', [
|
||||||
</div>
|
'label' => 'Statut',
|
||||||
<div class="row mb-3">
|
'name' => 'status',
|
||||||
<div class="col-6">
|
'list' => $statuses ?? [],
|
||||||
@include('components.form.select', [
|
'value' => $order['status'],
|
||||||
'label' => 'Canal de vente',
|
'class' => 'select2',
|
||||||
'name' => 'sale_channel_id',
|
])
|
||||||
'list' => $sale_channels ?? [],
|
</div>
|
||||||
'value' => $order['sale_channel_id'],
|
</div>
|
||||||
'class' => 'select2',
|
<div class="row mb-3">
|
||||||
])
|
<div class="col-6">
|
||||||
</div>
|
@include('components.form.select', [
|
||||||
<div class="col-6">
|
'label' => 'Canal de vente',
|
||||||
@include('components.form.select', [
|
'name' => 'sale_channel_id',
|
||||||
'label' => 'Règlement',
|
'list' => $sale_channels ?? [],
|
||||||
'name' => 'payment_type',
|
'value' => $order['sale_channel_id'],
|
||||||
'list' => $payment_types ?? [],
|
'class' => 'select2',
|
||||||
'value' => $order['payment_type'],
|
])
|
||||||
'class' => 'select2',
|
</div>
|
||||||
])
|
<div class="col-6">
|
||||||
</div>
|
@include('components.form.select', [
|
||||||
</div>
|
'label' => 'Règlement',
|
||||||
<div class="row mb-3">
|
'name' => 'payment_type',
|
||||||
<div class="col-4">
|
'list' => $payment_types ?? [],
|
||||||
@include('components.form.select', [
|
'value' => $order['payment_type'],
|
||||||
'label' => 'Type de livraison',
|
'class' => 'select2',
|
||||||
'name' => 'delivery_type_id',
|
])
|
||||||
'list' => $delivery_types ?? [],
|
</div>
|
||||||
'value' => $order['delivery_type_id'],
|
</div>
|
||||||
'with_empty' => '',
|
<div class="row mb-3">
|
||||||
])
|
<div class="col-4">
|
||||||
</div>
|
@include('components.form.select', [
|
||||||
<div class="col-4">
|
'label' => 'Type de livraison',
|
||||||
@include('components.form.input', [
|
'name' => 'delivery_type_id',
|
||||||
'label' => 'Référence colis',
|
'list' => $delivery_types ?? [],
|
||||||
'name' => 'delivery_ref',
|
'value' => $order['delivery_type_id'],
|
||||||
'value' => $order['delivery_ref'] ?? null,
|
'with_empty' => '',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'label' => 'Lien suivi',
|
'label' => 'Référence colis',
|
||||||
'name' => 'delivery_link',
|
'name' => 'delivery_ref',
|
||||||
'value' => $order['delivery_link'] ?? null,
|
'value' => $order['delivery_ref'] ?? null,
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
@include('components.form.input', [
|
||||||
|
'label' => 'Lien suivi',
|
||||||
|
'name' => 'delivery_link',
|
||||||
|
'value' => $order['delivery_link'] ?? null,
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
@include('Admin.Shop.Orders.partials.detail', ['detail_type' => 'commande'])
|
@include('Admin.Shop.Orders.partials.detail', ['detail_type' => 'commande'])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</x-card>
|
</x-card>
|
||||||
{{ Form::close() }}
|
{{ Form::close() }}
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -1,53 +1,53 @@
|
|||||||
@extends('Shop.layout.layout', [
|
@extends('Shop.layout.layout', [
|
||||||
'title' => __('home.title'),
|
'title' => __('home.title'),
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<h1>{{ $article['name'] }}</h1>
|
<h1>{{ $article['name'] }}</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-4 col-xs-12">
|
<div class="col-lg-4 col-xs-12">
|
||||||
<div style="max-width: 360px;">
|
<div style="max-width: 360px;">
|
||||||
@include('components.multi-images', ['image' => $article['image'], 'images' => $article['images']])
|
@include('components.multi-images', ['image' => $article['image'], 'images' => $article['images']])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-5 col-xs-12 text-justify">
|
<div class="col-lg-5 col-xs-12 text-justify">
|
||||||
{!! $article['description']['semences'] ?? null !!}
|
{!! $article['description']['semences'] ?? null !!}
|
||||||
{!! $article['description']['plants'] ?? null !!}
|
{!! $article['description']['plants'] ?? null !!}
|
||||||
{!! $article['description']['variety'] ?? null !!}
|
{!! $article['description']['variety'] ?? null !!}
|
||||||
{!! $article['description']['merchandise'] ?? null !!}
|
{!! $article['description']['merchandise'] ?? null !!}
|
||||||
|
|
||||||
@if ($article['description']['plus'] ?? false)
|
@if ($article['description']['plus'] ?? false)
|
||||||
<h3>Spécificités</h3>
|
<h3>Spécificités</h3>
|
||||||
{!! $article['description']['plus'] !!}
|
{!! $article['description']['plus'] !!}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if (count($article['tags'] ?? []))
|
@if (count($article['tags'] ?? []))
|
||||||
<h3>Caractéristiques</h3>
|
<h3>Caractéristiques</h3>
|
||||||
@foreach ($article['tags'] as $tag_group => $items)
|
@foreach ($article['tags'] as $tag_group => $items)
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
{{ $tag_group }} :
|
{{ $tag_group }} :
|
||||||
@foreach ($items as $tag)
|
@foreach ($items as $tag)
|
||||||
<span class="btn btn-xs btn-secondary pt-0 pb-0">{{ $tag }}</span>
|
<span class="btn btn-xs btn-secondary pt-0 pb-0">{{ $tag }}</span>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if ($article['description']['specie'] ?? false)
|
@if ($article['description']['specie'] ?? false)
|
||||||
<h3 class="mt-3">Complément</h3>
|
<h3 class="mt-3">Complément</h3>
|
||||||
{!! $article['description']['specie'] ?? null !!}
|
{!! $article['description']['specie'] ?? null !!}
|
||||||
{!! $article['description']['producer'] ?? null !!}
|
{!! $article['description']['producer'] ?? null !!}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3 col-xs-12">
|
<div class="col-lg-3 col-xs-12">
|
||||||
@include('Shop.Articles.partials.ArticleAddBasket')
|
@include('Shop.Articles.partials.ArticleAddBasket')
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@include('load.layout.modal')
|
@include('load.layout.modal')
|
||||||
|
|||||||
@@ -7,5 +7,4 @@ Route::prefix('DeliveryTypes')->name('DeliveryTypes.')->group(function () {
|
|||||||
Route::post('update', 'DeliveryTypeController@update')->name('update');
|
Route::post('update', 'DeliveryTypeController@update')->name('update');
|
||||||
Route::post('store', 'DeliveryTypeController@store')->name('store');
|
Route::post('store', 'DeliveryTypeController@store')->name('store');
|
||||||
Route::get('edit/{id}', 'DeliveryTypeController@edit')->name('edit');
|
Route::get('edit/{id}', 'DeliveryTypeController@edit')->name('edit');
|
||||||
Route::post('toggleActive', 'DeliveryTypeController@toggleActive')->name('toggleActive');
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user