Cost Control
You can attach an invoice to the cost item it settles, and open or remove it later.
An invoice goes on the cost item it settles. KOSMA saves it in the cost control set, in the **Attachments** panel of that cost item. For files on the accounts of a budget, see [attach files to accounts](/kb/article/attach-files-to-accounts).
In **Cost Items**, click the cost item the invoice belongs to. KOSMA shows **Cost Item Details** with the **Attachments** panel.
If you select the account row instead, you see the attachments of the budget account, but you cannot add or remove a file there.
To add a file, point at the title of the **Attachments** panel and click  **Add attachment**, or click the empty panel. KOSMA opens your computer's file dialog. Choose one or more files. You can also drag files from your computer and drop them on **Cost Item Details**. KOSMA lists each file by its name, for example Invoice 114.pdf.
A cost item can hold up to 8 files of up to 2 MB each. KOSMA accepts PDF, Word, Excel and RTF files, text files such as TXT or CSV, and images such as JPG, PNG or HEIC. KOSMA skips a larger file, a file of another type and any file beyond the eighth. A message names the file and the reason.
If you select several cost items, the **Attachments** panel shows only the files that all of them have. A file you then add goes to every selected cost item.
Name the file with the invoice number. Anyone who checks the cost item then finds the invoice by the number in the books.
To open an invoice, click its name in the **Attachments** panel. KOSMA opens the file.
KOSMA removes a file without asking. If several cost items are selected, KOSMA removes the file from all of them.
To remove a file, point at its row and click  **Delete attachment**. To get it back, press ⌘Z (Ctrl+Z on Windows), or revert the change in [History](/kb/article/see-and-revert-changes-in-history).
**Replace an invoice.** To put a new version in its place, point at the title of the **Attachments** panel and click  **Replace file…**. Choose the new file. Every cost item that shares this file, for example because you added it to several at once, then shows the new one. **Replace file…** appears only when you have selected one cost item and it holds exactly one file.
**If an invoice is not on this computer yet.** A file someone else adds appears at once. Its content arrives a moment later, and until then a spinner shows in the file's row. If you open the file before that, KOSMA waits for it. If KOSMA cannot download the file, its row shows  **Not available yet**, and opening it shows an error with the code `KOSMA-E-2044`.
**Where KOSMA saves the invoice.** KOSMA copies the file into the cost control set. The attachment does not depend on the original on your computer: if you move or delete the original, the attachment stays. Attached files make the set larger.
**If you cannot add a file.** You cannot add, replace or remove files if your licence does not cover Cost Control, if the set was shared with you for reading only, or if you are not signed in. You can still open a file. For what each licence lets you edit, see [what your licence includes](/kb/article/what-your-licence-includes).
Markdown