MDM, Mailvorlagen, EORI, Mahnlauf, Kundenblatt, CBAM

This commit is contained in:
2024-10-28 14:04:50 +01:00
parent 61bbe7ef82
commit 899b216263
11 changed files with 167 additions and 68 deletions

View File

@@ -649,6 +649,11 @@ Public Class frmKundenblatt
End If
End If
If checkNullStr(ADRESSE.Steuernummer) <> "" Then
If lblUid.Text <> "" Then lblUid.Text &= " / "
lblUid.Text &= "St-Nr.: " & checkNullStr(ADRESSE.Steuernummer)
End If
End If
Catch ex As Exception

View File

@@ -67,6 +67,8 @@ Partial Class usrCntlCBAM
Me.txtBis = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.txtEori = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.cbxIMEX = New System.Windows.Forms.CheckBox()
Me.cbxUNISPED = New System.Windows.Forms.CheckBox()
Me.cntxtAddSdl.SuspendLayout()
Me.MyPanel1.SuspendLayout()
Me.SuspendLayout()
@@ -483,6 +485,8 @@ Partial Class usrCntlCBAM
'
'MyPanel1
'
Me.MyPanel1.Controls.Add(Me.cbxUNISPED)
Me.MyPanel1.Controls.Add(Me.cbxIMEX)
Me.MyPanel1.Controls.Add(Me.cbxVERAG)
Me.MyPanel1.Location = New System.Drawing.Point(98, 4)
Me.MyPanel1.Name = "MyPanel1"
@@ -613,6 +617,26 @@ Partial Class usrCntlCBAM
Me.Button1.Text = "XML Datensatz generieren " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "(DAKOSY)"
Me.Button1.UseVisualStyleBackColor = True
'
'cbxIMEX
'
Me.cbxIMEX.AutoSize = True
Me.cbxIMEX.Location = New System.Drawing.Point(90, 6)
Me.cbxIMEX.Name = "cbxIMEX"
Me.cbxIMEX.Size = New System.Drawing.Size(52, 17)
Me.cbxIMEX.TabIndex = 1
Me.cbxIMEX.Text = "IMEX"
Me.cbxIMEX.UseVisualStyleBackColor = True
'
'cbxUNISPED
'
Me.cbxUNISPED.AutoSize = True
Me.cbxUNISPED.Location = New System.Drawing.Point(159, 6)
Me.cbxUNISPED.Name = "cbxUNISPED"
Me.cbxUNISPED.Size = New System.Drawing.Size(74, 17)
Me.cbxUNISPED.TabIndex = 2
Me.cbxUNISPED.Text = "UNISPED"
Me.cbxUNISPED.UseVisualStyleBackColor = True
'
'usrCntlCBAM
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -713,4 +737,6 @@ Partial Class usrCntlCBAM
Friend WithEvents btnCBAM_DS_DAKOSY_XML As Button
Friend WithEvents Button2 As Button
Friend WithEvents Button1 As Button
Friend WithEvents cbxIMEX As CheckBox
Friend WithEvents cbxUNISPED As CheckBox
End Class

View File

