Cost Control
You know whether an import that overlaps an earlier one duplicates your cost items, and how to replace a corrected booking.
When an accounting export overlaps a period you already imported, KOSMA does not import a line again if the set already holds it unchanged. This happens when accounting re-issues an export with corrections, or when a new export covers dates you already imported. In step 4 of the import, **Matching**, KOSMA compares each line of the file with the cost items in the set. To change the set, you need a Cost Control or Production licence, or a running trial. As a guest, the set must also be shared with you for editing. See [what your licence includes](/kb/article/what-your-licence-includes).
The **Matching** step shows this text:
**Message:** KOSMA automatically matches data with the same reference, text, amount and payment date. This data is not imported again. Drag new data on existing cost items to replace them.
KOSMA compares a line only with the cost items on the account that the line's account number belongs to. A line matches a cost item when reference, description, paid amount and payment date are all equal. The entry date does not count. Each cost item matches one line at most. If the file contains the same line twice and the set holds it once, one row is **Matched** and the other is **New**.
Each row in **Matching** has one of four states. Within an account, KOSMA lists them in this order:
| State | Meaning | | ------------ | -------------------------------------------------------------------------------------------- | | **Matched** | The line equals a cost item in the set. KOSMA does not import it again. | | **Replaced** | You dragged a new line onto a cost item. On import, KOSMA updates that cost item with it. | | **Existing** | A cost item in the set that no line matches. KOSMA leaves it as it is. | | **New** | A line that matches no cost item. KOSMA adds it as a new cost item. |
KOSMA hides the **Matched** rows. To see them, tick **Show automatically matched data**. The box is unticked each time you open the import.
A corrected line matches no cost item, because one of the four fields changed: a new amount, a moved payment date or a retyped reference is enough. The line arrives as **New**, and the original cost item stays **Existing**. If you import the line like this, the set contains both cost items.
Replacing works only if you untick **Copy Cost Control Dataset** in step 3, **Options**, see below. To replace the original, drag the **New** row  onto the **Existing** row. The dragged row changes to **Replaced**, and KOSMA removes the **Existing** row from the list. If you dropped it on the wrong row, click  **Undo replacement** in the **Replaced** row. KOSMA changes the set only when you click **Import**. The replaced cost item keeps its tags, effects, company and attachments.
In these cases, KOSMA cannot match a line to the cost item from the earlier import, and the line arrives as **New** again:
- The line has no account number. It goes to  **Unmapped**. - You moved the cost item to another account after the earlier import. - You changed the cost item's description, reference, paid amount or payment date in KOSMA. - You entered the cost item by hand, with an expected amount and no paid amount.
Each import with lines that have no account creates a new **Unmapped** account. KOSMA does not add these lines to the **Unmapped** account of an earlier import. To clear an **Unmapped** account, see [match accounts, effects and companies](/kb/article/match-accounts-effects-and-companies).
To keep the set as it is now, copy it first with  **Copy Cost Control** next to the set dropdown. The copy keeps all cost items, so you can re-import into either set. For the steps, see [copy a cost control set](/kb/article/copy-a-cost-control-set).
In step 3 of the import, **Options**, untick **Copy Cost Control Dataset**. The option is ticked by default, with this text:
**Message:** Do you want to create a copy of the cost control dataset before you import accounting data? (recommended)
With the option ticked, KOSMA does not copy the open set. It creates a new set from the budget, without cost items, and imports into that set. Step 4 still shows **Matched**, **Existing** and **Replaced** rows from the open set, but KOSMA ignores them and adds every line to the new set as a new cost item.
The option **Add Tag To Imported Data** is ticked by default: KOSMA tags the new cost items of this import with a time stamp. A replaced cost item does not get the tag. A filter by the tag therefore finds only the new cost items of this import.
If a re-import went wrong, choose **Edit** > **Undo** in the same session: KOSMA undoes the whole import in one step.
Markdown