POS in Kassa eingebaut.
This commit is contained in:
30
SDL/kassenbuch/frmBelegNeu.Designer.vb
generated
30
SDL/kassenbuch/frmBelegNeu.Designer.vb
generated
@@ -97,6 +97,7 @@ Partial Class frmBelegNeu
|
|||||||
Me.Label1 = New System.Windows.Forms.Label()
|
Me.Label1 = New System.Windows.Forms.Label()
|
||||||
Me.kdkunde = New VERAG_PROG_ALLGEMEIN.KdSearchBox()
|
Me.kdkunde = New VERAG_PROG_ALLGEMEIN.KdSearchBox()
|
||||||
Me.pnlOPt = New System.Windows.Forms.Panel()
|
Me.pnlOPt = New System.Windows.Forms.Panel()
|
||||||
|
Me.btnPOS = New System.Windows.Forms.Button()
|
||||||
Me.cbxBelegOffnen = New System.Windows.Forms.CheckBox()
|
Me.cbxBelegOffnen = New System.Windows.Forms.CheckBox()
|
||||||
Me.lblStorno = New System.Windows.Forms.Label()
|
Me.lblStorno = New System.Windows.Forms.Label()
|
||||||
Me.Label17 = New System.Windows.Forms.Label()
|
Me.Label17 = New System.Windows.Forms.Label()
|
||||||
@@ -135,7 +136,6 @@ Partial Class frmBelegNeu
|
|||||||
Me.DataGridViewTextBoxColumn8 = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
Me.DataGridViewTextBoxColumn8 = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
||||||
Me.DataGridViewTextBoxColumn9 = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
Me.DataGridViewTextBoxColumn9 = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
||||||
Me.FlowLayoutPanel2 = New System.Windows.Forms.FlowLayoutPanel()
|
Me.FlowLayoutPanel2 = New System.Windows.Forms.FlowLayoutPanel()
|
||||||
Me.btnPOS = New System.Windows.Forms.Button()
|
|
||||||
CType(Me.dgvBelegPos, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.dgvBelegPos, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.pnl.SuspendLayout()
|
Me.pnl.SuspendLayout()
|
||||||
Me.pnlData.SuspendLayout()
|
Me.pnlData.SuspendLayout()
|
||||||
@@ -1194,6 +1194,20 @@ Partial Class frmBelegNeu
|
|||||||
Me.pnlOPt.Size = New System.Drawing.Size(624, 92)
|
Me.pnlOPt.Size = New System.Drawing.Size(624, 92)
|
||||||
Me.pnlOPt.TabIndex = 6
|
Me.pnlOPt.TabIndex = 6
|
||||||
'
|
'
|
||||||
|
'btnPOS
|
||||||
|
'
|
||||||
|
Me.btnPOS.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||||
|
Me.btnPOS.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.btnPOS.Image = Global.SDL.My.Resources.Resources.verag_Card1
|
||||||
|
Me.btnPOS.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||||
|
Me.btnPOS.Location = New System.Drawing.Point(486, 33)
|
||||||
|
Me.btnPOS.Name = "btnPOS"
|
||||||
|
Me.btnPOS.Padding = New System.Windows.Forms.Padding(0, 0, 5, 0)
|
||||||
|
Me.btnPOS.Size = New System.Drawing.Size(64, 59)
|
||||||
|
Me.btnPOS.TabIndex = 16
|
||||||
|
Me.btnPOS.TextAlign = System.Drawing.ContentAlignment.MiddleRight
|
||||||
|
Me.btnPOS.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
'cbxBelegOffnen
|
'cbxBelegOffnen
|
||||||
'
|
'
|
||||||
Me.cbxBelegOffnen.AutoSize = True
|
Me.cbxBelegOffnen.AutoSize = True
|
||||||
@@ -1647,20 +1661,6 @@ Partial Class frmBelegNeu
|
|||||||
Me.FlowLayoutPanel2.TabIndex = 3
|
Me.FlowLayoutPanel2.TabIndex = 3
|
||||||
Me.FlowLayoutPanel2.Visible = False
|
Me.FlowLayoutPanel2.Visible = False
|
||||||
'
|
'
|
||||||
'btnPOS
|
|
||||||
'
|
|
||||||
Me.btnPOS.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
|
||||||
Me.btnPOS.ForeColor = System.Drawing.Color.Black
|
|
||||||
Me.btnPOS.Image = Global.SDL.My.Resources.Resources.verag_Card1
|
|
||||||
Me.btnPOS.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
|
||||||
Me.btnPOS.Location = New System.Drawing.Point(486, 33)
|
|
||||||
Me.btnPOS.Name = "btnPOS"
|
|
||||||
Me.btnPOS.Padding = New System.Windows.Forms.Padding(0, 0, 5, 0)
|
|
||||||
Me.btnPOS.Size = New System.Drawing.Size(64, 59)
|
|
||||||
Me.btnPOS.TabIndex = 16
|
|
||||||
Me.btnPOS.TextAlign = System.Drawing.ContentAlignment.MiddleRight
|
|
||||||
Me.btnPOS.UseVisualStyleBackColor = True
|
|
||||||
'
|
|
||||||
'frmBelegNeu
|
'frmBelegNeu
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!)
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports System.Drawing.Printing
|
Imports System.Drawing.Printing
|
||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
|
Imports com.sun.org.apache.xpath.internal.operations
|
||||||
|
Imports DAKOSY_Worker.DEXPRD
|
||||||
|
Imports Microsoft.Win32
|
||||||
Imports SDL.RKSVServer
|
Imports SDL.RKSVServer
|
||||||
|
Imports VERAG_PROG_ALLGEMEIN.TESTJSON
|
||||||
|
|
||||||
Public Class frmBelegNeu
|
Public Class frmBelegNeu
|
||||||
Implements System.ComponentModel.INotifyPropertyChanged
|
Implements System.ComponentModel.INotifyPropertyChanged
|
||||||
@@ -30,6 +34,7 @@ Public Class frmBelegNeu
|
|||||||
Private EasyZVT_Worker As System.ComponentModel.BackgroundWorker = New System.ComponentModel.BackgroundWorker()
|
Private EasyZVT_Worker As System.ComponentModel.BackgroundWorker = New System.ComponentModel.BackgroundWorker()
|
||||||
Private Funktion As Integer
|
Private Funktion As Integer
|
||||||
Private Betrag As Integer = 0
|
Private Betrag As Integer = 0
|
||||||
|
Private posTerminal As cRKSV_POS
|
||||||
|
|
||||||
Public aktFiliale As Integer = 0
|
Public aktFiliale As Integer = 0
|
||||||
Public aktAbfertigungsNr As Integer = 0
|
Public aktAbfertigungsNr As Integer = 0
|
||||||
@@ -281,6 +286,9 @@ Public Class frmBelegNeu
|
|||||||
cboFiliale.Enabled = False
|
cboFiliale.Enabled = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
AddHandler EasyZVT_Worker.DoWork, New ComponentModel.DoWorkEventHandler(AddressOf EasyZVT_Async)
|
||||||
|
AddHandler EasyZVT_Worker.RunWorkerCompleted, New System.ComponentModel.RunWorkerCompletedEventHandler(AddressOf EasyZVT_OnCompleted)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
@@ -723,7 +731,7 @@ Public Class frmBelegNeu
|
|||||||
|
|
||||||
|
|
||||||
' Dim RKSV_Service_Location = "\\192.168.0.106:8733/Design_Time_Addresses/RKSVCompleteServer/Service1/"
|
' Dim RKSV_Service_Location = "\\192.168.0.106:8733/Design_Time_Addresses/RKSVCompleteServer/Service1/"
|
||||||
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click, btnPOS.Click
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click ' ,btnPOS.Click
|
||||||
|
|
||||||
Dim IsPosPayment As Boolean = False
|
Dim IsPosPayment As Boolean = False
|
||||||
|
|
||||||
@@ -1106,7 +1114,8 @@ Public Class frmBelegNeu
|
|||||||
' If EA = "E" Then
|
' If EA = "E" Then
|
||||||
lblBetrag_Netto.Text = sum.ToString("C")
|
lblBetrag_Netto.Text = sum.ToString("C")
|
||||||
lblBetrag_Steuern.Text = (sum * txtSteuersatz._value).ToString("C")
|
lblBetrag_Steuern.Text = (sum * txtSteuersatz._value).ToString("C")
|
||||||
lblBetrag_Brutto.Text = (sum + sum * txtSteuersatz._value).ToString("C")
|
Betrag = (sum + sum * txtSteuersatz._value)
|
||||||
|
lblBetrag_Brutto.Text = (Betrag).ToString("C")
|
||||||
' Else
|
' Else
|
||||||
' lblBetrag_Netto.Text = (-1 * sum).ToString("C")
|
' lblBetrag_Netto.Text = (-1 * sum).ToString("C")
|
||||||
' lblBetrag_Steuern.Text = (-1 * (sum * txtSteuersatz._value)).ToString("C")
|
' lblBetrag_Steuern.Text = (-1 * (sum * txtSteuersatz._value)).ToString("C")
|
||||||
@@ -1425,6 +1434,7 @@ Public Class frmBelegNeu
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function cntPosFilAbf(FilialenNr, AbfertigungsNr) As Integer
|
Function cntPosFilAbf(FilialenNr, AbfertigungsNr) As Integer
|
||||||
For Each b In BELEG.POS
|
For Each b In BELEG.POS
|
||||||
' MsgBox(CInt(If(b.FilialenNr, 0)) & " = " & CInt(If(FilialenNr, 0)) & " -- " & CInt(If(b.AbfertigungsNr, 0)) & " = " & CInt(If(AbfertigungsNr, 0)) & " -- " & (CInt(If(b.FilialenNr, 0)) = CInt(If(FilialenNr, 0)) And CInt(If(b.AbfertigungsNr, 0)) = CInt(If(AbfertigungsNr, 0))))
|
' MsgBox(CInt(If(b.FilialenNr, 0)) & " = " & CInt(If(FilialenNr, 0)) & " -- " & CInt(If(b.AbfertigungsNr, 0)) & " = " & CInt(If(AbfertigungsNr, 0)) & " -- " & (CInt(If(b.FilialenNr, 0)) = CInt(If(FilialenNr, 0)) And CInt(If(b.AbfertigungsNr, 0)) = CInt(If(AbfertigungsNr, 0))))
|
||||||
@@ -1469,6 +1479,144 @@ Public Class frmBelegNeu
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub EasyZVT_Async(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs)
|
||||||
|
' Programmstart von ZVTStart.exe und warten auf Programmende
|
||||||
|
|
||||||
|
Dim ZVTKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\GUB\ZVT", True)
|
||||||
|
Try
|
||||||
|
Dim ZVTStart As String = ZVTKey.GetValue("Start")
|
||||||
|
Dim Proc As System.Diagnostics.Process
|
||||||
|
|
||||||
|
If (Len(ZVTStart) > 1) Then
|
||||||
|
ZVTKey.SetValue("Ergebnis", 1000, RegistryValueKind.DWord) ' Wenn das Ergebnis 1000 bleibt konnte EasyZVT nicht gestartet werden
|
||||||
|
Proc = System.Diagnostics.Process.Start(ZVTStart)
|
||||||
|
System.Threading.Thread.Sleep(posTerminal.pos_wartezeit) ' Warte xx Sekunden bis Prozess ZVTStart geladen ist, dann erst anfangen Flag Aktiv abzufragen
|
||||||
|
While ZVTKey.GetValue("Aktiv") = 1
|
||||||
|
System.Threading.Thread.Sleep(500) ' Warten...
|
||||||
|
|
||||||
|
End While
|
||||||
|
|
||||||
|
Else
|
||||||
|
MsgBox("EasyZVT ist nicht installiert. Bitte im Internet Explorer über www.easyzvt.de/publish installieren")
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
MessageBox.Show("Der Programmstart ist fehlgeschlagen: " & ex.Message)
|
||||||
|
Exit Sub
|
||||||
|
End Try
|
||||||
|
ZVTKey.Close()
|
||||||
|
End Sub
|
||||||
|
Private Sub EasyZVT_OnCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs)
|
||||||
|
' Diese Funktion wird automatisch aufgerufen wenn der Worker-Thread seine Arbeit beendet
|
||||||
|
' und EasyZVT seine Ausgabewerte in die Registry zurückgeschrieben hat
|
||||||
|
|
||||||
|
|
||||||
|
Dim ZVTKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\GUB\ZVT", True)
|
||||||
|
Dim response As String = ""
|
||||||
|
response &= ZVTKey.GetValue("Ergebnis") & vbNewLine
|
||||||
|
response &= ZVTKey.GetValue("ErgebnisText")
|
||||||
|
|
||||||
|
'TextBox_Drucktext.Text = Replace(ZVTKey.GetValue("Drucktext"), vbLf, vbCrLf)
|
||||||
|
'TextBox_Drucktext2.Text = Replace(ZVTKey.GetValue("Drucktext2"), vbLf, vbCrLf)
|
||||||
|
|
||||||
|
'TextBox_BelegNr.Text = ZVTKey.GetValue("BelegNr").ToString
|
||||||
|
'TextBox_Betrag.Text = ""
|
||||||
|
|
||||||
|
'If CheckBoxAutodruck.Checked Then
|
||||||
|
' If Len(TextBox_Drucktext.Text) > 1 Then
|
||||||
|
' Button_Kundenbeleg_drucken.PerformClick()
|
||||||
|
' End If
|
||||||
|
' If Len(TextBox_Drucktext2.Text) > 1 Then
|
||||||
|
' Button_Haendlerbeleg_drucken.PerformClick()
|
||||||
|
' End If
|
||||||
|
|
||||||
|
'End If
|
||||||
|
|
||||||
|
'TextBox_Betrag.Focus()
|
||||||
|
'Button_Autorisierung.Enabled = True
|
||||||
|
'Button_Diagnose.Enabled = True
|
||||||
|
'Button_Tagesabschluss.Enabled = True
|
||||||
|
'Button_Storno.Enabled = True
|
||||||
|
'Button_Gutschrift.Enabled = True
|
||||||
|
ZVTKey.Close()
|
||||||
|
MsgBox(response)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btnPOS_Click(sender As Object, e As EventArgs) Handles btnPOS.Click
|
||||||
|
|
||||||
|
If cboKassen.SelectedItem.Text = "" Then Exit Sub
|
||||||
|
|
||||||
|
|
||||||
|
Dim dt As DataTable = SQL.loadDgvBySql("SELECT * FROM tblRKSV_POS WHERE [pos_aktiv] = 1 AND [pos_kasse]='" & cboKassen.SelectedItem.Value & "'", "FMZOLL")
|
||||||
|
|
||||||
|
Select Case dt.Rows.Count
|
||||||
|
Case 0
|
||||||
|
MsgBox("Für diese Kasse ist kein aktives POS-Terminal hinterlegt!")
|
||||||
|
Exit Sub
|
||||||
|
Case 1
|
||||||
|
|
||||||
|
|
||||||
|
posTerminal = New cRKSV_POS(dt.Rows(0).Item("pos_id"), dt.Rows(0).Item("pos_kasse"))
|
||||||
|
|
||||||
|
Dim ZVTKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\GUB\ZVT", True)
|
||||||
|
Dim Typ As Long
|
||||||
|
|
||||||
|
Try
|
||||||
|
|
||||||
|
ZVTKey.SetValue("Funktion", Funktion, RegistryValueKind.DWord)
|
||||||
|
Typ = posTerminal.pos_typ
|
||||||
|
ZVTKey.SetValue("Typ", Typ, RegistryValueKind.DWord)
|
||||||
|
ZVTKey.SetValue("KasseNr", posTerminal.pos_kassennr, RegistryValueKind.String)
|
||||||
|
ZVTKey.SetValue("COM", posTerminal.pos_com, RegistryValueKind.String)
|
||||||
|
ZVTKey.SetValue("IP", posTerminal.pos_ip, RegistryValueKind.String)
|
||||||
|
ZVTKey.SetValue("Port", CInt(posTerminal.pos_port), RegistryValueKind.DWord)
|
||||||
|
ZVTKey.SetValue("ComSpeed", CInt(posTerminal.pos_comspeed), RegistryValueKind.DWord)
|
||||||
|
ZVTKey.SetValue("ComStop", CInt(posTerminal.pos_comstop), RegistryValueKind.DWord)
|
||||||
|
ZVTKey.SetValue("Lizenz", posTerminal.pos_lizenz, RegistryValueKind.String)
|
||||||
|
If Funktion = 0 Or Funktion = 4 Then
|
||||||
|
ZVTKey.SetValue("Betrag", Betrag * 100, RegistryValueKind.DWord) 'CENTbeträge 1€ --> 100 CENT
|
||||||
|
End If
|
||||||
|
If Funktion = 3 Then
|
||||||
|
'ZVTKey.SetValue("StornoBetrag", CInt("0" & TextBox_Betrag.Text), RegistryValueKind.DWord)
|
||||||
|
'ZVTKey.SetValue("StornoBelegNr", CInt("0" & StornoBelegNr.Text), RegistryValueKind.DWord)
|
||||||
|
End If
|
||||||
|
If posTerminal.pos_kassendruck Then
|
||||||
|
ZVTKey.SetValue("Kassedruck", 1, RegistryValueKind.DWord)
|
||||||
|
Else
|
||||||
|
ZVTKey.SetValue("Kassedruck", 0, RegistryValueKind.DWord)
|
||||||
|
End If
|
||||||
|
ZVTKey.SetValue("Ergebnis", 1000, RegistryValueKind.DWord) ' Zur Sicherheit, falls EasyZVT gar nicht installiert ist oder nicht gestartet werden kann
|
||||||
|
ZVTKey.SetValue("ErgebnisText", "EasyZVT konnte nicht gestartet werden", RegistryValueKind.String)
|
||||||
|
'ZVTKey.SetValue("DemoDruckername", comboInstalledPrinters.Text, RegistryValueKind.String)
|
||||||
|
'If CheckBoxAutodruck.Checked Then
|
||||||
|
' ZVTKey.SetValue("DemoAutodruck", 1, RegistryValueKind.DWord)
|
||||||
|
'Else
|
||||||
|
' ZVTKey.SetValue("DemoAutodruck", 0, RegistryValueKind.DWord)
|
||||||
|
'End If
|
||||||
|
'If CheckBoxDummy.Checked Then
|
||||||
|
' ZVTKey.SetValue("DemoDummydruck", 1, RegistryValueKind.DWord)
|
||||||
|
'Else
|
||||||
|
' ZVTKey.SetValue("DemoDummydruck", 0, RegistryValueKind.DWord)
|
||||||
|
'End If
|
||||||
|
|
||||||
|
EasyZVT_Worker.RunWorkerAsync()
|
||||||
|
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
MessageBox.Show("Das Schreiben der Parameter ist fehlgeschlagen: " & ex.Message)
|
||||||
|
Exit Sub
|
||||||
|
End Try
|
||||||
|
ZVTKey.Close()
|
||||||
|
|
||||||
|
Case Else
|
||||||
|
|
||||||
|
End Select
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user