@@ -91,7 +91,7 @@ Public Class usrCntlCBAM
txtCBAMPruef_DHF_VERAG.Text = "-"
Try
Dim EORI = txtEori.Text
If cbxVERAG.Checked Then EORI = "VERAG"
If cbxVERAG.Checked Or cbxUNISPED.Checked Or cbxIMEX.Checked Then EORI = "VERAG"
If EORI = "" Then MsgBox("EORI eingeben!") : Exit Sub
If txtVon._value = "" Then MsgBox("Datum von eingeben!") : Exit Sub
If txtBis._value = "" Then MsgBox("Datum bis eingeben!") : Exit Sub
@@ -156,7 +156,7 @@ Public Class usrCntlCBAM
txtCBAMPruef_DHF_UNISPED.Text = "-"
Try
Dim EORI = txtEori.Text
If cbxVERAG.Checked Then EORI = "VERAG"
If cbxVERAG.Checked Or cbxUNISPED.Checked Or cbxIMEX.Checked Then EORI = "VERAG"
If EORI = "" Then MsgBox("EORI eingeben!") : Exit Sub
If txtVon._value = "" Then MsgBox("Datum von eingeben!") : Exit Sub
If txtBis._value = "" Then MsgBox("Datum bis eingeben!") : Exit Sub
@@ -192,7 +192,7 @@ Public Class usrCntlCBAM
"
If cbxVERAG.Checked Then
If cbxUNISPED.Checked Then
SQLSTR &= "
and DecRep IN(3)
"
@@ -219,18 +219,56 @@ Public Class usrCntlCBAM
End Sub
Private Sub btnCBAMPruef_TELOTEC_Click(sender As Object, e As EventArgs) Handles btnCBAMPruef_TELOTEC.Click
txtCBAMPruef_TELOTEC.Text = "nicht verfügbar"
Exit Sub
txtCBAMPruef_TELOTEC.Text = "-"
Dim SQLSTR_WHERE_FIRMEN = ""
If cbxVERAG.Checked Then SQLSTR_WHERE_FIRMEN &= "'VERAG'"
If cbxIMEX.Checked Then SQLSTR_WHERE_FIRMEN &= IIf(SQLSTR_WHERE_FIRMEN <> "", ", ", "") & "'IMEX'"
If cbxUNISPED.Checked Then SQLSTR_WHERE_FIRMEN &= IIf(SQLSTR_WHERE_FIRMEN <> "", ", ", "") & "'UNISPED'"
Try
Dim EORI = txtEori.Text
If cbxVERAG.Checked Then EORI = "VERAG"
If cbxVERAG.Checked Or cbxUNISPED.Checked Or cbxIMEX.Checked Then EORI = "VERAG"
If EORI = "" Then MsgBox("EORI eingeben!") : Exit Sub
Me.Cursor = Cursors.WaitCursor
Dim SQLSTR = "
SELECT count (*)
FROM [VERAG].[dbo].[tblTelotec_Anmeldung]
inner join tblTelotec_Positionsdaten on telpos_telanmId=telanm_id
where 1=1
and
(
left(Item_ComCd,4) IN (2523,2716,2808,2814,3102,3105,7201,7203,7318,7326,7601,7616)
OR left(Item_ComCd,4) between 7301 and 7311
OR left(Item_ComCd,4) between 7205 and 7229
OR left(Item_ComCd,4) between 7603 and 7614
OR Item_ComCd like '25070080%'
OR Item_ComCd like '283421%'
OR Item_ComCd like '260112%'
OR Item_ComCd like '720211%'
OR Item_ComCd like '720219%'
OR Item_ComCd like '720241%'
OR Item_ComCd like '720249%'
OR Item_ComCd like '720260%'
OR Item_ComCd like '280410%'
)
and Item_ComCd not like '310560%'
and telnam_aktuellsteNachricht=1
and telanm_ART ='EUA'
and dec_CreateDate between '" & txtVon._value & "' and '" & txtBis._value & "'"
If SQLSTR_WHERE_FIRMEN <> "" Then
SQLSTR &= " and telanm_firma in ( " & SQLSTR_WHERE_FIRMEN & ")" 'nur IMEX????
Else
SQLSTR &= " and ConeeTra_TIN IN ( '" & EORI & "')"
End If
"
Dim dt = SQL.loadDgvBySql(SQLSTR, "FMZOLL", 600)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
@@ -290,6 +328,11 @@ Public Class usrCntlCBAM
btnCBAM_DS_DAKOSY_Copy.Enabled = False
btnCBAM_DS_DAKOSY_Deteil.Tag = ""
Dim SQLSTR_WHERE_FIRMEN = ""
If cbxVERAG.Checked Then SQLSTR_WHERE_FIRMEN &= "'VERAG'"
If cbxIMEX.Checked Then SQLSTR_WHERE_FIRMEN &= IIf(SQLSTR_WHERE_FIRMEN <> "", ", ", "") & "'IMEX'"
If cbxUNISPED.Checked Then SQLSTR_WHERE_FIRMEN &= IIf(SQLSTR_WHERE_FIRMEN <> "", ", ", "") & "'UNISPED'"
Try
Dim EORI = txtEori.Text
If cbxVERAG.Checked Then EORI = "VERAG"
@@ -298,6 +341,7 @@ Public Class usrCntlCBAM
If txtBis._value = "" Then MsgBox("Datum bis eingeben!") : Exit Sub
Me.Cursor = Cursors.WaitCursor
Dim SQLSTR = "
SELECT
[eza_ANR] RegistriernummerATLAS
@@ -340,16 +384,18 @@ Public Class usrCntlCBAM
"
If cbxVERAG.Checked Then
If cbxVERAG.Checked Or cbxIMEX.Checked Or cbxUNISPED.Checked Then
SQLSTR &= "
and eza_VertretungsVerhaeltnisCode=2
"
Else
SQLSTR &= "
and (select isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI]) FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN')='" & EORI & "'
and (select isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI]) FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN')='" & EORI & "'
"
End If
If SQLSTR_WHERE_FIRMEN <> "" Then SQLSTR &= " and EZA_firma in ( " & SQLSTR_WHERE_FIRMEN & ")"
SQLSTR &= " order by Absender,eza_ANR, tblDakosy_EZA_Warenposition.ezaWP_PositionsNummer"
@@ -415,7 +461,7 @@ Public Class usrCntlCBAM
"
If cbxVERAG.Checked Then
If cbxVERAG.Checked Or cbxIMEX.Checked Or cbxUNISPED.Checked Then
SQLSTR &= "
and eza_VertretungsVerhaeltnisCode=2
"
@@ -425,6 +471,8 @@ Public Class usrCntlCBAM
"
End If
If SQLSTR_WHERE_FIRMEN <> "" Then SQLSTR &= " and EZA_firma in ( " & SQLSTR_WHERE_FIRMEN & ")"
SQLSTR &= " group by eza_VersendungsLandCode,left(ezaWP_WarennummerEZT,8),ezaWP_AnmeldeVErfahren,ezaWP_VerfahrensCodeVorangegangenesVerfahren"
@@ -775,7 +823,7 @@ Public Class usrCntlCBAM
"
If cbxVERAG.Checked Then
If cbxVERAG.Checked Or cbxIMEX.Checked Or cbxUNISPED.Checked Then
SQLSTR &= "
and DecRep IN(3)
"
@@ -901,8 +949,8 @@ Public Class usrCntlCBAM
End Sub
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles cbxVERAG.CheckedChanged
txtEori.Enabled = Not cbxVERAG.Checked
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles cbxVERAG.CheckedChanged, cbxUNISPED.CheckedChanged, cbxIMEX.CheckedChanged
txtEori.Enabled = Not (cbxVERAG.Checked Or cbxUNISPED.Checked Or cbxIMEX.Checked)
End Sub
Private Sub btnCBAM_DS_DAKOSY_XML_Click(sender As Object, e As EventArgs) Handles btnCBAM_DS_DAKOSY_XML.Click
@@ -953,7 +1001,7 @@ Public Class usrCntlCBAM
Me.Cursor = Cursors.WaitCursor
Dim SQLSTR = "
SELECT
SELECT
telanm_CRN Registriernummer
,Pos_ID PositionsNummer
,dec_CreateDate Anmeldedatum
@@ -966,9 +1014,9 @@ Public Class usrCntlCBAM
,ValData_InvVal Rechnungspreis
,ValData_InvCurr Rechnungswaehrung
,ConeeTra_TIN as Empfänger
,ConeeTra_Na as Empfänger
,ConeeTra_Na as Empfänger_
,ConorTra_TIN as Absender
,ConorTra_Na as Absender
,ConorTra_Na as Absender_
FROM [VERAG].[dbo].[tblTelotec_Anmeldung]
inner join tblTelotec_Positionsdaten on telpos_telanmId=telanm_id
@@ -1004,7 +1052,7 @@ Public Class usrCntlCBAM
"
If cbxVERAG.Checked Then
If cbxVERAG.Checked Or cbxIMEX.Checked Or cbxUNISPED.Checked Then
SQLSTR &= "
and Declarant_DecRep IN(1,3,5,7)
"