Replace frmRuecklaeuferanalyse.frm

This commit is contained in:
Stoyan Zlatev
2023-05-15 12:04:28 +00:00
parent 7cbc0b36b2
commit 6db10618da
+103 -96
View File
@@ -262,7 +262,7 @@ Begin VB.Form frmRuecklaeuferanalyse
Begin VB.ListBox lstAusfallgrund
Height = 1410
Left = 240
Style = 1 'Kontrollkästchen
Style = 1 'Kontrollkästchen
TabIndex = 48
Top = 1680
Width = 7995
@@ -502,9 +502,9 @@ Dim mcol_IDs As Collection
Const NEU = "(neu)"
Const TXT_BITTEAUSWAEHLEN = "(Bitte auswählen!)"
Const TXT_ERFOLGREICH = "Zähler erfolgreich geprüft"
Const TXT_ERNEUTAUSGEFALLEN = "Zähler erneut ausgefallen"
Const TXT_BITTEAUSWAEHLEN = "(Bitte auswählen!)"
Const TXT_ERFOLGREICH = "Zähler erfolgreich geprüft"
Const TXT_ERNEUTAUSGEFALLEN = "Zähler erneut ausgefallen"
Private m_lngID As Long
@@ -525,7 +525,7 @@ Private Sub cmdBeenden_Click()
Dim lngReturn As Long
If cmdSave.Enabled = True Then
lngReturn = MsgBox("Sollen Ihre Änderungen gespeichert werden?", vbYesNoCancel Or vbDefaultButton1 Or vbExclamation, Me.caption)
lngReturn = MsgBox("Sollen Ihre Änderungen gespeichert werden?", vbYesNoCancel Or vbDefaultButton1 Or vbExclamation, Me.caption)
Select Case lngReturn
Case vbYes
If speichern() = True Then
@@ -596,13 +596,13 @@ Private Sub Form_Load()
If m_Pruefzaehler Is Nothing Then
Set m_Pruefzaehler = New CPruefzaehler
strSearch = InputBox("Bitte geben Sie die SerienNr, kundeneigene SNr oder Gerätenummer des Zählers an", "Rückläufer Analyse")
strSearch = InputBox("Bitte geben Sie die SerienNr, kundeneigene SNr oder Gerätenummer des Zählers an", "Rückläufer Analyse")
lngSerienNr = val(strSearch)
If strSearch <> "" Then
Screen.MousePointer = vbHourglass
If m_Pruefzaehler.loadForSerienOrFabNummerOrKundeneigene(strSearch) = False Then
Call MsgBox("Prüfzählerdaten konnten für Nr. " & lngSerienNr & " nicht geladen werden", vbCritical, "Rückläufer Analyse")
Call MsgBox("Prüfzählerdaten konnten für Nr. " & lngSerienNr & " nicht geladen werden", vbCritical, "Rückläufer Analyse")
Set m_Pruefzaehler = Nothing
Screen.MousePointer = vbNormal
Exit Sub
@@ -631,7 +631,7 @@ Private Sub Form_Load()
lblAuftragPosNr.caption = m_objAuftrag.getNr & " / " & m_objAuftragPosition.getNr
lblSerienNr.caption = FormatSerienNr(m_Pruefzaehler.getSerienNr)
lblKunde.caption = m_objAuftrag.getKunde.getName & ", " & m_objAuftrag.getKunde.getOrt
lblBezeichnung.caption = m_objIdentNr.getTyp & " " & m_objIdentNr.getTypzusatz & " DN" & m_objIdentNr.getNennweite & " " & m_objIdentNr.GetTemperatur & "°C/PN " & m_objIdentNr.getDruck & " (" & m_objAuftragPosition.getAnzeige & ")"
lblBezeichnung.caption = m_objIdentNr.getTyp & " " & m_objIdentNr.getTypzusatz & " DN" & m_objIdentNr.getNennweite & " " & m_objIdentNr.GetTemperatur & "°C/PN " & m_objIdentNr.getDruck & " (" & m_objAuftragPosition.getAnzeige & ")"
lblFabNr.caption = m_Pruefzaehler.getAuftragPositionSerienNr.getFabNr
lblKundeneigeneSNr.caption = m_Pruefzaehler.getAuftragPositionSerienNr.getKundeneigeneSerienNr
@@ -653,7 +653,7 @@ Private Sub Form_Load()
cmdSave.Enabled = False
Exit Sub
Errorhandler:
MsgBox "Fehler " & Err.Number & " in Rückläuferanalye (Form_Load):" & Err.Description
MsgBox "Fehler " & Err.Number & " in Rückläuferanalye (Form_Load):" & Err.Description
End Sub
Private Sub clearPruefpunkteFlexgrid()
@@ -662,7 +662,7 @@ Private Sub clearPruefpunkteFlexgrid()
msfgPruefpunkte.Font.Bold = True
msfgPruefpunkte.col = 0
msfgPruefpunkte.row = 0
msfgPruefpunkte.text = "Q [m³/h]"
msfgPruefpunkte.text = "Q [m³/h]"
msfgPruefpunkte.row = 1
msfgPruefpunkte.text = "Fehler [%]"
@@ -681,7 +681,7 @@ Private Sub fillPrueffehler()
For i = 1 To 10
strTemp = "PP" & i & "_Fehler"
If rs.isFieldNull(strTemp) Then Exit For
msfgPruefpunkte.Cols = i + 1
msfgPruefpunkte.cols = i + 1
' Fehler vorhanden
Fehler = Round(rs.getDoubleValue(strTemp), 2)
@@ -775,8 +775,8 @@ End Sub
Public Function getStatusFertigung(intStatus As Integer) As String
Select Case intStatus
'0=ohne Bearbeitung, 10=Vorfertigung OK, 20=Montage,22=Prüfung abgebrochen,
'25=Grenzwertüberschreitung Prüfstation, 30=Prüfstation geprüft, 40=dieser Zähler ausgeliefert,45= Lagerauftrag an Lager geliefert, 50=Auftrag ausgeliefert
'0=ohne Bearbeitung, 10=Vorfertigung OK, 20=Montage,22=Prüfung abgebrochen,
'25=Grenzwertüberschreitung Prüfstation, 30=Prüfstation geprüft, 40=dieser Zähler ausgeliefert,45= Lagerauftrag an Lager geliefert, 50=Auftrag ausgeliefert
Case 0
getStatusFertigung = "ohne Bearbeitung"
Case 10
@@ -784,13 +784,13 @@ Public Function getStatusFertigung(intStatus As Integer) As String
Case 20
getStatusFertigung = "Montage"
Case 22
getStatusFertigung = "Prüfung abgebrochen"
getStatusFertigung = "Prüfung abgebrochen"
Case 25
getStatusFertigung = "Grenzwertüberschreitung"
getStatusFertigung = "Grenzwertüberschreitung"
Case 30
getStatusFertigung = "Prüfstation geprüft"
getStatusFertigung = "Prüfstation geprüft"
Case 40
getStatusFertigung = "Zähler ausgeliefert"
getStatusFertigung = "Zähler ausgeliefert"
Case 45
getStatusFertigung = "Lagerauftrag an Lager geliefert"
Case 50
@@ -804,7 +804,7 @@ Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim lngReturn As Long
If UnloadMode = 0 And cmdSave.Enabled = True Then
' Benutzer hat auf [X] rechts oben geklickt
lngReturn = MsgBox("Sollen Ihre Änderungen gespeichert werden?", vbYesNoCancel Or vbDefaultButton1 Or vbExclamation, Me.caption)
lngReturn = MsgBox("Sollen Ihre Änderungen gespeichert werden?", vbYesNoCancel Or vbDefaultButton1 Or vbExclamation, Me.caption)
Select Case lngReturn
Case vbCancel
Cancel = 1
@@ -836,7 +836,7 @@ Private Function speichern() As Boolean
rs.openRS "Ruecklaeuferanalyse", False
rs.addNew
' Felder für die Neuanlage
' Felder für die Neuanlage
Call rs.setValue("AuftragNr", m_Pruefzaehler.getAuftrag.getNr)
Call rs.setValue("PositionNr", m_Pruefzaehler.getAuftragPosition.getNr)
@@ -866,7 +866,7 @@ Private Function speichern() As Boolean
Call rs.setValue("Bezeichnung", lblBezeichnung.caption)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''' Prüfpunkte speichern
'''' Prüfpunkte speichern
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim strQ As String
Dim strFehler As String
@@ -877,7 +877,7 @@ Private Function speichern() As Boolean
strQ = ""
strFehler = ""
For i = 1 To msfgPruefpunkte.Cols - 1
For i = 1 To msfgPruefpunkte.cols - 1
msfgPruefpunkte.col = i
msfgPruefpunkte.row = 0
strQ = strQ & strTrenner & msfgPruefpunkte.text
@@ -916,7 +916,7 @@ Private Function speichern() As Boolean
Call rs.setValue("Befund", txtReparaturmassnahme.text)
End If
If cmbBefund.text = TXT_BITTEAUSWAEHLEN Then
' nichts ausgewählt
' nichts ausgewählt
ElseIf cmbBefund.text = TXT_ERFOLGREICH Then
rs.setValue "ReparaturErfolgreich", True
ElseIf cmbBefund.text = TXT_ERNEUTAUSGEFALLEN Then
@@ -926,7 +926,7 @@ Private Function speichern() As Boolean
rs.update
If m_lngID = 0 Then
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Die ID des eben gespeicherten Rückläufers
' Die ID des eben gespeicherten Rückläufers
Set rs = New CRecordset
rs.openRS "SELECT newID = @@IDENTITY", True
m_lngID = rs.getIntValue("newID")
@@ -940,7 +940,7 @@ Private Function speichern() As Boolean
speichern = True
Exit Function
Errorhandler:
ErrorMsg "Fehler " & Err.Number & " beim Speichern des Rückläufers: " & Err.Description
ErrorMsg "Fehler " & Err.Number & " beim Speichern des Rückläufers: " & Err.Description
End Function
Private Sub lstAusfallgrund_Click()
@@ -989,12 +989,12 @@ Private Sub AktualisiereVonHistorie(lngIndex As Long)
txtZeitaufwand = ""
Fill_lstAusfallgrund
' RH 31.07.2007: nichts auswählen
' RH 31.07.2007: nichts auswählen
'lstAusfallgrund.Selected(0) = True ' erster Eintrag ist selektiert
FelderEingabenZulassen
Call fillPruefgangFelder
msfgPruefpunkte.Cols = 1
msfgPruefpunkte.cols = 1
If Not m_Pruefgang Is Nothing Then
Call fillPrueffehler
End If
@@ -1064,8 +1064,8 @@ Private Sub AktualisiereVonHistorie(lngIndex As Long)
strDurchfluesse = rs.getStringValue("Pruefpunkte")
strFehler = rs.getStringValue("Fehler")
msfgPruefpunkte.Cols = UBound(Split(strDurchfluesse, "|")) + 2
For i = 1 To msfgPruefpunkte.Cols - 1
msfgPruefpunkte.cols = UBound(Split(strDurchfluesse, "|")) + 2
For i = 1 To msfgPruefpunkte.cols - 1
msfgPruefpunkte.col = i
msfgPruefpunkte.row = 0
msfgPruefpunkte.text = Split(strDurchfluesse, "|")(i - 1)
@@ -1083,7 +1083,7 @@ Private Sub AktualisiereVonHistorie(lngIndex As Long)
Exit Sub
Errorhandler:
ErrorMsg "Fehler " & Err.Number & " beim Anzeigen des Rückläufers: " & Err.Description
ErrorMsg "Fehler " & Err.Number & " beim Anzeigen des Rückläufers: " & Err.Description
End Sub
Private Sub TestAufAusfallgrund()
@@ -1111,7 +1111,7 @@ Private Function PruefeAufPflichtfelder() As Boolean
Next
If blnAusgewaehlt = False Then
MsgBox "Bitte wählen Sie mindestens einen Ausfallgrund!", vbCritical
MsgBox "Bitte wählen Sie mindestens einen Ausfallgrund!", vbCritical
If lstAusfallgrund.Enabled = True Then
lstAusfallgrund.SetFocus
End If
@@ -1120,7 +1120,7 @@ Private Function PruefeAufPflichtfelder() As Boolean
End If
' If Trim(txtAusfallgrund.text) = "" Then
' MsgBox "Bitte füllen Sie das Feld 'sonstiges' aus!", vbCritical
' MsgBox "Bitte füllen Sie das Feld 'sonstiges' aus!", vbCritical
' If txtAusfallgrund.Enabled = True Then
' txtAusfallgrund.SetFocus
' End If
@@ -1128,7 +1128,7 @@ Private Function PruefeAufPflichtfelder() As Boolean
' Exit Function
' End If
' If Trim(txtReparaturmassnahme.text) = "" Then
' MsgBox "Bitte füllen Sie das Feld 'Reparaturmaßnahmen' aus!", vbCritical
' MsgBox "Bitte füllen Sie das Feld 'Reparaturmaßnahmen' aus!", vbCritical
' If txtReparaturmassnahme.Enabled = True Then
' txtReparaturmassnahme.SetFocus
' End If
@@ -1137,7 +1137,7 @@ Private Function PruefeAufPflichtfelder() As Boolean
' End If
If Trim(txtZeitaufwand.text) = "" Then
MsgBox "Bitte füllen Sie das Feld 'Zeitaufwand' aus!", vbCritical
MsgBox "Bitte füllen Sie das Feld 'Zeitaufwand' aus!", vbCritical
If txtZeitaufwand.Enabled = True Then
txtZeitaufwand.SetFocus
End If
@@ -1255,7 +1255,7 @@ Private Sub PrintProtokoll(ByRef PrintObjekt As Object)
lngSeite = lngSeite + 1
' neue Seite
If Not rs.EOF Then
' es gibt noch weitere Blöcke für weitere Seiten
' es gibt noch weitere Blöcke für weitere Seiten
If TypeName(PrintObjekt) = "Printer" Then
Printer.NewPage
Else
@@ -1267,16 +1267,20 @@ Private Sub PrintProtokoll(ByRef PrintObjekt As Object)
End If
Loop
Else
MsgBox "Es gibt keine Rückläuferdaten zu diesem Zähler"
MsgBox "Es gibt keine Rückläuferdaten zu diesem Zähler"
Printer.KillDoc
Exit Sub
End If
' ===================================================================================================================================
' === Prüfgang & Prüffehler =========================================================================================================
' ===================================================================================================================================
Dim recordset As CRecordset
Dim evaluationsQuery As String
Set recordset = New CRecordset
evaluationsQuery = " SELECT ROW_NUMBER() OVER (ORDER BY [PG].[Datum] DESC) AS [Id]"
evaluationsQuery = " SELECT ROW_NUMBER() OVER (ORDER BY [PG].[Datum]) AS [Id]"
evaluationsQuery = evaluationsQuery & " , [PG].[PruefgangNr] AS [Nr]"
evaluationsQuery = evaluationsQuery & " , [PG].[PP1_Soll] AS [P1]"
evaluationsQuery = evaluationsQuery & " , [PF].[PP1_Fehler] AS [E1]"
evaluationsQuery = evaluationsQuery & " , [PG].[PP2_Soll] AS [P2]"
@@ -1310,10 +1314,11 @@ Private Sub PrintProtokoll(ByRef PrintObjekt As Object)
Dim x As Integer
Dim p As Double
Dim e As Double
Dim cols(10) As Double
Dim soll(10) As String
Dim evaluations() As Variant
Dim length As Integer
Dim mw As Double
Const offsetX = 0.5
length = recordset.RecordCount
ReDim evaluations(length)
@@ -1325,27 +1330,28 @@ Private Sub PrintProtokoll(ByRef PrintObjekt As Object)
Do While Not recordset.EOF
Dim ist(10) As String
id = recordset.getIntValue("Id")
x = 0
ist(0) = recordset.getLongValue("Nr")
If cols(0) < Printer.textWidth(ist(0)) + 2 * offsetX Then
cols(0) = Printer.textWidth(ist(0)) + 2 * offsetX
End If
soll(0) = "Püfgang"
For col = 1 To 10
p = recordset.getDoubleValue("P" & col)
If p <> 0 Then
soll(x) = Format(p, "#,##0.000") & ""
End If
e = recordset.getDoubleValue("E" & col)
If e <> 0 Then
ist(x) = Format(e, "#,##0.000") & "%"
If Printer.TextWidth(ist(x)) > mw Then
mw = Printer.TextWidth(ist(x))
End If
If p <> 0 Then
soll(col) = Format(p, "#,##0.000") & ""
End If
If p <> 0 Or e <> 0 Then
x = x + 1
If e <> 0 Then
ist(col) = Format(e, "#,##0.000") & "%"
If cols(col) < Printer.textWidth(ist(col)) Then
cols(col) = Printer.textWidth(ist(col)) + 2 * offsetX
End If
End If
Next
@@ -1356,7 +1362,6 @@ Private Sub PrintProtokoll(ByRef PrintObjekt As Object)
evaluations(0) = soll
If length > 0 Then
Dim offsetX As Double
Dim offsetY As Double
Dim initX As Double
Dim initY As Double
@@ -1367,10 +1372,8 @@ Private Sub PrintProtokoll(ByRef PrintObjekt As Object)
Dim text As String
Dim h As Double
Dim tw As Double
Dim mw As Double
Printer.FontSize = 10
offsetX = 0.75
offsetY = 0.75
initX = 22 + 5 ' is the left border X coordinate of the previous element
initY = mdblCurrentY ' is the bottom border Y coordinate of the previous element
@@ -1379,7 +1382,6 @@ Private Sub PrintProtokoll(ByRef PrintObjekt As Object)
width = Printer.ScaleWidth - 9.7 ' width between inner frames
lineH = Printer.TextHeight("|")
h = initY + lineH * (length + 2) + 0.4
x = x - 1
Printer.Line (initX, initY)-(width, initY), vbActiveBorder
@@ -1392,13 +1394,14 @@ Private Sub PrintProtokoll(ByRef PrintObjekt As Object)
Printer.FontBold = False
End If
For col = 0 To x
For col = 0 To 10
text = evaluations(row)(col)
tw = Printer.TextWidth(text)
tw = Printer.textWidth(text)
px = px + offsetX + 0.1
mw = cols(col)
Printer.currentX = px + ((mw - tw) / 2)
Printer.currentY = py
Printer.CurrentX = px + ((mw - tw) / 2)
Printer.CurrentY = py
Printer.Print text
px = px + mw + offsetX
@@ -1409,20 +1412,24 @@ Private Sub PrintProtokoll(ByRef PrintObjekt As Object)
Printer.Line (initX, py)-(width, py), vbActiveBorder
Next
x = x + 1
px = initX
For col = 0 To x
Printer.Line (px, initY)-(px, h), vbActiveBorder
px = px + offsetX + mw + offsetX + 0.1
For col = 0 To 10
On Error Resume Next
text = evaluations(0)(col)
If text <> "" Then
Printer.Line (px, initY)-(px, h), vbActiveBorder
px = px + cols(col) + offsetX * 2 + 0.1
End If
Next
Printer.Line (width, initY)-(width, h), vbActiveBorder
mdblCurrentY = py
End If
' ===================================================================================================================================
' === Ende Prüfgang & Prüffehler ====================================================================================================
' ===================================================================================================================================
mdblCurrentY = mdblCurrentY + PrintObjekt.TextHeight("X") * 1.5
PrintObjekt.FontSize = 10
@@ -1431,17 +1438,17 @@ Private Sub PrintProtokoll(ByRef PrintObjekt As Object)
PrintText PrintObjekt, mdblLinkerRand + 52, mdblCurrentY, lngGesZeit & " min", , False
mdblCurrentY = mdblCurrentY + PrintObjekt.TextHeight("X") * 1.5 * 2
PrintWithLinie PrintObjekt, "Befund / Reparatur-Maßnahme:"
PrintWithLinie PrintObjekt, "Befund / Reparatur-Maßnahme:"
mdblCurrentY = mdblCurrentY + PrintObjekt.TextHeight("X") * 1.5 * 2
PrintWithLinie PrintObjekt, ""
mdblCurrentY = mdblUntererRand - 20
PrintText PrintObjekt, mdblLinkerRand + 10, mdblCurrentY, "Unterschrift:", , True
PrintObjekt.Line (mdblLinkerRand + 10 + PrintObjekt.TextWidth("Unterschrift:"), mdblCurrentY + PrintObjekt.TextHeight("X"))-(mdblLinkerRand + 10 + PrintObjekt.TextWidth("Unterschrift:") + 50, mdblCurrentY + PrintObjekt.TextHeight("X"))
PrintObjekt.Line (mdblLinkerRand + 10 + PrintObjekt.textWidth("Unterschrift:"), mdblCurrentY + PrintObjekt.TextHeight("X"))-(mdblLinkerRand + 10 + PrintObjekt.textWidth("Unterschrift:") + 50, mdblCurrentY + PrintObjekt.TextHeight("X"))
PrintText PrintObjekt, mdblLinkerRand + 100, mdblCurrentY, "Datum:", , True
PrintObjekt.Line (mdblLinkerRand + 100 + PrintObjekt.TextWidth("Datum:"), mdblCurrentY + PrintObjekt.TextHeight("X"))-(mdblRechterRand - 20, mdblCurrentY + PrintObjekt.TextHeight("X"))
PrintObjekt.Line (mdblLinkerRand + 100 + PrintObjekt.textWidth("Datum:"), mdblCurrentY + PrintObjekt.TextHeight("X"))-(mdblRechterRand - 20, mdblCurrentY + PrintObjekt.TextHeight("X"))
If TypeName(PrintObjekt) = "Printer" Then
Printer.EndDoc
@@ -1455,16 +1462,16 @@ Errorhandler:
'End If
End Sub
Private Sub PrintWithLinie(PrintObjekt As Object, strText As String, Optional MaxWidth As Variant)
Private Sub PrintWithLinie(PrintObjekt As Object, strText As String, Optional maxWidth As Variant)
If IsMissing(MaxWidth) Then
MaxWidth = mdblRechterRand - 10
If IsMissing(maxWidth) Then
maxWidth = mdblRechterRand - 10
Else
MaxWidth = MaxWidth + mdblLinkerRand + 10 + PrintObjekt.TextWidth(strText)
maxWidth = maxWidth + mdblLinkerRand + 10 + PrintObjekt.textWidth(strText)
End If
PrintText PrintObjekt, mdblLinkerRand + 10, mdblCurrentY, strText, , True
PrintObjekt.Line (mdblLinkerRand + 10 + PrintObjekt.TextWidth(strText), mdblCurrentY + PrintObjekt.TextHeight(strText))-(MaxWidth, mdblCurrentY + PrintObjekt.TextHeight(strText))
PrintObjekt.Line (mdblLinkerRand + 10 + PrintObjekt.textWidth(strText), mdblCurrentY + PrintObjekt.TextHeight(strText))-(maxWidth, mdblCurrentY + PrintObjekt.TextHeight(strText))
End Sub
Private Sub PrintRahmen(ByRef PrintObjekt As Object, Optional lngSeitenNr As Long = 1, Optional lngAnzahlSeiten As Long = 1)
@@ -1487,27 +1494,27 @@ Private Sub PrintRahmen(ByRef PrintObjekt As Object, Optional lngSeitenNr As Lon
Dim dblBildhoehe As Double
dblBildbreite = 45
dblBildhoehe = dblBildbreite * ImgLogo.Height / ImgLogo.width
dblBildhoehe = dblBildbreite * ImgLogo.height / ImgLogo.width
PrintObjekt.PaintPicture ImgLogo.Picture, mdblLinkerRand + 2, mdblObererRand + 5, dblBildbreite, dblBildhoehe
' Linie Vertikal rechts vom Bild
PrintObjekt.Line (mdblLinkerRand + dblBildbreite + 4, mdblObererRand)-(mdblLinkerRand + dblBildbreite + 4, mdblLinie1top)
' Linie horizontal halbe Höhe
' Linie horizontal halbe Höhe
PrintObjekt.Line (mdblLinkerRand + dblBildbreite + 4, mdblObererRand + 13)-(mdblRechterRand, mdblObererRand + 13)
PrintObjekt.FontSize = 12
' PrintText PrintObjekt, mdblLinkerRand + 75, mdblLinie1top - 18, "Anlage 2 zur", , False
' PrintText PrintObjekt, mdblLinkerRand + 65, mdblLinie1top - 12, "Arbeits- und Prüfanweisung", , True
' PrintText PrintObjekt, mdblLinkerRand + 65, mdblLinie1top - 12, "Arbeits- und Prüfanweisung", , True
'
PrintObjekt.FontSize = 12
'PrintText PrintObjekt, mdblLinkerRand + 95, mdblLinie1top - 6, "Rückläuferanalyse", , True
'PrintText PrintObjekt, mdblLinkerRand + 95, mdblLinie1top - 6, "Rückläuferanalyse", , True
PrintObjekt.Font.Bold = False
PrintTextAligned PrintObjekt, "Anlage 2 zur", mdblLinkerRand + dblBildbreite + 4, mdblLinkerRand + dblBildbreite + 100, mdblLinie1top - 18, vbCenter
PrintObjekt.Font.Bold = True
PrintTextAligned PrintObjekt, "ARBEITS- UND PRÜFANWEISUNG", mdblLinkerRand + dblBildbreite + 4, mdblLinkerRand + dblBildbreite + 100, mdblLinie1top - 12, vbCenter
PrintTextAligned PrintObjekt, "ARBEITS- UND PRÜFANWEISUNG", mdblLinkerRand + dblBildbreite + 4, mdblLinkerRand + dblBildbreite + 100, mdblLinie1top - 12, vbCenter
PrintTextAligned PrintObjekt, "Rückläuferanalyse", mdblLinkerRand + dblBildbreite + 4, mdblLinkerRand + dblBildbreite + 100, mdblLinie1top - 6, vbCenter
PrintTextAligned PrintObjekt, "Rückläuferanalyse", mdblLinkerRand + dblBildbreite + 4, mdblLinkerRand + dblBildbreite + 100, mdblLinie1top - 6, vbCenter
' vertikale Linie rechts , links neben Dokument-Nr
PrintObjekt.Line (mdblLinkerRand + dblBildbreite + 100, mdblObererRand)-(mdblLinkerRand + dblBildbreite + 100, mdblLinie1top)
@@ -1523,8 +1530,8 @@ Private Sub PrintRahmen(ByRef PrintObjekt As Object, Optional lngSeitenNr As Lon
mdblCurrentY = mdblLinie1top
PrintObjekt.currentX = mdblLinkerRand
PrintObjekt.currentY = mdblUntererRand + 1
PrintObjekt.CurrentX = mdblLinkerRand
PrintObjekt.CurrentY = mdblUntererRand + 1
PrintObjekt.Font.Size = 8
PrintObjekt.Print "gedruckt am " & Format(Now, "dd.mm.yyyy hh:mm:ss") & " von " & g_App.Mitarbeiter.getVorname & " " & g_App.Mitarbeiter.getName
PrintObjekt.Font.Size = 12
@@ -1543,10 +1550,10 @@ Private Sub PrintKopfdaten(ByRef PrintObjekt As Object)
PrintText PrintObjekt, mdblLinkerRand + 10 + 75, mdblCurrentY, m_objAuftrag.getKunde.getOrt
mdblCurrentY = mdblCurrentY + 10
PrintText PrintObjekt, mdblLinkerRand + 10, mdblCurrentY, "Zählertyp:", , True
PrintText PrintObjekt, mdblLinkerRand + 10, mdblCurrentY, "Zählertyp:", , True
PrintText PrintObjekt, mdblLinkerRand + 10 + 25, mdblCurrentY, lblBezeichnung.caption
mdblCurrentY = mdblCurrentY + 10
PrintText PrintObjekt, mdblLinkerRand + 10, mdblCurrentY, "Zählernummer:", , True
PrintText PrintObjekt, mdblLinkerRand + 10, mdblCurrentY, "Zählernummer:", , True
PrintText PrintObjekt, mdblLinkerRand + 10 + 35, mdblCurrentY, FormatSerienNr(lblSerienNr.caption), , True
If m_objAuftragPositionSerienNr.getKundeneigeneSerienNr <> "" Then
@@ -1575,19 +1582,19 @@ Private Sub PrintAusfallBlock(rs As CRecordset, ByRef PrintObjekt As Object)
PrintObjekt.Line (dblLinksOben, mdblCurrentY)-(dblRechtsOben, mdblCurrentY)
PrintObjekt.Font.Size = 10
mdblCurrentY = mdblCurrentY + PrintObjekt.TextHeight("X")
PrintText PrintObjekt, mdblLinkerRand + 12, mdblCurrentY, "Prüfstation: ", , True
PrintText PrintObjekt, mdblLinkerRand + 12, mdblCurrentY, "Prüfstation: ", , True
PrintText PrintObjekt, mdblLinkerRand + 35, mdblCurrentY, rs.getIntValue("Pruefstation")
PrintText PrintObjekt, mdblLinkerRand + 50, mdblCurrentY, "Zählerposition: ", , True
PrintText PrintObjekt, mdblLinkerRand + 50, mdblCurrentY, "Zählerposition: ", , True
PrintText PrintObjekt, mdblLinkerRand + 80, mdblCurrentY, rs.getIntValue("Einbauplatz")
PrintText PrintObjekt, mdblLinkerRand + 90, mdblCurrentY, "Prüfer: ", , True
PrintText PrintObjekt, mdblLinkerRand + 90, mdblCurrentY, "Prüfer: ", , True
PrintText PrintObjekt, mdblLinkerRand + 107, mdblCurrentY, rs.getStringValue("Pruefer") & " (" & rs.getStringValue("PrueferNr") & ")"
mdblCurrentY = mdblCurrentY + PrintObjekt.TextHeight("X") * 1.5
If rs.getLongValue("PruefgangNr") <> 0 Then
PrintText PrintObjekt, mdblLinkerRand + 10, mdblCurrentY, "Prüfgang: ", , True
PrintText PrintObjekt, mdblLinkerRand + 10, mdblCurrentY, "Prüfgang: ", , True
PrintText PrintObjekt, mdblLinkerRand + 30, mdblCurrentY, rs.getLongValue("PruefgangNr")
blnHasPruefgang = True
End If
@@ -1599,7 +1606,7 @@ Private Sub PrintAusfallBlock(rs As CRecordset, ByRef PrintObjekt As Object)
Dim varTmp As Variant
Dim i As Integer
i = 1
PrintText PrintObjekt, mdblLinkerRand + 80, mdblCurrentY, "Q [m³/h]"
PrintText PrintObjekt, mdblLinkerRand + 80, mdblCurrentY, "Q [m³/h]"
PrintObjekt.Line (mdblLinkerRand + 80, mdblCurrentY + 5)-(mdblLinkerRand + 80 + 15, mdblCurrentY + 5)
PrintText PrintObjekt, mdblLinkerRand + 68, mdblCurrentY + 6, "Abweichung [%]"
@@ -1622,7 +1629,7 @@ Private Sub PrintAusfallBlock(rs As CRecordset, ByRef PrintObjekt As Object)
End If
If rs.getLongValue("FabNr") Then
PrintText PrintObjekt, mdblLinkerRand + 10, mdblCurrentY, "Geräte-Nr.:", True
PrintText PrintObjekt, mdblLinkerRand + 10, mdblCurrentY, "Geräte-Nr.:", True
PrintText PrintObjekt, mdblLinkerRand + 30, mdblCurrentY, rs.getLongValue("FabNr")
mdblCurrentY = mdblCurrentY + Printer.TextHeight("X") * 1.5
End If
@@ -1639,7 +1646,7 @@ Private Sub PrintAusfallBlock(rs As CRecordset, ByRef PrintObjekt As Object)
strSQL = strSQL & "WHERE (Ruecklaeufer_Ausfallgrund.Ruecklaufer_ID = " & rs.getIntValue("ID") & ") ORDER BY Ausfallgruende.Sortorder"
rsAusfall.openRS strSQL, True
If Not rs.EOF Then
PrintText PrintObjekt, mdblLinkerRand + 10, mdblCurrentY, "Ausfallgründe: ", , True
PrintText PrintObjekt, mdblLinkerRand + 10, mdblCurrentY, "Ausfallgründe: ", , True
Do While Not rsAusfall.EOF
PrintText PrintObjekt, mdblLinkerRand + 40, mdblCurrentY, rsAusfall.getStringValue("Text")
@@ -1658,7 +1665,7 @@ Private Sub PrintAusfallBlock(rs As CRecordset, ByRef PrintObjekt As Object)
For Each varZeile In Split(strTemp, vbCrLf)
ymax = mdblCurrentY + 40
WrapText PrintObjekt, Trim(varZeile), mdblLinkerRand + 20, mdblRechterRand - 10, mdblCurrentY, ymax, False
mdblCurrentY = PrintObjekt.currentY
mdblCurrentY = PrintObjekt.CurrentY
Next
End If
@@ -1672,7 +1679,7 @@ Private Sub PrintAusfallBlock(rs As CRecordset, ByRef PrintObjekt As Object)
For Each varZeile In Split(strTemp, vbCrLf)
ymax = mdblCurrentY + 40
WrapText PrintObjekt, Trim(varZeile), mdblLinkerRand + 20, mdblRechterRand - 10, mdblCurrentY, ymax, False
mdblCurrentY = PrintObjekt.currentY
mdblCurrentY = PrintObjekt.CurrentY
Next
End If
@@ -1703,21 +1710,21 @@ Private Sub SaveAusfallgruende(RuecklaeuferID As Long)
If rs.EOF Then
' kein Datensatz vorhanden
If lstAusfallgrund.Selected(i) = True Then
' ist ausgewählt ? Dann als neu hinzufügen
' ist ausgewählt ? Dann als neu hinzufügen
rs.addNew
rs.setValue "Ruecklaufer_ID", RuecklaeuferID
rs.setValue "Ausfallgrund_ID", lngAusfallgrundID
Debug.Print RuecklaeuferID & "/" & lngAusfallgrundID & " neu"
rs.update
Else
'Debug.Print RuecklaeuferID & "/" & lngAusfallgrundID & " bleibt draußen"
'Debug.Print RuecklaeuferID & "/" & lngAusfallgrundID & " bleibt draußen"
End If
Else
' Datensatz vorhanden
If lstAusfallgrund.Selected(i) = True Then
Else
Debug.Print RuecklaeuferID & "/" & lngAusfallgrundID & " wird gelöscht"
Debug.Print RuecklaeuferID & "/" & lngAusfallgrundID & " wird gelöscht"
rs.delete
rs.update
End If