Skip to main content

Order from a User Inquiry - WUI

How to Create Issued Orders in the Web Interface Based on the Results of a Custom Query, and How to Build Such a Query

Written by Petr Pech

In some situations, the standard ABRA Flexi functions for ordering goods may not meet your needs. ABRA Flexi supports creating an issued order from the minimum stock quantity, from existing received orders, or, for example, creating a production order.

If you need to place orders based on specific data and conditions, you can prepare a so-called user query. The application then uses its result as the basis for the order form.

If you want to know how to do this in the desktop application, go to the guide for the desktop application.


Where do I find this option in the web interface?

You can find this function in the Issued Orders module. In the footer of the list, click the three dots (More functions) and select Order from user query.

This option runs the user query, processes its output, and offers it for insertion into the items of an issued order.

You can create the query yourself (available from the Premium plan), or have us create it for you as a custom service. In that case, we need the most precise specification possible of what the query output should be. If you have any questions, feel free to contact our support line.

It can be any kind of stock processing that takes into account, for example, items already on order, expected orders, the minimum stock combined with another specific condition, or even ordering up to the maximum stock. There are simply no limits when creating a user query.


Creating a user query

The query must have Issued Orders set as its primary form, and its first four properties (columns) must be of the following types:

  1. Integer (integer): the ID of the price list item to be ordered,

  2. Integer (integer): the ID of the warehouse the order is for,

  3. Decimal number (numeric): the quantity displayed in the To order column,

  4. Decimal number (numeric): the quantity displayed in the Already ordered column (the quantity already on order).

The quantity offered for ordering (the Order column) is the difference between the third and fourth columns. The third column should therefore contain the total quantity you want to have on order, and the fourth should contain the quantity that has already been ordered but not yet delivered.

As an example, we include a query for ordering up to the maximum. It offers items from warehouse KANCELÁŘ whose stock level is below the maximum stock on the stock card in the 2026 accounting period. In the third column, it returns how many units are missing to reach the maximum stock; in the fourth, the total of undelivered units from issued orders. Adjust the warehouse code and accounting period to suit your needs.

select x.idcenik, x.idskladu, x.k_objednani, x.objednano
from (
select sk.idcenik, sk.idskladu, c.kod,
sk.maxmj - sk.stavmj as k_objednani,
coalesce((select sum(p.mnozmj - p.mnozmjreal) from dpolobch p
where p.modul = 'OBV' and p.storno = false
and p.idcenik = sk.idcenik and p.idbspskl = sk.idskladu), 0) as objednano
from skarty sk
join ccenik c on c.idcenik = sk.idcenik
join dbsp s on s.idbsp = sk.idskladu
join nucetobdobi o on o.iducetobdobi = sk.iducetobdobi
where s.kod = 'KANCELÁŘ' and o.kod = '2026'
) x
where x.k_objednani > x.objednano
order by x.kod

⚠️ The query text must not contain a semicolon. The application will not save such a query (disallowed word ";").


Creating an order based on the query result

As mentioned in the introduction, you can place an order based on the query result from the Issued Orders module. If the query is set up correctly (as described above), the Order from user query window opens with the query result.

First, fill in the Issued order type field, that is, the type with which the orders will be created. You can narrow down the list using the Filter by supplier and Filter by warehouse fields.

Next, review the items. For each item, you can see the stock level (In stock), the values from the query (To order, Already ordered), issue requirements, and the suggested quantity in the Order column, which you can edit. The supplier is prefilled based on the price list and can be changed. Use the checkbox at the beginning of each row to specify which items will be ordered.

Click the Create button to create the orders. A separate issued order is created for each supplier, so in our example there are two. The application notifies you when the orders have been created, and you can find the new orders in the list of issued orders.

💡 If you are interested in having a user query created, feel free to contact us.

Did this answer your question?