Callback
  • From a market stall to a store

  • -

  • From a store to a retail chain

  • -

  • From retail to manufacturing

Arithmetic overflow error - how to fix scanning barcode instead of price or quantity

Volodymyr Vytyshchenko
Volodymyr Vytyshchenko

Trade automation expert at Torgsoft

The error “Arithmetic overflow error converting expression to data type int” (or “numeric”) occurs when a numeric value in the database exceeds the maximum allowed size for its data type.

In the context of Torgsoft inventory accounting, this critical error most often occurs due to human error: a user accidentally scans a 13-digit product barcode into the “Quantity” or “Price” field instead of the corresponding barcode field.

As a result, the program records a product receipt or product price in the amount of several billion units. When the program tries to process such huge numbers, for example, during automatic cost recalculation, period closing, or opening the "Inventory Status” form, the system cannot process the data, shows an overflow error, or completely “freezes“.

This error is usually related not to the interface, but to damaged or incorrectly entered data in product movement records, so it must be fixed carefully. If the document is in a past period, if the «Inventory Status» form does not open, or if SQL verification is required to find the problem, it is better not to experiment with the database yourself. In such cases, it is safer to first locate the problematic product and contact technical support if needed.

Step 1. Finding the problematic document

Step 1. Finding the problematic document

Because this error can block warehouse operations or stop nightly calculations, the problematic product must be located. This can be done in several ways:

1. Visual search through the “Inventory Status“ form

The fastest user method is to check the balances. Since the barcode was entered into the quantity or price field, this product will have abnormal values in the “Inventory Status” form, for example, the retail price or balance will consist of 13 digits.

  • Open “Inventory Status” and sort the table by the “Quantity” or “Retail Price” column in descending order.

  • After finding a product with billion-level balances or price, select it and click the “Product Movement” button.

  • In the product movement history, you will clearly see which document, such as a Goods Receipt Invoice, Inventory Count Act, Return, and so on, contains this abnormal value.

2. Search through SQL queries 

If the database is large or the “Inventory Status” form does not open due to a manager class error, technical support specialists use SQL queries. The query is created to search for products where the quantity value exceeds normal limits. For example, a search is performed for products with a balance of more than 1,000,000 units. After finding the IDs of such products through SQL Management Studio, specialists provide them to the client so the product movement can be checked and corrected.

3. Using “Error Diagnostics” 

It should be noted that the standard “Inventory Management — Error Diagnostics” form is mainly used to search for products with identical barcodes, fix duplicate names, or identify products that are not linked to directories. To find a mathematical overflow error (Arithmetic overflow) caused by scanning a barcode into the quantity field, the most effective tools are the analysis of “Inventory Status” and direct SQL queries.

Step 2. Correcting the document and recalculation

Step 2. Correcting the document and recalculation

After you have located the document, for example, a “Receipt from Inventory Count” or a regular goods receipt invoice, it must be edited:

  1. Opening the period. If the document with the error was created in a previous month and the period has already been closed, the program will show the overflow error when trying to close or recalculate this period. In this case, the period must be temporarily opened for editing.

  2. Editing the quantity/price. Find the problematic document, for example, through the “Goods Receipt Invoice Register” or directly from “Product Movement”, and open it for editing. Replace the abnormal 13-digit number in the “Quantity” or “Price” field with the correct actual value.

  3. Clearing and recalculation. After correcting the document, it is mandatory to recalculate the cost. To do this, go to the settings and run the service operation “Clear product movement information and recalculate cost”.

  4. Closing the period. If you opened a past period to correct the document, make sure to close it again after the cost recalculation is completed successfully.

Important nuance. If the product posted by mistake has a very long movement history, for example, it was used as a test product or for repeated product merges, the cost recalculation process may “freeze” on this product again. In such complex cases, Torgsoft developers are involved in resolving the issue and clear the movement of this specific product directly through the database.


Програма обліку товару | Торгсофт



Facebook Instagram YouTube Twitter Google News Apple Podcast SounCloud

Add comment

Add comment
Thank you for your feedback! It will be published after being reviewed by a moderator.
Related articles