Skip to main content

Order from User Query - WUI

How to Create a Purchase Order from a User Request in the Web Application?

Written by Petr Pech

In some situations, the standard ABRA Flexi features for ordering goods may not be sufficient. ABRA Flexi supports creating a purchase order from minimum stock levels, from existing sales orders, or for example creating a production order.

If you need to create an order based on specific data and conditions, there is an option to create a so-called user query, which can then be used to generate an order. This order can subsequently be used in the application as the basis for an ordering form.

If you are interested in how to carry out this procedure using the desktop application, please refer to a different guide.

Where can I find this option in the web interface?

In the web interface, this feature can be found under the purchase orders agenda.

This option allows you to select a user query, process its output, and insert it into the line items of a purchase order.

You can create the query yourself (available from the Premium plan onwards), or have it custom-built by us. In that case, we need as precise a specification as possible of what the output of the query should be. If you have any questions, do not hesitate to contact support.

This can involve any custom processing of stock inventory, taking into account factors such as already ordered quantities, anticipated ordering, minimum stock levels with additional specific conditions, or for example ordering up to a maximum stock level.

There are simply no limits when it comes to creating a user query.

Creating a user query

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

  • integer – the ID of the price list item to be ordered

  • integer – the ID of the warehouse to which the order should be placed

  • double – the quantity that will appear in the quantity-to-order field

  • double – the quantity that will appear in the already-ordered quantity field

The quantity offered for the final order is the difference between the third and fourth fields.

As an example, we are including a very simple query for ordering up to maximum stock — that is, a query that offers for ordering those items whose stock level is lower than the max. stock qty field.

select c.idcenik, sklad.idbsp, sk.maxmj, sk.maxmj-sk.stavmj as rozdil from skarty sk
left join ccenik c on sk.idcenik = c.idcenik
left join dbsp sklad on sk.idskladu = sklad.idbsp
left join nucetobdobi o on o.iducetobdobi = sk.iducetobdobi
where sklad.idbsp = 8 and sk.iducetobdobi = 2 and (sk.maxmj > sk.stavmj)
order by maxmj

Creating an order based on query results

As mentioned in the introduction to this guide, it is possible to place an order based on query results from within the purchase orders section.

If the query is correctly configured (as described above), Flexi will present its results for use in creating an order.

Once the order creation form has been successfully generated, you must first fill in the type to be used when creating the purchase order.

After that, all that remains is to adjust any item details as needed or leave them at their default values. Like other ordering forms, this form also takes already ordered quantities into account.

Once the order has been successfully created, you will be notified by a confirmation message.

If you are interested in having a user query created, do not hesitate to contact us.

Did this answer your question?