Merge branch 'develop' into trunk
This commit is contained in:
commit
fd320e0e1a
59 changed files with 2300 additions and 860 deletions
10
.env.example
10
.env.example
|
|
@ -22,16 +22,16 @@ SESSION_DRIVER=file
|
|||
SESSION_LIFETIME=120
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PASSWORD=
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=smtp
|
||||
MAIL_HOST=smtp.mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS=null
|
||||
MAIL_USERNAME=
|
||||
MAIL_PASSWORD=
|
||||
MAIL_ENCRYPTION=
|
||||
MAIL_FROM_ADDRESS=
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
MAIL_ADMIN=equipe.web@ldc.fr
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ use App\Models\User;
|
|||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class CreateAdmin extends Command
|
||||
class UserCreate extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'create:admin';
|
||||
protected $signature = 'user:create';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
|
|
@ -33,15 +33,15 @@ class CreateAdmin extends Command
|
|||
$lastname = $this->ask('What is the lastname?', 'Web');
|
||||
$email = $this->ask('What is the email?', 'equipe.web@ldc.fr');
|
||||
$pwd = $this->secret('What is the password?');
|
||||
$role = $this->ask('What is the role? (1 = SuperAdmin, 2 = Admin)', 2);
|
||||
|
||||
$user = new User();
|
||||
$user->firstname = $firstname;
|
||||
$user->lastname = $lastname;
|
||||
$user->date_of_birth = now();
|
||||
$user->email = $email;
|
||||
$user->password = Hash::make($pwd);
|
||||
$user->email_verified_at = now();
|
||||
$user->role = 1;
|
||||
$user->role = $role;
|
||||
$user->save();
|
||||
|
||||
$this->info('User created.');
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Console;
|
||||
|
||||
use App\Jobs\SendReminderMail;
|
||||
use App\Jobs\XmlIncoReader as JobsXmlIncoReader;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
|
@ -26,6 +27,7 @@ class Kernel extends ConsoleKernel
|
|||
{
|
||||
$schedule->command('ldcweb:statuschecker')->everyFifteenMinutes();
|
||||
$schedule->job(JobsXmlIncoReader::class)->name('xml-inco-reader')->onOneServer()->dailyAt('15:00');
|
||||
$schedule->job(SendReminderMail::class)->onOneServer()->dailyAt('7:00');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
83
app/Exports/SalariesExport.php
Normal file
83
app/Exports/SalariesExport.php
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use App\Models\Salarie;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithCustomCsvSettings;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
|
||||
class SalariesExport implements FromCollection, WithHeadings, WithMapping, WithCustomCsvSettings
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $salariesImport = null;
|
||||
|
||||
/**
|
||||
* Create a new instance.
|
||||
*
|
||||
* @param array $salariesImport
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(array $salariesImport)
|
||||
{
|
||||
$this->salariesImport = $salariesImport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the header of the .csv.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Matricule',
|
||||
'Code',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set data to specific column.
|
||||
*
|
||||
* @param \App\Models\Salarie $salaries
|
||||
* @return array
|
||||
* @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing
|
||||
*/
|
||||
public function map($salaries): array
|
||||
{
|
||||
//phpcs:enable
|
||||
return [
|
||||
$salaries->matricule,
|
||||
$salaries->code,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Surchage defaults config of Laravel.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getCsvSettings(): array
|
||||
{
|
||||
return [
|
||||
'delimiter' => ';'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
$salaries = Salarie::query();
|
||||
foreach ($this->salariesImport as $salarieImport) {
|
||||
$salaries->orWhere('matricule', $salarieImport);
|
||||
}
|
||||
|
||||
return $salaries->get();
|
||||
}
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@ use App\Models\Range;
|
|||
use App\Models\Tag;
|
||||
use App\Models\TaxRate;
|
||||
use App\Models\XmlInco;
|
||||
use App\Traits\Controllers\ChangesModelOrder;
|
||||
use App\Traits\Controllers\UpdateModelStatus;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
|
|
@ -22,6 +23,7 @@ use Illuminate\Support\Facades\File;
|
|||
class ProductsController extends Controller
|
||||
{
|
||||
use UpdateModelStatus;
|
||||
use ChangesModelOrder;
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
|
|
@ -48,7 +50,7 @@ class ProductsController extends Controller
|
|||
if (!empty($filter_brand)) {
|
||||
$products = $products->where('brand', $filter_brand);
|
||||
}
|
||||
$products = $products->paginate(10);
|
||||
$products = $products->orderBy('order', 'ASC')->paginate(10);
|
||||
|
||||
// Ici récupération des infos additionnelles pour affichage dans la liste.
|
||||
foreach ($products as &$product) {
|
||||
|
|
|
|||
53
app/Http/Controllers/Bo/SalariesController.php
Normal file
53
app/Http/Controllers/Bo/SalariesController.php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Bo\ImportRequest;
|
||||
use App\Imports\SalariesImport;
|
||||
use App\Jobs\SalariesExportJob;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class SalariesController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
* @ignore phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
||||
*/
|
||||
public function index(): \Illuminate\Contracts\View\View
|
||||
{
|
||||
return view('bo.salaries.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Mass import by CSV.
|
||||
* matricule;lastname;firstname;email
|
||||
* default role = user
|
||||
*
|
||||
* @param \App\Http\Requests\Bo\ImportRequest $request
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function import(ImportRequest $request)
|
||||
{
|
||||
$salariesImport = new SalariesImport();
|
||||
Excel::import($salariesImport, $request->import, null, \Maatwebsite\Excel\Excel::CSV);
|
||||
$this->export($salariesImport->salariesImport);
|
||||
|
||||
return redirect()->route('bo.salaries.index')->with('success', 'Import terminé.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exporter l'ensemble des salariés dans un fichier .csv,
|
||||
* au format matricule | code.
|
||||
*
|
||||
* @param array $salariesImport
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Contracts\Routing\ResponseFactory
|
||||
*/
|
||||
public function export(array $salariesImport)
|
||||
{
|
||||
$this->dispatch(new SalariesExportJob($salariesImport));
|
||||
return redirect()->route('bo.salaries.index')->with('success', 'Export terminé.');
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ class ContactController extends Controller
|
|||
$status = $request->session()->get('status');
|
||||
|
||||
// 1er magasin en base pour le moment
|
||||
$magasin = Magasin::first();
|
||||
$magasin = Magasin::firstOrFail();
|
||||
$content = Content::where('key', 'contact')->first();
|
||||
|
||||
return view('contact', compact('status', 'magasin', 'content'));
|
||||
|
|
|
|||
|
|
@ -109,8 +109,6 @@ class OrderTunnelController extends Controller
|
|||
$order_line->save();
|
||||
} //end foreach
|
||||
|
||||
// Empty cart.
|
||||
Cart::destroy();
|
||||
// Then redirect.
|
||||
return redirect()->route('sales.pick-slot', ['reference' => $order->reference]);
|
||||
}
|
||||
|
|
@ -447,6 +445,9 @@ class OrderTunnelController extends Controller
|
|||
// 1 seul magasin en base pour le moment
|
||||
$magasin = Magasin::find($order->timeslot->magasin->id);
|
||||
|
||||
// Empty cart.
|
||||
Cart::instance('panier')->destroy();
|
||||
|
||||
return view('sales.confirm', compact('activestep', 'order', 'magasin'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class ProductsController extends Controller
|
|||
$productsQuery = $this->buildFilterQuery($sessionFilter);
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Collection<\App\Models\Product> */
|
||||
$products = $productsQuery->paginate(6);
|
||||
$products = $productsQuery->orderBy('order', 'ASC')->paginate(6);
|
||||
|
||||
if ($request->ajax()) {
|
||||
return \response()->json([ProductResource::collection($products), $products->total()]);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace App\Http;
|
||||
|
||||
use App\Http\Middleware\IsAdmin;
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
|
|
@ -62,6 +61,7 @@ class Kernel extends HttpKernel
|
|||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
'is-admin' => IsAdmin::class,
|
||||
'is-admin' => \App\Http\Middleware\IsAdmin::class,
|
||||
'is-super-admin' => \App\Http\Middleware\IsSuperAdmin::class,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
26
app/Http/Middleware/IsSuperAdmin.php
Normal file
26
app/Http/Middleware/IsSuperAdmin.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class IsSuperAdmin
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$role = Auth::user()->role;
|
||||
if ($role === 1) {
|
||||
return $next($request);
|
||||
}
|
||||
abort(404, "Cette page n'existe pas.");
|
||||
}
|
||||
}
|
||||
46
app/Http/Requests/Bo/ImportRequest.php
Normal file
46
app/Http/Requests/Bo/ImportRequest.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Bo;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class ImportRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return (Auth::user()->role === 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'import' => [
|
||||
'required',
|
||||
'file',
|
||||
'mimes:csv,txt',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'mimetypes:text/csv,text/plain,application/csv,text/comma-separated-values,text/anytext,application/octet-stream,application/txt',
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
|
||||
function ($attribute, $value, $fail) {
|
||||
if (
|
||||
$this->import->getClientMimeType() !== 'text/csv'
|
||||
&& $this->import->getClientMimeType() !== 'application/vnd.ms-excel'
|
||||
) {
|
||||
$fail(__('Le fichier doit être d\'un mime type text/csv ou application/vnd.ms-excel'));
|
||||
}
|
||||
}
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,6 @@ namespace App\Http\Requests\Bo;
|
|||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class ProductRequest extends FormRequest
|
||||
{
|
||||
|
|
|
|||
46
app/Http/Requests/Bo/SalariesImportRequest.php
Normal file
46
app/Http/Requests/Bo/SalariesImportRequest.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Bo;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class SalariesImportRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return (Auth::user()->role === 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'import' => [
|
||||
'required',
|
||||
'file',
|
||||
'mimes:csv,txt',
|
||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
'mimetypes:text/csv,text/plain,application/csv,text/comma-separated-values,text/anytext,application/octet-stream,application/txt',
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
|
||||
function ($attribute, $value, $fail) {
|
||||
if (
|
||||
$this->import->getClientMimeType() !== 'text/csv'
|
||||
&& $this->import->getClientMimeType() !== 'application/vnd.ms-excel'
|
||||
) {
|
||||
$fail(__('Le fichier doit être d\'un mime type text/csv ou application/vnd.ms-excel'));
|
||||
}
|
||||
}
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
42
app/Http/Requests/Bo/UpdateChangeOrderRequest.php
Normal file
42
app/Http/Requests/Bo/UpdateChangeOrderRequest.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Bo;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateChangeOrderRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the data for validation.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'direction' => $this->direction === 'up' ? true : false
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'direction' => 'required|boolean',
|
||||
];
|
||||
}
|
||||
}
|
||||
80
app/Imports/SalariesImport.php
Normal file
80
app/Imports/SalariesImport.php
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
|
||||
namespace App\Imports;
|
||||
|
||||
use App\Models\Salarie;
|
||||
use Carbon\Carbon;
|
||||
use Maatwebsite\Excel\Concerns\ToModel;
|
||||
use Maatwebsite\Excel\Concerns\WithCustomCsvSettings;
|
||||
|
||||
class SalariesImport implements ToModel, WithCustomCsvSettings
|
||||
{
|
||||
/**
|
||||
* @var array $salariesImport
|
||||
*/
|
||||
public $salariesImport = [];
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getCsvSettings(): array
|
||||
{
|
||||
return [
|
||||
'delimiter' => ";"
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $line
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Model|null
|
||||
*/
|
||||
public function model(array $line)
|
||||
{
|
||||
if (
|
||||
!isset($line[0]) ||
|
||||
!isset($line[1]) ||
|
||||
!isset($line[2]) ||
|
||||
!isset($line[6]) ||
|
||||
!isset($line[7]) ||
|
||||
!isset($line[7])
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
return $this->processFile($line);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $line
|
||||
*
|
||||
* @return \App\Models\Salarie
|
||||
*/
|
||||
public function processFile(array $line)
|
||||
{
|
||||
/** Check if the first line of the file matches to the data expected or is just a column commentary */
|
||||
if (preg_match('/[0-9]{7}/', $line[0])) {
|
||||
/** @var \App\Models\Salarie */
|
||||
$salarie = Salarie::firstOrNew(['matricule' => $line[0]]);
|
||||
$salarie->customer_id = $salarie->customer_id ?? null;
|
||||
$salarie->nom = ucfirst(strtolower($line[1]));
|
||||
$salarie->prenom = ucfirst(strtolower($line[2]));
|
||||
if (isset($line[3])) {
|
||||
$salarie->start_date = Carbon::createFromFormat('d/m/Y', $line[3])->format('Y-m-d');
|
||||
}
|
||||
if (isset($line[4])) {
|
||||
$salarie->end_date = Carbon::createFromFormat('d/m/Y', $line[4])->format('Y-m-d');
|
||||
} elseif (isset($line[5])) {
|
||||
$salarie->end_date = Carbon::createFromFormat('d/m/Y', $line[5])->format('Y-m-d');
|
||||
}
|
||||
$salarie->etablissement = $line[6];
|
||||
$salarie->site = $line[7];
|
||||
$salarie->service = $line[8];
|
||||
$salarie->code = $salarie->code ?? Salarie::generateRandomString(8, Salarie::query());
|
||||
Salarie::setSalarieMagasin($salarie);
|
||||
$salarie->saveOrFail();
|
||||
$this->salariesImport = array_merge($this->salariesImport, [$line[0]]);
|
||||
|
||||
return $salarie;
|
||||
} //end if
|
||||
}
|
||||
}
|
||||
|
|
@ -3,14 +3,11 @@
|
|||
namespace App\Jobs;
|
||||
|
||||
use App\Enums\LogType;
|
||||
use App\Enums\SalarieSite;
|
||||
use App\Models\Salarie;
|
||||
use ErrorException;
|
||||
use TypeError;
|
||||
use Illuminate\Database\QueryException;
|
||||
use App\Exceptions\AbortCsvImportException;
|
||||
use App\Lib\Utils;
|
||||
use App\Models\Magasin;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class CsvSalariesReader extends CsvJobs
|
||||
|
|
@ -28,15 +25,6 @@ class CsvSalariesReader extends CsvJobs
|
|||
*/
|
||||
protected $disk = 'salaries';
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
|
|
@ -117,15 +105,8 @@ class CsvSalariesReader extends CsvJobs
|
|||
// First line is header (mandatory).
|
||||
$header = array_flip(array_shift($data));
|
||||
foreach ($data as $line) {
|
||||
$matricule = $line[$header['Matricule']];
|
||||
$prenom = $line[$header['Prénom']];
|
||||
$nom = $line[$header['Nom']];
|
||||
$start_date = Carbon::createFromFormat('d/m/Y', $line[$header['Date début']]);
|
||||
$end_date = $line[$header['Date fin']] ?
|
||||
$end_date = $line[$header['Date fin']] ?
|
||||
$line[$header['Date fin']] : $line[$header['Date fin prévue']];
|
||||
$etablissement = $line[$header['Etablissement']];
|
||||
$site = $line[$header['Site']];
|
||||
$service = $line[$header['Service']];
|
||||
|
||||
if ($end_date != '') {
|
||||
$end_date = Carbon::createFromFormat('d/m/Y', $end_date);
|
||||
|
|
@ -133,19 +114,18 @@ class CsvSalariesReader extends CsvJobs
|
|||
$end_date = null;
|
||||
}
|
||||
|
||||
|
||||
$salarie = Salarie::firstOrNew(['matricule' => $matricule]);
|
||||
$salarie->matricule = $matricule;
|
||||
$salarie->nom = $nom;
|
||||
$salarie->prenom = $prenom;
|
||||
$salarie->start_date = $start_date;
|
||||
$salarie = Salarie::firstOrNew(['matricule' => $line[$header['Matricule']]]);
|
||||
$salarie->matricule = $line[$header['Matricule']];
|
||||
$salarie->nom = $line[$header['Nom']];
|
||||
$salarie->prenom = $line[$header['Prénom']];
|
||||
$salarie->start_date = Carbon::createFromFormat('d/m/Y', $line[$header['Date début']]);
|
||||
$salarie->end_date = $end_date;
|
||||
$salarie->etablissement = $etablissement;
|
||||
$salarie->site = $site;
|
||||
$salarie->service = $service;
|
||||
$salarie->etablissement = $line[$header['Etablissement']];
|
||||
$salarie->site = $line[$header['Site']];
|
||||
$salarie->service = $line[$header['Service']];
|
||||
$salarie->code = $salarie->code ?? $this->generateCode();
|
||||
$salarie->save();
|
||||
$this->setMagasin($salarie);
|
||||
Salarie::setSalarieMagasin($salarie);
|
||||
} //end foreach
|
||||
}
|
||||
|
||||
|
|
@ -156,46 +136,6 @@ class CsvSalariesReader extends CsvJobs
|
|||
*/
|
||||
protected function generateCode()
|
||||
{
|
||||
return Utils::generateRandomString(8);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the fixed collection point for a salarie.
|
||||
*
|
||||
* @param \App\Models\Salarie $salarie
|
||||
* @return void
|
||||
*/
|
||||
protected function setMagasin(Salarie $salarie)
|
||||
{
|
||||
if ($salarie->site == SalarieSite::ldccav()) {
|
||||
// CAVOL.
|
||||
$magasin = Magasin::find(3);
|
||||
} elseif ($salarie->site == SalarieSite::dde()) {
|
||||
// Dinde.
|
||||
$magasin = Magasin::find(8);
|
||||
} elseif ($salarie->site == SalarieSite::dpe()) {
|
||||
// DPE.
|
||||
$magasin = Magasin::find(9);
|
||||
} elseif ($salarie->site == SalarieSite::cepacpe()) {
|
||||
if (
|
||||
$salarie->service == "CEPACP060"
|
||||
|| $salarie->service == "CEPACP070"
|
||||
|| $salarie->service == "CEPACP072"
|
||||
) {
|
||||
// CPE.
|
||||
$magasin = Magasin::find(6);
|
||||
} elseif ($salarie->service == "CEPACP065" || $salarie->service == "CEPACP066") {
|
||||
// PLB.
|
||||
$magasin = Magasin::find(10);
|
||||
} else {
|
||||
// CEPA.
|
||||
$magasin = Magasin::find(10);
|
||||
}
|
||||
} else {
|
||||
// Saint Laurent.
|
||||
$magasin = Magasin::find(1);
|
||||
} //end if
|
||||
$salarie->magasin()->associate($magasin);
|
||||
$salarie->save();
|
||||
return Salarie::generateRandomString(8, Salarie::all());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
53
app/Jobs/SalariesExportJob.php
Normal file
53
app/Jobs/SalariesExportJob.php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Exports\SalariesExport;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use App\Mail\SendSalariesCSVMail;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class SalariesExportJob implements ShouldQueue
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var array|null
|
||||
*/
|
||||
public $salariesImport = null;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @param array $salariesImport
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(array $salariesImport)
|
||||
{
|
||||
$this->salariesImport = $salariesImport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the export salaries file in the salarie disk.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
/** @var \App\Models\User */
|
||||
$user = Auth::user();
|
||||
$disk = Storage::disk('salaries');
|
||||
$csv_file = Carbon::now()->format('d_m_Y-H_i_s') . '-' . $user->id . '-export_salaries.csv';
|
||||
|
||||
Excel::store(new SalariesExport($this->salariesImport), $csv_file, 'salaries');
|
||||
|
||||
Mail::to($user->email)->send(new SendSalariesCSVMail($user, $csv_file));
|
||||
|
||||
if ($disk->exists($csv_file)) {
|
||||
$disk->delete($csv_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
37
app/Jobs/SendReminderMail.php
Normal file
37
app/Jobs/SendReminderMail.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Mail\OrderTodayReminderMail;
|
||||
use App\Models\Order;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class SendReminderMail implements ShouldQueue
|
||||
{
|
||||
use Dispatchable;
|
||||
use InteractsWithQueue;
|
||||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$orders = Order::whereHas('timeslot', function (Builder $query) {
|
||||
$query->where('day', now()->format('d/m/Y'));
|
||||
})->get();
|
||||
|
||||
foreach ($orders as $order) {
|
||||
Mail::to($order->customer->email)->queue(new OrderTodayReminderMail($order));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,25 +8,6 @@ use Throwable;
|
|||
|
||||
class Utils
|
||||
{
|
||||
/**
|
||||
* Simple Custom Random string generator
|
||||
*
|
||||
* @param integer $length
|
||||
* @param string $characters
|
||||
* @return string
|
||||
*/
|
||||
public static function generateRandomString(
|
||||
int $length = 10,
|
||||
string $characters = 'abcdefghjkmnpqrstuwxyzABCDEFGHJKMNPQRSTUWXYZ123456789'
|
||||
) {
|
||||
$charactersLength = strlen($characters);
|
||||
$randomString = '';
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$randomString .= $characters[rand(0, $charactersLength - 1)];
|
||||
}
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Manually send an exception to team instead of going trough the error handler
|
||||
* (requires package kwaadpepper/exception-handler)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use App\Models\Order;
|
|||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class OrderConfirmAdminMail extends Mailable
|
||||
{
|
||||
|
|
@ -43,7 +44,12 @@ class OrderConfirmAdminMail extends Mailable
|
|||
$magasin = Magasin::find($order->timeslot->magasin->id);
|
||||
|
||||
return $this->subject(
|
||||
"Nouvelle Commande - " . config('theme.site_name')
|
||||
\sprintf(
|
||||
'Nouvelle commande de %s %s - %s',
|
||||
$order->customer->salarie->prenom,
|
||||
Str::upper($order->customer->salarie->nom),
|
||||
config('theme.site_name')
|
||||
)
|
||||
)->view('emails.order-confirm-admin', compact('order', 'magasin'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
48
app/Mail/OrderTodayReminderMail.php
Normal file
48
app/Mail/OrderTodayReminderMail.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\Magasin;
|
||||
use App\Models\Order;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class OrderTodayReminderMail extends Mailable
|
||||
{
|
||||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* The Order
|
||||
*
|
||||
* @var \Illuminate\Database\Eloquent\Collection
|
||||
*/
|
||||
private $order;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param \App\Models\Order $order
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Order $order)
|
||||
{
|
||||
$this->order = $order;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$order = $this->order;
|
||||
$magasin = Magasin::find($order->timeslot->magasin->id);
|
||||
|
||||
return $this->subject(
|
||||
"Votre commande est prête - " . config('theme.site_name')
|
||||
)->view('emails.order-reminder', compact('order', 'magasin'));
|
||||
}
|
||||
}
|
||||
53
app/Mail/SendSalariesCSVMail.php
Normal file
53
app/Mail/SendSalariesCSVMail.php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class SendSalariesCSVMail extends Mailable
|
||||
{
|
||||
use Queueable;
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* The model.
|
||||
*
|
||||
* @var \App\Models\Salarie
|
||||
*/
|
||||
protected $model;
|
||||
|
||||
/**
|
||||
* The file.
|
||||
*
|
||||
* @var \App\Models\Salarie
|
||||
*/
|
||||
protected $file;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param \App\Models\User $model
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(User $model, string $file)
|
||||
{
|
||||
$this->model = $model;
|
||||
$this->file = $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
return $this->subject("Export salariés - " . config('theme.site_name', 'Boutique'))
|
||||
->attach(storage_path('salaries') . "/" . $this->file)
|
||||
->markdown('mails.send-csv', ['model' => $this->model]);
|
||||
}
|
||||
}
|
||||
|
|
@ -215,7 +215,7 @@ class Product extends Model implements Buyable
|
|||
$this->priceHt = $this->attributes['price'];
|
||||
return $this->priceHt;
|
||||
}
|
||||
}//end if
|
||||
} //end if
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -261,18 +261,9 @@ class Product extends Model implements Buyable
|
|||
}
|
||||
}
|
||||
$showPrice = $this->priceKgTtc;
|
||||
}//end if
|
||||
} //end if
|
||||
|
||||
// Prix transmis en fonction du setting show_prices.
|
||||
if (config('bosettings.show_prices_authenticated') == "authenticated") {
|
||||
if (Auth::guard('customer')->check()) {
|
||||
return $showPrice;
|
||||
}
|
||||
}
|
||||
if (config('bosettings.show_prices_guest') == "guest") {
|
||||
return $showPrice;
|
||||
}
|
||||
return "-.--";
|
||||
return $showPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -324,7 +315,7 @@ class Product extends Model implements Buyable
|
|||
if (isset($this->priceTtc)) {
|
||||
return $this->priceTtc;
|
||||
} else {
|
||||
$priceTtc = $this->priceHt * ( 1 + ( $this->tax->rate / 100));
|
||||
$priceTtc = $this->priceHt * (1 + ($this->tax->rate / 100));
|
||||
/**
|
||||
* On travaille avec des centimes puis on redivise par 100 pour avoir des unités monetaires
|
||||
* on augmente la précision à 3 digits, l'affichage formate les prix sur 2 décimales
|
||||
|
|
@ -356,7 +347,7 @@ class Product extends Model implements Buyable
|
|||
if (isset($this->discountedPriceTtc)) {
|
||||
$showPrice = $this->discountedPriceTtc;
|
||||
} else {
|
||||
$discountedPriceTtc = $this->discountedPriceHt * ( 1 + ( $this->tax->rate / 100));
|
||||
$discountedPriceTtc = $this->discountedPriceHt * (1 + ($this->tax->rate / 100));
|
||||
// On travaille avec des centimes puis on redivise par 100 pour avoir des unités monetaires.
|
||||
$roundingDiscountedPriceTTC = round($discountedPriceTtc * 1000) / 1000;
|
||||
$this->discountedPriceTtc = $roundingDiscountedPriceTTC;
|
||||
|
|
@ -509,7 +500,7 @@ class Product extends Model implements Buyable
|
|||
public function orders()
|
||||
{
|
||||
return $this->belongsToMany('App\Models\Order', 'orders_products', 'product_id', 'order_id')
|
||||
->withPivot('quantity');
|
||||
->withPivot('quantity');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -584,8 +575,8 @@ class Product extends Model implements Buyable
|
|||
{
|
||||
$now = Carbon::now();
|
||||
return $this->belongsToMany(Promotion::class)
|
||||
->whereDate('date_start', '<=', $now)
|
||||
->whereDate('date_end', '>=', $now);
|
||||
->whereDate('date_start', '<=', $now)
|
||||
->whereDate('date_end', '>=', $now);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\SalarieSite;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models\Customers;
|
||||
|
|
@ -22,6 +23,83 @@ class Salarie extends Model
|
|||
'start_date', 'end_date', 'etablissement', 'site', 'service'
|
||||
];
|
||||
|
||||
/**
|
||||
* Setter magasin for a salarie.
|
||||
*
|
||||
* @param \App\Models\Salarie $salarie
|
||||
* @return void
|
||||
*/
|
||||
public static function setSalarieMagasin(Salarie $salarie)
|
||||
{
|
||||
Salarie::setMagasin($salarie);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the fixed collection point for a salarie.
|
||||
*
|
||||
* @param \App\Models\Salarie $salarie
|
||||
* @return void
|
||||
*/
|
||||
private function setMagasin(Salarie $salarie)
|
||||
{
|
||||
if ($salarie->site == SalarieSite::ldccav()) {
|
||||
// CAVOL.
|
||||
$magasin = Magasin::find(3);
|
||||
} elseif ($salarie->site == SalarieSite::dde()) {
|
||||
// Dinde.
|
||||
$magasin = Magasin::find(8);
|
||||
} elseif ($salarie->site == SalarieSite::dpe()) {
|
||||
// DPE.
|
||||
$magasin = Magasin::find(9);
|
||||
} elseif ($salarie->site == SalarieSite::cepacpe()) {
|
||||
if (
|
||||
$salarie->service == "CEPACP060"
|
||||
|| $salarie->service == "CEPACP070"
|
||||
|| $salarie->service == "CEPACP072"
|
||||
) {
|
||||
// CPE.
|
||||
$magasin = Magasin::find(6);
|
||||
} elseif ($salarie->service == "CEPACP065" || $salarie->service == "CEPACP066") {
|
||||
// PLB.
|
||||
$magasin = Magasin::find(10);
|
||||
} else {
|
||||
// CEPA.
|
||||
$magasin = Magasin::find(10);
|
||||
}
|
||||
} else {
|
||||
// Saint Laurent.
|
||||
$magasin = Magasin::find(1);
|
||||
} //end if
|
||||
$salarie->magasin()->associate($magasin);
|
||||
$salarie->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple Custom Random string generator
|
||||
*
|
||||
* @param integer $length
|
||||
* @param object|null $model
|
||||
* @param string $characters
|
||||
* @return string
|
||||
*/
|
||||
public static function generateRandomString(
|
||||
int $length = 10,
|
||||
object $model = null,
|
||||
string $characters = 'abcdefghjkmnpqrstuwxyzABCDEFGHJKMNPQRSTUWXYZ123456789'
|
||||
) {
|
||||
$charactersLength = strlen($characters);
|
||||
$randomString = '';
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$randomString .= $characters[rand(0, $charactersLength - 1)];
|
||||
}
|
||||
if (isset($model) && $model->where('code', $randomString)->exists()) {
|
||||
self::generateRandomString();
|
||||
}
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
// * RELATIONSHIPS
|
||||
|
||||
/**
|
||||
* BelongsTo customer relation
|
||||
*
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ use Illuminate\Support\Facades\View;
|
|||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
|
|
@ -70,7 +71,7 @@ class AppServiceProvider extends ServiceProvider
|
|||
View::share('published_tags', $tags);
|
||||
}
|
||||
|
||||
Blade::directive('fmt_currency', function ($expression) {
|
||||
Blade::directive('fmt_currency_without_auth', function ($expression) {
|
||||
return "<?php
|
||||
if(is_float($expression)) {
|
||||
echo sprintf('%s €', number_format($expression, 2, ',', ' '));
|
||||
|
|
@ -79,13 +80,36 @@ class AppServiceProvider extends ServiceProvider
|
|||
} ?>";
|
||||
});
|
||||
|
||||
Blade::directive('fmt_currency', function ($expression) {
|
||||
// Prix transmis en fonction du setting show_prices.
|
||||
if (
|
||||
(config('bosettings.show_prices_authenticated') === "authenticated" && Auth::guard('customer')->check())
|
||||
|| config('bosettings.show_prices_guest') == "guest"
|
||||
) {
|
||||
return "<?php
|
||||
if(is_float($expression)) {
|
||||
echo sprintf('%s €', number_format($expression, 2, ',', ' '));
|
||||
} else {
|
||||
echo $expression;
|
||||
} ?>";
|
||||
}
|
||||
return "-.--";
|
||||
});
|
||||
|
||||
Blade::directive('fmt_currency_without_ttc', function ($expression) {
|
||||
return "<?php
|
||||
if(is_float($expression)) {
|
||||
echo sprintf('%s €', number_format($expression, 2, ',', ' '));
|
||||
} else {
|
||||
echo $expression;
|
||||
} ?>";
|
||||
// Prix transmis en fonction du setting show_prices.
|
||||
if (
|
||||
(config('bosettings.show_prices_authenticated') === "authenticated" && Auth::guard('customer')->check())
|
||||
|| config('bosettings.show_prices_guest') == "guest"
|
||||
) {
|
||||
return "<?php
|
||||
if(is_float($expression)) {
|
||||
echo sprintf('%s €', number_format($expression, 2, ',', ' '));
|
||||
} else {
|
||||
echo $expression;
|
||||
} ?>";
|
||||
}
|
||||
return "-.--";
|
||||
});
|
||||
|
||||
Blade::directive('fmt_sellunit', function ($expression) {
|
||||
|
|
|
|||
55
app/Traits/Controllers/ChangesModelOrder.php
Normal file
55
app/Traits/Controllers/ChangesModelOrder.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
namespace App\Traits\Controllers;
|
||||
|
||||
use App\Http\Requests\Bo\UpdateChangeOrderRequest;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
trait ChangesModelOrder
|
||||
{
|
||||
/**
|
||||
* Change order.
|
||||
*
|
||||
* @param \App\Http\Requests\Bo\UpdateChangeOrderRequest $request
|
||||
* @param \Illuminate\Database\Eloquent\Model $model
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @throws \RuntimeException Si le nom du parametre de la route ne correspond pas au model utilisé.
|
||||
*/
|
||||
public function changeOrder(UpdateChangeOrderRequest $request, Model $model): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
$params = collect(request()->route()->parameterNames);
|
||||
$className = Str::ucfirst(Str::lower($params->get($params->count() - 2)));
|
||||
$className = "\\App\\Models\\$className";
|
||||
|
||||
if (!class_exists($className)) {
|
||||
throw new \RuntimeException("The $className class doesn't exist.");
|
||||
}
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Model|null */
|
||||
$model = $className::where('id', $model->id)->first();
|
||||
|
||||
if (!$model) {
|
||||
return redirect()->back()->with('error', trans('crud.messages.order_not_changed'));
|
||||
}
|
||||
|
||||
return DB::transaction(function () use ($request, $className, $model) {
|
||||
/** @var \Illuminate\Database\Eloquent\Model|null */
|
||||
$tmp = $className::where('order', $request->direction ? '<' : '>', $model->order)
|
||||
->orderBy('order', $request->direction ? 'DESC' : 'ASC')->first();
|
||||
|
||||
if (!$tmp) {
|
||||
return redirect()->back()->with('error', trans('crud.messages.order_not_changed'));
|
||||
}
|
||||
|
||||
$newOrder = $tmp->order;
|
||||
$tmp->order = $model->order;
|
||||
$model->order = $newOrder;
|
||||
$tmp->saveOrFail();
|
||||
$model->saveOrFail();
|
||||
|
||||
return redirect()->back()->with('success', trans('crud.messages.order_changed'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -20,6 +20,7 @@
|
|||
"laravel/framework": "^8.12",
|
||||
"laravel/tinker": "^2.5",
|
||||
"ldc/ldccrmv2client": "^3.0",
|
||||
"maatwebsite/excel": "^3.1",
|
||||
"mews/purifier": "^3.3",
|
||||
"spatie/laravel-sitemap": "^5.8"
|
||||
},
|
||||
|
|
|
|||
923
composer.lock
generated
923
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Database\DBAL\TimestampType;
|
||||
|
||||
return [
|
||||
|
||||
|
|
@ -144,4 +145,10 @@ return [
|
|||
|
||||
],
|
||||
|
||||
'dbal' => [
|
||||
'types' => [
|
||||
'timestamp' => TimestampType::class,
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ return [
|
|||
// * For iframes
|
||||
'URI.SafeIframeRegexp' => "%^(http://|https://|//)(vimeo.com)%",
|
||||
'HTML.Doctype' => 'HTML 4.01 Transitional',
|
||||
'HTML.Allowed' => 'h1[style],h2[style],h3[style],h4[style],h5[style],h6[style],figure[class|style],oembed[url],div[style],b,strong,i,em,u,a[href|title|target|rel],ul[style],ol[style],dl[style],li,p[style],br,span[style|class],img[width|height|alt|src|style|class|title],iframe[src|width|height|class|frameborder|style],table[style|align|border|cellspacing|cellpadding|width],thead,tbody,th[colspan|align|valign|style],tr[align|valign|style],td[style|colspan|rowspan|scope|align|valign],hr,dl,dt',
|
||||
'HTML.Allowed' => 'h1[style],h2[style],h3[style],h4[style],h5[style],h6[style],figure[class|style],oembed[url],div[style],b,strong,i,em,u,a[href|title|target|rel],ul[style],ol[style],dl[style],li,p[style],br,span[style|class],img[width|height|alt|src|style|class|title],iframe[src|width|height|class|frameborder|style],table[style|align|border|cellspacing|cellpadding|width],thead,tbody,th[colspan|align|valign|style],tr[align|valign|style],td[style|colspan|rowspan|scope|align|valign],hr,dl,dt,blockquote',
|
||||
'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align,list-style-type,float,width,height,vertical-align,border-color',
|
||||
'AutoFormat.AutoParagraph' => false,
|
||||
'AutoFormat.RemoveEmpty' => false,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterCodeSalariesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('salaries', function (Blueprint $table) {
|
||||
$table->string('code', 50)->unique()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('salaries', function (Blueprint $table) {
|
||||
$table->dropUnique('salaries_code_unique');
|
||||
});
|
||||
DB::statement('ALTER TABLE `salaries` MODIFY `code` VARBINARY(50) AFTER `prenom`');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Product;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddOrderProductsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->integer('order')->default(1)->after('margin')->comment('Ordonnancement du produit.');
|
||||
});
|
||||
|
||||
$allProducts = Product::all();
|
||||
foreach ($allProducts as $key => $product) {
|
||||
$product->order = ($key + 1);
|
||||
$product->saveOrFail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->dropColumn('order');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AlterBirthUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('date_of_birth');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->date('date_of_birth')->nullable()->after('lastname');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Models\User;
|
||||
|
||||
class AlterRoleUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
foreach (User::where('email', '<>', 'equipe.web@ldc.fr')->get() as $user) {
|
||||
$user->role = 2;
|
||||
$user->saveOrFail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
foreach (User::all() as $user) {
|
||||
$user->role = 1;
|
||||
$user->saveOrFail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AlterCleanSalariesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('salaries', function (Blueprint $table) {
|
||||
$table->date('start_date')->nullable()->change();
|
||||
$table->date('end_date')->nullable()->change();
|
||||
$table->string('nom')->nullable(false)->change();
|
||||
$table->string('prenom')->nullable(false)->change();
|
||||
$table->string('code', 10)->nullable(false)->change();
|
||||
// FIXME : Pourquoi ca passe pas avec eloquent ????
|
||||
DB::statement(
|
||||
'ALTER TABLE `salaries` CHANGE COLUMN `magasin_id` `magasin_id` BIGINT(20) UNSIGNED NOT NULL AFTER `service`;'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('salaries', function (Blueprint $table) {
|
||||
$table->timestamp('start_date')->nullable()->change();
|
||||
$table->timestamp('end_date')->nullable()->change();
|
||||
$table->string('nom')->nullable()->change();
|
||||
$table->string('prenom')->nullable()->change();
|
||||
$table->string('code', 50)->nullable()->change();
|
||||
// FIXME : Pourquoi ca passe pas avec eloquent ????
|
||||
DB::statement(
|
||||
'ALTER TABLE `salaries` CHANGE COLUMN `magasin_id` `magasin_id` BIGINT(20) UNSIGNED NULL AFTER `service`;'
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
14
resources/lang/fr/crud.php
Normal file
14
resources/lang/fr/crud.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'messages' => [
|
||||
'order_changed' => 'L\'ordre a été changé !',
|
||||
'order_not_changed' => 'L\'ordre n\'a pas été changé !',
|
||||
],
|
||||
|
||||
'other' => [
|
||||
'up' => 'Modifier l\'ordre d\'apparition vers le haut',
|
||||
'down' => 'Modifier l\'ordre d\'apparition vers le bas',
|
||||
'right' => 'Vous n\'avez pas les droits',
|
||||
]
|
||||
];
|
||||
22
resources/views/bo/modules/change-model-order.blade.php
Normal file
22
resources/views/bo/modules/change-model-order.blade.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<td class="text-center align-middle">
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<a href="{{ route('bo.' . $routeName . '.change-order', [Str::singular($routeName) => $model, 'direction' => 'up']) }}"
|
||||
class="@if($loop->first and $models->onFirstPage()) invisible @endif">
|
||||
<button type="submit"
|
||||
class="btn btn-sm btn-outline-dark @if(($loop->first and $models->onFirstPage())) disabled @endif"
|
||||
title="{{ __('crud.other.up') }}"
|
||||
data-bs="tooltip">
|
||||
<i class="fas fa-arrow-up"></i>
|
||||
</button>
|
||||
</a>
|
||||
<a href="{{ route('bo.' . $routeName . '.change-order', [Str::singular($routeName) => $model, 'direction' => 'down']) }}"
|
||||
class="@if($loop->last and $models->currentPage() === $models->lastPage()) invisible @endif">
|
||||
<button type="submit"
|
||||
class="btn btn-sm btn-outline-dark ms-1 @if($loop->last and $models->currentPage() === $models->lastPage()) disabled @endif"
|
||||
title="{{ __('crud.other.down') }}"
|
||||
data-bs="tooltip">
|
||||
<i class="fas fa-arrow-down"></i>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
|
|
@ -1,127 +1,132 @@
|
|||
@extends('layouts.bo-layout')
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Produits <small class="text-muted">Liste</small></h1>
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Produits <small class="text-muted">Liste</small></h1>
|
||||
|
||||
<form method="GET">
|
||||
<div class="row">
|
||||
<label for="filter_range" class="col-form-label">Gamme</label>
|
||||
<div class="col">
|
||||
<select class="form-control" id="filter_range" name="filter_range">
|
||||
<option value="" @if ($filter_range == '') selected @endif>Toutes</option>
|
||||
@foreach($ranges as $range)
|
||||
<option value="{{$range->id}}" @if ($range->id == $filter_range) selected @endif>{{$range->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<label for="filter_range" class="col-form-label">Marque</label>
|
||||
<div class="col">
|
||||
<select class="form-control" id="filter_brand" name="filter_brand">
|
||||
<option value="" @if ($filter_brand == '') selected @endif>Toutes</option>
|
||||
@foreach (ProductBrand::toArray() as $productbrand)
|
||||
<option value="{{$productbrand->value}}" @if ($productbrand->value == $filter_brand) selected @endif>{{$productbrand->label}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<label for="filter_name" class="col-form-label">Nom</label>
|
||||
<div class="col">
|
||||
<input class="form-control" type="text"
|
||||
placeholder="Recherchez un produit"
|
||||
id="filter_name" name="filter_name"
|
||||
value="{{ $filter_name ?? ''}}">
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-primary">Filtrer</button>
|
||||
<a class="btn btn-info" href="{{ route('bo.products.index') }}">Effacer le filtre</a>
|
||||
</div>
|
||||
<form method="GET">
|
||||
<div class="row">
|
||||
<label for="filter_range" class="col-form-label">Gamme</label>
|
||||
<div class="col">
|
||||
<select class="form-control" id="filter_range" name="filter_range">
|
||||
<option value="" @if ($filter_range == '') selected @endif>Toutes</option>
|
||||
@foreach($ranges as $range)
|
||||
<option value="{{$range->id}}" @if ($range->id == $filter_range) selected @endif>{{$range->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-primary float-right dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Ajouter un produit
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
@foreach (Config::get('theme.enum_product_types') as $productType=>$label)
|
||||
<a class="dropdown-item" href="{{route('bo.products.create', $productType)}}">{{ __($label)}}</a>
|
||||
@endforeach
|
||||
<label for="filter_range" class="col-form-label">Marque</label>
|
||||
<div class="col">
|
||||
<select class="form-control" id="filter_brand" name="filter_brand">
|
||||
<option value="" @if ($filter_brand == '') selected @endif>Toutes</option>
|
||||
@foreach (ProductBrand::toArray() as $productbrand)
|
||||
<option value="{{ $productbrand->value }}" @if ($productbrand->value == $filter_brand) selected @endif>{{ $productbrand->label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<label for="filter_name" class="col-form-label">Nom</label>
|
||||
<div class="col">
|
||||
<input class="form-control" type="text"
|
||||
placeholder="Recherchez un produit"
|
||||
id="filter_name" name="filter_name"
|
||||
value="{{ $filter_name ?? ''}}">
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-primary">Filtrer</button>
|
||||
<a class="btn btn-info" href="{{ route('bo.products.index') }}">Effacer le filtre</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
@if(count(Config::get('theme.enum_product_types'))>1)
|
||||
<th scope="col">Type</th>
|
||||
@endif
|
||||
<th scope="col">Ref Externe</th>
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Nom</th>
|
||||
<th scope="col">Marque</th>
|
||||
<th scope="col">Prix en €</th>
|
||||
<th scope="col">Stock</th>
|
||||
<th scope="col">Référence</th>
|
||||
<th scope="col">Slug</th>
|
||||
<th scope="col">Gamme</th>
|
||||
<th scope="col">Publié</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($products as $product)
|
||||
<tr>
|
||||
@if(count(Config::get('theme.enum_product_types'))>1)
|
||||
<td>
|
||||
{{ Config::get('theme.enum_product_types')[$product->product_type] }}
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
@if($product->product_type == "foodProduct")
|
||||
{{ $product->foodProduct->no_art }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($product->picture !== null)
|
||||
<a data-fancybox="gallery" href="/images/produits/{{$product->picture}}">
|
||||
<img src="/images/produits/{{$product->picture}}" alt="{{$product->name}}" style="max-height: 100px;">
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{$product->name}}</td>
|
||||
<td>{{$product->brand->label ?? ''}}</td>
|
||||
<td>{{number_format($product->price, 2, ',', ' ')}}€</td>
|
||||
<td>{{number_format($product->stock, 0, ',', ' ')}}</td>
|
||||
<td>{{$product->reference}}</td>
|
||||
<td>{{$product->slug}}</td>
|
||||
<td>{{$product->range->name}}</td>
|
||||
<td>
|
||||
<form action="{{ route('bo.products.change-published', $product) }}" method="POST">
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="btn btn-sm"
|
||||
title="{{ __($product->status ? __('Dépublier') : __('Publier')) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
@if($product->status)
|
||||
<i class="fas fa-check check-green"></i>
|
||||
@else
|
||||
<i class="fas fa-times cross-red"></i>
|
||||
@endif
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{{route('bo.products.edit', $product->id)}}" class="btn btn-sm btn-primary">Éditer</a>
|
||||
<form action="{{route('bo.products.destroy', $product->id)}}" method="POST" class="d-inline">
|
||||
@method('DELETE')
|
||||
@csrf
|
||||
<input type="submit" class="btn btn-sm btn-danger" value="Supprimer"
|
||||
onclick="return confirm('Êtes-vous sûr(e) ?')">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-primary float-right dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Ajouter un produit
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
@foreach (Config::get('theme.enum_product_types') as $productType=>$label)
|
||||
<a class="dropdown-item" href="{{route('bo.products.create', $productType)}}">{{ __($label) }}</a>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@if($products instanceof \Illuminate\Pagination\LengthAwarePaginator )
|
||||
{{ $products->appends(['filter_name' => $filter_name,'filter_range' => $filter_range])->links() }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
@if(count(Config::get('theme.enum_product_types'))>1)
|
||||
<th scope="col">Type</th>
|
||||
@endif
|
||||
<th scope="col">Ref Externe</th>
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Nom</th>
|
||||
<th scope="col">Marque</th>
|
||||
<th scope="col">Prix en €</th>
|
||||
<th scope="col">Stock</th>
|
||||
<th scope="col">Référence</th>
|
||||
<th scope="col">Gamme</th>
|
||||
<th scope="col">Publié</th>
|
||||
<th scope="col">Ordre</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($products as $product)
|
||||
<tr>
|
||||
@if(count(Config::get('theme.enum_product_types'))>1)
|
||||
<td>
|
||||
{{ Config::get('theme.enum_product_types')[$product->product_type] }}
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
@if($product->product_type == "foodProduct")
|
||||
{{ $product->foodProduct->no_art }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($product->picture !== null)
|
||||
<a data-fancybox="gallery" href="/images/produits/{{ $product->picture }}">
|
||||
<img src="/images/produits/{{ $product->picture }}" alt="{{ $product->name }}" style="max-height: 100px;">
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $product->name }}</td>
|
||||
<td>{{ $product->brand->label ?? '' }}</td>
|
||||
<td>{{ number_format($product->price, 2, ',', ' ') }}€</td>
|
||||
<td>{{ number_format($product->stock, 0, ',', ' ') }}</td>
|
||||
<td>{{ $product->reference }}</td>
|
||||
<td>{{ $product->range->name }}</td>
|
||||
<td>
|
||||
<form action="{{ route('bo.products.change-published', $product) }}" method="POST">
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="btn btn-sm"
|
||||
title="{{ __($product->status ? __('Dépublier') : __('Publier')) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
@if($product->status)
|
||||
<i class="fas fa-check check-green"></i>
|
||||
@else
|
||||
<i class="fas fa-times cross-red"></i>
|
||||
@endif
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@php $routeName = request()->route()->getName(); @endphp
|
||||
@include('bo.modules.change-model-order', [
|
||||
'routeName' => 'products',
|
||||
'models' => $products,
|
||||
'model' => $product
|
||||
])
|
||||
<td class="text-center">
|
||||
<a href="{{ route('bo.products.edit', $product->id) }}" class="btn btn-sm btn-primary">Éditer</a>
|
||||
<form action="{{ route('bo.products.destroy', $product->id) }}" method="POST" class="d-inline">
|
||||
@method('DELETE')
|
||||
@csrf
|
||||
<input type="submit" class="btn btn-sm btn-danger" value="Supprimer"
|
||||
onclick="return confirm('Êtes-vous sûr(e) ?')">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@if($products instanceof \Illuminate\Pagination\LengthAwarePaginator )
|
||||
{{ $products->appends(['filter_name' => $filter_name,'filter_range' => $filter_range])->links() }}
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
|
|
|
|||
29
resources/views/bo/salaries/index.blade.php
Normal file
29
resources/views/bo/salaries/index.blade.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
@extends('layouts.bo-layout')
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">{{ __('Paramètres Site Public') }}</h1>
|
||||
@if (session('success'))
|
||||
<span class="float-center text-success">{{ session('success') }}</span>
|
||||
@endif
|
||||
</div>
|
||||
<form
|
||||
action="{{ route('bo.salaries.file') }}"
|
||||
method="POST"
|
||||
enctype="multipart/form-data">
|
||||
<fieldset>
|
||||
<legend>{{ __('Importer des salariés') }}</legend>
|
||||
<div class="input-group my-2">
|
||||
<input class="form-control" type="file" name="import" accept="text/csv,.csv"
|
||||
title="{{ __('Sélectionner un fichier .csv') }}"
|
||||
data-bs-toggle="tooltip" required>
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary"
|
||||
title="{{ __('Importer le fichier .csv') }}"
|
||||
data-bs-toggle="tooltip">
|
||||
{{ __('Importer') }}
|
||||
</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
@endsection
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
@extends('layouts.bo-layout')
|
||||
|
||||
@section('content')
|
||||
<form method="POST" action="{{route('bo.settings')}}">
|
||||
<form method="POST" action="{{ route('bo.settings') }}">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
|
|
@ -22,30 +22,6 @@
|
|||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
{{--<div class="form-group">
|
||||
<label class="col-form-label">
|
||||
<input type="checkbox" name="has_costs" value="1" @if ($settingsToPrint['has_costs'] == "1") checked @endif>
|
||||
Frais de commande
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">
|
||||
Montant des frais de commande
|
||||
<input type="number" name="costs" step=".01" class="form-control" value="{{$settingsToPrint['costs']}}">
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">
|
||||
<input type="checkbox" name="has_payment" value="1" @if ($settingsToPrint['has_payment'] == "1") checked @endif>
|
||||
Prise en charge du paiement
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">
|
||||
<input type="checkbox" name="qr_code" value="1" @if ($settingsToPrint['qr_code'] == "1") checked @endif>
|
||||
Gestion des QR codes
|
||||
</label>
|
||||
</div>--}}
|
||||
<div class="form-group">
|
||||
<label class="col-form-label">
|
||||
Délai de retrait de la commande
|
||||
|
|
@ -196,45 +172,3 @@
|
|||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
{{-- devenu inutile puisque le swicth envoi de commande active en fait le champs order_unit, et rend oligatoire le champ reference
|
||||
mais le champs sell unit reste un champs d'uvc qui peut prendre d'autres formes.
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("INPUT[name=regate_orders]").change(function(){
|
||||
if($(this).prop("checked") == true){
|
||||
//console.log("Checkbox is checked.");
|
||||
//check strict sell units
|
||||
$("INPUT[name=sell_unit_management]").prop("checked",true);
|
||||
}
|
||||
else if($(this).prop("checked") == false){
|
||||
//console.log("Checkbox is unchecked.");
|
||||
}
|
||||
});
|
||||
|
||||
$("INPUT[name=sell_unit_management]").change(function(){
|
||||
if($(this).prop("checked") == true){
|
||||
//console.log("Checkbox is checked.");
|
||||
}
|
||||
else if($(this).prop("checked") == false){
|
||||
//console.log("Checkbox is unchecked.");
|
||||
if($("INPUT[name=regate_orders]").prop("checked") == true){
|
||||
//recheck
|
||||
$(this).prop("checked",true);
|
||||
$.fancybox.open({
|
||||
src : '#hidden-content',
|
||||
type : 'inline',
|
||||
opts : {
|
||||
afterShow : function( instance, current ) {
|
||||
console.info( 'done!' );
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
--}}
|
||||
|
|
|
|||
|
|
@ -168,29 +168,7 @@
|
|||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:black;">Bonjour,<br><br> La commande {{ $order->reference }} est confirmée</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<p style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:100%;">
|
||||
</p>
|
||||
<!--[if mso | IE]>
|
||||
<table
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px"
|
||||
>
|
||||
<tr>
|
||||
<td style="height:0;line-height:0;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:black;">Détail de la Commande : <br><br></div>
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:black;">Bonjour,<br><br> La commande {{ $order->reference }} de {{ $order->customer->salarie->prenom }} {{ Str::upper($order->customer->salarie->nom) }} est confirmée</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -199,35 +177,18 @@
|
|||
<tr style="border-bottom:1px solid #ecedee;text-align:left;padding:15px 0;">
|
||||
<th style="padding: 0 15px 0 0;">Produit</th>
|
||||
<th style="padding: 0 15px;">Quantité</th>
|
||||
<th style="padding: 0 0 0 15px;">Total</th>
|
||||
<th style="padding: 0 0 0 15px;">Total TTC</th>
|
||||
</tr> @foreach ($order->lines as $line) <tr>
|
||||
<td style="padding: 0 15px 0 0;">{{ $line->product->name }}</td>
|
||||
<td style="padding: 0 15px;">{{ $line->quantity }}</td>
|
||||
<td style="padding: 0 0 0 15px;">@fmt_currency($line->total_ttc)</td>
|
||||
<td style="padding: 0 0 0 15px;">@fmt_currency_without_auth($line->total_ttc)</td>
|
||||
</tr> @endforeach
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<p style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:100%;">
|
||||
</p>
|
||||
<!--[if mso | IE]>
|
||||
<table
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px"
|
||||
>
|
||||
<tr>
|
||||
<td style="height:0;line-height:0;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:black;">Total de la commande : @fmt_currency($order->total)</div>
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;font-weight:bold;line-height:1;text-align:left;color:black;">Total estimé : @fmt_currency_without_auth($order->total) TTC</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
|||
215
resources/views/emails/order-reminder.blade.php
Normal file
215
resources/views/emails/order-reminder.blade.php
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
<!doctype html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
||||
|
||||
<head>
|
||||
<title>
|
||||
</title>
|
||||
<!--[if !mso]><!-- -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<!--<![endif]-->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type="text/css">
|
||||
#outlook a {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-ms-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
table,
|
||||
td {
|
||||
border-collapse: collapse;
|
||||
mso-table-lspace: 0pt;
|
||||
mso-table-rspace: 0pt;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
height: auto;
|
||||
line-height: 100%;
|
||||
outline: none;
|
||||
text-decoration: none;
|
||||
-ms-interpolation-mode: bicubic;
|
||||
}
|
||||
|
||||
p {
|
||||
display: block;
|
||||
margin: 13px 0;
|
||||
}
|
||||
</style>
|
||||
<!--[if mso]>
|
||||
<xml>
|
||||
<o:OfficeDocumentSettings>
|
||||
<o:AllowPNG/>
|
||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||
</o:OfficeDocumentSettings>
|
||||
</xml>
|
||||
<![endif]-->
|
||||
<!--[if lte mso 11]>
|
||||
<style type="text/css">
|
||||
.mj-outlook-group-fix { width:100% !important; }
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if !mso]><!-->
|
||||
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css">
|
||||
<style type="text/css">
|
||||
@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);
|
||||
</style>
|
||||
<!--<![endif]-->
|
||||
<style type="text/css">
|
||||
@media only screen and (min-width:480px) {
|
||||
.mj-column-per-100 {
|
||||
width: 100% !important;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style type="text/css">
|
||||
@media only screen and (max-width:480px) {
|
||||
table.mj-full-width-mobile {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
td.mj-full-width-mobile {
|
||||
width: auto !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body style="background-color:#f9f7f3;">
|
||||
<div style="background-color:#f9f7f3;">
|
||||
<!--[if mso | IE]>
|
||||
<table
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600"
|
||||
>
|
||||
<tr>
|
||||
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
|
||||
<![endif]-->
|
||||
<div style="background:#f9f7f3;background-color:#f9f7f3;margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#f9f7f3;background-color:#f9f7f3;width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
|
||||
<!--[if mso | IE]>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
|
||||
<tr>
|
||||
|
||||
<td
|
||||
class="" style="vertical-align:top;width:600px;"
|
||||
>
|
||||
<![endif]-->
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tr>
|
||||
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:collapse;border-spacing:0px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width:339px;">
|
||||
<img height="auto" src="{{ asset(config('app.theme').'/img/logo.png')}}" style="border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:13px;" width="339">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:25px;font-weight:bold;line-height:1;text-align:center;text-transform:uppercase;color:black;">VOTRE COMMANDE EST PRÊTE !</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600"
|
||||
>
|
||||
<tr>
|
||||
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
|
||||
<![endif]-->
|
||||
<div style="background:#f9f7f3;background-color:#f9f7f3;margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#f9f7f3;background-color:#f9f7f3;width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
|
||||
<!--[if mso | IE]>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
|
||||
<tr>
|
||||
|
||||
<td
|
||||
class="" style="vertical-align:top;width:600px;"
|
||||
>
|
||||
<![endif]-->
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:black;">
|
||||
Bonjour {{ $order->customer->salarie->prenom }} {{ Str::upper($order->customer->salarie->nom) }},
|
||||
<br><br>
|
||||
Votre commande {{ $order->reference }} est disponible
|
||||
<br>
|
||||
N'oubliez pas de la récupérer aujourd'hui dans votre point relais :
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:black;">
|
||||
<b>Point de retrait {{$magasin->name}}, {{$magasin->address}}, {{$magasin->postcode}} {{$magasin->city}}</b>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:center;color:black;">
|
||||
<br>L'équipe {{ config('theme.site_name') }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -6,12 +6,12 @@
|
|||
@section('breadcrumb', 'no')
|
||||
|
||||
@section('content')
|
||||
<section class="auth-login d-flex flex-column justify-content-center">
|
||||
<section class="contact-content">
|
||||
<h1 class="title-medium font-Barlow-extra-bold text-uppercase text-grey text-center">{!! $content->title !!}</h1>
|
||||
<div class="row justify-content-around">
|
||||
<div class="col-12 col-lg-6 p-0 font-Barlow-bold">
|
||||
@if ($content !== null)
|
||||
{!! $content->value !!}
|
||||
{!! clean($content->value) !!}
|
||||
@else
|
||||
<p>{{ __('Bonjour,') }}</p>
|
||||
<p>{{ __('Si vous avez une question à nous poser ou des remarques à formuler sur notre site, n\'hésitez pas à les inscrire dans le formulaire ci-contre. Merci d\'indiquer vos coordonnées exactes pour que nous puissions vous répondre prochainement.') }}</p>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
@section('breadcrumb', 'no')
|
||||
|
||||
@section('content')
|
||||
<section class="auth-login d-flex justify-content-center align-items-start">
|
||||
<section>
|
||||
<div class="row w-100">
|
||||
<div class="col">
|
||||
<h1 class="title-medium font-Barlow-extra-bold text-uppercase text-grey text-center">{{ $content->value }}</h1>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<ul class="d-flex flex-column flex-xl-row justify-content-evenly align-items-center p-3 p-xl-0 m-0">
|
||||
<li class="list-group-item">
|
||||
<a class="nav-link" href="/">
|
||||
<img class="p-1" src="{{ asset(config('app.theme') . "/img/logo.png")}}" alt="Logo" />
|
||||
<img class="p-1" src="{{ asset(config('app.theme') . "/img/logo.png") }}" alt="Logo" />
|
||||
</a>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<!-- Styles -->
|
||||
<link href="{{ asset(config('app.theme') . '/css/app.css') }}" rel="stylesheet">
|
||||
<link href="{{ mix(config('app.theme') . '/css/app.css') }}" rel="stylesheet">
|
||||
|
||||
@if(config('app.env') === 'local')
|
||||
<script>window.vueDebug = true;</script>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
@include('layouts.footer')
|
||||
</div>
|
||||
<script src="{{ asset(config('app.theme') . '/js/app.js') }}"></script>
|
||||
<script src="{{ mix(config('app.theme') . '/js/app.js') }}"></script>
|
||||
@yield('scripts')
|
||||
|
||||
@include('partials.cookie')
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<nav id="navbar" class="navbar navbar-expand-lg navbar-dark position-sticky top-0 start-0 w-100 bkg-orange">
|
||||
<nav id="navbar" class="navbar navbar-expand-lg navbar-light position-sticky top-0 start-0 w-100 bkg-orange">
|
||||
<div class="container-fluid">
|
||||
<button class="navbar-toggler border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup"
|
||||
aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@
|
|||
@section('breadcrumb', 'no')
|
||||
|
||||
@section('content')
|
||||
<section class="auth-login d-flex justify-content-center align-items-center">
|
||||
<section>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1 class="title-medium font-Barlow-extra-bold text-uppercase text-grey text-center">{{ $content->title }}</h1>
|
||||
@if ($content !== null)
|
||||
<div class="row mt-2">
|
||||
<div class="col d-flex flex-column justify-content-center align-items-center text-center">
|
||||
{!! $content->value !!}
|
||||
<div class="col d-flex flex-column justify-content-center">
|
||||
{!! clean($content->value) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -167,29 +167,7 @@
|
|||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:black;">Bonjour,<br><br> Votre commande {{ $order->reference }} est confirmée</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<p style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:100%;">
|
||||
</p>
|
||||
<!--[if mso | IE]>
|
||||
<table
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px"
|
||||
>
|
||||
<tr>
|
||||
<td style="height:0;line-height:0;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:black;">Détail de votre Commande :<br></div>
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:black;">Bonjour {{ $order->customer->salarie->prenom }} {{ Str::upper($order->customer->salarie->nom) }},<br><br> Votre commande {{ $order->reference }} est confirmée</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -198,8 +176,8 @@
|
|||
<tr style="border-bottom:1px solid #ecedee;text-align:left;padding:15px 0;">
|
||||
<th style="padding: 0 15px 0 0;">Produit</th>
|
||||
<th style="padding: 0 15px;">Quantité</th>
|
||||
<th style="padding: 0 15px;">Prix kilo</th>
|
||||
<th style="padding: 0 0 0 15px;">Total</th>
|
||||
<th style="padding: 0 15px;">Prix kilo TTC</th>
|
||||
<th style="padding: 0 0 0 15px;">Total TTC</th>
|
||||
</tr>
|
||||
@foreach ($order->lines as $line)
|
||||
<tr>
|
||||
|
|
@ -208,29 +186,19 @@
|
|||
</td>
|
||||
<td style="padding: 0 15px;">{{ $line->quantity }}</td>
|
||||
<td style="padding: 0 15px;">
|
||||
@if ($line->product->weight_variable) @fmt_currency($line->product->priceKgTtc) @endif
|
||||
@if ($line->product->weight_variable) @fmt_currency_without_auth($line->product->priceKgTtc) @endif
|
||||
</td>
|
||||
<td style="padding: 0 0 0 15px;">@fmt_currency($line->total_ttc)</td>
|
||||
<td style="padding: 0 0 0 15px;">@fmt_currency_without_auth($line->total_ttc)</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<p style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:100%;">
|
||||
</p>
|
||||
<!--[if mso | IE]>
|
||||
<table
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px"
|
||||
>
|
||||
<tr>
|
||||
<td style="height:0;line-height:0;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;font-weight:bold;line-height:1;text-align:left;color:black;">
|
||||
Total estimé de la commande : @fmt_currency_without_auth($order->total) TTC
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -240,10 +208,20 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:0px 25px;word-break:break-word;">
|
||||
<p style="margin:0;color:#000000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;">NB: Nous faisons le maximum pour vous livrer l'intégralité de votre commande, malheureusement certains produits peuvent
|
||||
être en rupture. Vous ne serez pas facturé des produits non livrés.<br>
|
||||
Pour toutes questions <a href="{{ route('contact') }}" target="_blank">contactez-nous</a>.</p>
|
||||
<td style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<p style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:100%;">
|
||||
</p>
|
||||
<!--[if mso | IE]>
|
||||
<table
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px"
|
||||
>
|
||||
<tr>
|
||||
<td style="height:0;line-height:0;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -266,41 +244,30 @@
|
|||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:black;">
|
||||
Total estimé de la commande : @fmt_currency($order->total) TTC
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<p style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:100%;">
|
||||
</p>
|
||||
<!--[if mso | IE]>
|
||||
<table
|
||||
align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:dashed 1px lightgrey;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px"
|
||||
>
|
||||
<tr>
|
||||
<td style="height:0;line-height:0;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:black;">
|
||||
A retirer le <b>{{$order->timeslot->day}} à {{$order->timeslot->time}}</b>, à l’adresse suivante :<br><br>
|
||||
A retirer le <b>{{$order->timeslot->day}} à {{$order->timeslot->time}}</b>, à l'adresse suivante :<br><br>
|
||||
<b>Mon point de retrait {{$magasin->name}}, {{$magasin->address}}, {{$magasin->postcode}} {{$magasin->city}}</b>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:0px 25px;word-break:break-word;">
|
||||
<p style="margin:0;color:#000000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;">NB: Nous faisons le maximum pour vous livrer l'intégralité de votre commande, malheureusement certains produits peuvent
|
||||
être en rupture. Vous ne serez pas facturé des produits non livrés.<br></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:center;color:black;">
|
||||
<br>L'équipe {{ config('theme.site_name') }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;background-color:#f6c500">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;color:black;">
|
||||
Pour toutes questions liées à votre commande, merci de contacter l'accueil par téléphone ou par notre rubrique <a href="{{ route('contact') }}" target="_blank">contactez-nous</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]>
|
||||
|
|
|
|||
|
|
@ -208,9 +208,9 @@
|
|||
</td>
|
||||
<td style="padding: 0 15px;">{{ $line->quantity }}</td>
|
||||
<td style="padding: 0 15px;">
|
||||
@if ($line->product->weight_variable) @fmt_currency($line->product->priceKgTtc) @endif
|
||||
@if ($line->product->weight_variable) @fmt_currency_without_auth($line->product->priceKgTtc) @endif
|
||||
</td>
|
||||
<td style="padding: 0 0 0 15px;">@fmt_currency($line->total_ttc)</td>
|
||||
<td style="padding: 0 0 0 15px;">@fmt_currency_without_auth($line->total_ttc)</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
|
@ -266,7 +266,7 @@
|
|||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:left;color:black;">
|
||||
Total estimé de la commande : @fmt_currency($order->total) TTC
|
||||
Total estimé de la commande : @fmt_currency_without_auth($order->total) TTC
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
15
resources/views/front/sable/mails/send-csv.blade.php
Normal file
15
resources/views/front/sable/mails/send-csv.blade.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
@component('mail::message')
|
||||
|
||||
<div style="display:flex;justify-content:center;">
|
||||
|
||||
 . "/img/logo.png") }})
|
||||
|
||||
</div>
|
||||
|
||||
# {{ __('Bonjour :lastname :firstname', ['lastname' => $model->lastname, 'firstname' => $model->firstname]) }}
|
||||
|
||||
{{ __("Vous venez de générer un fichier .csv suite à l'import de salariés, disponible en pièce jointe de cet email.") }}
|
||||
|
||||
{{ config('app.name') }}.
|
||||
|
||||
@endcomponent
|
||||
|
|
@ -6,14 +6,14 @@
|
|||
@section('breadcrumb', 'no')
|
||||
|
||||
@section('content')
|
||||
<section class="auth-login d-flex justify-content-center align-items-center">
|
||||
<section>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1 class="title-medium font-Barlow-extra-bold text-uppercase text-grey text-center">{{ $content->title }}</h1>
|
||||
@if ($content !== null)
|
||||
<div class="row mt-2">
|
||||
<div class="col d-flex flex-column justify-content-center align-items-center text-center">
|
||||
{!! $content->value !!}
|
||||
<div class="col d-flex flex-column justify-content-center">
|
||||
{!! clean($content->value) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -180,6 +180,27 @@ img {
|
|||
}
|
||||
}
|
||||
|
||||
.contact {
|
||||
&-content {
|
||||
form {
|
||||
width: 100%;
|
||||
max-width: 25rem;
|
||||
|
||||
.form-control {
|
||||
width: 20rem;
|
||||
}
|
||||
|
||||
img {
|
||||
height: 5rem;
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pagination {
|
||||
.page-link {
|
||||
background-color: #f6c500;
|
||||
|
|
@ -191,6 +212,15 @@ img {
|
|||
}
|
||||
}
|
||||
|
||||
blockquote {
|
||||
background-color: #909090;
|
||||
padding: 1rem;
|
||||
|
||||
p:last-child {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// SSSSSSSSSSSSSSS MMMMMMMM MMMMMMMM
|
||||
// SS:::::::::::::::SM:::::::M M:::::::M
|
||||
// S:::::SSSSSS::::::SM::::::::M M::::::::M
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@
|
|||
@section('breadcrumb', 'no')
|
||||
|
||||
@section('content')
|
||||
<section class="auth-login d-flex justify-content-center align-items-center">
|
||||
<section>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1 class="title-medium font-Barlow-extra-bold text-uppercase text-grey text-center">{{ $content->title }}</h1>
|
||||
@if ($content !== null)
|
||||
<div class="row mt-2">
|
||||
<div class="col d-flex flex-column justify-content-center align-items-center text-center">
|
||||
{!! $content->value !!}
|
||||
<div class="col d-flex flex-column justify-content-center overflow-hidden">
|
||||
{!! clean($content->value) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<!-- CSRF Token -->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<title>Tableau de bord</title>
|
||||
<title>{{ __('Tableau de bord') }}</title>
|
||||
|
||||
<script src="https://cdn.ckeditor.com/ckeditor5/23.0.0/classic/ckeditor.js"></script>
|
||||
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
</button>
|
||||
<ul class="navbar-nav px-3">
|
||||
<li class="nav-item text-nowrap">
|
||||
<a class="nav-link" href="{{ route('auth.logout') }}">Déconnexion</a>
|
||||
<a class="nav-link" href="{{ route('auth.logout') }}">{{ __('Déconnexion') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
@ -32,40 +32,40 @@
|
|||
<div class="position-sticky pt-3">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{route('home')}}" target="_front">Voir le site</a>
|
||||
<a class="nav-link" href="{{route('home')}}" target="_front">{{ __('Voir le site') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="accordion" id="accordionMenu">
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingSliders">
|
||||
<button class="accordion-button {{ ( request()->routeIs('bo.sliders*') || request()->routeIs('bo.slides*') ) ? '' : 'collapsed' }}" type="button" data-bs-toggle="collapse" data-bs-target="#collapseSliders" aria-expanded="true" aria-controls="collapseSliders">
|
||||
<i class="fas fa-tv"></i> Sliders
|
||||
</button>
|
||||
<button class="accordion-button {{ ( request()->routeIs('bo.sliders*') || request()->routeIs('bo.slides*') ) ? '' : 'collapsed' }}" type="button" data-bs-toggle="collapse" data-bs-target="#collapseSliders" aria-expanded="true" aria-controls="collapseSliders">
|
||||
<i class="fas fa-tv"></i> {{ __('Sliders') }}
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseSliders" class="accordion-collapse collapse {{ ( request()->routeIs('bo.sliders*') || request()->routeIs('bo.slides*') ) ? 'show' : '' }}" aria-labelledby="headingSliders" data-bs-parent="#accordionMenu">
|
||||
<div class="accordion-body">
|
||||
<div class="accordion-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.sliders.index')}}">Sliders</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.slides.index')}}">Slides</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.sliders.index')}}">{{ __('Sliders') }}</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.slides.index')}}">{{ __('Slides') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingPages">
|
||||
<button class="accordion-button {{ ( request()->routeIs('bo.content') || request()->routeIs('bo.faq') ) ? '' : 'collapsed' }}" type="button" data-bs-toggle="collapse" data-bs-target="#collapsePages" aria-expanded="true" aria-controls="collapsePages">
|
||||
<i class="far fa-file-word"></i> Pages
|
||||
</button>
|
||||
<i class="far fa-file-word"></i> {{ __('Pages') }}
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapsePages" class="accordion-collapse collapse {{ ( request()->routeIs('bo.content') || request()->routeIs('bo.faq') ) ? 'show' : '' }}" aria-labelledby="headingPages" data-bs-parent="#accordionMenu">
|
||||
<div class="accordion-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'accueil')}}">Accueil</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'contact')}}">Contact</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'legals')}}">Mentions Légales</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'cgv')}}">CGV</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'confidentialite')}}">Politique de confidentialité</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.faq')}}">FAQ</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'accueil')}}">{{ __('Accueil') }}</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'contact')}}">{{ __('Contact') }}</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'legals')}}">{{ __('Mentions Légales') }}</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'cgv')}}">{{ __('CGV') }}</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'confidentialite')}}">{{ __('Politique de confidentialité') }}</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.faq')}}">{{ __('FAQ') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingProduits">
|
||||
<button class="accordion-button {{ ( request()->routeIs('bo.products*') || request()->routeIs('bo.ranges*') || request()->routeIs('bo.tags*') ) ? '' : 'collapsed' }}" type="button" data-bs-toggle="collapse" data-bs-target="#collapseProduits" aria-expanded="true" aria-controls="collapseProduits">
|
||||
<i class="fas fa-warehouse"></i> Catalogue
|
||||
<i class="fas fa-warehouse"></i> {{ __('Catalogue') }}
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
|
|
@ -81,9 +81,9 @@
|
|||
<div class="accordion-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{route('bo.products.index')}}">Produits</a>
|
||||
<a class="nav-link" href="{{route('bo.ranges.index')}}">Gammes de produits</a>
|
||||
<a class="nav-link" href="{{route('bo.tags.index')}}">Mots Clés</a>
|
||||
<a class="nav-link" href="{{route('bo.products.index')}}">{{ __('Produits') }}</a>
|
||||
<a class="nav-link" href="{{route('bo.ranges.index')}}">{{ __('Gammes de produits') }}</a>
|
||||
<a class="nav-link" href="{{route('bo.tags.index')}}">{{ __('Mots Clés') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingMerchandising">
|
||||
<button class="accordion-button {{ ( request()->routeIs('bo.promotions*') || request()->routeIs('bo.products.starred') ) ? '' : 'collapsed' }}" type="button" data-bs-toggle="collapse" data-bs-target="#collapseMerchandising" aria-expanded="true" aria-controls="collapseMerchandising">
|
||||
<i class="fas fa-cart-arrow-down"></i> Merchandising
|
||||
<i class="fas fa-cart-arrow-down"></i> {{ __('Merchandising') }}
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
|
|
@ -100,9 +100,8 @@
|
|||
<div class="accordion-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{route('bo.promotions.index')}}">Promotions</a>
|
||||
<a class="nav-link" href="{{route('bo.products.starred')}}">Mise en avant</a>
|
||||
{{--<a class="nav-link" href="#">Associations de produits</a>--}}
|
||||
<a class="nav-link" href="{{route('bo.promotions.index')}}">{{ __('Promotions') }}</a>
|
||||
<a class="nav-link" href="{{route('bo.products.starred')}}">{{ __('Mise en avant') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -112,7 +111,7 @@
|
|||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingOrders">
|
||||
<button class="accordion-button {{ ( request()->routeIs('bo.orders*') ) ? '' : 'collapsed' }}" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOrders" aria-expanded="true" aria-controls="collapseOrders">
|
||||
<i class="fas fa-cash-register"></i> Commandes
|
||||
<i class="fas fa-cash-register"></i> {{ __('Commandes') }}
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
|
|
@ -120,8 +119,8 @@
|
|||
<div class="accordion-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{route('bo.orders')}}">Commandes</a>
|
||||
<a class="nav-link" href="{{route('bo.orders.today')}}">Commandes à retirer aujourd'hui</a>
|
||||
<a class="nav-link" href="{{route('bo.orders')}}">{{ __('Commandes') }}</a>
|
||||
<a class="nav-link" href="{{route('bo.orders.today')}}">{{ __('Commandes à retirer aujourd\'hui') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -131,19 +130,19 @@
|
|||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingCollecte">
|
||||
<button class="accordion-button {{ ( request()->routeIs('bo.magasins*') || request()->routeIs('bo.creneaux*') ) ? '' : 'collapsed' }}" type="button" data-bs-toggle="collapse" data-bs-target="#collapseCollecte" aria-expanded="true" aria-controls="collapseCollecte">
|
||||
<i class="fas fa-store"></i> Points de retrait
|
||||
<i class="fas fa-store"></i> {{ __('Points de retrait') }}
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseCollecte" class="accordion-collapse collapse {{ ( request()->routeIs('bo.magasins*') || request()->routeIs('bo.creneaux*') ) ? 'show' : '' }}" aria-labelledby="headingCollecte" data-bs-parent="#accordionMenu">
|
||||
<div class="accordion-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{route('bo.magasins.index')}}">Magasins</a>
|
||||
<a class="nav-link" href="{{route('bo.magasins.index')}}">{{ __('Magasins') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingSettings">
|
||||
<button class="accordion-button {{ ( request()->routeIs('bo.settings*') ) ? '' : 'collapsed' }}" type="button" data-bs-toggle="collapse" data-bs-target="#collapseSettings" aria-expanded="true" aria-controls="collapseSettings">
|
||||
|
|
@ -155,160 +154,18 @@
|
|||
<div class="accordion-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{route('bo.settings')}}">Paramètres généraux</a>
|
||||
<a class="nav-link" href="{{route('bo.settings')}}">{{ __('Paramètres généraux') }}</a>
|
||||
@if(Auth::user()->role === 1)
|
||||
<a class="nav-link" href="{{route('bo.salaries.index')}}">{{ __('Import/Export des salariés') }}</a>
|
||||
@endif
|
||||
@if(!empty(Config::get('theme.bo_theme_settings')))
|
||||
<a class="nav-link" href="{{route('bo.themesettings')}}">Paramètres site public</a>
|
||||
<a class="nav-link" href="{{route('bo.themesettings')}}">{{ __('Paramètres site public') }}</a>
|
||||
@endif
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- <div class="card">
|
||||
<div class="card-header" id="headingSliders">
|
||||
<h2 class="mb-0">
|
||||
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapseSliders" aria-expanded="true" aria-controls="collapseOne">
|
||||
<i class="fas fa-tv"></i> Sliders
|
||||
</button>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="collapseSliders" class="collapse {{ ( request()->routeIs('bo.sliders*') || request()->routeIs('bo.slides*') ) ? 'show' : '' }}" aria-labelledby="headingSliders" tata-parent="#accordionMenu">
|
||||
<div class="card-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.sliders.index')}}">Sliders</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.slides.index')}}">Slides</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header" id="headingPages">
|
||||
<h2 class="mb-0">
|
||||
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapsePages" aria-expanded="true" aria-controls="collapseOne">
|
||||
<i class="far fa-file-word"></i> Pages
|
||||
</button>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="collapsePages" class="collapse {{ ( request()->routeIs('bo.content') || request()->routeIs('bo.faq') ) ? 'show' : '' }}" aria-labelledby="headingPages" tata-parent="#accordionMenu">
|
||||
<div class="card-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'accueil')}}">Accueil</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'contact')}}">Contact</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'legals')}}">Mentions Légales</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'cgv')}}">CGV</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.content', 'confidentialite')}}">Politique de confidentialité</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{route('bo.faq')}}">FAQ</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header" id="headingProduits">
|
||||
<h2 class="mb-0">
|
||||
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapseProduits" aria-expanded="true" aria-controls="collapseOne">
|
||||
<i class="fas fa-warehouse"></i> Catalogue
|
||||
</button>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="collapseProduits" class="collapse {{ ( request()->routeIs('bo.products*') || request()->routeIs('bo.ranges*') || request()->routeIs('bo.tags*') ) ? 'show' : '' }}" aria-labelledby="headingProduits" tata-parent="#accordionMenu">
|
||||
<div class="card-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{route('bo.products.index')}}">Produits</a>
|
||||
<a class="nav-link" href="{{route('bo.ranges.index')}}">Gammes de produits</a>
|
||||
<a class="nav-link" href="{{route('bo.tags.index')}}">Mots Clés</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header" id="headingMerchandising">
|
||||
<h2 class="mb-0">
|
||||
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapseMerchandising" aria-expanded="true" aria-controls="collapseOne">
|
||||
<i class="fas fa-cart-arrow-down"></i> Merchandising
|
||||
</button>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="collapseMerchandising" class="collapse {{ ( request()->routeIs('bo.promotions*') || request()->routeIs('bo.products.starred') ) ? 'show' : '' }}" aria-labelledby="headingMerchandising" tata-parent="#accordionMenu">
|
||||
<div class="card-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{route('bo.promotions.index')}}">Promotions</a>
|
||||
<a class="nav-link" href="{{route('bo.products.starred')}}">Mise en avant</a>
|
||||
{{--<a class="nav-link" href="#">Associations de produits</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Commandes -->
|
||||
<div class="card">
|
||||
<div class="card-header" id="headingOrders">
|
||||
<h2 class="mb-0">
|
||||
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapseOrders" aria-expanded="true" aria-controls="collapseOne">
|
||||
<i class="fas fa-cash-register"></i> Commandes
|
||||
</button>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="collapseOrders" class="collapse {{ ( request()->routeIs('bo.orders*') ) ? 'show' : '' }}" aria-labelledby="headingOrders" tata-parent="#accordionMenu">
|
||||
<div class="card-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{route('bo.orders')}}">Commandes</a>
|
||||
<a class="nav-link" href="{{route('bo.orders.today')}}">Commandes à retirer aujourd'hui</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Points de Collecte -->
|
||||
<div class="card">
|
||||
<div class="card-header" id="headingCollecte">
|
||||
<h2 class="mb-0">
|
||||
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapseCollecte" aria-expanded="true" aria-controls="collapseOne">
|
||||
<i class="fas fa-store"></i> Points de retrait
|
||||
</button>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="collapseCollecte" class="collapse {{ ( request()->routeIs('bo.magasins*') || request()->routeIs('bo.creneaux*') ) ? 'show' : '' }}" aria-labelledby="headingCollecte" tata-parent="#accordionMenu">
|
||||
<div class="card-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{route('bo.magasins.index')}}">Magasins</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header" id="headingSettings">
|
||||
<h2 class="mb-0">
|
||||
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapseSettings" aria-expanded="true" aria-controls="collapseOne">
|
||||
<i class="fas fa-cog"></i> Règlages
|
||||
</button>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="collapseSettings" class="collapse {{ ( request()->routeIs('bo.settings*') ) ? 'show' : '' }}" aria-labelledby="headingSettings" tata-parent="#accordionMenu">
|
||||
<div class="card-body">
|
||||
<ul class="nav flex-column mb-2">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{route('bo.settings')}}">Paramètres généraux</a>
|
||||
@if(!empty(Config::get('theme.bo_theme_settings')))
|
||||
<a class="nav-link" href="{{route('bo.themesettings')}}">Paramètres site public</a>
|
||||
@endif
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@ use App\Http\Controllers\Bo\FaqController;
|
|||
use App\Http\Controllers\Bo\SettingsController;
|
||||
use App\Http\Controllers\Bo\OrdersController;
|
||||
use App\Http\Controllers\Bo\CreneauxController;
|
||||
use App\Http\Controllers\Bo\MagasinsController;
|
||||
use App\Http\Controllers\Bo\ProductsController;
|
||||
use App\Http\Controllers\Bo\SlidesController;
|
||||
use App\Http\Controllers\Bo\TagsController;
|
||||
use App\Http\Controllers\Bo\SalariesController;
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------------
|
||||
|
|
@ -38,6 +43,14 @@ Route::namespace('App\Http\Controllers\Bo')
|
|||
->middleware(['auth', 'is-admin'])
|
||||
->group(
|
||||
function () {
|
||||
Route::middleware(['is-super-admin'])
|
||||
->group(
|
||||
function () {
|
||||
// Salaries.
|
||||
Route::get('/salaries', [SalariesController::class, 'index'])->name('salaries.index');
|
||||
Route::post('/salaries/file', [SalariesController::class, 'import'])->name('salaries.file');
|
||||
}
|
||||
);
|
||||
Route::get('/', [DashboardController::class, 'index'])->name('dashboard');
|
||||
Route::match(['get', 'put'], '/content/{key}', [ContentController::class, 'manage'])->name('content');
|
||||
Route::match(['get', 'put'], '/settings', [SettingsController::class, 'manage'])->name('settings');
|
||||
|
|
@ -52,67 +65,39 @@ Route::namespace('App\Http\Controllers\Bo')
|
|||
Route::post('/magasins/{id}/creneaux', [CreneauxController::class, 'updateSettings'])
|
||||
->name('creneaux.settings.update');
|
||||
// Exceptions de collecte.
|
||||
Route::post(
|
||||
'/ajax/save-creneaux-exception',
|
||||
[\App\Http\Controllers\Bo\MagasinsController::class, 'saveExceptions']
|
||||
);
|
||||
Route::post(
|
||||
'/ajax/delete-creneaux-exception',
|
||||
[\App\Http\Controllers\Bo\MagasinsController::class, 'destroyExceptions']
|
||||
);
|
||||
Route::post('/ajax/save-creneaux-exception', [MagasinsController::class, 'saveExceptions']);
|
||||
Route::post('/ajax/delete-creneaux-exception', [MagasinsController::class, 'destroyExceptions']);
|
||||
// Recherche d'inco.
|
||||
Route::post('/ajax/check-inco-data', [\App\Http\Controllers\Bo\ProductsController::class, 'checkIncoData']);
|
||||
Route::post(
|
||||
'/ajax/get-inco-images',
|
||||
[\App\Http\Controllers\Bo\ProductsController::class, 'getPrepareIncoImages']
|
||||
);
|
||||
Route::post('/ajax/set-inco-images', [\App\Http\Controllers\Bo\ProductsController::class, 'setIncoImage']);
|
||||
Route::post('/ajax/check-inco-data', [ProductsController::class, 'checkIncoData']);
|
||||
Route::post('/ajax/get-inco-images', [ProductsController::class, 'getPrepareIncoImages']);
|
||||
Route::post('/ajax/set-inco-images', [ProductsController::class, 'setIncoImage']);
|
||||
// Produits.
|
||||
// Route ajoutée avant la déclaration de route resource.
|
||||
// Sinon la forme /products/{product} l'emporte lors du routage.
|
||||
Route::get(
|
||||
'/products/starred',
|
||||
[\App\Http\Controllers\Bo\ProductsController::class, 'starred']
|
||||
)->name('products.starred');
|
||||
Route::get(
|
||||
'/products/create/{product_type?}',
|
||||
[\App\Http\Controllers\Bo\ProductsController::class, 'create']
|
||||
)->name('products.create');
|
||||
Route::resource(
|
||||
'products',
|
||||
'\App\Http\Controllers\Bo\ProductsController'
|
||||
)->except(['create', 'show']);
|
||||
Route::post(
|
||||
'/products/{product}/change-published',
|
||||
[\App\Http\Controllers\Bo\ProductsController::class, 'changePublished']
|
||||
)
|
||||
->name('products.change-published');
|
||||
Route::get('/products/starred', [ProductsController::class, 'starred'])->name('products.starred');
|
||||
Route::get('/products/create/{product_type?}', [ProductsController::class, 'create'])
|
||||
->name('products.create');
|
||||
Route::resource('products', 'ProductsController')->except(['create', 'show']);
|
||||
Route::post('/products/{product}/change-published', [ProductsController::class, 'changePublished'])
|
||||
->name('products.change-published');
|
||||
Route::get('/products/change-order/{product}/{direction}', [ProductsController::class, 'changeOrder'])
|
||||
->where('direction', 'up|down')->name('products.change-order');
|
||||
// Slides.
|
||||
Route::resource('slides', SlidesController::class)->except(['show']);
|
||||
Route::resource('sliders', SlidersController::class)->except(['show']);
|
||||
Route::resource('tags', TagsController::class)->except(['show']);
|
||||
Route::resource('promotions', PromotionsController::class)->except(['show']);
|
||||
Route::resource('magasins', MagasinsController::class)->except(['show']);
|
||||
Route::resources(['ranges' => RangesController::class]);
|
||||
Route::get(
|
||||
'/slide/change-order/{id}/{action}',
|
||||
[App\Http\Controllers\Bo\SlidesController::class, 'changeOrder']
|
||||
)->name('slides.change-order');
|
||||
Route::get(
|
||||
'/tag/change-order/{id}/{action}',
|
||||
[App\Http\Controllers\Bo\TagsController::class, 'changeOrder']
|
||||
)->name('tags.change-order');
|
||||
Route::get(
|
||||
'/tag/toggle-status/{id}',
|
||||
[App\Http\Controllers\Bo\TagsController::class, 'toggleStatus']
|
||||
)->name('tags.toggle-status');
|
||||
Route::get(
|
||||
'/customer-info/{id}/{mode?}',
|
||||
[OrdersController::class, 'getCustomerInfo']
|
||||
)->name('get-customer-info');
|
||||
Route::get(
|
||||
'/magasin-info/{id}/{mode?}',
|
||||
[App\Http\Controllers\Bo\MagasinsController::class, 'getMagasinInfo']
|
||||
)->name('get-magasin-info');
|
||||
Route::get('/slide/change-order/{id}/{action}', [SlidesController::class, 'changeOrder'])
|
||||
->name('slides.change-order');
|
||||
Route::get('/tag/change-order/{id}/{action}', [TagsController::class, 'changeOrder'])
|
||||
->name('tags.change-order');
|
||||
Route::get('/tag/toggle-status/{id}', [TagsController::class, 'toggleStatus'])->name('tags.toggle-status');
|
||||
Route::get('/customer-info/{id}/{mode?}', [OrdersController::class, 'getCustomerInfo'])
|
||||
->name('get-customer-info');
|
||||
Route::get('/magasin-info/{id}/{mode?}', [MagasinsController::class, 'getMagasinInfo'])
|
||||
->name('get-magasin-info');
|
||||
// Commandes.
|
||||
Route::get('/orders', [OrdersController::class, 'index'])->name('orders');
|
||||
Route::get('/orders/today', [OrdersController::class, 'today'])->name('orders.today');
|
||||
|
|
|
|||
4
webpack.mix.js
vendored
4
webpack.mix.js
vendored
|
|
@ -32,7 +32,9 @@ mix.js('resources/views/front/' + process.env.APP_THEME + '/js/app.js', 'public/
|
|||
.sass('resources/views/front/' + process.env.APP_THEME + '/sass/app.scss', 'public/' + process.env.APP_THEME + '/css')
|
||||
.options({
|
||||
processCssUrls: false
|
||||
});
|
||||
})
|
||||
.version();
|
||||
|
||||
|
||||
mix.copyDirectory('resources/views/front/' + process.env.APP_THEME + '/img', 'public/' + process.env.APP_THEME + '/img/')
|
||||
.copyDirectory('resources/views/front/' + process.env.APP_THEME + '/fonts', 'public/' + process.env.APP_THEME + '/fonts/');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue