ATEZ, USTV, etc.

This commit is contained in:
2025-04-08 13:12:39 +02:00
parent 80f9563bf6
commit b00baa6486
9 changed files with 731 additions and 611 deletions

View File

@@ -4991,15 +4991,13 @@
<None Include="Resources\Verag-AG-Logo_DE.jpg" />
<None Include="Resources\plose_truckmaster.png" />
<None Include="Resources\pdf_s.png" />
<None Include="Resources\VERAG_360.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Resources\ungueltig_de.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Resources\ungueltig_en.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Resources\VERAG_360.jpg" />
<Content Include="Resources\Verag_Customs_Service_AEO.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,6 @@

Imports System.ComponentModel
Imports System.IO
Imports System.IO
Imports System.Reflection
Imports System.Windows.Documents
Imports com.sun.org.apache.xml.internal.utils
Imports DAKOSY_Worker.InformationEXITDE
Imports itextsharp.text.pdf
Imports itextsharp.text.pdf.parser
Imports Microsoft.Office.Interop
@@ -18,6 +14,7 @@ Public Class frmMDM_USTVAntrag
Dim Antrag_LandKz As String = ""
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Dim posTabisSelected As Boolean = True
Dim atez_api = New cATEZ_NCTS_IN("ATEZ_VAT")
Dim von, bis As Date
@@ -63,10 +60,8 @@ Public Class frmMDM_USTVAntrag
btnEintragloeschen.Enabled = Not UStVAn_ID <= 0
btnNeuerEintrag.Enabled = Not UStVAn_ID <= 0
UstCntlUSTV_AntragPosition1.Enabled = Not UStVAn_ID <= 0
cbxLand.Visible = UStVAn_ID <= 0
With dgvUSTVPositionen
.ClearSelection()
@@ -528,6 +523,8 @@ Public Class frmMDM_USTVAntrag
setinfofields()
End Sub
Private Sub Button14_Click(sender As Object, e As EventArgs) Handles btnAntrageeinarbeiten.Click
@@ -1255,9 +1252,8 @@ Public Class frmMDM_USTVAntrag
ANTR_Leistender = New VERAG_PROG_ALLGEMEIN.cUStVLeistender(ANTR_POS.UStVPo_LeistenderId)
End If
UstCntlUSTV_AntragPosition1.Enabled = True
UstCntlUSTV_AntragPosition1.setValues(USTV_ANTRAG.UStVAn_KuNr, ANTR_POS, Antrag_LandKz, ANTR_Leistender)
UstCntlUSTV_AntragPosition1.setValues(USTV_ANTRAG.UStVAn_KuNr, ANTR_POS, Antrag_LandKz, ANTR_Leistender, atez_api)
Else
UstCntlUSTV_AntragPosition1.reset()
UstCntlUSTV_AntragPosition1.Enabled = False
@@ -2392,6 +2388,7 @@ Public Class frmMDM_USTVAntrag
End Sub
Private Sub calcSumme()
Dim countSumme As Double = 0

View File

@@ -74,6 +74,7 @@ Partial Class ustCntlUSTV_AntragPosition
Me.txtUmrechnungskurs = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.txtUSTBetrag = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.btnAPIUbload = New System.Windows.Forms.Button()
Me.Panel3 = New System.Windows.Forms.Panel()
Me.Panel4 = New System.Windows.Forms.Panel()
Me.TabControl1 = New System.Windows.Forms.TabControl()
@@ -876,6 +877,7 @@ Partial Class ustCntlUSTV_AntragPosition
'
'Panel1
'
Me.Panel1.Controls.Add(Me.btnAPIUbload)
Me.Panel1.Controls.Add(Me.btnBildAuf)
Me.Panel1.Controls.Add(Me.Button1)
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Right
@@ -884,6 +886,18 @@ Partial Class ustCntlUSTV_AntragPosition
Me.Panel1.Size = New System.Drawing.Size(99, 239)
Me.Panel1.TabIndex = 2
'
'btnAPIUbload
'
Me.btnAPIUbload.BackgroundImage = Global.SDL.My.Resources.Resources.refresh
Me.btnAPIUbload.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.btnAPIUbload.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnAPIUbload.Location = New System.Drawing.Point(36, 186)
Me.btnAPIUbload.Name = "btnAPIUbload"
Me.btnAPIUbload.Size = New System.Drawing.Size(35, 24)
Me.btnAPIUbload.TabIndex = 25
Me.btnAPIUbload.TextAlign = System.Drawing.ContentAlignment.TopCenter
Me.btnAPIUbload.UseVisualStyleBackColor = True
'
'Panel3
'
Me.Panel3.Controls.Add(Me.tbcntr)
@@ -1050,4 +1064,5 @@ Partial Class ustCntlUSTV_AntragPosition
Friend WithEvents btnLeistenderSave As Button
Friend WithEvents lblWarning As Label
Friend WithEvents cbxAntragsfilter As VERAG_PROG_ALLGEMEIN.MyCheckBoxValue
Friend WithEvents btnAPIUbload As Button
End Class

View File

