Public Sub POS_Display()
Dim txt1 As String, txt2 As String, txt3 As String, txt4 As String
Dim iName1 As Variant, iName2 As Variant, iName3 As Variant, iName4 As Variant
Dim x As Long, i As Long, z As Long
txt1 = "POS_Install"
x = 0
If Worksheets("Werte").Cells(6, 5).Value = 0 Then
Panel_Trade.POS_Image.Picture = LoadPicture("")
Else
Panel_Trade.POS_Image.Picture = LoadPicture(AppPath & "\JPG\" & Worksheets("Werte").Cells(6, 5).Value & ".jpg")
End If
Panel_Trade.POS_System.Caption = UCase(Worksheets("Werte").Cells(4, 2).Text) & " : " & UCase(Worksheets("Werte").Cells(5, 2).Text)
Panel_Trade.POS_Pad.Caption = "UNKNOWN"
If Worksheets("Werte").Cells(3, 8).Text = "S" Then
Panel_Trade.POS_Pad.Caption = "SMALL"
End If
If Worksheets("Werte").Cells(3, 8).Text = "M" Then
Panel_Trade.POS_Pad.Caption = "MEDIUM"
End If
If Worksheets("Werte").Cells(3, 8).Text = "L" Then
Panel_Trade.POS_Pad.Caption = "LARGE"
End If
Panel_Trade.POS_Stationtype.Caption = UCase(Worksheets("Werte").Cells(6, 6).Text)
Panel_Trade.POS_Juris.Caption = UCase(Worksheets("Werte").Cells(6, 2).Text)
Panel_Trade.POS_Eco.Caption = UCase(Worksheets("Werte").Cells(7, 2).Text)
If Worksheets("Data").Cells(76, 3).Value = 0 Then
Panel_Trade.POS_Distance.Caption = Worksheets("Werte").Cells(7, 5).Text & " LS"
Else
Panel_Trade.POS_Distance.Caption = Worksheets("Data").Cells(76, 3).Text & " LY / " & Worksheets("Werte").Cells(7, 5).Text & " LS"
End If
If Worksheets("Werte").Cells(10, 2).Value = 0 Then
Panel_Trade.POS_Date.Caption = "NEVER"
Else
Panel_Trade.POS_Date.Caption = UCase(Worksheets("Werte").Cells(10, 2).Text) & " - " & UCase(Worksheets("Werte").Cells(10, 3).Text)
End If
If Worksheets("Werte").Cells(8, 5).Value = 1 Then
x = x + 1
iName1 = txt1 & x
Panel_Trade.Controls(iName1).Caption = "# REFUELING"
End If
If Worksheets("Werte").Cells(9, 5).Value = 1 Then
x = x + 1
iName1 = txt1 & x
Panel_Trade.Controls(iName1).Caption = "# REARMING"
End If
If Worksheets("Werte").Cells(2, 8).Value = 1 Then
x = x + 1
iName1 = txt1 & x
Panel_Trade.Controls(iName1).Caption = "# REPAIR"
End If
If Worksheets("Werte").Cells(9, 2).Value = 1 Then
x = x + 1
iName1 = txt1 & x
Panel_Trade.Controls(iName1).Caption = "# BLACKMARKET"
End If
If Worksheets("Werte").Cells(10, 5).Value = 1 Then
x = x + 1
iName1 = txt1 & x
Panel_Trade.Controls(iName1).Caption = "# OUTFITTING"
End If
If Worksheets("Werte").Cells(8, 2).Value = 1 Then
x = x + 1
iName1 = txt1 & x
Panel_Trade.Controls(iName1).Caption = "# SHIPYARD"
End If
For i = x + 1 To 6
iName1 = txt1 & i
Panel_Trade.Controls(iName1).Caption = ""
Next i
txt1 = "POS_Ex"
txt2 = "POS_Discount"
For z = 1 To 6 Step 1
iName1 = txt1 & z
iName2 = txt2 & z
iName3 = txt2 & z & "P"
If Worksheets("POS_Export").Cells(z + 1, 1).Value <> "" Then
Panel_Trade.Controls(iName1).Caption = UCase(Worksheets("POS_Export").Cells(z + 1, 1).Text)
Panel_Trade.Controls(iName1).Visible = True
Panel_Trade.Controls(iName2).Caption = Worksheets("POS_Export").Cells(z + 1, 2).Text & " CR."
Panel_Trade.Controls(iName2).Visible = True
If Worksheets("POS_Export").Cells(z + 1, 3).Value > 0 Then
Panel_Trade.Controls(iName3).Caption = "+" & Worksheets("POS_Export").Cells(z + 1, 3).Text & " CR."
Else
Panel_Trade.Controls(iName3).Caption = Worksheets("POS_Export").Cells(z + 1, 3).Text & " CR."
End If
Panel_Trade.Controls(iName3).Visible = True
Else
Panel_Trade.Controls(iName1).Visible = False
Panel_Trade.Controls(iName2).Visible = False
Panel_Trade.Controls(iName3).Visible = False
End If
Next z
txt1 = "POS_Im"
txt2 = "POS_Profit"
For z = 1 To 6 Step 1
iName1 = txt1 & z
iName2 = txt2 & z
iName3 = txt2 & z & "P"
If Worksheets("POS_Import").Cells(z + 1, 1).Value <> "" Then
Panel_Trade.Controls(iName1).Caption = UCase(Worksheets("POS_Import").Cells(z + 1, 1).Text)
Panel_Trade.Controls(iName1).Visible = True
Panel_Trade.Controls(iName2).Caption = Worksheets("POS_Import").Cells(z + 1, 2).Text & " CR."
Panel_Trade.Controls(iName2).Visible = True
If Worksheets("POS_Import").Cells(z + 1, 3).Value > 0 Then
Panel_Trade.Controls(iName3).Caption = "+" & Worksheets("POS_Import").Cells(z + 1, 3).Text & " CR."
Else
Panel_Trade.Controls(iName3).Caption = Worksheets("POS_Import").Cells(z + 1, 3).Text & " CR."
End If
Panel_Trade.Controls(iName3).Visible = True
Else
Panel_Trade.Controls(iName1).Visible = False
Panel_Trade.Controls(iName2).Visible = False
Panel_Trade.Controls(iName3).Visible = False
End If
Next z
If Worksheets("Werte").Cells(3, 5).Value > 6 Then
Panel_Trade.POS_SB_Export.Max = Worksheets("Werte").Cells(3, 5).Value - 6
Panel_Trade.POS_SB_Export.Value = 0
Panel_Trade.POS_SB_Export.Visible = True
Else
Panel_Trade.POS_SB_Export.Visible = False
Panel_Trade.POS_SB_Export.Max = 0
Panel_Trade.POS_SB_Export.Value = 0
Panel_Trade.POS_SB_Export.Visible = True
End If
If Worksheets("Werte").Cells(3, 6).Value > 6 Then
Panel_Trade.POS_SB_Import.Max = Worksheets("Werte").Cells(3, 6).Value - 6
Panel_Trade.POS_SB_Import.Value = 0
Panel_Trade.POS_SB_Import.Visible = True
Else
Panel_Trade.POS_SB_Import.Visible = False
Panel_Trade.POS_SB_Import.Max = 0
Panel_Trade.POS_SB_Import.Value = 0
Panel_Trade.POS_SB_Import.Visible = True
End If
End Sub