> For the complete documentation index, see [llms.txt](https://docs.openstamanager.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openstamanager.com/2.7.2/guide/esempi/fatturazione-elettronica/codice-identificativo-documento-e-cig.md).

# Codice identificativo documento e CIG

Guida al Codice identificativo documento e CIG in OpenSTAManager

{% hint style="info" %}
Quando si vuole emettere una fattura verso le PA è necessario riportare il **CIG** e il **Codice identificativo documento**. Come inserire questi due parametri in **OpenSTAManager**?
{% endhint %}

Il primo passo è quello di specificare nella creazione di un'anagrafica la tipologia **Ente pubblico** o **Azienda**:

![](https://content.gitbook.com/content/gn8Ljr2tGg6ZmZiv74Ca/blobs/k0HHmINDYl9Uzv1p0sbC/AnagraficaPerCIG.png)

Se l'anagrafica è già stata creata basta modificarla e selezionare tipologia **Ente pubblico** o **Azienda:**

![](https://firebasestorage.googleapis.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZJeLg23eVDvrCv74U7-887967055%2Fuploads%2FppIgLUMrxwcgNmLNZNEW%2Ffile.png?alt=media)

Ora, nella creazione di un **Contratto**, è possibile compilare i campi necessari per l'emissione di una Fattura verso le PA:

![](https://content.gitbook.com/content/gn8Ljr2tGg6ZmZiv74Ca/blobs/KamTAg8LMS9JgjkXEXth/DatiAppalto.png)

I **Dati appalto** verranno visualizzati quando si aggiunge un **Contratto** ad una **fattura di vendita,** in questo modo è possibile verificare se sono stati inseriti.

![](https://content.gitbook.com/content/gn8Ljr2tGg6ZmZiv74Ca/blobs/lTYTyae5yG9axFN7HIo1/AggiuntoFattureDiVendita.png)

Un' ulteriore verifica della presenza o meno dei **Dati appalto** è disponibile nell'anteprima della fattura, visualizzabile tramite il pulsante **Visualizza** in **Fatturazione elettronica:**

![](https://content.gitbook.com/content/gn8Ljr2tGg6ZmZiv74Ca/blobs/iGRYLQkkjFX74pSeN2ZB/image.png)

![](https://content.gitbook.com/content/gn8Ljr2tGg6ZmZiv74Ca/blobs/7nrq5jkVrlhisodujSsv/VisualizzaCIGeCodiceIdentificavoDocumento.png)

Infine sono visibili nel file XML generato:

![](https://content.gitbook.com/content/gn8Ljr2tGg6ZmZiv74Ca/blobs/imQ5ffuFowOTYZEzSva8/CIGeCodiceIdentificativoDocumentoXML.png)

{% hint style="info" %}
La logica precedentemente spiegata vale per l'inserimento di **Contratti, Ordini cliente** e **Interventi.**
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.openstamanager.com/2.7.2/guide/esempi/fatturazione-elettronica/codice-identificativo-documento-e-cig.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
