> ## Documentation Index
> Fetch the complete documentation index at: https://docs.filexpress.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Expenses / Purchases

> Register supplier invoices and control pending payments

The Expenses module lets you register all purchases and operating expenses: supplier invoices, services, materials and any other business expense.

## Register an expense

**1. Go to Expenses → New Expense**

**2. Select the supplier**

If the supplier doesn't exist, create it first in the [Suppliers](https://docs.filexpress.app/en/docs/ventas/proveedores.md) module.

**3. Add the detail**

Enter the items, quantities and amounts of the expense.

**4. Set the payment terms**

Select **Cash** (already paid) or **Credit** (paid later) with its term in days.

**5. Save the expense**

## Register a payment on a credit expense

Open the expense's detail → **Register payment** → enter amount and method → save. The balance is updated with each payment.

If the method is cash you can choose the petty cash fund the payment is made from (empty = general cash); if it is check, the **Checkbook**. The payment's **Cost center** is optional (empty = the purchase's).

## Credit and debit notes

A **credit note** reduces the balance of the CCF (Comprobante de Crédito Fiscal, tax credit invoice) it references and a **debit note** increases it; in the Purchases Book, NC subtract and ND add. When you open the detail of a note (or edit it) you see the related document; and in the base document's detail, the **Related documents** card appears with the notes applied. The same behavior applies to sales, with their Guatemala equivalents (`ncre`/`ndeb`) and United States equivalents (`cm`/`dm`).

## Available filters

* By date, supplier, status or document type.
* View expense statistics by period from the list view.

## Supplier document

From the expense's detail you can view or download the tax document received from the supplier (the supplier's DTE).

## Advanced purchase options

The **Advanced options** button on the purchase form classifies the purchase for accounting and tax annexes. The window has two tabs: **Classification** (category, classification, sector and cost type) and **Cost center**.

| Option | Use |
| - | - |
| **Purchase Category** | Groups the purchase (materials, labor, services...) for expense reports and analysis. You can create new categories from there. |
| **Classification** | Classification code of the purchase reported in the [purchases book](https://docs.filexpress.app/en/docs/ventas/libros-iva.md) for the Ministry of Finance (Hacienda). |
| **Sector** | Sector code reported in the purchases book. |
| **Cost type** | Cost or expense type code reported in the purchases book. |
| **Cost center** | The purchase's [cost center](https://docs.filexpress.app/en/docs/contabilidad/centros-de-costo.md) and, per line, **Cost center** (empty = uses the purchase's). When posting to accounting, the expense is split by account and center. |

In addition, on each purchase line you can:

* **Search for an inventory product** to autocomplete SKU, name and price.
* Enable **Add to inventory** so the product is registered or increased in inventory when saving.
* Review the **purchase cost**, the **margin** and decide whether to **update the product's sale price**.

## Receive purchases by email

Each branch has its own **purchases email**. When you forward to that address the email with the DTE your supplier sends you (JSON and PDF), FileXpress registers the purchase automatically.

**1. Copy the purchases email**

In **Purchases**, the **Purchases email** button in the header opens a window with the branch's email and a button to copy it. It only appears if the branch has a purchases email assigned.

**2. Forward your suppliers' DTEs to that email**

You can also give it to your suppliers so they send DTEs directly there, or create an automatic forwarding rule in your email.

**3. Review the received purchases**

Purchases arrive with **Requires review** status. Check the data and use **Approve** (individual) or **Approve selected** (in bulk).

| Behavior | Detail |
| - | - |
| **Accepted documents** | Invoice (01), Tax Credit (03), Credit Note (05) and Debit Note (06). |
| **Recipient** | The DTE's recipient NIT must be your company's; if it doesn't match, the document is discarded. |
| **Supplier** | Looked up by NRC, NIT or name and contact data. If it doesn't exist, it is created automatically. |
| **Duplicates** | The same DTE (supplier, branch and generation code) is not registered twice, even if it is forwarded again. |
| **Inventory** | Does not move until you **approve** the purchase. |
| **PDF and JSON** | Saved with the purchase. The supplier's PDF is available in the Purchases **PDF viewer** (*View PDF* action) and the JSON can be downloaded. |

> [!TIP]
>
> Ideal for avoiding manual entry of purchases: all suppliers' electronic invoices are registered with their exact amounts and taxes, ready to approve and [post to accounting](https://docs.filexpress.app/en/docs/contabilidad/procesar-documentos.md).

## Bulk import of purchases

