public function calculateNextFreeNumber()
    {
        $year = (new \DateTime())->format('Y');

        /** @var \Railken\Amethyst\Models\InvoiceModel */
        $result = $this->getManager()
            ->getRepository()
            ->newQuery()
            ->where('number', 'like', '%/'.$year)
            ->orderBy(DB::raw("CAST(REPLACE(number, '/{$year}', '') AS DECIMAL(10,2))"), 'desc')
            ->first();

        $number = $result ? intval(str_replace("/{$year}", '', $result->number)) + 1 : 1;

        return $number.'/'.$year;
    }