diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 9f113d6..096d564 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -6,6 +6,7 @@ use App\Enums\Invoice\TaskType; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Str; use Kwaadpepper\CrudPolicies\Enums\CrudAction; use Kwaadpepper\CrudPolicies\Enums\CrudType; @@ -255,7 +256,7 @@ class Invoice extends Model Str::padLeft((Invoice::whereYear('created_at', Carbon::now()->isoFormat('YYYY')) ->whereMonth('created_at', Carbon::now()->isoFormat('MM')) ->count() + 1) ?: 1, 4, '0'), - Str::substr(Str::upper(Str::slug(User::query()->inRandomOrder()->first()->name)), 0, 1) + Str::substr(Str::upper(Str::slug(Auth::user()->name)), 0, 1) ); $model->total_days = collect($model->tasks) /** @var null|float $previous */ diff --git a/resources/ts/components/ScheduleComponent.vue b/resources/ts/components/ScheduleComponent.vue index bdf56c6..be46413 100644 --- a/resources/ts/components/ScheduleComponent.vue +++ b/resources/ts/components/ScheduleComponent.vue @@ -729,7 +729,9 @@ export default defineComponent({ value: "", }, currentModale: Modale = { - id: this.schedules[userid][slotkey][day as any]["id"] ?? this.__("Nouveau"), + id: + this.schedules[userid][slotkey][day as any]["id"] ?? + this.__("Nouveau"), userid: userid, slot: slotkey, day: day, @@ -871,7 +873,11 @@ export default defineComponent({ if (search !== false && search !== null) { this.searchText = search; } - route += "?page=" + this.page; + if (route.indexOf("?") < 0) { + route += "?page=" + this.page; + } else { + route += "&page=" + this.page; + } route += "&s=" + this.searchText; this.loading = true; axios