# Invoice subtypes problem

**URL:** <https://www.dolibarr.org/forum/t/invoice-subtypes-problem/25184>\
**Category:** Financial modules\
**Created:** [April 8, 2024, 1:54am UTC](https://www.dolibarr.org/forum/t/invoice-subtypes-problem/25184 "2024-04-08T01:54:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsmontalvo](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jsmontalvo](https://www.dolibarr.org/forum/u/jsmontalvo)\
**Post date:** [April 8, 2024, 1:54am UTC](https://www.dolibarr.org/forum/t/invoice-subtypes-problem/25184/1 "2024-04-08T01:54:36Z")

</div>

Hello,  
I use version 19.0.1 and in setup-other, I activated INVOICE\_SUBTYPE\_ENABLED.  
In the database for the llx\_c\_invoice\_subtype table I registered three invoice subtypes.  
But I can’t find a way to enter the masks and serial numbers of the subtypes.  
Can you help me please.

---

<div class="post-metadata">

**Author:** ![sonikf](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sonikf](https://www.dolibarr.org/forum/u/sonikf)\
**Post date:** [April 8, 2024, 12:57pm UTC](https://www.dolibarr.org/forum/t/invoice-subtypes-problem/25184/2 "2024-04-08T12:57:01Z")

</div>

Hi @jsmontalvo

You have to use free module

> **[CTPT](https://www.dolistore.com/en/modules/1834-CTPT.html)**
>
> CTPT

setup instructions

> **[Home](https://github.com/sonikf/ctpt/wiki)**
>
> A dolibarr module . Contribute to sonikf/ctpt development by creating an account on GitHub.

Can you describe your use case?  
Are these subtypes compulsory for your country?

---

<div class="post-metadata">

**Author:** ![jsmontalvo](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jsmontalvo](https://www.dolibarr.org/forum/u/jsmontalvo)\
**Post date:** [April 8, 2024, 3:08pm UTC](https://www.dolibarr.org/forum/t/invoice-subtypes-problem/25184/3 "2024-04-08T15:08:12Z")

</div>

Hello sonikf,  
In Peru we use the sales documents: Factura (Invoice standar), Boleta de Venta (new invoice type or invoice subtype) and Nota de Credito(Credit Note).  
Each one has an independent mask and serial number.  
By default, Dolibarr contains the Invoice and Credit Note cases but not the “Boleta de Venta”.  
I proceeded as you recommend, you can see it in the attached images.  
The “Boleta de Venta” does not appear in the invoice and credit numbering module (mercure).  
And when I make a new invoice both the invoice subtype and the CTPT series are additional fields.  
But what I need is for the invoice ref field to take an independent mask and serial number for the “Boleta de Venta”

---

<div class="post-metadata">

**Author:** ![sonikf](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sonikf](https://www.dolibarr.org/forum/u/sonikf)\
**Post date:** [April 8, 2024, 6:46pm UTC](https://www.dolibarr.org/forum/t/invoice-subtypes-problem/25184/4 "2024-04-08T18:46:54Z")

</div>

Hi @jsmontalvo  
You forgot the images but no worries  
What is the difference between Factura and Boleta de Venta?  
In subtype dictionary create 2 entries Factura and Boleta de Venta  
If they are similar you have to create 2 entries in third party type dictionary for example TE\_FAC for Factura and TE\_BOL for Boleta de Venta. Then in Mercure setup for standard invoice only you have to enter {yyy}-{0000} for example.  
In invoice creation screen then you leave always invoice radio as is and choose from subtype combo Boleta de Venta for example and Boleta de Venta from CTPT series combo and when you validate the ref will be BOL-0001  
If you choose Factura in both combos ref will be FAC-0001 and so on…

---

<div class="post-metadata">

**Author:** ![jsmontalvo](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jsmontalvo](https://www.dolibarr.org/forum/u/jsmontalvo)\
**Post date:** [April 9, 2024, 2:10am UTC](https://www.dolibarr.org/forum/t/invoice-subtypes-problem/25184/5 "2024-04-09T02:10:12Z")

</div>

Hello sonikf,

Thank you very much for your help, it worked fine.  
The only thing I had to change was {tttt} to {yyyy} since the series are 4 alphanumeric characters.  
It is not necessary to activate INVOICE\_SUBTYPE\_ENABLED in setup-others.
