# Faktura

## Display attribute on every line item

If you want to display a specific attribute (like the Purchase Order number) on every line item, follow the steps below. The approach will differ depending on whether you need the attribute in the JSON extraction or in the XSL output.

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-c43633752eac0ac5f67c4c2a9faa2faa178321fe%2FScreenshot%202025-01-28%20at%2014.33.16.png?alt=media" alt=""><figcaption></figcaption></figure>

### Method 1: Display Attribute in the JSON Extraction (DocBits config)

1. Go to **Settings**
2. Go to **Document Types**
3. Select **Invoice/E-Doc**

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-420a43915a5baa2395ea65798c880f4b560e24fd%2FScreenshot%202025-01-28%20at%2015.07.58.png?alt=media" alt=""><figcaption></figcaption></figure>

4. Open the **"FATTURAPA"** tab
5. Click on **JSON**

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-be82875d5375a30731acb72b542c020ea24b77b5%2FScreenshot%202025-01-28%20at%2015.01.13.png?alt=media" alt=""><figcaption></figcaption></figure>

6. To create a draft, click the **pen** icon

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-dab5b13097927c4f0fd739cf6719ce33ac0a8600%2FScreenshot%202025-01-28%20at%2014.58.56.png?alt=media" alt=""><figcaption></figcaption></figure>

7. Inside the `"tables"` array, add the specific column you want to display by providing a name and path:

```
{ 
"name": "PURCHASE_ORDER",    
"path":"path_to_source" 
}
```

**NOTE:** E-documents will always have the origin set to **Great Britain**, so the amounts will be saved in international format, using a **dot (.)** as the decimal separator.

8. Save the draft

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-19950b35c57d857d958968028bb937f8f0355ba4%2FScreenshot%202025-01-28%20at%2015.11.04.png?alt=media" alt=""><figcaption></figcaption></figure>

9. Make sure that your draft is the **active** one.

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-05594a6103e4aadc3ce87d35511c0d6caa11dbf9%2FScreenshot%202025-01-28%20at%2016.03.50.png?alt=media" alt=""><figcaption></figcaption></figure>

### Method 2: Display Attribute in the XSL Output (HTML/PDF preview)

1. Go to **Settings**
2. Go to **Document Types**
3. Select **Invoice/E-Doc**

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-420a43915a5baa2395ea65798c880f4b560e24fd%2FScreenshot%202025-01-28%20at%2015.07.58.png?alt=media" alt=""><figcaption></figcaption></figure>

4. Open the **"FATTURAPA"** tab
5. **Click on XLST**

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-a9d423801b9ac9d2f821bd2f374985deff8573cd%2FScreenshot%202025-01-28%20at%2015.23.06.png?alt=media" alt=""><figcaption></figcaption></figure>

6. To create a draft, click the **pen** icon

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-dab5b13097927c4f0fd739cf6719ce33ac0a8600%2FScreenshot%202025-01-28%20at%2014.58.56.png?alt=media" alt=""><figcaption></figcaption></figure>

7. In the `<xsl:for-each select="path">` block that generates the table rows, add a snippet like this where you want the attribute to appear (e.g., in its own column):

```
<tr>
    <!-- Other columns ... -->

    <td>
        <!-- PO number -->
        <xsl:variable name="variable_name" select="value" />
        <xsl:value-of 
            select="path_to_attribute" 
        />
    </td>
</tr>
```

**NOTE:** E-documents will always have the origin set to **Great Britain**, so the amounts will be saved in international format, using a **dot (.)** as the decimal separator.

8. Save the draft

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-19950b35c57d857d958968028bb937f8f0355ba4%2FScreenshot%202025-01-28%20at%2015.11.04.png?alt=media" alt=""><figcaption></figcaption></figure>

9. Make sure that your draft is the **active** one.

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-05594a6103e4aadc3ce87d35511c0d6caa11dbf9%2FScreenshot%202025-01-28%20at%2016.03.50.png?alt=media" alt=""><figcaption></figcaption></figure>
