MA Anzeige Hauptfirma, div. Fixes

This commit is contained in:
2022-12-05 14:17:34 +01:00
parent 0fd21dba2a
commit b4d25e6ea1
5 changed files with 104 additions and 69 deletions

View File

@@ -4,7 +4,7 @@ Imports System.Reflection
Public Class cPLOSE_Inv_Data
Property plInv_Id As Integer
Property plInv_SupplierRechnungsDatum As Date
Property plInv_SupplierRechnungsDatum As Object = Nothing
Property plInv_SupplierRechnungsNr As String
Property plInv_SupplierCountry As Object = Nothing
Property plInv_Lieferant As Object = Nothing

View File

@@ -51,7 +51,7 @@ Public Class usrCntlMitarbeiter
Dim sql As String = "SELECT mit_id,mit_username,mit_vname, mit_nname ,mit_niederlassung,mit_abteilung,mit_email,mit_durchwahl,mit_gekuendigt FROM tblMitarbeiter WHERE (mit_firma='" & firma & "' OR mit_firma='ALL') "
Dim sql As String = "SELECT mit_id,mit_username,mit_vname, mit_nname ,mit_niederlassung,mit_abteilung,mit_email,mit_durchwahl,mit_gekuendigt FROM tblMitarbeiter WHERE (mit_firma='" & firma & "' OR (mit_firma='ALL' AND mit_FirmaHaupt='" & firma & "' )) "
If txtSuche.Text <> "" Then
sql &= " AND (mit_username LIKE '%" & txtSuche.Text & "%' OR mit_nname LIKE '%" & txtSuche.Text & "%' OR mit_vname LIKE '%" & txtSuche.Text & "%') "

View File