@@ -1,4 +1,5 @@
Imports VERAG_PROG_ALLGEMEIN
Imports com.sun.net.httpserver.Authenticator
Imports VERAG_PROG_ALLGEMEIN
Public Class ustCntlUSTV_AntragPosition
Public UStV_POS As VERAG_PROG_ALLGEMEIN.cUStVPositionen = Nothing
@@ -12,6 +13,7 @@ Public Class ustCntlUSTV_AntragPosition
Public Event CHANGED(UStVPo_ID)
Dim gridAktiv = False
Dim txtChanged As Boolean = False
Dim API As cATEZ_NCTS_IN
Private Sub btnBildAuf_Click(sender As Object, e As EventArgs) Handles btnBildAuf.Click
RaiseEvent EV_PREV()
End Sub
@@ -56,7 +58,7 @@ Public Class ustCntlUSTV_AntragPosition
End Sub
Sub setValues(kdnr As Integer, UStV_POS As VERAG_PROG_ALLGEMEIN.cUStVPositionen, Antrag_LandKz As String, UStV_Leitender As VERAG_PROG_ALLGEMEIN.cUStVLeistender)
Sub setValues(kdnr As Integer, UStV_POS As VERAG_PROG_ALLGEMEIN.cUStVPositionen, Antrag_LandKz As String, UStV_Leitender As VERAG_PROG_ALLGEMEIN.cUStVLeistender, atez_api As cATEZ_NCTS_IN)
initSchnittstellenNr()
@@ -79,6 +81,7 @@ Public Class ustCntlUSTV_AntragPosition
sbLeistender.Text = UStV_Leitender.UStV_Leistender
loadChangedDSToPanel(UStV_Leitender, True)
API = atez_api
Dim da_id = -1
@@ -104,12 +107,15 @@ Public Class ustCntlUSTV_AntragPosition
If da_id > -1 Then
scanSonstiges.INIT_daId(da_id)
scanSonstiges.Enabled = UStV_POS.UStVPo_daId_loeschbar 'Not UStV_POS.UStVPo_SchnittstellenNr > 0
btnAPIUbload.Enabled = UStV_POS.UStVPo_daId_loeschbar
Else
scanSonstiges.INIT(kdnr, "MDM", "MDM_DATEN", "USTVA_" & UStV_POS.UStVAn_ID & "_" & UStV_POS.UStVPo_ID)
'scanSonstiges.INIT_daId(da_id)
scanSonstiges.Enabled = True
btnAPIUbload.Enabled = False
End If
scanUSTVFABest.INIT(kdnr, "KUNDENDATEN", "FA_Bestaetigungen")
scanUSTVVollmachten.INIT(kdnr, "KUNDENDATEN", "USTV_Vollmachten")
@@ -240,7 +246,7 @@ Public Class ustCntlUSTV_AntragPosition
Private Sub loadChangedDSToPanel(UStV_Leitender As VERAG_PROG_ALLGEMEIN.cUStVLeistender, Optional initial As Boolean = False)
Dim adressLoadedByLeistender As Boolean = False
UStV_Leist = UStV_Leitender
'If newLeistender <> "" Then UStV_Leist = New VERAG_PROG_ALLGEMEIN.cUStVLeistender(newLeistender)
@@ -252,7 +258,6 @@ Public Class ustCntlUSTV_AntragPosition
txtOrt.Text = ""
txtLand.Text = ""
txtUIDNr.Text = ""
Else
pnlAdresse.Enabled = True 'enablePanel 'immer änderbar!
@@ -262,20 +267,26 @@ Public Class ustCntlUSTV_AntragPosition
txtOrt.Text = If(UStV_Leist.UstV_Leistender_Stadt, "")
txtLand.Text = If(UStV_Leist.UstV_Leistender_Land, "")
txtUIDNr.Text = If(UStV_Leist.UstV_Leistender_UstNr, "")
adressLoadedByLeistender = True
End If
btnLeistenderSave.Visible = True
If Not initial Then
'Listener für Änderungen im Detail-Panel
For Each c As Control In pnlAdresse.Controls
If TypeOf (c) Is TextBox Then
AddHandler CType(c, TextBox).TextChanged, AddressOf SomethingChanged
End If
If TypeOf (c) Is MyComboBox Then
AddHandler CType(c, MyComboBox).TextChanged, AddressOf SomethingChanged
End If
Next
If Not adressLoadedByLeistender Then
For Each c As Control In pnlAdresse.Controls
If TypeOf (c) Is TextBox Then
AddHandler CType(c, TextBox).TextChanged, AddressOf SomethingChanged
End If
If TypeOf (c) Is MyComboBox Then
AddHandler CType(c, MyComboBox).TextChanged, AddressOf SomethingChanged
End If
Next
Else
btnLeistenderSave.Visible = False
End If
Else
btnLeistenderSave.Visible = False
@@ -301,7 +312,7 @@ Public Class ustCntlUSTV_AntragPosition
If Not UStV_Leist.hasEntry Then
If vbYes = MsgBox("Dieser Leistende wurde noch nicht angelegt!" & vbNewLine & UStV_Leist.UStV_Leistender & " anlegen? ", vbYesNo) Then
'adresseChanged = True
UStV_Leist.UstV_Leistender_Strasse = If(txtStrasse.Text, "")
UStV_Leist.UstV_Leistender_StrasseNr = If(txtStrassenNr.Text, "")
UStV_Leist.UstV_Leistender_PLZ = If(txtPLZ.Text, "")
@@ -309,18 +320,18 @@ Public Class ustCntlUSTV_AntragPosition
UStV_Leist.UstV_Leistender_Land = If(txtLand.Text, "")
UStV_Leist.UstV_Leistender_UstNr = If(txtUIDNr.Text, "")
If UStV_Leist.SAVE() Then
Dim saveid = UStV_Leist.SAVEID
If saveid > 0 Then
btnLeistenderSave.Visible = False
UStV_POS.UStVPo_Leistender = UStV_Leist.UStV_Leistender
UStV_POS.UStVPo_LeistenderId = UStV_Leist.UStV_LeistenderId
UStV_POS.UStVPo_LeistenderId = saveid
'RaiseEvent CHANGED(UStV_POS.UStVPo_ID)
values_changed()
End If
End If
Else
Dim adresseChanged As Boolean = False
If UStV_Leist.UstV_Leistender_Strasse <> If(txtStrasse.Text, "") Then adresseChanged = True
@@ -405,7 +416,7 @@ Public Class ustCntlUSTV_AntragPosition
loadChangedDSToPanel(UStV_Leist)
Else
loadChangedDSToPanel(Nothing)
loadChangedDSToPanel(Nothing, True)
End If
@@ -457,11 +468,11 @@ Public Class ustCntlUSTV_AntragPosition
txtUSTBetragEUR.Text = Math.Floor((txtUSTBetrag.Text / txtUmrechnungskurs.Text) * 100 + 0.5) / 100
txtChanged = True
End If
txtChanged = True
End If
End If
ElseIf sender Is txtUSTBetragEUR Then
@@ -559,5 +570,36 @@ Public Class ustCntlUSTV_AntragPosition
If cbxAntragsfilter.Checked Then filter &= " and left(UstV_Leistender_UstNr,2)='" & Antrag_LandKz & "'"
sbLeistender.initSearchBox(Me.FindForm, "[UStV_LeistenderId],[UStV_Leistender], ([UStV_Leistender] + ' ' + isnull([UstV_Leistender_UstNr],'')) as Leistender,[UstV_Leistender_PLZ] as PLZ, ([UstV_Leistender_Strasse] + ' ' +[UstV_Leistender_StrasseNr]) as Strasse, [UstV_Leistender_Stadt] as Stadt FROM [tblUStVLeistender]", {"UStV_Leistender", "UstV_Leistender_UstNr"}, filter, "UStV_Leistender", "UStV_LeistenderId", "Leistender", "FMZOLL",, 400, 200, {"UStV_Leistender", "UStV_LeistenderId"})
End If
End Sub
Private Sub btnAPIUbload_Click(sender As Object, e As EventArgs) Handles btnAPIUbload.Click
If API IsNot Nothing Then
If vbYes = MsgBox("Möchten Sie die Rechnungsdaten per ATEZ-API auslesen lassen?", vbYesNoCancel) Then
Dim failreDesc As String
Dim authResp = API.authenticate("VAT", "client1", "password")
Dim resp
If authResp <> "200" Then
MsgBox("Authentifizierung fehlgeschlagen")
Exit Sub
Else
If API.SendRequestWithAuthHeader("application/json", failreDesc, "/health", "GET") = "200" Then
'document_type = vat_invoice or receipt
If API.setJsonVAT("vat_invoice", UStV_POS.UStVPo_daId) Then
resp = API.SendRequestWithAuthHeader("application/json", failreDesc, "/process", "POST")
End If
Else
MsgBox("Service is not running!")
End If
End If
End If
End If
End Sub
End Class

