PdcMaterialFile.MergeStockLines: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
Created page with "PdcMaterialFile.ConvertUnitToUnitFactor Contents [hide] 1 Declaration 2 Description 3 Notes 4 Code example VB.NET 5 Availability [edit]Declaration ConvertUnitToUnitFactor(Uni..."
 
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
PdcMaterialFile.ConvertUnitToUnitFactor
== Declaration ==
Contents [hide]
MergeStockLines(oldID as Integer, newID as Integer, quantity as double, code as integer) as Boolean
1 Declaration
2 Description
3 Notes
4 Code example VB.NET
5 Availability
[edit]Declaration
ConvertUnitToUnitFactor(UnitFrom as string, UnitTo as string, UnitWeightFactor as string, StandardSize as string, WeightFactor as double) as double


[edit]Description
== Description ==
Returns the factor from wich a unit to a unit conversion can be executed. This function uses the LM_STAM and LM_GEW of a material (LM_MAT) for the conversion between units.
This function merges two stocklines into one. The amount of the old stockline is merged into the new stockline.


[edit]Notes
== Notes ==
The function returns 0 if the LM_STAFM or LM_GEW isn't correctly filled.
All checks are done by standard PdC.
The UnitWeightFactor is the unit which corresponds to the weightfactor, most likely the unit of the material in question.
Units:
m / ft,
m2 / ft2,
m3 / ft3,
kg / lb,
Ltr / Gal,
1 (Piece)


[edit]Code example VB.NET
== Code example ==
Dim strUnitFrom as string = "kg"
Dim strUnitTo as string = "1"
Dim strUnitWeightFactor as string = "m2"
Dim strStandardSize as string = "1.500x3.000"
dim dblWeightFactor as double = 7.8
   
   
Dim factor as Double = PDC.App.MasterData.MaterialFile.ConvertUnitToUnitFactor(strUnitFrom, strUnitTo, strUnitWeightFactor, strStandardSize, dblWeightFactor)
Merge two lines into one.
[edit]Availability
 
Available since Juli 2020 (from version 5.6)
<source lang="vbnet">
Sub MergeStocklines
dim oldID as Integer = 123
dim newID as Integer = 456
dim Quantity as double = 1
dim code as Integer = 12
  if not PDC.App.MasterData.MaterialFile.MergeStockLines(oldID, newID, quantity, code) then
    msgbox(pdc.app.lasterror)
  end if
End Sub
</source>
 
== Availability ==
Available since August 2020 (5.6)

Latest revision as of 10:23, 29 September 2020

Declaration

MergeStockLines(oldID as Integer, newID as Integer, quantity as double, code as integer) as Boolean

Description

This function merges two stocklines into one. The amount of the old stockline is merged into the new stockline.

Notes

All checks are done by standard PdC.

Code example

Merge two lines into one.

Sub MergeStocklines
dim oldID as Integer = 123
dim newID as Integer = 456
dim Quantity as double = 1
dim code as Integer = 12
   if not PDC.App.MasterData.MaterialFile.MergeStockLines(oldID, newID, quantity, code) then
     msgbox(pdc.app.lasterror)
   end if
End Sub

Availability

Available since August 2020 (5.6)