@@ -570,7 +570,7 @@ Public Class cGetMsgType
Shared Function isPLOSE_Detail(doc As String) As Boolean
Dim lines() As String = IO.File.ReadAllLines(doc)
If lines.Count > 0 Then
If lines(0).ToString.StartsWith("TR5") Or (lines.Count > 1 AndAlso (lines(0).ToString.StartsWith("TR1") And lines(1).ToString.StartsWith("TR5"))) Then
If lines(0).ToString.Replace("""", "").StartsWith("TR5") Or (lines.Count > 1 AndAlso (lines(0).ToString.Replace("""", "").StartsWith("TR1") And lines(1).ToString.Replace("""", "").StartsWith("TR5"))) Then
Return True
End If
End If
@@ -579,7 +579,7 @@ Public Class cGetMsgType
Shared Function isPLOSE_Header(doc As String) As Boolean
Dim lines() As String = IO.File.ReadAllLines(doc)
If lines.Count > 0 Then
If lines(0).ToString.StartsWith("TR6") Then
If lines(0).ToString.Replace("""", "").StartsWith("TR6") Then
Return True
End If
End If
@@ -587,8 +587,9 @@ Public Class cGetMsgType
End Function
Shared Function isPLOSE_INVData(doc As String) As Boolean
Dim lines() As String = IO.File.ReadAllLines(doc)
If lines.Count > 0 Then
If lines(0).ToString.StartsWith("PloseCode") Then
If lines(0).ToString.Replace("""", "").StartsWith("PloseCode") Then
Return True
End If
End If

View File

@@ -3342,39 +3342,54 @@ Public Class frmDYNachrichtenVerarbeitung
'Erwerber --> NEU!!! = zusätzl. Steuerl. Angaben
If FCFCDE.Body IsNot Nothing AndAlso FCFCDE.Body.AdditionalDutyReferences IsNot Nothing AndAlso FCFCDE.Body.AdditionalDutyReferences.Count > 0 AndAlso FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty IsNot Nothing Then
For Each ADDREF In FCFCDE.Body.AdditionalDutyReferences
If ADDREF.ReferenceNumber IsNot Nothing Then
If ADDREF.ReferenceNumber.ToString.StartsWith("FR2") Then 'ERWERBER
Dim UIDNR = ADDREF.ReferenceNumber.Substring(3) ' ohne FR2
Dim ADR As New DAKOSY_Worker.cDakosy_EZA_Adressen
ADR.ezaAd_AdressTyp = "UC"
If FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name IsNot Nothing Then
If FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Length > 40 Then
If FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Length > 80 Then
ADR.ezaAd_NameFirma1 = FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Substring(40, 40)
ADR.ezaAd_NameFirma3 = FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Substring(80, FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Length - 80)
ADR.ezaAd_AdressTyp = "UC" 'ERWERBER
If ADDREF.DutyInterestedParty.Name IsNot Nothing Then
If ADDREF.DutyInterestedParty.Name.ToString.Length > 40 Then
If ADDREF.DutyInterestedParty.Name.ToString.Length > 80 Then
ADR.ezaAd_NameFirma1 = ADDREF.DutyInterestedParty.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = ADDREF.DutyInterestedParty.Name.ToString.Substring(40, 40)
ADR.ezaAd_NameFirma3 = ADDREF.DutyInterestedParty.Name.ToString.Substring(80, ADDREF.DutyInterestedParty.Name.ToString.Length - 80)
End If
ADR.ezaAd_NameFirma1 = FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Substring(40, FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Length - 40)
ADR.ezaAd_NameFirma1 = ADDREF.DutyInterestedParty.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = ADDREF.DutyInterestedParty.Name.ToString.Substring(40, ADDREF.DutyInterestedParty.Name.ToString.Length - 40)
Else
ADR.ezaAd_NameFirma1 = FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name
ADR.ezaAd_NameFirma1 = ADDREF.DutyInterestedParty.Name
End If
End If
If FCFCDE.Body.AdditionalDutyReferences(0).ReferenceNumber IsNot Nothing Then
ADR.ezaAd_UStIDAnmelder = FCFCDE.Body.AdditionalDutyReferences(0).ReferenceNumber
EZA.eza_UstIdAnmelder = FCFCDE.Body.AdditionalDutyReferences(0).ReferenceNumber
End If
If FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Identification IsNot Nothing Then
ADR.ezaAd_TeilnehmerEORI = FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Identification.ReferenceNumber
'ADR.ezaAd_TeilnehmerNLNR = FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Identification.ReferenceNumber
ADR.ezaAd_UStIDAnmelder = UIDNR
EZA.eza_UstIdAnmelder = UIDNR
If ADDREF.DutyInterestedParty.Identification IsNot Nothing Then
ADR.ezaAd_TeilnehmerEORI = ADDREF.DutyInterestedParty.Identification.ReferenceNumber
'ADR.ezaAd_TeilnehmerNLNR = ADDREF.DutyInterestedParty.Identification.ReferenceNumber
End If
If FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Address IsNot Nothing Then
ADR.ezaAd_StrasseHausNr1 = FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Address.Line
If ADDREF.DutyInterestedParty.Address IsNot Nothing Then
ADR.ezaAd_StrasseHausNr1 = ADDREF.DutyInterestedParty.Address.Line
ADR.ezaAd_StrasseHausNr2 = Nothing
ADR.ezaAd_Ort = FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Address.City
ADR.ezaAd_PLZ = FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Address.Postcode
ADR.ezaAd_LandCode = FCFCDE.Body.AdditionalDutyReferences(0).DutyInterestedParty.Address.Country
ADR.ezaAd_Ort = ADDREF.DutyInterestedParty.Address.City
ADR.ezaAd_PLZ = ADDREF.DutyInterestedParty.Address.Postcode
ADR.ezaAd_LandCode = ADDREF.DutyInterestedParty.Address.Country
End If
EZA.eza_ADRESSEN.Add(ADR)
ElseIf ADDREF.ReferenceNumber.ToString.StartsWith("FR2") Then 'ERWERBER
'Fiskalvertreter
End If
End If
Next
End If
'Versender/Ausführer
If FCFCDE.Body IsNot Nothing AndAlso FCFCDE.Body.Consignor IsNot Nothing Then
@@ -3961,38 +3976,49 @@ Public Class frmDYNachrichtenVerarbeitung
'Erwerber --> NEU!!! = zusätzl. Steuerl. Angaben
If FCFCDF.Body IsNot Nothing AndAlso FCFCDF.Body.AdditionalDutyReferences IsNot Nothing AndAlso FCFCDF.Body.AdditionalDutyReferences.Count > 0 AndAlso FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty IsNot Nothing Then
For Each ADDREF In FCFCDF.Body.AdditionalDutyReferences
If ADDREF.ReferenceNumber IsNot Nothing Then
If ADDREF.ReferenceNumber.ToString.StartsWith("FR2") Then 'ERWERBER
Dim UIDNR = ADDREF.ReferenceNumber.Substring(3) ' ohne FR2
Dim ADR As New DAKOSY_Worker.cDakosy_EZA_Adressen
ADR.ezaAd_AdressTyp = "UC"
If FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name IsNot Nothing Then
If FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Length > 40 Then
If FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Length > 80 Then
ADR.ezaAd_NameFirma1 = FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Substring(40, 40)
ADR.ezaAd_NameFirma3 = FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Substring(80, FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Length - 80)
ADR.ezaAd_AdressTyp = "UC" 'ERWERBER
If ADDREF.DutyInterestedParty.Name IsNot Nothing Then
If ADDREF.DutyInterestedParty.Name.ToString.Length > 40 Then
If ADDREF.DutyInterestedParty.Name.ToString.Length > 80 Then
ADR.ezaAd_NameFirma1 = ADDREF.DutyInterestedParty.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = ADDREF.DutyInterestedParty.Name.ToString.Substring(40, 40)
ADR.ezaAd_NameFirma3 = ADDREF.DutyInterestedParty.Name.ToString.Substring(80, ADDREF.DutyInterestedParty.Name.ToString.Length - 80)
End If
ADR.ezaAd_NameFirma1 = FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Substring(40, FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name.ToString.Length - 40)
ADR.ezaAd_NameFirma1 = ADDREF.DutyInterestedParty.Name.ToString.Substring(0, 40)
ADR.ezaAd_NameFirma2 = ADDREF.DutyInterestedParty.Name.ToString.Substring(40, ADDREF.DutyInterestedParty.Name.ToString.Length - 40)
Else
ADR.ezaAd_NameFirma1 = FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Name
ADR.ezaAd_NameFirma1 = ADDREF.DutyInterestedParty.Name
End If
End If
If FCFCDF.Body.AdditionalDutyReferences(0).ReferenceNumber IsNot Nothing Then
ADR.ezaAd_UStIDAnmelder = FCFCDF.Body.AdditionalDutyReferences(0).ReferenceNumber
EZA.eza_UstIdAnmelder = FCFCDF.Body.AdditionalDutyReferences(0).ReferenceNumber
End If
If FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Identification IsNot Nothing Then
ADR.ezaAd_TeilnehmerEORI = FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Identification.ReferenceNumber
'ADR.ezaAd_TeilnehmerNLNR = FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Identification.ReferenceNumber
ADR.ezaAd_UStIDAnmelder = UIDNR
EZA.eza_UstIdAnmelder = UIDNR
If ADDREF.DutyInterestedParty.Identification IsNot Nothing Then
ADR.ezaAd_TeilnehmerEORI = ADDREF.DutyInterestedParty.Identification.ReferenceNumber
'ADR.ezaAd_TeilnehmerNLNR = ADDREF.DutyInterestedParty.Identification.ReferenceNumber
End If
If FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Address IsNot Nothing Then
ADR.ezaAd_StrasseHausNr1 = FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Address.Line
If ADDREF.DutyInterestedParty.Address IsNot Nothing Then
ADR.ezaAd_StrasseHausNr1 = ADDREF.DutyInterestedParty.Address.Line
ADR.ezaAd_StrasseHausNr2 = Nothing
ADR.ezaAd_Ort = FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Address.City
ADR.ezaAd_PLZ = FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Address.Postcode
ADR.ezaAd_LandCode = FCFCDF.Body.AdditionalDutyReferences(0).DutyInterestedParty.Address.Country
ADR.ezaAd_Ort = ADDREF.DutyInterestedParty.Address.City
ADR.ezaAd_PLZ = ADDREF.DutyInterestedParty.Address.Postcode
ADR.ezaAd_LandCode = ADDREF.DutyInterestedParty.Address.Country
End If
EZA.eza_ADRESSEN.Add(ADR)
End If
End If
Next
End If
'Versender/Ausführer

View File

@@ -774,7 +774,6 @@ Public Class frmMDMNachrichtenVerarbeitung
Dim currentRow As String()
Dim fi As FileInfo = New FileInfo(d)
While Not MyReader.EndOfData
@@ -784,8 +783,10 @@ Public Class frmMDMNachrichtenVerarbeitung
If currentRow(0) <> "PloseCode" Then ' Header
If currentRow.Length >= 15 Then
Dim PLOSE_INV As New MDM_Worker.cPLOSE_Inv_Data
' MsgBox(SQL.isleernothingDateFormatstring(currentRow(7)))
' MsgBox(currentRow(7))
PLOSE_INV.plInv_SupplierRechnungsDatum = SQL.isleernothingDateFormatstring(currentRow(7))
' MsgBox(PLOSE_INV.plInv_SupplierRechnungsDatum)
PLOSE_INV.plInv_SupplierRechnungsNr = SQL.isleernothing(currentRow(8))
PLOSE_INV.plInv_SupplierCountry = SQL.isleernothing(currentRow(6))
PLOSE_INV.plInv_Lieferant = SQL.isleernothing(currentRow(4))
@@ -793,6 +794,9 @@ Public Class frmMDMNachrichtenVerarbeitung
PLOSE_INV.plInv_LieferantUID = SQL.isleernothing(currentRow(5))
'PLOSE_INV.plInv_RechnungsJahr = SQL.isleernothing(currentRow(7)) --> JAHR
PLOSE_INV.plInv_PdfFileName = SQL.isleernothing(currentRow(14))
If If(PLOSE_INV.plInv_PdfFileName, "") <> "" Then
If Not PLOSE_INV.plInv_PdfFileName.ToString.ToLower.EndsWith(".pdf") Then PLOSE_INV.plInv_PdfFileName += ".pdf" ' Falls Endung nciht .pdf --> anfügen
End If
PLOSE_INV.plInv_Einlesedatum = Now.ToShortDateString
PLOSE_INV.plInv_Datensatztyp = "PDF"
PLOSE_INV.plInv_PLOSEKundennummer = SQL.isleernothing(currentRow(0))
@@ -807,6 +811,10 @@ Public Class frmMDMNachrichtenVerarbeitung
' [plInv_daId]
'If If(PLOSE_INV.plInv_PdfFileName, "") <> "" Then 'And PLOSE_INV.plInv_daId Is Nothing Then
' PLOSE_INV.plInv_daId = SQL.getValueTxtBySql("SELECT TOP (1) [da_id] FROM [tblDatenarchiv] where da_kategorie = 'MDM' AND da_ordner='MDM_DATEN' and da_name='" & PLOSE_INV.plInv_PdfFileName & "' order by da_id desc", "FMZOLL",,, Nothing)
'End If
PLOSE_INV.plInv_Dateiname = fi.Name