From 307b6f95ac9119f5ad4d112f7ec66853d4c8e1a6 Mon Sep 17 00:00:00 2001 From: Andreas Luxbauer Date: Thu, 10 Oct 2024 20:04:27 +0200 Subject: [PATCH] cbam --- SDL/My Project/AssemblyInfo.vb | 4 +- SDL/kunden/usrCntlCBAM.vb | 193 +++++++++++++++++++++++++++++++++ 2 files changed, 195 insertions(+), 2 deletions(-) diff --git a/SDL/My Project/AssemblyInfo.vb b/SDL/My Project/AssemblyInfo.vb index 52cfb4eb..b1e99a60 100644 --- a/SDL/My Project/AssemblyInfo.vb +++ b/SDL/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/SDL/kunden/usrCntlCBAM.vb b/SDL/kunden/usrCntlCBAM.vb index 4c4d6fae..170f95dc 100644 --- a/SDL/kunden/usrCntlCBAM.vb +++ b/SDL/kunden/usrCntlCBAM.vb @@ -938,4 +938,197 @@ Public Class usrCntlCBAM Clipboard.SetDataObject(d, True) End If End Sub + + Private Sub btnCBAM_DS_TELOTEC_Click(sender As Object, e As EventArgs) Handles btnCBAM_DS_TELOTEC.Click + btnCBAM_DS_DAKOSY_Deteil.Enabled = False + btnCBAM_DS_DAKOSY_Copy.Enabled = False + btnCBAM_DS_DAKOSY_Deteil.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 + + Dim SQLSTR = " + SELECT + telanm_CRN Registriernummer + ,Pos_ID PositionsNummer + ,dec_CreateDate Anmeldedatum + ,telanm_BezugsNr BezugsNr + ,Declarant_DecRep VertretungsVerhaeltnis + ,Item_ComCd Tarifnummer + ,dec_TotNet Eigenmasse + ,Locs_Disp VersendungsLand + , Locs_Dest Bestimmungsland + ,ValData_InvVal Rechnungspreis + ,ValData_InvCurr Rechnungswaehrung + ,ConeeTra_TIN as Empfänger + ,ConeeTra_Na as Empfänger + ,ConorTra_TIN as Absender + ,ConorTra_Na as Absender + + 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 cbxVERAG.Checked Then + SQLSTR &= " + and Declarant_DecRep IN(1,3,5,7) + " + Else + SQLSTR &= " + and ConeeTra_TIN='" & EORI & "' /*and Declarant_DecRep NOT IN(1,3,5,7)*/ + " + End If + + SQLSTR &= " order by Absender,telanm_CRN " + + + 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 & "_Detailbericht_" & txtVon._value & "-" & txtBis._value) + btnCBAM_DS_DAKOSY_Deteil.Tag = path + btnCBAM_DS_DAKOSY_Deteil.Enabled = True + btnCBAM_DS_DAKOSY_Copy.Enabled = True + Me.Cursor = Cursors.Default + + 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 + + + '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + + 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 + + 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%') + + " + + 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 + + Me.Cursor = Cursors.Default + + End If + + + + ''----- XML ---------------------------------------------------------------------------------------------------------------------------------------- + + '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) + ' '--------------------------------------------------------------------------------------------------------------------------------------------- + + '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 + + End Sub End Class