CBAM
This commit is contained in:
@@ -1086,94 +1086,91 @@ Public Class usrCntlCBAM
|
||||
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
btnCBAM_DS_DAKOSY_Summe.Enabled = False
|
||||
btnCBAM_DS_DAKOSY_Summe.Tag = ""
|
||||
'btnCBAM_DS_DAKOSY_Summe.Enabled = False
|
||||
'btnCBAM_DS_DAKOSY_Summe.Tag = ""
|
||||
|
||||
Try
|
||||
Dim EORI = txtEori.Text
|
||||
If cbxVERAG.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
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
'Try
|
||||
' Dim EORI = txtEori.Text
|
||||
' If cbxVERAG.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
|
||||
' Me.Cursor = Cursors.WaitCursor
|
||||
|
||||
Dim SQLSTR = "
|
||||
SELECT
|
||||
left(ezaWP_WarennummerEZT,8) Tarifnummer,sum(ezaWP_Eigenmasse)Eigenmasse,sum(ezaWP_Rohmasse)Rohmasse,sum(ezaWP_Artikelpreis)Rechnungspreis,eza_VersendungsLandCode VersendungsLand ,isnull(ezaWP_AnmeldeVErfahren,'') Verfahren,isnull([ezaWP_VerfahrensCodeVorangegangenesVerfahren],'') VorangegangenesVerfahren
|
||||
|
||||
FROM [VERAG].[dbo].[tblDakosy_EZA]
|
||||
inner join tblDakosy_EZA_Warenposition on ezaWP_EzaId=eza_Id
|
||||
where
|
||||
eza_anmeldedatum between '" & txtVon._value & "' and '" & txtBis._value & "'
|
||||
and
|
||||
(
|
||||
left(ezaWP_WarennummerEZT,4) IN (2523,2716,2808,2814,3102,3105,7201,7203,7318,7326,7601,7616)
|
||||
OR left(ezaWP_WarennummerEZT,4) between 7301 and 7311
|
||||
OR left(ezaWP_WarennummerEZT,4) between 7205 and 7229
|
||||
OR left(ezaWP_WarennummerEZT,4) between 7603 and 7614
|
||||
OR ezaWP_WarennummerEZT like '25070080%'
|
||||
OR ezaWP_WarennummerEZT like '283421%'
|
||||
OR ezaWP_WarennummerEZT like '260112%'
|
||||
OR ezaWP_WarennummerEZT like '720211%'
|
||||
OR ezaWP_WarennummerEZT like '720219%'
|
||||
OR ezaWP_WarennummerEZT like '720241%'
|
||||
OR ezaWP_WarennummerEZT like '720249%'
|
||||
OR ezaWP_WarennummerEZT like '720260%'
|
||||
OR ezaWP_WarennummerEZT like '280410%'
|
||||
|
||||
)
|
||||
and ezaWP_WarennummerEZT not like '310560%'
|
||||
and (eza_status between 50 and 60 or [eza_ANR] LIKE 'ATC%')
|
||||
|
||||
"
|
||||
' Dim SQLSTR = "
|
||||
' SELECT
|
||||
' left(ezaWP_WarennummerEZT,8) Tarifnummer,sum(ezaWP_Eigenmasse)Eigenmasse,sum(ezaWP_Rohmasse)Rohmasse,sum(ezaWP_Artikelpreis)Rechnungspreis,eza_VersendungsLandCode VersendungsLand ,isnull(ezaWP_AnmeldeVErfahren,'') Verfahren,isnull([ezaWP_VerfahrensCodeVorangegangenesVerfahren],'') VorangegangenesVerfahren
|
||||
|
||||
If cbxVERAG.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 & "'
|
||||
"
|
||||
End If
|
||||
' FROM [VERAG].[dbo].[tblDakosy_EZA]
|
||||
' inner join tblDakosy_EZA_Warenposition on ezaWP_EzaId=eza_Id
|
||||
' where
|
||||
' eza_anmeldedatum between '" & txtVon._value & "' and '" & txtBis._value & "'
|
||||
' and
|
||||
' (
|
||||
' left(ezaWP_WarennummerEZT,4) IN (2523,2716,2808,2814,3102,3105,7201,7203,7318,7326,7601,7616)
|
||||
' OR left(ezaWP_WarennummerEZT,4) between 7301 and 7311
|
||||
' OR left(ezaWP_WarennummerEZT,4) between 7205 and 7229
|
||||
' OR left(ezaWP_WarennummerEZT,4) between 7603 and 7614
|
||||
' OR ezaWP_WarennummerEZT like '25070080%'
|
||||
' OR ezaWP_WarennummerEZT like '283421%'
|
||||
' OR ezaWP_WarennummerEZT like '260112%'
|
||||
' OR ezaWP_WarennummerEZT like '720211%'
|
||||
' OR ezaWP_WarennummerEZT like '720219%'
|
||||
' OR ezaWP_WarennummerEZT like '720241%'
|
||||
' OR ezaWP_WarennummerEZT like '720249%'
|
||||
' OR ezaWP_WarennummerEZT like '720260%'
|
||||
' OR ezaWP_WarennummerEZT like '280410%'
|
||||
|
||||
SQLSTR &= " group by eza_VersendungsLandCode,left(ezaWP_WarennummerEZT,8),ezaWP_AnmeldeVErfahren,ezaWP_VerfahrensCodeVorangegangenesVerfahren"
|
||||
' )
|
||||
' and ezaWP_WarennummerEZT not like '310560%'
|
||||
' and (eza_status between 50 and 60 or [eza_ANR] LIKE 'ATC%')
|
||||
|
||||
' "
|
||||
|
||||
' If cbxVERAG.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 & "'
|
||||
' "
|
||||
' End If
|
||||
|
||||
' SQLSTR &= " group by eza_VersendungsLandCode,left(ezaWP_WarennummerEZT,8),ezaWP_AnmeldeVErfahren,ezaWP_VerfahrensCodeVorangegangenesVerfahren"
|
||||
|
||||
|
||||
Dim dt = SQL.loadDgvBySql(SQLSTR, "FMZOLL", 600)
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
Dim path = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt,,,,, False, EORI & "_Summenbericht_" & txtVon._value & "-" & txtBis._value)
|
||||
btnCBAM_DS_DAKOSY_Summe.Tag = path
|
||||
btnCBAM_DS_DAKOSY_Summe.Enabled = True
|
||||
btnCBAM_DS_DAKOSY_Copy.Enabled = True
|
||||
' Dim dt = SQL.loadDgvBySql(SQLSTR, "FMZOLL", 600)
|
||||
' If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
' Dim path = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt,,,,, False, EORI & "_Summenbericht_" & txtVon._value & "-" & txtBis._value)
|
||||
' btnCBAM_DS_DAKOSY_Summe.Tag = path
|
||||
' btnCBAM_DS_DAKOSY_Summe.Enabled = True
|
||||
' btnCBAM_DS_DAKOSY_Copy.Enabled = True
|
||||
|
||||
Me.Cursor = Cursors.Default
|
||||
' Me.Cursor = Cursors.Default
|
||||
|
||||
End If
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
''----- XML ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
''----- XML ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
'btnCBAM_DS_DAKOSY_XML.Enabled = False
|
||||
'btnCBAM_DS_DAKOSY_XML.Tag = ""
|
||||
'btnCBAM_DS_DAKOSY_XML.Enabled = False
|
||||
'btnCBAM_DS_DAKOSY_XML.Tag = ""
|
||||
|
||||
'If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
' '---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
' doCBAM_XML(dt, EORI)
|
||||
' '---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
'If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
' '---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
' doCBAM_XML(dt, EORI)
|
||||
' '---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
'End If
|
||||
|
||||
|
||||
''---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
'End If
|
||||
|
||||
|
||||
''---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
'Catch ex As Exception
|
||||
' VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
'End Try
|
||||
|
||||
|
||||
Me.Cursor = Cursors.Default
|
||||
|
||||
Reference in New Issue
Block a user