View File

@@ -33,12 +33,15 @@ Partial Class usrcntlFakturierung
Me.Label61 = New System.Windows.Forms.Label()
Me.GBMautberichte = New System.Windows.Forms.GroupBox()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.MyDatagridview1 = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.Label5 = New System.Windows.Forms.Label()
Me.lblAnzahlMautberichte = New System.Windows.Forms.Label()
Me.pbMautAnh_Proz = New System.Windows.Forms.ProgressBar()
Me.lblMautAnh_Proz = New System.Windows.Forms.Label()
Me.cbxDateMautbericht = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.Label69 = New System.Windows.Forms.Label()
Me.Label68 = New System.Windows.Forms.Label()
Me.cbxMautbericht = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.Label62 = New System.Windows.Forms.Label()
Me.Button18 = New System.Windows.Forms.Button()
Me.Label44 = New System.Windows.Forms.Label()
@@ -52,7 +55,7 @@ Partial Class usrcntlFakturierung
Me.Button3 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.cbxMautanh = New System.Windows.Forms.CheckBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.btnMautanh_pruefen = New System.Windows.Forms.Button()
Me.PictureBox6 = New System.Windows.Forms.PictureBox()
Me.PictureBox5 = New System.Windows.Forms.PictureBox()
Me.PictureBox4 = New System.Windows.Forms.PictureBox()
@@ -63,16 +66,18 @@ Partial Class usrcntlFakturierung
Me.cbxVorschau = New System.Windows.Forms.CheckBox()
Me.cbxAbfVerbotdrucken = New System.Windows.Forms.CheckBox()
Me.cbxRechnungsjournaldrucken = New System.Windows.Forms.CheckBox()
Me.Button20 = New System.Windows.Forms.Button()
Me.btn_Mautanh_entfernen = New System.Windows.Forms.Button()
Me.Label72 = New System.Windows.Forms.Label()
Me.KdSearchBox3 = New VERAG_PROG_ALLGEMEIN.KdSearchBox()
Me.rbkunde = New System.Windows.Forms.RadioButton()
Me.rbAlleKunden = New System.Windows.Forms.RadioButton()
Me.txtPloseAnh_Einarbeitung = New System.Windows.Forms.TextBox()
Me.Label71 = New System.Windows.Forms.Label()
Me.pbPloseAnh_Proz = New System.Windows.Forms.ProgressBar()
Me.lblPloseAnh_Proz = New System.Windows.Forms.Label()
Me.Button19 = New System.Windows.Forms.Button()
Me.btn_setRENr = New System.Windows.Forms.Button()
Me.Label70 = New System.Windows.Forms.Label()
Me.cboSachbearbeiter = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.Label67 = New System.Windows.Forms.Label()
Me.dtRechnungsdatum = New System.Windows.Forms.DateTimePicker()
Me.Label66 = New System.Windows.Forms.Label()
@@ -80,14 +85,10 @@ Partial Class usrcntlFakturierung
Me.Label64 = New System.Windows.Forms.Label()
Me.Label63 = New System.Windows.Forms.Label()
Me.Label45 = New System.Windows.Forms.Label()
Me.Button14 = New System.Windows.Forms.Button()
Me.MyDatagridview1 = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.cbxDateMautbericht = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.cbxMautbericht = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.KdSearchBox3 = New VERAG_PROG_ALLGEMEIN.KdSearchBox()
Me.cboSachbearbeiter = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.btnRePos = New System.Windows.Forms.Button()
Me.GroupBox1.SuspendLayout()
Me.GBMautberichte.SuspendLayout()
CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GBSammelrechnung.SuspendLayout()
CType(Me.PictureBox8, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox7, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -97,7 +98,6 @@ Partial Class usrcntlFakturierung
CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'GroupBox1
@@ -212,6 +212,16 @@ Partial Class usrcntlFakturierung
Me.TextBox1.Size = New System.Drawing.Size(106, 13)
Me.TextBox1.TabIndex = 105
'
'MyDatagridview1
'
Me.MyDatagridview1.AKTUALISIERUNGS_INTERVALL = -1
Me.MyDatagridview1.BackgroundColor = System.Drawing.SystemColors.Window
Me.MyDatagridview1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.MyDatagridview1.Location = New System.Drawing.Point(4, 71)
Me.MyDatagridview1.Name = "MyDatagridview1"
Me.MyDatagridview1.Size = New System.Drawing.Size(471, 135)
Me.MyDatagridview1.TabIndex = 34
'
'Label5
'
Me.Label5.AutoSize = True
@@ -245,6 +255,17 @@ Partial Class usrcntlFakturierung
Me.lblMautAnh_Proz.Text = "0%"
Me.lblMautAnh_Proz.TextAlign = System.Drawing.ContentAlignment.TopRight
'
'cbxDateMautbericht
'
Me.cbxDateMautbericht._allowedValuesFreiText = Nothing
Me.cbxDateMautbericht._allowFreiText = False
Me.cbxDateMautbericht._value = ""
Me.cbxDateMautbericht.FormattingEnabled = True
Me.cbxDateMautbericht.Location = New System.Drawing.Point(265, 12)
Me.cbxDateMautbericht.Name = "cbxDateMautbericht"
Me.cbxDateMautbericht.Size = New System.Drawing.Size(87, 21)
Me.cbxDateMautbericht.TabIndex = 32
'
'Label69
'
Me.Label69.AutoSize = True
@@ -262,6 +283,18 @@ Partial Class usrcntlFakturierung
Me.Label68.TabIndex = 30
Me.Label68.Text = "Generiert Mautberichte"
'
'cbxMautbericht
'
Me.cbxMautbericht._allowedValuesFreiText = Nothing
Me.cbxMautbericht._allowFreiText = False
Me.cbxMautbericht._value = ""
Me.cbxMautbericht.DropDownWidth = 200
Me.cbxMautbericht.FormattingEnabled = True
Me.cbxMautbericht.Location = New System.Drawing.Point(265, 33)
Me.cbxMautbericht.Name = "cbxMautbericht"
Me.cbxMautbericht.Size = New System.Drawing.Size(152, 21)
Me.cbxMautbericht.TabIndex = 30
'
'Label62
'
Me.Label62.AutoSize = True
@@ -304,7 +337,7 @@ Partial Class usrcntlFakturierung
Me.GBSammelrechnung.Controls.Add(Me.Button3)
Me.GBSammelrechnung.Controls.Add(Me.Button2)
Me.GBSammelrechnung.Controls.Add(Me.cbxMautanh)
Me.GBSammelrechnung.Controls.Add(Me.Button1)
Me.GBSammelrechnung.Controls.Add(Me.btnMautanh_pruefen)
Me.GBSammelrechnung.Controls.Add(Me.PictureBox6)
Me.GBSammelrechnung.Controls.Add(Me.PictureBox5)
Me.GBSammelrechnung.Controls.Add(Me.PictureBox4)
@@ -315,7 +348,7 @@ Partial Class usrcntlFakturierung
Me.GBSammelrechnung.Controls.Add(Me.cbxVorschau)
Me.GBSammelrechnung.Controls.Add(Me.cbxAbfVerbotdrucken)
Me.GBSammelrechnung.Controls.Add(Me.cbxRechnungsjournaldrucken)
Me.GBSammelrechnung.Controls.Add(Me.Button20)
Me.GBSammelrechnung.Controls.Add(Me.btn_Mautanh_entfernen)
Me.GBSammelrechnung.Controls.Add(Me.Label72)
Me.GBSammelrechnung.Controls.Add(Me.KdSearchBox3)
Me.GBSammelrechnung.Controls.Add(Me.rbkunde)
@@ -324,7 +357,7 @@ Partial Class usrcntlFakturierung
Me.GBSammelrechnung.Controls.Add(Me.Label71)
Me.GBSammelrechnung.Controls.Add(Me.pbPloseAnh_Proz)
Me.GBSammelrechnung.Controls.Add(Me.lblPloseAnh_Proz)
Me.GBSammelrechnung.Controls.Add(Me.Button19)
Me.GBSammelrechnung.Controls.Add(Me.btn_setRENr)
Me.GBSammelrechnung.Controls.Add(Me.Label70)
Me.GBSammelrechnung.Controls.Add(Me.cboSachbearbeiter)
Me.GBSammelrechnung.Controls.Add(Me.Label67)
@@ -334,7 +367,7 @@ Partial Class usrcntlFakturierung
Me.GBSammelrechnung.Controls.Add(Me.Label64)
Me.GBSammelrechnung.Controls.Add(Me.Label63)
Me.GBSammelrechnung.Controls.Add(Me.Label45)
Me.GBSammelrechnung.Controls.Add(Me.Button14)
Me.GBSammelrechnung.Controls.Add(Me.btnRePos)
Me.GBSammelrechnung.Enabled = False
Me.GBSammelrechnung.Location = New System.Drawing.Point(10, 356)
Me.GBSammelrechnung.Name = "GBSammelrechnung"
@@ -438,16 +471,16 @@ Partial Class usrcntlFakturierung
Me.cbxMautanh.Text = "Mautanhänge im PDF hinzufügen"
Me.cbxMautanh.UseVisualStyleBackColor = True
'
'Button1
'btnMautanh_pruefen
'
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button1.Location = New System.Drawing.Point(10, 12)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(121, 49)
Me.Button1.TabIndex = 106
Me.Button1.Text = "Mautanh. prüfen"
Me.Button1.UseVisualStyleBackColor = True
Me.btnMautanh_pruefen.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnMautanh_pruefen.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.btnMautanh_pruefen.Location = New System.Drawing.Point(10, 12)
Me.btnMautanh_pruefen.Name = "btnMautanh_pruefen"
Me.btnMautanh_pruefen.Size = New System.Drawing.Size(121, 49)
Me.btnMautanh_pruefen.TabIndex = 106
Me.btnMautanh_pruefen.Text = "Mautanh. prüfen"
Me.btnMautanh_pruefen.UseVisualStyleBackColor = True
'
'PictureBox6
'
@@ -559,16 +592,16 @@ Partial Class usrcntlFakturierung
Me.cbxRechnungsjournaldrucken.Text = "Rechnungsjournal drucken"
Me.cbxRechnungsjournaldrucken.UseVisualStyleBackColor = True
'
'Button20
'btn_Mautanh_entfernen
'
Me.Button20.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button20.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button20.Location = New System.Drawing.Point(147, 12)
Me.Button20.Name = "Button20"
Me.Button20.Size = New System.Drawing.Size(121, 49)
Me.Button20.TabIndex = 43
Me.Button20.Text = "Mautanh. aus RE entfernen"
Me.Button20.UseVisualStyleBackColor = True
Me.btn_Mautanh_entfernen.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btn_Mautanh_entfernen.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.btn_Mautanh_entfernen.Location = New System.Drawing.Point(147, 12)
Me.btn_Mautanh_entfernen.Name = "btn_Mautanh_entfernen"
Me.btn_Mautanh_entfernen.Size = New System.Drawing.Size(121, 49)
Me.btn_Mautanh_entfernen.TabIndex = 43
Me.btn_Mautanh_entfernen.Text = "Mautanh. aus RE entfernen"
Me.btn_Mautanh_entfernen.UseVisualStyleBackColor = True
'
'Label72
'
@@ -578,6 +611,34 @@ Partial Class usrcntlFakturierung
Me.Label72.TabIndex = 42
Me.Label72.Text = "* hier wird eine RE-Nr erzeugt, die Rechnungen gelten dann als ""gedruckt"" und kön" &
"nen somit nicht mehr geändert werden."
'
'KdSearchBox3
'
Me.KdSearchBox3._AlleFirmenCLUSTER = False
Me.KdSearchBox3._AllowSetValue = True
Me.KdSearchBox3._autoSizeGross = False
Me.KdSearchBox3._display_Name1 = False
Me.KdSearchBox3._displayAVISO_Email = False
Me.KdSearchBox3._displayFullName = False
Me.KdSearchBox3._displayWoelflKd = False
Me.KdSearchBox3._hideIfListEmpty = True
Me.KdSearchBox3._loadKdData = False
Me.KdSearchBox3._searchName1 = True
Me.KdSearchBox3._UseFIRMA = ""
Me.KdSearchBox3._ValueKdAndName = True
Me.KdSearchBox3.dgvpos = "LEFT"
Me.KdSearchBox3.KdName = ""
Me.KdSearchBox3.KdNr = "-1"
Me.KdSearchBox3.kdNrField = Nothing
Me.KdSearchBox3.KdNrNullInt = Nothing
Me.KdSearchBox3.Location = New System.Drawing.Point(87, 308)
Me.KdSearchBox3.Name = "KdSearchBox3"
Me.KdSearchBox3.nurAktive = True
Me.KdSearchBox3.searchActive = True
Me.KdSearchBox3.Size = New System.Drawing.Size(350, 20)
Me.KdSearchBox3.TabIndex = 41
Me.KdSearchBox3.TIMER_SEARCH = True
Me.KdSearchBox3.usrcntl = Nothing
'
'rbkunde
'
@@ -635,16 +696,16 @@ Partial Class usrcntlFakturierung
Me.lblPloseAnh_Proz.Text = "0%"
Me.lblPloseAnh_Proz.TextAlign = System.Drawing.ContentAlignment.TopRight
'
'Button19
'btn_setRENr
'
Me.Button19.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button19.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button19.Location = New System.Drawing.Point(10, 182)
Me.Button19.Name = "Button19"
Me.Button19.Size = New System.Drawing.Size(121, 49)
Me.Button19.TabIndex = 32
Me.Button19.Text = "RE.Nr setzen*"
Me.Button19.UseVisualStyleBackColor = True
Me.btn_setRENr.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btn_setRENr.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.btn_setRENr.Location = New System.Drawing.Point(10, 182)
Me.btn_setRENr.Name = "btn_setRENr"
Me.btn_setRENr.Size = New System.Drawing.Size(121, 49)
Me.btn_setRENr.TabIndex = 32
Me.btn_setRENr.Text = "RE.Nr setzen*"
Me.btn_setRENr.UseVisualStyleBackColor = True
'
'Label70
'
@@ -654,6 +715,17 @@ Partial Class usrcntlFakturierung
Me.Label70.TabIndex = 30
Me.Label70.Text = "6. Hängt Mautgesamtbericht an Sammenrechnungen an."
'
'cboSachbearbeiter
'
Me.cboSachbearbeiter._allowedValuesFreiText = Nothing
Me.cboSachbearbeiter._allowFreiText = False
Me.cboSachbearbeiter._value = ""
Me.cboSachbearbeiter.FormattingEnabled = True
Me.cboSachbearbeiter.Location = New System.Drawing.Point(529, 38)
Me.cboSachbearbeiter.Name = "cboSachbearbeiter"
Me.cboSachbearbeiter.Size = New System.Drawing.Size(152, 21)
Me.cboSachbearbeiter.TabIndex = 29
'
'Label67
'
Me.Label67.AutoSize = True
@@ -713,88 +785,16 @@ Partial Class usrcntlFakturierung
Me.Label45.TabIndex = 5
Me.Label45.Text = "1. Einträge auf Sachbearbeiter ändern."
'
'Button14
'btnRePos
'
Me.Button14.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button14.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button14.Location = New System.Drawing.Point(10, 81)
Me.Button14.Name = "Button14"
Me.Button14.Size = New System.Drawing.Size(121, 49)
Me.Button14.TabIndex = 4
Me.Button14.Text = "Rechnungspos. berechnen"
Me.Button14.UseVisualStyleBackColor = True
'
'MyDatagridview1
'
Me.MyDatagridview1.AKTUALISIERUNGS_INTERVALL = -1
Me.MyDatagridview1.BackgroundColor = System.Drawing.SystemColors.Window
Me.MyDatagridview1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.MyDatagridview1.Location = New System.Drawing.Point(4, 71)
Me.MyDatagridview1.Name = "MyDatagridview1"
Me.MyDatagridview1.Size = New System.Drawing.Size(471, 135)
Me.MyDatagridview1.TabIndex = 34
'
'cbxDateMautbericht
'
Me.cbxDateMautbericht._allowedValuesFreiText = Nothing
Me.cbxDateMautbericht._allowFreiText = False
Me.cbxDateMautbericht._value = ""
Me.cbxDateMautbericht.FormattingEnabled = True
Me.cbxDateMautbericht.Location = New System.Drawing.Point(265, 12)
Me.cbxDateMautbericht.Name = "cbxDateMautbericht"
Me.cbxDateMautbericht.Size = New System.Drawing.Size(87, 21)
Me.cbxDateMautbericht.TabIndex = 32
'
'cbxMautbericht
'
Me.cbxMautbericht._allowedValuesFreiText = Nothing
Me.cbxMautbericht._allowFreiText = False
Me.cbxMautbericht._value = ""
Me.cbxMautbericht.DropDownWidth = 200
Me.cbxMautbericht.FormattingEnabled = True
Me.cbxMautbericht.Location = New System.Drawing.Point(265, 33)
Me.cbxMautbericht.Name = "cbxMautbericht"
Me.cbxMautbericht.Size = New System.Drawing.Size(152, 21)
Me.cbxMautbericht.TabIndex = 30
'
'KdSearchBox3
'
Me.KdSearchBox3._AlleFirmenCLUSTER = False
Me.KdSearchBox3._AllowSetValue = True
Me.KdSearchBox3._autoSizeGross = False
Me.KdSearchBox3._display_Name1 = False
Me.KdSearchBox3._displayAVISO_Email = False
Me.KdSearchBox3._displayFullName = False
Me.KdSearchBox3._displayWoelflKd = False
Me.KdSearchBox3._hideIfListEmpty = True
Me.KdSearchBox3._loadKdData = False
Me.KdSearchBox3._searchName1 = True
Me.KdSearchBox3._UseFIRMA = ""
Me.KdSearchBox3._ValueKdAndName = True
Me.KdSearchBox3.dgvpos = "LEFT"
Me.KdSearchBox3.KdName = ""
Me.KdSearchBox3.KdNr = "-1"
Me.KdSearchBox3.kdNrField = Nothing
Me.KdSearchBox3.KdNrNullInt = Nothing
Me.KdSearchBox3.Location = New System.Drawing.Point(87, 308)
Me.KdSearchBox3.Name = "KdSearchBox3"
Me.KdSearchBox3.nurAktive = True
Me.KdSearchBox3.searchActive = True
Me.KdSearchBox3.Size = New System.Drawing.Size(350, 20)
Me.KdSearchBox3.TabIndex = 41
Me.KdSearchBox3.TIMER_SEARCH = True
Me.KdSearchBox3.usrcntl = Nothing
'
'cboSachbearbeiter
'
Me.cboSachbearbeiter._allowedValuesFreiText = Nothing
Me.cboSachbearbeiter._allowFreiText = False
Me.cboSachbearbeiter._value = ""
Me.cboSachbearbeiter.FormattingEnabled = True
Me.cboSachbearbeiter.Location = New System.Drawing.Point(529, 38)
Me.cboSachbearbeiter.Name = "cboSachbearbeiter"
Me.cboSachbearbeiter.Size = New System.Drawing.Size(152, 21)
Me.cboSachbearbeiter.TabIndex = 29
Me.btnRePos.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnRePos.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.btnRePos.Location = New System.Drawing.Point(10, 81)
Me.btnRePos.Name = "btnRePos"
Me.btnRePos.Size = New System.Drawing.Size(121, 49)
Me.btnRePos.TabIndex = 4
Me.btnRePos.Text = "Rechnungspos. berechnen"
Me.btnRePos.UseVisualStyleBackColor = True
'
'usrcntlFakturierung
'
@@ -812,6 +812,7 @@ Partial Class usrcntlFakturierung
Me.GroupBox1.ResumeLayout(False)
Me.GBMautberichte.ResumeLayout(False)
Me.GBMautberichte.PerformLayout()
CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).EndInit()
Me.GBSammelrechnung.ResumeLayout(False)
Me.GBSammelrechnung.PerformLayout()
CType(Me.PictureBox8, System.ComponentModel.ISupportInitialize).EndInit()
@@ -822,7 +823,6 @@ Partial Class usrcntlFakturierung
CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
@@ -846,7 +846,7 @@ Partial Class usrcntlFakturierung
Friend WithEvents cbxVorschau As CheckBox
Friend WithEvents cbxAbfVerbotdrucken As CheckBox
Friend WithEvents cbxRechnungsjournaldrucken As CheckBox
Friend WithEvents Button20 As Button
Friend WithEvents btn_Mautanh_entfernen As Button
Friend WithEvents Label72 As Label
Friend WithEvents KdSearchBox3 As VERAG_PROG_ALLGEMEIN.KdSearchBox
Friend WithEvents rbkunde As RadioButton
@@ -855,7 +855,7 @@ Partial Class usrcntlFakturierung
Friend WithEvents Label71 As Label
Friend WithEvents pbPloseAnh_Proz As ProgressBar
Friend WithEvents lblPloseAnh_Proz As Label
Friend WithEvents Button19 As Button
Friend WithEvents btn_setRENr As Button
Friend WithEvents Label70 As Label
Friend WithEvents cboSachbearbeiter As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents Label67 As Label
@@ -865,7 +865,7 @@ Partial Class usrcntlFakturierung
Friend WithEvents Label64 As Label
Friend WithEvents Label63 As Label
Friend WithEvents Label45 As Label
Friend WithEvents Button14 As Button
Friend WithEvents btnRePos As Button
Friend WithEvents btnMDMSammelrechnung As Button
Friend WithEvents PictureBox1 As PictureBox
Friend WithEvents Label4 As Label
@@ -878,7 +878,7 @@ Partial Class usrcntlFakturierung
Friend WithEvents PictureBox4 As PictureBox
Friend WithEvents PictureBox3 As PictureBox
Friend WithEvents PictureBox2 As PictureBox
Friend WithEvents Button1 As Button
Friend WithEvents btnMautanh_pruefen As Button
Friend WithEvents cbxMautanh As CheckBox
Friend WithEvents Button3 As Button
Friend WithEvents Button2 As Button

