Anlage des Repos
This commit is contained in:
23
current/Modules/GetWinLineStockedAmount.vbs
Normal file
23
current/Modules/GetWinLineStockedAmount.vbs
Normal file
@@ -0,0 +1,23 @@
|
||||
' Version Date: 13.10.2020
|
||||
Function GetWinLineStockedAmount(ProductNumber, IncludeSalesDocuments)
|
||||
' Lagerstand des Artikels prüfen
|
||||
SQL = ""
|
||||
SQL = SQL & "SELECT "
|
||||
SQL = SQL & "(SELECT C008 AS [MengeZugang] from [v021] (NOLOCK) where (c002 = '__ARTICLENUMBER__') "& SQLQuery_BasicWhere &") - "
|
||||
SQL = SQL & "(SELECT C009 AS [MengeAbgang] from [v021] (NOLOCK) where (c002 = '__ARTICLENUMBER__') "& SQLQuery_BasicWhere &") - "
|
||||
|
||||
If IncludeSalesDocuments = True Or IncludeSalesDocuments = "True" Or IncludeSalesDocuments = 1 Then
|
||||
' Include Products from sales documents
|
||||
SQL = SQL & "ISNULL((SELECT SUM(C035) AS [MengeVerkauf] FROM [t014] (NOLOCK) where c000 = '__ARTICLENUMBER__' "& SQLQuery_BasicWhere &"), 0) "
|
||||
Else
|
||||
' Skip Products from sales documents
|
||||
SQL = SQL & "(SELECT 0) "
|
||||
End If
|
||||
|
||||
SQL = SQL & "AS c000"
|
||||
|
||||
SQL = Replace(SQL, "__ARTICLENUMBER__", ProductNumber)
|
||||
Set Result = CWLStart.CurrentCompany.Connection.Select(SQL)
|
||||
|
||||
GetWinLineStockedAmount = Result.Value("c000")
|
||||
End Function
|
||||
Reference in New Issue
Block a user