UoMConversion
Define formula for convert from a unit to another
Allow to calculate this by length/width/height and density
Property |
Description |
Table |
BEAS_ME_UMR |
Primary key |
FromUoMId/c,ToUoMId/c |
$transaction |
no |
$branch |
no |
$mask |
no |
Name |
Type |
Description |
|
FromUoMId |
Edm.String(20) |
|
|
ToUoMId |
Edm.String(20) |
|
|
Formula |
Edm.String(20) |
|
Function |
Parameter |
Description |
|
Conversion |
FromUnitId/c,ToUnitId/C,Length/i,Width/i,Height/i,Density/i,UnitGroupId/i |
|
|
QtyConversion |
FromUnitId/c,ToUnitId/C,Length/i,Width/i,Height/i,Density/i,UnitGroupId/i,Quantity/i |
|
|
ItemConversion |
ItemCode/c,FromUnitId/c,ToUnitId/C |
example for Conversion from one to another unit
Note: The system calculate always from FromUnitId to ToUnitId
if you work with Factor, the target quantity is
toQuantiy=fromQuantity * Factor
// work with QtyConversion
instance bsl b
b.get=UoMConversion/QtyConversion(<dw_1.item.me_verbrauch.value,bsl>,<dw_1.item.me_lager.value,bsl>,<dw_1.item.abm1.value,num(6)>,<dw_1.item.abm2.value,num(6)>,<dw_1.item.abm3.value,num(6)>,<dw_1.item.dichte.value,num(6)>,<bslitem.UnitGroupId>,<dw_1.item.menge_verbrauch.value,num(6)>)
dw_1.item.me_umr.value=<b.factor,#0.000000>
dw_1.item.menge_lager.value=<b.quantity,#0.000000>
// work with only Conversion
instance bsl b
b.get=UoMConversion/QtyConversion(<dw_1.item.me_verbrauch.value,bsl>,<dw_1.item.me_lager.value,bsl>,<dw_1.item.abm1.value,num(6)>,<dw_1.item.abm2.value,num(6)>,<dw_1.item.abm3.value,num(6)>,<dw_1.item.dichte.value,num(6)>,<bslitem.UnitGroupId>)
dw_1.item.me_umr.value=<b.factor,#0.000000>
// Note: in %() functions: don't work with < and >, only the variable name.
dw_1.item.menge_lager.value=%mul(dw_1.item.menge_verbrauch,b.factor)
Compatibility
Old scripts compatible. But need more time, because not all Infomations available and the system need additional select commands.
Old Syntax (beas 2020/11 and older):
object=ue_artikelstamm=umrechnung=itemcode:unit_material
New (BeasScript):
dec ProdutionUnitQty
dec StockUnitQty
ProdutionUnitQty=10
b.get=UoMConversion/ItemConversion("unit_material","Pcs","m")
WhsUnitQty = <ProdutionUnitQty,dbnum> * <b.factor,dbnum>