View File

@@ -89,7 +89,7 @@ Public Class usrcntlFakturierung
End Sub
Private Sub Button20_Click(sender As Object, e As EventArgs) Handles Button20.Click
Private Sub Button20_Click(sender As Object, e As EventArgs) Handles btn_Mautanh_entfernen.Click
Dim Sachbearbeiter = cboSachbearbeiter._value
Dim rechnungsdatum As Date = CDate(dtRechnungsdatum.Text)
@@ -133,7 +133,7 @@ Public Class usrcntlFakturierung
End Sub
Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click
Private Sub Button14_Click(sender As Object, e As EventArgs) Handles btnRePos.Click
Label70.Text = "6. Hängt Mautgesamtbericht an Sammelrechnungen an."
@@ -190,7 +190,7 @@ Public Class usrcntlFakturierung
If rechnungenMitAbwAbfDat > 0 Then
Dim res As MsgBoxResult
res = MsgBox("Es gibt noch " & rechnungenMitAbwAbfDat & " Rechnungen mit abweichenden Abfertigungsdatum (Abfertigungsdatum ist nicht " & rechnungsdatum & ")" & vbNewLine & "Möchten Sie fortfahren (Abfertigungsdatum wird autoamtisch auf " & rechnungsdatum & " gesetzt) ?", vbYesNoCancel)
res = MsgBox("Es gibt noch " & rechnungenMitAbwAbfDat & " Rechnungen mit abweichenden Abfertigungsdatum (Abfertigungsdatum ist nicht " & rechnungsdatum & ")" & vbNewLine & "Möchten Sie fortfahren (Abfertigungsdatum wird automatisch auf " & rechnungsdatum & " gesetzt) ?", vbYesNoCancel)
Select Case res
Case MsgBoxResult.Yes : SQL.doSQL("update [Rechnungsausgang] set Abfertigungsdatum = '" & rechnungsdatum & "' WHERE [Status] = 0 AND [Sammelrechnung] = 6 AND UPPER([Sachbearbeiter]) = '" & Sachbearbeiter & "' AND ([SteuerpflichtigerGesamtbetrag] <> 0 OR [SteuerfreierGesamtbetrag] <> 0) AND cast(Abfertigungsdatum as Date) <> '" & rechnungsdatum & "'", "FMZOLL")
Case MsgBoxResult.No
@@ -234,6 +234,10 @@ Public Class usrcntlFakturierung
GROUP BY [Firma_ID], [Status], [Sammelrechnung], [Sachbearbeiter], [RechnungsKundenNr], [Währungscode], [Steuersatz %], [Lastschrift]", "FMZOLL")
If Not vbYes = MsgBox("Möchten Sie mit der Erstellung der " & dtREGU.Rows.Count & " Sammelrechnungen vorfahren?", vbYesNoCancel) Then
Exit Sub
End If
'RECHNUNG ODER GUTSCHRIFT
'Rechnung oder Gutschrift im RK eintragen, abhängig vom Sammelrechnungsbetrag (+/-)
@@ -912,7 +916,7 @@ Public Class usrcntlFakturierung
End Function
Private Sub Button19_Click(sender As Object, e As EventArgs) Handles Button19.Click
Private Sub Button19_Click(sender As Object, e As EventArgs) Handles btn_setRENr.Click
Dim Sachbearbeiter = cboSachbearbeiter._value
Dim rechnungsdatum As Date = CDate(dtRechnungsdatum.Text)
Dim rechnungsstatus As Integer = 0
@@ -1521,21 +1525,21 @@ Public Class usrcntlFakturierung
group by [Datenquelle]", "FMZOLL")
Dim sumNetto As Double = 0
Dim sumVAT As Double = 0
Dim sumBrutto As Double = 0
Dim sumVAT As Double = 0
Dim sumBrutto As Double = 0
For Each row As DataRow In dtSummen.Rows
For Each row As DataRow In dtSummen.Rows
If Not IsDBNull(row("Netto")) AndAlso IsNumeric(row("Netto")) Then sumNetto += CDbl(row("Netto"))
If Not IsDBNull(row("VAT")) AndAlso IsNumeric(row("VAT")) Then sumVAT += CDbl(row("VAT"))
If Not IsDBNull(row("Brutto")) AndAlso IsNumeric(row("Brutto")) Then sumBrutto += CDbl(row("Brutto"))
Next
Dim drLast = dtSummen.NewRow
Dim drLast = dtSummen.NewRow
If dtSummen.Columns.Contains("Lieferant") Then drLast.Item("Lieferant") = "SUMME"
If dtSummen.Columns.Contains("Netto") Then drLast.Item("Netto") = sumNetto
If dtSummen.Columns.Contains("VAT") Then drLast.Item("VAT") = sumVAT
If dtSummen.Columns.Contains("Brutto") Then drLast.Item("Brutto") = sumBrutto
If dtSummen.Columns.Contains("Lieferant") Then drLast.Item("Lieferant") = "SUMME"
If dtSummen.Columns.Contains("Netto") Then drLast.Item("Netto") = sumNetto
If dtSummen.Columns.Contains("VAT") Then drLast.Item("VAT") = sumVAT
If dtSummen.Columns.Contains("Brutto") Then drLast.Item("Brutto") = sumBrutto
dtSummen.Rows.InsertAt(drLast, dtSummen.Rows.Count)
@@ -1597,7 +1601,7 @@ Public Class usrcntlFakturierung
f.Show(Me)
End Sub
Private Sub Button1_Click_2(sender As Object, e As EventArgs) Handles Button1.Click
Private Sub Button1_Click_2(sender As Object, e As EventArgs) Handles btnMautanh_pruefen.Click
Dim Sachbearbeiter = cboSachbearbeiter._value
Dim rechnungsdatum As Date = CDate(dtRechnungsdatum.Text)
@@ -1701,9 +1705,9 @@ Public Class usrcntlFakturierung
Dim sammelrechnung0vorhanden As Boolean = True
sammelrechnung0vorhanden = checkIfStatus0Sammelrechnugnenvorhanden(cboSachbearbeiter._value, CDate(dtRechnungsdatum.Text))
Button14.Enabled = sammelrechnung0vorhanden
btnRePos.Enabled = sammelrechnung0vorhanden
'Button19.Enabled = sammelrechnung0vorhanden wenn RE bereits Status 2 wird sie nur gedruckt!!!!
Button20.Enabled = sammelrechnung0vorhanden
btn_Mautanh_entfernen.Enabled = sammelrechnung0vorhanden
End Sub
@@ -1728,8 +1732,8 @@ Public Class usrcntlFakturierung
sammelrechnung0vorhanden = checkIfStatus0Sammelrechnugnenvorhanden(cboSachbearbeiter._value, CDate(dtRechnungsdatum.Text))
'Button19.Enabled = sammelrechnung0vorhanden wenn RE bereits Status 2 wird sie nur gedruckt!!!!
Button14.Enabled = True 'sammelrechnung0vorhanden
Button20.Enabled = sammelrechnung0vorhanden
btnRePos.Enabled = True 'sammelrechnung0vorhanden
btn_Mautanh_entfernen.Enabled = sammelrechnung0vorhanden
End Sub

