| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/erp/horilla_api/api_methods/employee/__pycache__/ |
Upload File : |
o
hͦh� � @ s0 d dl Z d dlmZ d dlT d dlT dd� ZdS )� N)�
eval_validate)�*c
C s� ddl m} ddlm} | d�d }|� }g }z�|D ].}|D ])}t|t�rG|�� �|�� �rG|�|�}|d t |�k rG||d }t
�d|�}qq|r�g }d}t|�D ]M}t |�} d}
|D ]}|d krh|
d }
q] |
rq||
d� }t|t
�rz|d
}|s�ttt|��t�r�t|�d }d}t|t�r�d�|| �}|�dt|�� qSd
�|�}W |S W |S ty� } z
| d�d }W Y d}~|S d}~ww )z2
This method is used to generate badge id
r )�get_initial_prefix)�get_ordered_badge_idsNr � z[a-zA-Z]+|\d+|[^a-zA-Z\d\s]F�0���Tz{:0{}d}� )�base.context_processorsr �employee.methods.methodsr �
isinstance�str�lower�
startswith�index�len�re�findall�reversed�listr �int�format�insert�join� Exception)
r r �prefix�data�result�sublist�itemr �incremented�
total_letters�total_zero_leads�letter�e� r% �8/var/www/erp/horilla_api/api_methods/employee/methods.py�get_next_badge_id sZ
��
����r'