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, all values are kept unchanged.