# Document types

# Overview

Document types are used in the ERP, to tell apart documents with different purposes, for example **Sale** **orders** and **Calibration** **orders** ( Both are orders, but of different types ). Document types are always connected to the document, whose sub-type they are.

![image.png](https://how-to-erp.dewesoft.com/uploads/images/gallery/2024-04/scaled-1680-/laqimage.png)

Users with proper permissions can add new and edit existing document types. Document types can also be exported into an excel file.

# Create new document type

<p class="callout danger">This action requires the **"create document type"** permission.</p>

Creating a new document type requires no special procedures. When on document types' table view, click the **"Add new"** button to open the **"Add new form".**

![image.png](https://how-to-erp.dewesoft.com/uploads/images/gallery/2024-05/scaled-1680-/4Zaimage.png)

While filling out the form, select a document to which this document type belongs. After adding it's name, you have to write a formula, that will be used to generate document numbers for this document type.

<p class="callout info">Adding a generator formula is important, because the formula defines the structure of a document type's document number.</p>

In this example, the formula is **NEW-QUOTE-%5N-%YYYY**, which will generate document numbers, structured as NEW-QUOTE-00001-2024.

**NEW-QUOTE-** is the prefix that is always the same for all instances of the document type.

**%5N** is markdown, that defines this as 5 numbers, starting from 00001 up to 99999.

**%YYYY** is markdown, that defines the date, formatted as year, eg. 2024.

<p class="callout warning">The **document number prefix** should **always** be **unique** to the document type in order to avoid confusion. These prefixes are also useful for quickly discerning a document's type.   
</p>

![image.png](https://how-to-erp.dewesoft.com/uploads/images/gallery/2024-05/scaled-1680-/5OEimage.png)

To begin using it, just toggle the **"Enabled"** switch to Yes, ans save the new document type.

# Update existing document types

<p class="callout danger">This action requires the **"update document type"** permission.</p>

When updating a document type, all information, with the exception of the generator formula, can be changed.

<p class="callout danger">The generator formula must not be changed without consult. If a different document number is required, a new document type with the proper generator formula should be created.</p>

[![image.png](https://how-to-erp.dewesoft.com/uploads/images/gallery/2024-05/scaled-1680-/dWoimage.png)](https://how-to-erp.dewesoft.com/uploads/images/gallery/2024-05/dWoimage.png)

t

# Delete document types

<p class="callout danger">For deletion of existing document types, contact your ERP's administrator.</p>