Package Conversion

If the preference packageConversion is true, all itemsPlanned attachments are inspected during insert or update. If the product specified in the reference field and the unitOfmeasure field match with an entry in the conversion table, the following values are written to the database:

quantity = f(original quantity / conversion factor) where f(x) = x + 1 if x is not an integer, x otherwise
unit = conversion unit

It is assumed that the original product unit is stored as an attribute called inventoryUnit in the extra field of the itemsPlanned attachment.

For itemsDelivered attachments, returned from OMD Mobile, OMD Domain converts quantity and unit back into the original unit:

quantity = conversion factor * quantity
unit = inventory unit

In case no entry exists for a matching product and unit or in case the unit is identical to the one in the inventoryUnit field, all values are kept unchanged.

The name of the attribute representing the original inventory unit can be adapted by setting the inventoryUnitAttributeName. It defaults to inventoryUnit.

results matching ""

    No results matching ""