Custom Module to Generate Quotation Number - Issue with multiple prefix

Custom Module to Generate Quotation Number - Issue with multiple prefix

Hi everyone,

I created a custom module to generate a simple quotation number based on the auto number field (with 1 prefix PM) - i.e PM-1000, PM-1001,.. etc

What we would like to achieve now is to have multiple prefix based on selected criteria and a date (auto date?) as suffix. In our fields to generate quote number we have this:

Type: Trading, IBD - SEA, IBD - EMEA

What we would like to achieve is
Prefix based on Type field (PT, PM, PI) + Auto Number + Date
If we select Trading in the field, it should generate PT-0001-01012020 
If we select IBD Sea, it would then be PM-0001-01012020
If we select IBD EMEA, it would be PI-0001-01012020

Is this possible?