View File

@@ -13,7 +13,6 @@ Public Class cUStVLeistender
Property UstV_Leistender_Adresse As Boolean
Property UStV_LeistenderId As Integer
Public hasEntry = False
Dim SQL As New SQL
@@ -59,10 +58,29 @@ Public Class cUStVLeistender
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
End Function
Public Function SAVEID() As Integer
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblUStVLeistender WHERE UStV_Leistender=@UStV_Leistender) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
UStV_LeistenderId = SQL.doSQLVarListID(UStV_LeistenderId, sqlstr, "FMZOLL", , list)
Return UStV_LeistenderId
End Function
Public Function INSERT() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()

View File

@@ -1,14 +1,10 @@
Imports System.Data.SqlClient
Imports System.Net
Imports System.Reflection
Imports System.ServiceModel.Configuration
Imports System.ServiceModel.Security
Imports System.Threading
Imports System.Web.Routing
Imports System.Windows.Forms
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
Imports Chilkat
Imports Newtonsoft.Json.Linq
Imports VERAG_PROG_ALLGEMEIN.VERAG_OUT_NCTS
Public Class cATEZ_NCTS_Sessions
@@ -17,6 +13,7 @@ Public Class cATEZ_NCTS_Sessions
Public Property datetime As DateTime = Now()
Public Property refresh_token As String
Public Property token_validuntil As DateTime
Public Property program As String
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
@@ -30,18 +27,24 @@ Public Class cATEZ_NCTS_Sessions
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("datetime", datetime))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("refresh_token", refresh_token))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("token_validuntil", token_validuntil))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("program", program))
Return list
End Function
Sub New()
LOAD()
LOAD("")
End Sub
Sub New(token As String, refreshtoken As String, timestamp As DateTime)
Sub New(Program As String)
LOAD(Program)
End Sub
Sub New(token As String, refreshtoken As String, timestamp As DateTime, program As String)
Me.token = token
Me.refresh_token = refreshtoken
token_validuntil = timestamp
program = program
SAVE()
End Sub
@@ -80,11 +83,11 @@ Public Class cATEZ_NCTS_Sessions
End Function
Public Sub LOAD()
Public Sub LOAD(Program As String)
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT TOP(1) * FROM tblATEZ_NCTS_Sessions where token_validuntil >= dateadd(minute,-10,getdate()) order by datetime desc ", conn)
Using cmd As New SqlCommand("SELECT TOP(1) * FROM tblATEZ_NCTS_Sessions where token_validuntil >= dateadd(minute,-10,getdate()) " & IIf(Program <> "", " AND program = '" & Program & "' ", "") & " order by datetime desc ", conn)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
@@ -630,17 +633,17 @@ Public Class cATEZ_NCTS_IN
API_STRING = API.Rows(0).Item("api_url")
If Not IsDBNull(API.Rows(0).Item("api_debugpath")) AndAlso API.Rows(0).Item("api_debugpath") <> "" Then
Rest.VerboseLogging = True
Rest.DebugLogFilePath = API.Rows(0).Item("api_debugpath") & program & IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "_Test", "") & ".txt"
rest.VerboseLogging = True
rest.DebugLogFilePath = API.Rows(0).Item("api_debugpath") & program & IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "_Test", "") & ".txt"
Else
Rest.VerboseLogging = False
rest.VerboseLogging = False
End If
End If
API_STRING = API.Rows(0).Item("api_url")
End Sub
Shared Function SendRequestAuthentificationToken(ByVal myuri As String, ByVal contentType As String, ByVal method As String, ByRef Itoken As String) As String
Shared Function SendRequestAuthentificationToken(ByVal myuri As String, ByVal contentType As String, ByVal method As String, ByRef Itoken As String, ByVal program As String, Optional client_id As String = "", Optional grant_type As String = "") As String
Try
Dim session = New cATEZ_NCTS_Sessions()
@@ -675,6 +678,8 @@ Public Class cATEZ_NCTS_IN
Dim json As New Chilkat.JsonObject
json.UpdateString("password", API.Rows(0).Item("api_password"))
json.UpdateString("username", API.Rows(0).Item("api_user"))
If client_id <> "" Then json.UpdateString("client_id", client_id)
If grant_type <> "" Then json.UpdateString("grant_type", grant_type)
rest.AddHeader("Content-Type", contentType)
@@ -697,10 +702,10 @@ Public Class cATEZ_NCTS_IN
jsonResp.LoadSb(sbResponseBody)
Itoken = jsonResp.StringOf("access_token")
token = Itoken
refresh_token = jsonResp.StringOf("refresh_token")
refresh_token = If(jsonResp.StringOf("refresh_token"), "")
Dim now As DateTime = DateTime.Now()
now = now.AddSeconds(jsonResp.IntOf("expires_in"))
session = New cATEZ_NCTS_Sessions(Itoken, refresh_token, now.ToString("yyyy-MM-dd HH:mm:ss"))
session = New cATEZ_NCTS_Sessions(Itoken, refresh_token, now.ToString("yyyy-MM-dd HH:mm:ss"), program)
sessionID = session.session_Id
Return rest.ResponseStatusCode
@@ -710,17 +715,25 @@ Public Class cATEZ_NCTS_IN
End Function
Shared Function authenticate() As String
Shared Function authenticate(program As String, Optional client_id As String = "", Optional grant_type As String = "") As String
Dim myUri As String = API_STRING & "/api/tds/auth/"
Dim response = SendRequestAuthentificationToken(myUri, "application/json", "POST", token)
Dim myUri As String = API_STRING
Dim contentType = "application/json"
Select Case program
Case "NCTS" : myUri &= "/api/tds/auth/"
Case "VAT" : myUri &= "/token" : contentType = "application/x-www-form-urlencoded"
End Select
Dim response = SendRequestAuthentificationToken(myUri, contentType, "POST", token, program, client_id, grant_type)
Return response
End Function
Shared Function SendRequestWithAuthHeader(acceptContentType As String, ByRef failureDesc As String) As String
Shared Function SendRequestWithAuthHeader(acceptContentType As String, ByRef failureDesc As String, myUrl As String, Method As String) As String
Try
VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat()
@@ -755,7 +768,7 @@ Public Class cATEZ_NCTS_IN
'rest.PercentDoneOnSend = True
rest.IdleTimeoutMs = 5000 * 31
success = rest.SendReqSb("POST", "/api/integrations/verag", sbRequestBody)
success = rest.SendReqSb(Method, myUrl, sbRequestBody)
Dim responseStatusCode = rest.ReadResponseHeader()
If (responseStatusCode < 0) Then
@@ -816,7 +829,7 @@ Public Class cATEZ_NCTS_IN
End Try
End Function
Shared Function setJson(ncts As cATEZ_NCTS_DATA)
Shared Function setJsonNCTS(ncts As cATEZ_NCTS_DATA)
jsonData.Clear()
ncts.json = ""
@@ -868,6 +881,21 @@ Public Class cATEZ_NCTS_IN
End Function
Shared Function setJsonVAT(documentType As String, docID As Integer)
jsonData.Clear()
Dim success As Boolean
success = jsonData.UpdateString("document_type", documentType)
Dim base64 As Chilkat.BinData
success = base64.LoadFile(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(docID))
success = jsonData.UpdateString("document_base64", base64.GetEncoded("base64"))
Return success
End Function
Public Function setJsonPDF(ncts As cATEZ_NCTS_DATA, dgv As DataGridView)
Dim success As Boolean
@@ -894,4 +922,7 @@ Public Class cATEZ_NCTS_IN
End Function
End Class