# Auto Periodic Expenses

https://docs.wisecp.com/es/auto-periodic-expenses

A fixed cost that leaves the vault the same day every month, written once so the panel books it.

## Reaching the Screen

Panel menu: **Billing** then **Cash Management**, and the **Periodic Expenses** button there: `{admin}/invoices/periodic-expenses`

The screen has no menu entry. **Back to Vault** goes back to Cash Management. With the invoice system off the **Billing** entries leave the menu, but the address works.

It opens for staff who can see invoices. Without the invoice operation right, **Add New Entry**, the tick boxes, the bulk box, the row menu and its dialog are absent.

## What Is on the Screen

A note, two figures with the page actions, a filter row, and the list.

- **The two figures**: What the rules add up to, and how many.
- **The list of rules**: One row per rule: description, amount, day and time, and when it was written.
- **Advanced Filter**: Four filters over the same list.
- **The table strip**: Above the list. A search box, a rows per page selector, and a download menu for CSV, JSON or XML.

### The two figures

**Total Expense Records** reads like a count but is money: every rule's amount, converted into the local currency.

**Active Schedules** is the count, and every rule is counted. A rule has no on and off switch, so delete the ones you no longer want.

### The list of rules

**Description** is the text written on the vault entry. **Amount** is the sum in the rule's own currency. **Period** is a chip with the day and time, for example `15th Day, 09:00`. **Created** is the date the rule was written, and editing does not move it.

**Amount** and **Created** can be sorted; **Description** and **Period** cannot.

### When a rule fires

One scheduled task, **Recurring Expenses**, checks every rule once a minute. It books the ones whose turn has come.

A rule's turn comes when today matches its day and the clock reaches its time. The booking can land up to five minutes later. That window closes on the hour: a rule set for 09:58 can only be booked at 09:58 or 09:59. The entry always carries the planned minute.

A duplicate check compares description, amount, currency and minute, so a late round cannot book twice. Two rules matching in all four produce one entry, and a matching hand-written entry stops the automatic one.

It writes an ordinary vault expense with the rule's description, amount and currency. No staff member or payment method is recorded, so Cash Management shows **System**. It is not tied to an invoice, so you can edit or delete it there.

### The filters

**Advanced Filter** holds four. **Item Description** searches inside the description, **Currency** narrows to one currency and **Amount** filters on the amount. **Date Range** works on the date the rule was created, not the day it fires.

The panel opens by itself when a filter has a value; the button counts them.

## Fields

**Add New Entry** and the row menu's **Edit** open the same form.

- **Amount**: Required, greater than zero, in the format of the currency beside it.
- **Currency**: Required. Inside the amount box with no label of its own, listing the currencies switched on. Editing a rule whose currency was switched off puts it back on the list.
- **Description**: Optional, but worth writing: it is copied on to every vault entry, and the duplicate check compares it.
- **Period (day)**: Required, starts at the 1st. One **Period** label covers two controls; this is the first: **Every Month**, then the day, then **Day**. It runs from 1 to 31, and a month without that day is skipped.
- **Period (time)**: Required, starts at the current time. The clock box beside the day, 24 hour.

Above the list:

- **Apply to selected**: Only for staff with the invoice operation right. It acts on the ticked rows; the one action is **Delete**.

## Tasks

### Write a new rule

1. Click **Add New Entry**.
2. Fill in the amount with its currency, and a description that identifies the expense in the vault.
3. Pick the day of the month and the time, then click **Add**.
4. The rule joins the list with its **Period** chip. Nothing is booked until that day and time arrive.

### Change a rule

1. Open the row menu and choose **Edit**.
2. Change what you need and click **Save**. The row shows the new values at once, **Created** stays put, and entries already in the vault keep their values.

### Delete rules

1. Use **Delete** in a rule's row menu. For several, tick the rows and pick **Delete** under **Apply to selected**.
2. Deleting one shows its description and amount; several show only a count. Confirm.
3. The rows leave the list; the entries they created stay in the vault.

### Check that an expense was booked

1. Once the rule's day and time have passed, open Cash Management with **Back to Vault**.
2. Look for an expense with the rule's description at the planned time; the handler reads **System**.
3. If it is missing, open the automation dashboard and find the **Recurring Expenses** task.

## Things to Watch

> **A missed window is never caught up**
> 
> A rule is booked only within five minutes of its time. That window closes on the hour, so 09:58 leaves two minutes. If the automation worker is down then, the expense is not booked that month and nothing retries. Add it by hand in Cash Management, and pick a minute below 55 for a payment you cannot miss.

> **Deleting a rule leaves what it already booked**
> 
> A rule and the vault entries it creates are separate records. Deleting the rule stops future entries and cannot be undone. The expenses already in the vault stay, and go only one by one. Editing works the same way: it reaches the entries still to come.

> **A day the month does not have is skipped**
> 
> The rule fires when the day of the month matches. The 29th, 30th and 31st never come round in shorter months. For a monthly commitment, pick a day of 28 or lower.

## Required Privileges

The list opens for `INVOICES_LOOK` or `INVOICES_OPERATION`; either is enough.

Adding, editing and deleting need `INVOICES_OPERATION`. The **Cash Management** menu entry needs `INVOICES_CASH`; downloading needs `TABLE_EXPORT`.

## Related Articles

- [Cash Management](https://docs.wisecp.com/en/cash-management)
- [Automation Overview](https://docs.wisecp.com/en/automation-overview)
- [Currencies](https://docs.wisecp.com/en/currencies)
