Anlage des Repos
This commit is contained in:
40
examples/VBS/WinLine PDFE/FORMEL-RÜCKSTAND.txt
Normal file
40
examples/VBS/WinLine PDFE/FORMEL-RÜCKSTAND.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
'TITLE: FORMEL-RÜCKSTAND
|
||||
'Rückstand aus altem Lieferschein?
|
||||
'Stand: MK // 14.04.2022
|
||||
On Error resume next
|
||||
|
||||
WinLineCurrentMandatorNr = Cstr(CWLStart.CurrentCompany.Nr)
|
||||
WinLineCurrentYear = cint(CWLStart.CurrentCompany.CompanyYear)
|
||||
|
||||
Auftragsnummer = Value (25,44)
|
||||
Lieferscheinnummer = Value (25,45)
|
||||
Projektnummer = Value (25,136)
|
||||
|
||||
SQLQuery_PredecessorDeliveryNote = "" &_
|
||||
"SELECT TOP 1 [C045] from [v250] (NOLOCK) " & vbCrlf & _
|
||||
"WHERE [c025] <> 'L' " & vbCrlf & _
|
||||
" and [c044] = '" & Auftragsnummer & "' " & vbCrlf & _
|
||||
" and [c045] IS NOT NULL " & vbCrlf & _
|
||||
" and [c045] <> '" & Lieferscheinnummer & "' " & vbCrlf & _
|
||||
" and [c100] > 0 " & vbCrlf & _
|
||||
" and [c136] = '" & Projektnummer & "' " & vbCrlf & _
|
||||
" and [c137] = 2 " & vbCrlf & _
|
||||
" and [c139] in (3,-3) " & vbCrlf & _
|
||||
" and [mesocomp] = '" & WinLineCurrentMandatorNr & "' " & vbCrlf & _
|
||||
" and [mesoyear] in (" & WinLineCurrentYear & ",(" & WinLineCurrentYear & "-12)) " & vbCrlf & _
|
||||
"Order by [C022] asc; "
|
||||
|
||||
Set Conn = CWLStart.CurrentCompany.Connection
|
||||
If (Len(Auftragsnummer) > 0) and (Len(Projektnummer) > 0) Then
|
||||
|
||||
Set SQLQueryResult_PredecessorDeliveryNote = Conn.Select(SQLQuery_PredecessorDeliveryNote)
|
||||
|
||||
If (SQLQueryResult_PredecessorDeliveryNote.RowCount) > 0 Then
|
||||
ResultValue = "Rückstand aus Lieferschein: " & SQLQueryResult_PredecessorDeliveryNote.value("c045")
|
||||
Else
|
||||
ResultValue = ""
|
||||
End if
|
||||
|
||||
Else
|
||||
ResultValue = ""
|
||||
End If
|
||||
Reference in New Issue
Block a user