Reprice bills and regenerate their entries
The Reprice Bills and Generate their Entries wizard rewrites the price of every material line in the bills of the types and period you choose, with the price you choose, then generates the entries of these bills again. The program explains why you may need it: when you enter purchase and sales bills out of chronological order, the program stores the last purchase price, the cost and the last sales price to the customer with wrong values. The wizard runs from the Files Maintenance window.
Before you begin
- The wizard shows in Files Maintenance when the file does not work in multi-file mode and does not belong to a profit center (Available maintenance).
- You need what Run files maintenance explains. The program checks no permission named after the operation when you run it from the Files Maintenance window, the favorites menu or Quick Launch. The Reprice Bills and Generate their Entries permission in Users Management > Operations only decides whether the operation's tile shows on the desktop.
- If the types you want include bills that have linked payments, you also need the Delete or Modify an Entry or a Bill Related with Payment permission. Without it the program refuses to run for those types.
- The bill types on which approvals are activated do not show in the list (Require approvals on a form).
- Ask the other users to leave the file. If the program finds another user when you click Start, it refuses to run.
- Take a backup. You cannot undo the operation after it ends. The wizard itself shows the backup page first (Back up a company file).
- The program recommends recalculating the prices before this operation (Audit materials balances and prices). When the chosen price is Cost, the program audits the balances and prices itself before the repricing and after it.
- If the period has closed days in a profit center (Close a day in a profit center), From must be after the last closed day.
Steps
Open the wizard and take the backup
-
Click File, then Tools, then Files Maintenance. Select Reprice Bills and Generate their Entries and click Run. The warning box "This operation is dangerous …" shows when you select the operation. The details are in Run files maintenance.
-
On the Make a Backup page choose the type of backup, then click Next:
- To Hard Disk: selected when the page opens.
- To Removable Disk: its page and steps are in Make a backup.
- Don't Make a Backup (not recommended): the program goes to the next page without asking anything.
If your key is a cloud subscription, a page with the same title replaces this one. It says that the files do not support the manual backup, tells you to request the backup from the service provider, and asks "Are you sure you want to continue maintenance process?". Click Next to continue.
-
If you chose the hard disk, the Make Backup Copy on Hard Disk page shows. The program fills the Notes field with the file, server, computer, user, program version and date. Change it or leave it, then click Start. When the copy ends the program shows "Operation completed successfully" and goes to the next page. If the copy fails you stay on the page. Next is disabled on it.
You can click Cancel before Start on any page. The program asks "Are you sure you want to exit and cancel the maintenance operation?". Click Yes to leave with no change to the bills.
Read the explanation and choose how discounts and additions are treated
- The Reprice Bills and Generate their Entries page shows with an explanation of the operation, among it that the entries are generated again automatically after the repricing. Read it, then click Next. The explanation says that the average price is used if you do not use the multiplication factor. What the program applies in fact is the price you choose in Price on the last page.
- The Discounts and Additions Options page shows. Choose how the program treats the discount and the addition after the price changes, then click Next. The options are in Fields.
Choose the bills and the price
- In the Invoices list untick the bill types you do not want to reprice. All the types are ticked when the page opens.
- Choose in Price the price the program puts in the bill lines. The default is Cost.
- To change the price by a percentage, tick Use multiplication factor and enter the percentage in the field next to it, for example
90. The program multiplies the chosen price by the percentage divided by 100. When it is not ticked the percentage stays100. - Enter the start and end of the period in From and To, for example
1-1-2026and31-3-2026. How the date field works is in Date fields and calendar. - To limit the repricing to certain lines, choose Warehouse, Cost Center, Salesman, Distributor, Material or Group. Leave a field empty to include everything.
This operation permanently changes the prices stored in the bills, the discounts, the additions, the tax and the totals. It deletes the current entries of these bills and generates them again, and it may unlink payments from bills. There is no undo after the run ends. If the run is cut in the middle, some bills may be repriced and others not, and the only way back is to restore the backup. If you limited the run by warehouse, material or group, check afterwards the totals of the bills that have lines outside the limit.
- Click Start. The program checks the period and the types, then asks: "This operation will change the prices saved in the selected bills and you cannot undo. Are you sure?". Click Yes to start. If you click No nothing changes, but the program shows the message "An error was encountered while performing the operation.".
- The progress bar shows. Cancel is disabled during the run, so you cannot stop it.
After the run
- If a window shows the bills that were not repriced because their value would be negative, note their numbers. The window lists each bill with its type and number.
- If a message with a file path shows, open the file to see the payments that were unlinked or modified and the bills that were not priced. It is explained in The payments and bills file.
- On success the message "Operation successfully completed" shows and the wizard page closes. Close Files Maintenance so that the other users can sign in.
Fields
The Discounts and Additions Options page
| Field | Description | Required | Values and rules |
|---|---|---|---|
| Keep Discount and Additions As Value | The amount of the discount and the addition of each line stays as it is after the price changes, and so do the bill's total discount and addition. | Yes (one of the two) | Selected when the page opens. |
| Keep Discount and Additions As Percentage | The percentage of the discount and the addition of the line value stays, and so does the percentage of the bill total for the total discount, so the amount changes with the new price. | Yes (one of the two) | |
| If there is one column for discounts and additions, keep the value depending on the column | The program keeps this option, but it does not change the result: every line follows the choice you made, as value or as percentage. | No | Not ticked by default. |
| Remove Discounts | Sets the discount of the material lines to zero. It does not change the total discount of the bill. | No | Not ticked by default. |
| Remove Additions | Sets the addition of the material lines to zero. It does not change the total addition of the bill. | No | Not ticked by default. |
| Keep Price when the Origrinal Price equals Zero | If the price to be applied to a line is zero (for example a price not entered in the material card), the current price of the line stays instead of becoming zero. | No | Not ticked by default. |
| Unlink All Bill Payments (when bill value become less than payments sum) | After generating the entry the program links the payments of the bill again. If the bill value becomes less than the sum of its linked payments, or they cannot all be linked again, it unlinks all the payments of the bill. | No | In the Payments Link Options group. Not selected by default. Disabled and not selected if you lack the Delete or Modify an Entry or a Bill Related with Payment permission. |
| Auto Link ( relink with payments and delete extra links if any ) | The program links the payments of the bill again in the order of the payment date then number, and deletes the links that the bill value cannot hold. | No | Selected by default for a user who has the same permission. Disabled and not selected if you lack it. |
The last page
| Field | Description | Required | Values and rules |
|---|---|---|---|
| Invoices | List of the bill types to reprice. | Yes (at least one type) | The list shows the bill types you have the permission to browse. All are ticked when it opens. A type on which approvals are activated does not show. With the Gulf tax system the purchase, sales and return types that generate an entry do not show. With the Syrian tax system only the ordinary and standard input and output types show. |
| Use multiplication factor | Multiplies the chosen price by a percentage you enter. | No | Not ticked by default. The field next to it is disabled and holds 100, and it is enabled when you tick. The program does not check the value. |
| Price | The price the program puts in the bill line. | Yes | The default is Cost. Price explains the values. |
| From and To | The period of the bills. | Yes | Each starts with today's date. They cannot be empty. |
| Warehouse | Limits the repricing to the lines of this warehouse. | No | Empty means all the warehouses. |
| Cost Center | Limits the repricing to the bills that have this cost center. | No | Empty means all the centers. |
| Salesman and Distributor | Limit the repricing to the bills of this salesman and this distributor. | No | Empty means all. |
| Material and Group | Limit the repricing to the lines of this material or the materials of this group. | No | Empty means all. When you enter one, the other is disabled until you empty it. |
| Skip display negative output report | The program does not show the negative output list that the audit of balances and prices produces before and after the repricing. | No | Not ticked by default. It works with the two prices Cost and Last Purchase only, and is disabled with the others. |
| Button | What it does |
|---|---|
| Next | Goes to the next page. Disabled on the last page and on the hard disk backup page. |
| Back | Returns to the previous page. |
| Start | Checks your choices and the date, then asks for confirmation and starts. |
| Cancel | Asks "Are you sure you want to exit and cancel the maintenance operation?", then closes the wizard. Disabled during the run. |
Price
The Price list shows the prices you have the permission to read in Users Management, in this order: Cost, Wholesale, Semi wholesale, Export, Distributor, Retail, Consumer, Last Purchase and Weighted average. If you lack the permission to read the cost price, the list stays with no choice, so choose a price before Start.
| Price | What the program puts in the bill line |
|---|---|
| Cost | The current price of the line minus the profit of the line plus the discount of the line and minus its addition, divided over the quantity. The program audits the balances and prices before the repricing to calculate the profits again. |
| Wholesale, Semi wholesale, Export, Distributor, Retail and Consumer | The current price recorded in the material card, in the unit of the line. |
| Last Purchase | The last purchase price now recorded in the material card, in the unit of the line. |
| Weighted average | The fixed weighted average price of the material on the date of the bill. |
The program converts the price to the currency of the line with the exchange rate recorded in the bill. The material card prices it uses are the current prices in the card, not those at the time of the bill. Weighted average is calculated on the date of the bill.
Example (not verified in the program): the wholesale price in a material card is 50, and a sales form has no tax and uses the file currency. When you choose Wholesale, tick Use multiplication factor and enter 90, the unit price in each line of this material becomes 45, that is 50 × 90 ÷ 100.
What the operation does
It runs in this order:
- If the price is Cost, the program audits the balances and prices of the materials and the profits of the bills (Audit materials balances and prices).
- It rewrites the price in the lines with a quantity greater than zero that match the period, the types, the warehouse, the cost center, the salesman, the distributor, the material and the group. It recalculates the discount, the addition, the tax and the totals in the bill according to your options.
- It generates again the entries of all the bills of the ticked types in the period that have an entry, or whose type carries Generates Entry Automatically, even the bills in which no line changed. The entry keeps its number and its state (posted or unposted). A bill that has no entry and whose type generates entries automatically gets an unposted entry. The program also posts to the warehouses the bills of the types that carry Generates Entry Automatically.
- It links the payments of the bills again according to your choice, and writes the file mentioned below.
- If the price is Cost or Last Purchase, the program audits the balances and prices a second time. With the other prices it audits nothing after the repricing.
At the end of this operation the program does not recalculate the balances of the accounts. To update them run Audit accounts balances.
Bills the operation does not process
| Bill | What happens |
|---|---|
| Lines outside the conditions (zero quantity, or another warehouse, material or group) | Their price does not change. |
| A bill whose value after the repricing would be less than its down payment, or less than the total of its commercial papers (the program tests each one separately) | It is not repriced. It is listed in the file mentioned below. |
| A bill whose value would become negative | It is not repriced. It shows in the errors window titled "The bills that have not been re-priced, due their value would be negative". |
| A file with replication sources, and a bill issued by another source | It is not repriced unless the program option "Replication system - Generate the others invoices entries ( by source code )" is on. |
| Turkish e-invoicing is on | Its bill types do not show in the list, and the program does not generate again the entries of the scenario types. |
| Egyptian e-invoicing is on | The program does not generate again the entries of the sales and resale types set for it and of its receipt types. |
| A bill cancelled in Turkish or Egyptian e-invoicing | The program does not generate its entry again. |
The payments and bills file
When the program unlinks or modifies payments, or skips bills because of the down payment and the commercial papers, it writes to a file named error.txt in the program's log folder. The program opens the file and empties it in every run, so it holds only the current run. At the end of the run it shows the message "There are invoices haven't been re-priced and payments have been unlinked or modified. A file of them has been generated on path :" with the path, but only if something was written to the file. It has two parts:
| Part | Its title | Its columns |
|---|---|---|
| Payments | "Here below a list of Payments that have been unlinked or modified :" | Invoice, Payment before Maintenance, Payment after Maintenance, Origin of Payment. |
| Bills not repriced | "Here below a list of invoices that haven't been re-priced because the sum of down payment and commercial papers of the invoice is more than its value:" | Invoice, Down Payment, Commercial Papers. |
What the program logs
If the program option Activate log file is on, the program adds, after the repricing is done in the database and before the second audit, a log record with the note "- Reprice Bills and Generate its entries". It shows in the Log File, on the Maintenances Log page (Log File). The record is not saved if the database refused the repricing command.
Result
- The bill lines carry the new prices, and the totals, the taxes and the entries change. Open a bill and check.
- The profits of the bills, the cost of the materials and the last purchase price may change because the program audits the prices.
- You cannot undo the operation. To return to the state before it, restore the backup.
If something goes wrong
| Message | Why it shows | What to do |
|---|---|---|
| Please select report sources | You ticked no type in the Invoices list. | Tick at least one type. |
| Latest closed day is … cannot run the maintenance before next day. | From is on the last closed day or before it. | Set From after the date the message shows. |
| Database is Opened By Users : … Please check that all users logged out then try again. | Another user works on the file. The message lists their names. The message "An error was encountered while performing the operation." follows it. | Ask them to leave, then click Start again. |
| There are invoices forms contain linked payments and you have no permission to " modify or delete entry or invoice linked to payment " | Some of the ticked types have bills with linked payments and you lack the permission. The message "An error was encountered while performing the operation." follows it. | Ask for the permission, or untick these types. |
| No movement found in the specified period | The period has no bills of any ticked type. Nothing changes after it. | Change the two dates or the types. |
| This operation will change the prices saved in the selected bills and you cannot undo. Are you sure? | The confirmation question after Start. | Click Yes to start, or No to go back. |
| An error was encountered while performing the operation. | The database refused the repricing command, or you clicked No in the confirmation question, or the run was refused for a reason in the messages above. | If you clicked No nothing changed. Otherwise read the message that came before it. If the repricing stopped in the middle, restore the backup. |
| There are invoices haven't been re-priced and payments have been unlinked or modified. A file of them has been generated on path : … | Payments changed or the program skipped bills. | Open the file at the path shown. It is explained in The payments and bills file. |
Related
This page applies to alameen ERP 10, version 10.1.79.764.