> [!NOTE]
>
> Available only for **El Salvador** branches.

The **Import purchases** button in the list loads several supplier documents at once. A three-step wizard opens: **Upload files**, **Preview** and **Result**. Nothing is saved until you confirm the preview.

**1. Upload the files**

Choose one of the two options:

| Source | What to upload |
| - | - |
| **DTE JSON** | Several `.json` files of the DTEs your suppliers sent you. |
| **Excel/CSV template** | A single `.xlsx` or `.csv` file with the template, one row per document. Download it with **Download Excel template**. |

Limits: up to **200 documents** per batch and **5 MB** per file.

**2. Generate and review the preview**

Each document appears with its status, source, type, date, supplier (**Existing** or **Will be created**), total and detail. The batch totals show how many documents will be imported, how many are duplicates and how many have errors. You can filter by status.

**3. Import**

Click **Import N purchase(s)**. The preview expires after 30 minutes; if it expires, generate it again.

**4. Review the result**

The **created** purchases, the **duplicates skipped** and the ones that failed are shown. **Download errors (CSV)** exports the detail of what could not be imported.

### Preview statuses

| Status | Meaning |
| - | - |
| **OK** | Will be imported without remarks. |
| **Warning** | Will be imported, but there is something to review (for example, an empty NRC or an VAT (IVA) that is not 13%). |
| **Error** | Will not be imported. The detail indicates what to fix. |
| **Duplicate** | A purchase from the same supplier and document already exists in the branch (or the document is repeated in the batch). It is skipped without error. |

### Template columns

The template's **Purchases** sheet has these columns (the *Instructions* and *References* sheets explain the values and list document types, terms and categories):

| Column | Required | Description |
| - | - | - |
| **Issue date** | Yes | `YYYY-MM-DD` or `DD/MM/YYYY`. |
| **Document type** | Yes | `CCF`, `FC`, `NC` or `ND`. |
| **Generation code** | One of the two | DTE code. It is the key for detecting duplicates. |
| **Control number** | One of the two | Document control number. |
| **Supplier NIT** | Yes | |
| **Supplier NRC** | No | Recommended for CCF, NC and ND. |
| **Supplier name** | Yes | If the supplier doesn't exist, it is created on confirmation. |
| **Purchase category** | No | Must exist in the system. |
| **Description** | No | Purchase concept. |
| **Total taxed**, **Total exempt**, **Total non-taxable** | No | Amounts by tax treatment. |
| **VAT** | No | Value-added tax. |
| **COTRANS**, **FOVIAL** | No | Fixed taxes (optional). |
| **Withholdings** | No | **VAT withheld** (for example, 1%). Subtracted from the amount to pay. |
| **Income tax withheld** | No | Income tax withholding. Subtracted from the amount to pay. |
| **Total** | Yes | Must match the amounts (see below). |
| **Condition** | No | `Contado` (cash, default) or `Crédito` (credit). |
| **Credit days** | No | Credit only. If omitted, 30 is assumed. |

> [!WARNING]
>
> The **Total** must equal **taxed + exempt + non-taxable + VAT + COTRANS + FOVIAL** (tolerance of 0.02). Withholdings are not part of this sum: they are subtracted afterward to obtain the amount to pay and cannot exceed the total.

### Import rules

| Rule | Detail |
| - | - |
| **Cash purchases** | Left with a **cash payment** for the amount to pay, without moving petty cash or bank. Credit notes do not generate a payment. |
| **Credit purchases** | Left pending in [Accounts payable](https://docs.filexpress.app/en/docs/finanzas/cuentas-pagar.md). |
| **Debit Note (ND)** | Supported, both in JSON and in the template. |
| **Factura de Sujeto Excluido (FSE, excluded-subject invoice)** | **Cannot be imported**: it is issued from **New expense**. |
| **DTE recipient** | In JSON files, the recipient NIT/NRC must be your company's; otherwise, the document is rejected. |
| **Duplicates** | Skipped without error, even if the document is uploaded again. |
| **Inventory** | Imported purchases are not recorded in inventory. |

## Foreign-currency purchases

If your company has active foreign currencies, the purchase form shows the **Document currency** selector with its exchange rate. Amounts are entered in that currency and the system stores them in the base currency. See [Multi-currency](https://docs.filexpress.app/en/docs/sistema/multi-moneda.md).

## Void a purchase

Purchases issued by your company (for example, the Factura de Sujeto Excluido) can be voided from the list's actions menu. The **Invalidated** status filter shows voided purchases.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.