Conversion of Acumatica UOMs

Vachagan Mirzoian
3 min readMay 21, 2023

Acumatica provides functionality for Ecommerce Item management. On the user interface each Item has 2 important fields, quantity and measurement unit. Sometimes we need to convert item quantity measurements within Acumatica systems and Ecommerce store. The simplest way is to use the Base Unit and EA. But we can have some specific cases.

Stock Item can use Sales Unit field for item quantity calculation.

The used Sales Unit Conversion Factor is here.

We can use an additional dropdown list to choose which unit is used for final quantity calculation. The field Shopify Qty Export UOM is added in the EPORT UOM group.

A new Group is added from Customization Project Editor’s ADD CONTROLS tab.

Now we Sync the Acumatica Item Quantity to Shopify.

Here we see the number 500 000. As 500 000 / 2 000 = 250, we can assume that there is a quantity of 250 items having EA Unit Of Measure.

This is the method segment that is responsible for showing the field value on Export Shopify Inventory Quantities screen and sending the quantity to Shopify Store.

As the Rate is kept on Stock Item, we must find the item in InventoryItem DAC. We add simple PXSelect<>, to get Stock Item data based on item.InventoryID field. Note that the item here is an element of List<BZItemSync>.

Here is the PXSelect finding the exact item.

The SalesUnit field of invItem variable is used as an argument for the GetItemUomFactor() method.

The method contains PXSelect to retrieve the whole row value of measurement unit specified in Sales Unit field.

Then we get the final Unit Conversion Rate.

We will always multiply the Item quantity by UnitRate. The UnitRate can be a rational number or a positive real number. For example, if we convert 2.5 KG to grams, we multiply 2.5 by conversion rate 1000 to get 2500, and if we convert 3600 grams to KG, we will multiply 3600 by 1/1000 to get 3.6.

For the code

we have the following mathematics.

250 / (1/2000) = 500 000,

where 1/2000 is the value returned by GetItemUomFactor, as UnitMultDiv field value is “Divide” and UnitRate field value is 2000.

--

--