billing frontend for mariadb. setup as otb_billing for outsidethebox.top accounting. also involved with outsidethedb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
import re |
|
|
|
def generate_client_code(company_name, last_number): |
|
# remove non letters |
|
cleaned = re.sub(r'[^A-Za-z]', '', company_name.upper()) |
|
|
|
# first 5 characters |
|
suffix = cleaned[:5] |
|
|
|
number = last_number + 1 |
|
|
|
code = f"{number:04d}-{suffix}" |
|
|
|
return code
|
|
|