Regenerate Cost Entries
The Regenerate Cost Entries wizard rebuilds the cost and stock lines in the entries of bills whose types carry Consider Perpetual Inventory, in a period you choose. It does not touch the other lines of the entry. This page explains its two pages with their fields, buttons and messages, and what the operation does. The steps are in Regenerate cost entries.
After Start the wizard works on the whole file in one go, and there is no undo once it succeeds. Make a backup before you begin, and ask the other users to leave the file.
Opening the wizard
- Open File > Tools > Files Maintenance, select Regenerate Cost Entries and click Run. The window and its warning frame "This operation is dangerous …" are in Run files maintenance. The frame shows for every operation whose severity is above low; this operation has the highest severity.
- You can also start it from the arrow beside Files Maintenance on the Tools page, if you added it to the favorites (Favorites), from a Maintenance tile on the desktop (Add a tile to the desktop), and from Quick Launch search.
- The operation shows in the list when your administration includes accounting and the file does not work in multi-file mode (Available maintenance).
- You need the Files Maintenance permission to open the window. Users Management > Operations also lists a permission named Regenerate Cost Entries. The program checks it for the desktop tile only, so the tile is hidden from users who lack it. It does not check it when you start the operation from the window, from the favorites menu or from Quick Launch search.
The explanation shown in the list
The Files Maintenance list shows the name of the operation and under it the explanation: "This maintenance regenerates the cost entries of entries generated from bills that have "Perpetual Inventory" option activated".
The backup page
The first page of the wizard is the Make a Backup page. It shows before anything else in this wizard. Its types and fields are in Make a backup. After the backup, or after you choose not to make one, the explanation page shows. How the pages and buttons work, and the cancel question, are in How maintenance wizards work.
The explanation page
A read-only page with no fields. Its header says "Regenerate Cost Entries", and under it are two paragraphs, each with an icon beside it:
- "Regenerate cost entries in the entries generated from bills forms that have the 'Use perpetual Inventory' option activated within selected period."
- "If you adopt the perpetual inventory in bill forms with weighted average pricing policy to set the cost, these bills entries will be re-generated with the average price on these bills (we recommend in this case that you recalculate the prices of the bills before this operation)."
| Button | What it does |
|---|---|
| Next | Goes to the page where you choose types and period. |
| Back | Returns to the backup page. |
| Cancel | Asks "Are you sure you want to exit and cancel the maintenance operation?" and closes the wizard on Yes with nothing changed. |
| Help | Opens the help topic of the page, if there is one. |
The last page: types and period
The title of the page is "Regenerate Cost Entries", and at the top it says "Select the period and bills types you want to regenerate their cost entries, then click 'Start' to begin."
| Field | Description | Required | Values and rules |
|---|---|---|---|
| Invoices | The bill types whose bills' cost entries the program regenerates. | No | The list shows only the types that carry Consider Perpetual Inventory and that you browse at the medium or high level (Permission levels). All are ticked when the page opens. There is no forms-group field under it and no button to tick or untick all. |
| Use fixed weighted average price | The program values the cost and stock lines with the fixed weighted average price of the material on the date of the bill, instead of the cost price set in the type. | No | Not ticked when the page opens. You need to calculate the fixed weighted average price first (Calculate fixed weighted average). |
| From | The first day of the period. | Yes | Starts with the opening date of the file. Example: 1-1-2026. |
| To | The last day of the period. | Yes | Starts with today's date. Example: 31-3-2026. How the field works is in Date fields and calendar. |
The program does not compare the two dates on this page. If the first is after the second it finds no movement and shows "No movement found in the specified period".
| Button | What it does |
|---|---|
| Start | Starts the operation and asks the confirmation questions listed in What the operation does. |
| Back | Returns to the explanation page. The list, the option and the dates return to their values at opening. |
| Next | Disabled on this page. |
| Cancel | Before Start: asks "Are you sure you want to exit and cancel the maintenance operation?" and closes the wizard on Yes. While it runs: see Cancel while it runs. |
| Help | Opens the help topic of the page, if there is one. |
While it runs the progress bar shows, with a status line above it that says "Preparing- Please wait...", then "Audit Materials Balances and Prices", then the name and number of the bill being processed.
What the operation does
The program works in the order below, all in one database transaction.
- Other users: if someone else is in the file, a list of the users signed in to the file, you included, shows and the operation ends with "An error was encountered while performing the operation.".
- Movement: the program looks for bills dated in the period in the ticked types. If it finds none it shows "No movement found in the specified period" and nothing changes.
- Confirmation: it asks "This operation will delete the cost entries of the selected bills during selected period, and regenerate a new cost entries according to the current settings in bills forms." then "Are you sure?". The default button is No. Yes continues. No stops the operation with "An error was encountered while performing the operation." and nothing changes.
- Bills without cost lines: if a bill in the period has an entry without cost lines, the program asks "Some bills have no cost entry, in case bills are updated from old version, the cost entry will be doubled. Therefore it is recommended to perform " Regenerate Entries " maintenance before performing this operation Do you want to continue?". Yes continues. No stops the operation with "An error was encountered while performing the operation.". The maintenance named in the message is Regenerate Entries.
- Materials audit: if there are bills to process, the program first audits the balances and prices of the materials, as Audit Materials Balances and Prices does, so that the prices of the materials are current before the cost is built.
- Bills: for each bill in the period of the ticked types that has an entry, ordered by date then number, the program builds the cost and stock lines again:
- It deletes the lines of the entry that perpetual inventory created and adds new lines at the end of the entry. It does not change the entry number or its other lines, and it updates the debit and credit totals in its header.
- If the entry is posted, the program unposts it while it rebuilds and posts it again.
- It values each line as quantity × the cost price set in Cost Price in the type, or the fixed weighted average price if you ticked it. It generates no line for a service material or for a zero price.
- In output bills the cost account is debited and the stock account credited, and the reverse in input bills. The full entry rules are in How bills work.
- For a type with Brief Entry the program groups the lines by account, cost center and contra account.
- At the end: the program recalculates the balances of the accounts from the posted entries, as Audit Accounts Balances does. It commits the changes, "Operation successfully completed" shows, and the wizard page closes and you are back in Files Maintenance.
Example: sales bill 20 sells 10 units of a material whose cost price is 15. The cost line is debit 150 on the cost account and the stock line is credit 150 on the stock account. If you change the cost price to 18 in the type and run the operation, both lines become 180.
What the operation does not process
| Case | What happens |
|---|---|
| A bill without an entry | Nothing changes. The program does not generate an entry for it. |
| A file with replication sources, and a bill issued by another source | Its entry does not change unless the program option "Replication system - Generate the others invoices entries ( by source code )" is on. |
| Lines of the entry other than the cost and stock lines | They stay as they are. |
Cancel while it runs
Unlike most maintenance wizards, Cancel stays enabled while the operation runs. If you click it the question "Are you sure you want to exit and cancel the maintenance operation?" shows, and on Yes the program disables the button. The program does not stop the operation on this request: it goes on until it ends and then shows its result. Do not click the button to stop an operation that has started.
What the program records
If the program option Activate log file is on, the program adds a log record with the note "- Regenerate Entries" after it checks for other users and before it processes, whether the operation succeeds or finds no movement. The record shows in the Log File, on the Maintenances Log page (Log File). It then adds a second record with the note "- Audit Accounts Balances" when it recalculates the balances at the end.
Messages
| Message | Why it shows | What to do |
|---|---|---|
| Database is Opened By Users : … Please check that all users logged out then try again. | Another user works on the file. The message lists every user signed in to the file, you included. "An error was encountered while performing the operation." follows. | Ask them to leave, then click Start again. |
| No movement found in the specified period | There are no bills in the period for the ticked types. Nothing changes. | Change the dates or the types. |
| This operation will delete the cost entries of the selected bills during selected period, and regenerate a new cost entries according to the current settings in bills forms. Are you sure? | Types are ticked and have bills in the period. The default button is No. | Yes to continue, or No and the operation ends with an error and nothing changes. |
| Some bills have no cost entry, in case bills are updated from old version, the cost entry will be doubled. Therefore it is recommended to perform " Regenerate Entries " maintenance before performing this operation Do you want to continue? | A bill in the period has an entry without cost lines. | Yes to continue, or No and the operation ends with an error and nothing changes. |
| Are you sure you want to exit and cancel the maintenance operation? | You clicked Cancel. | Before Start: Yes to exit, No to stay. After Start see Cancel while it runs. |
| Operation successfully completed | The operation ended and the changes are committed. | Close Files Maintenance so that the other users can sign in. |
| An error was encountered while performing the operation. | You answered No to one of the questions, or another user was found, or the database refused a command. The program restores the file to its state before the run. | Read the message before it and run again. |
Related
This page applies to alameen ERP 10, version 10.1.79.764.