@@ -5,8 +5,7 @@ Imports Microsoft.Office.Interop
Imports VERAG_PROG_ALLGEMEIN
Imports s2industries . ZUGFeRD
Imports System . IO
Imports GrapeCity . ActiveReports . Core . Rendering . Tools
Imports System . Windows . Converters
Public Class cFakturierung
@@ -935,8 +934,12 @@ Public Class cFakturierung
rpt . lblFirmaEmail . Text = If ( FIRMA . Firma_E_Mail , " " )
rpt . lblFirmaWeb . Text = If ( FIRMA . Firma_Webadresse , " " )
rpt . lblFirma . Text = ( If ( FIRMA . Firma_Bez , " " ) & " , " & If ( FIRMA . Firma_Ort , " " ) ) . ToString . Replace ( " (DE) " , " " )
If FIRMA . Firma_ID = 1 Then rpt . lblFirma . Text &= vbNewLine & " D-94152 Neuhaus/Inn, Hartham 6 "
If FIRMA . Firma_ID = 19 Then rpt . lblFirma . Text &= vbNewLine & " VERAG Spedition GmbH, Hartham 6, D-94152 Neuhaus/Inn "
rpt . lblFirmenbuch . Text = If ( FIRMA . Firma_Firmenbuch , " " ) . ToString . Replace ( " Firmenbuch: " , " " ) . Trim
rpt . lblUID . Text = If ( FIRMA . Firma_UID , " " )
rpt . lblEORI . Text = If ( FIRMA . Firma_EORI , " " )
@@ -983,7 +986,7 @@ Public Class cFakturierung
End If
End If
End If
Case Else 'VERAG,ATILLA
Case Else 'VERAG,ATILLA, VERAG360
rpt . txtBank1 . Text = If ( FIRMA . Firma_Bankverbindung1 , " " ) & vbNewLine & If ( FIRMA . Firma_IBAN1 , " " ) & vbNewLine & If ( FIRMA . Firma_BIC1 , " " ) . ToString . Trim
rpt . txtBank2 . Text = If ( FIRMA . Firma_Bankverbindung2 , " " ) & vbNewLine & If ( FIRMA . Firma_IBAN2 , " " ) & vbNewLine & If ( FIRMA . Firma_BIC2 , " " ) . ToString . Trim
@@ -1869,69 +1872,69 @@ Public Class cFakturierung
If RECHNUNG . SteuerfreierGesamtbetrag > 0 Then
desc . AddApplicableTradeTax ( Convert . ToDecimal ( RECHNUNG . SteuerfreierGesamtbetrag ) , 0 , TaxTypes . VAT , TaxCategoryCodes . Z )
End If
desc . AddApplicableTradeTax ( Convert . ToDecimal ( RECHNUNG . SteuerfreierGesamtbetrag ) , 0 , TaxTypes . VAT , TaxCategoryCodes . Z )
End If
If RECHNUNG . SteuerpflichtigerGesamtbetrag > 0 Then
desc . AddApplicableTradeTax ( Convert . ToDecimal ( taxBasisAmount - RECHNUNG . SteuerfreierGesamtbetrag ) , Convert . ToDecimal ( steuerProzenFaktor ) , Convert . ToDecimal ( taxTotalAmount ) , TaxTypes . VAT , IIf ( isReverseCharge , TaxCategoryCodes . AE , TaxCategoryCodes . S ) )
End If
If RECHNUNG . SteuerpflichtigerGesamtbetrag > 0 Then
desc . AddApplicableTradeTax ( Convert . ToDecimal ( taxBasisAmount - RECHNUNG . SteuerfreierGesamtbetrag ) , Convert . ToDecimal ( steuerProzenFaktor ) , Convert . ToDecimal ( taxTotalAmount ) , TaxTypes . VAT , IIf ( isReverseCharge , TaxCategoryCodes . AE , TaxCategoryCodes . S ) )
End If
Select Case FIRMA . Firma_ID
Case 21 , 22 , 23 '"UNISPED"
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
Select Case FIRMA . Firma_ID
Case 21 , 22 , 23 '"UNISPED"
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
Case 26 'VERAG-UNISPED"
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
Case 26 'VERAG-UNISPED"
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
Case 24 'AMBAR"
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
desc . AddCreditorFinancialAccount ( " TR90 0006 2001 6040 0009 0804 66 " , " TGBATRISXXX " , , , " Garanti Bank Türkei – Euro Konto " )
Case 24 'AMBAR"
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
desc . AddCreditorFinancialAccount ( " TR90 0006 2001 6040 0009 0804 66 " , " TGBATRISXXX " , , , " Garanti Bank Türkei – Euro Konto " )
Case 20 '"IMEX"
If RECHNUNG . RechnungsLandKz = " TR " Then
desc . AddCreditorFinancialAccount ( " TR84 0006 2001 6040 0009 0987 13 " , " " , , , " Garanti Bank " )
Case 20 '"IMEX"
If RECHNUNG . RechnungsLandKz = " TR " Then
desc . AddCreditorFinancialAccount ( " TR84 0006 2001 6040 0009 0987 13 " , " " , , , " Garanti Bank " )
Else
If hasVK ( RECHNUNG ) Then
desc . AddCreditorFinancialAccount ( " AT35 4480 0365 7822 0002 " , " VBOEATWWOOE " , , , " Volksbank Oberösterreich AG " )
Else
If hasVK ( RECHNUNG ) Then
desc . AddCreditorFinancialAccount ( " AT35 4480 0365 7822 0002 " , " VBOEATWWOOE " , , , " Volksbank Oberösterreich AG " )
If hasEUSTZOLL ( RECHNUNG . RechnungsNr ) Then
desc . AddCreditorFinancialAccount ( " AT62 4480 0365 7822 0001 " , " VBOEATWWOOE " , )
Else
If hasEUSTZOLL ( RECHNUNG . RechnungsNr ) Then
desc . AddCreditorFinancialAccount ( " AT62 4480 0365 7822 0001 " , " VBOEATWWOOE " , )
Else
desc . AddCreditorFinancialAccount ( " TR84 0006 2001 6040 0009 0987 13 " , " VBOEATWWOOE " , , , " Volksbank Oberösterreich AG " )
End If
desc . AddCreditorFinancialAccount ( " TR84 0006 2001 6040 0009 0987 13 " , " VBOEATWWOOE " , , , " Volksbank Oberösterreich AG " )
End If
End If
End If
Case 19
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
Case 19
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
Case Else 'VERAG,ATILLA
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
Case Else 'VERAG,ATILLA
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
End Select
End Select
Dim tmpPathZugpferd = VERAG_PROG_ALLGEMEIN . DATENVERVER_OPTIONS . getTMPPath ( " ZUGFeRD_Invoice_ " & RECHNUNG . RechnungsNr , " .xml " , True , False )
Dim stream As FileStream = New FileStream ( tmpPathZugpferd , FileMode . Create , FileAccess . Write )
desc . Save ( stream , ZUGFeRDVersion . Version20 , Profile . Comfort )
Dim tmpPathZugpferd = VERAG_PROG_ALLGEMEIN . DATENVERVER_OPTIONS . getTMPPath ( " ZUGFeRD_Invoice_ " & RECHNUNG . RechnungsNr , " .xml " , True , False )
Dim stream As FileStream = New FileStream ( tmpPathZugpferd , FileMode . Create , FileAccess . Write )
desc . Save ( stream , ZUGFeRDVersion . Version20 , Profile . Comfort )
stream . Flush ( )
stream . Close ( )
Return tmpPathZugpferd
stream . Flush ( )
stream . Close ( )
Return tmpPathZugpferd
ElseIf Not einzelrechnung AndAlso SR_DT IsNot Nothing Then
ElseIf Not einzelrechnung AndAlso SR_DT IsNot Nothing Then
'---------------------------------------------------------------------------------
'--------------------------------SAMMELRECHNUNG-----------------------------------
'---------------------------------------------------------------------------------
'---------------------------------------------------------------------------------
'--------------------------------SAMMELRECHNUNG-----------------------------------
'---------------------------------------------------------------------------------
Dim ROW As DataRow = SR_DT . Rows ( 0 )
Dim ROW As DataRow = SR_DT . Rows ( 0 )
Dim FIRMA As New VERAG_PROG_ALLGEMEIN . cFirmen ( ROW ( " Firma_ID " ) )
Dim RECHNUNG_AD As New VERAG_PROG_ALLGEMEIN . cAdressen ( ROW ( " RechnungsKundenNr " ) )
@@ -2156,67 +2159,67 @@ Public Class cFakturierung
Select Case FIRMA . Firma_ID
Case 21 , 22 , 23 '"UNISPED"
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
Case 21 , 22 , 23 '"UNISPED"
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
Case 26 'VERAG-UNISPED"
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
Case 26 'VERAG-UNISPED"
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
Case 24 'AMBAR"
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
desc . AddCreditorFinancialAccount ( " TR90 0006 2001 6040 0009 0804 66 " , " TGBATRISXXX " , , , " Garanti Bank Türkei – Euro Konto " )
Case 24 'AMBAR"
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
desc . AddCreditorFinancialAccount ( " TR90 0006 2001 6040 0009 0804 66 " , " TGBATRISXXX " , , , " Garanti Bank Türkei – Euro Konto " )
Case 20 '"IMEX"
If RechnungsLandKz = " TR " Then
desc . AddCreditorFinancialAccount ( " TR84 0006 2001 6040 0009 0987 13 " , " " , , , " Garanti Bank " )
Case 20 '"IMEX"
If RechnungsLandKz = " TR " Then
desc . AddCreditorFinancialAccount ( " TR84 0006 2001 6040 0009 0987 13 " , " " , , , " Garanti Bank " )
Else
If hasVK ( RechnungsNr , ROW ( " Buchungsjahr " ) ) Then
desc . AddCreditorFinancialAccount ( " AT35 4480 0365 7822 0002 " , " VBOEATWWOOE " , , , " Volksbank Oberösterreich AG " )
Else
If hasVK ( RechnungsNr , ROW ( " Buchungsjahr " ) ) Then
desc . AddCreditorFinancialAccount ( " AT35 4480 0365 7822 0002 " , " VBOEATWWOOE " , , , " Volksbank Oberösterreich AG " )
If hasEUSTZOLL ( RechnungsNr ) Then
desc . AddCreditorFinancialAccount ( " AT62 4480 0365 7822 0001 " , " VBOEATWWOOE " , )
Else
If hasEUSTZOLL ( RechnungsNr ) Then
desc . AddCreditorFinancialAccount ( " AT62 4480 0365 7822 0001 " , " VBOEATWWOOE " , )
Else
desc . AddCreditorFinancialAccount ( " TR84 0006 2001 6040 0009 0987 13 " , " VBOEATWWOOE " , , , " Volksbank Oberösterreich AG " )
End If
desc . AddCreditorFinancialAccount ( " TR84 0006 2001 6040 0009 0987 13 " , " VBOEATWWOOE " , , , " Volksbank Oberösterreich AG " )
End If
End If
End If
Case 19
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
Case 19
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
Case Else 'VERAG,ATILLA
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
Case Else 'VERAG,ATILLA
If FIRMA . Firma_IBAN1 IsNot Nothing AndAlso FIRMA . Firma_BIC1 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung1 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN1 IsNot Nothing , FIRMA . Firma_IBAN1 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC1 IsNot Nothing , FIRMA . Firma_BIC1 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung1 IsNot Nothing , FIRMA . Firma_Bankverbindung1 , " " ) )
If FIRMA . Firma_IBAN2 IsNot Nothing AndAlso FIRMA . Firma_BIC2 IsNot Nothing AndAlso FIRMA . Firma_Bankverbindung2 IsNot Nothing Then desc . AddCreditorFinancialAccount ( IIf ( FIRMA . Firma_IBAN2 IsNot Nothing , FIRMA . Firma_IBAN2 . ToString . Replace ( " IBAN: " , " " ) , " " ) , IIf ( FIRMA . Firma_BIC2 IsNot Nothing , FIRMA . Firma_BIC2 . ToString . Replace ( " BIC: " , " " ) , " " ) , , , IIf ( FIRMA . Firma_Bankverbindung2 IsNot Nothing , FIRMA . Firma_Bankverbindung2 , " " ) )
End Select
End Select
Dim isReverseCharge = IIf ( getReverseChargeSumme ( FIRMA , ROW ( " RechnungsLandKz " ) , ROW ( " RechnungsNr " ) , ROW ( " RechnungsDatum " ) , " " ) > 0 , True , False )
Dim isReverseCharge = IIf ( getReverseChargeSumme ( FIRMA , ROW ( " RechnungsLandKz " ) , ROW ( " RechnungsNr " ) , ROW ( " RechnungsDatum " ) , " " ) > 0 , True , False )
If Gesamt_RG_BetragSteuerfrei > 0 Then
desc . AddApplicableTradeTax ( Convert . ToDecimal ( Gesamt_RG_BetragSteuerfrei ) , 0 , TaxTypes . VAT , TaxCategoryCodes . Z )
End If
If Gesamt_RG_BetragSteuerpflichtig > 0 Then
desc . AddApplicableTradeTax ( Convert . ToDecimal ( taxBasisAmount - Gesamt_RG_BetragSteuerfrei ) , Convert . ToDecimal ( steuerProzenFaktor ) , Convert . ToDecimal ( taxTotalAmount ) , TaxTypes . VAT , IIf ( isReverseCharge , TaxCategoryCodes . AE , TaxCategoryCodes . S ) )
End If
Dim tmpPathZugpferd = VERAG_PROG_ALLGEMEIN . DATENVERVER_OPTIONS . getTMPPath ( " ZUGFeRD_Invoice_ " & RechnungsNr , " .xml " , True , False )
Dim stream As FileStream = New FileStream ( tmpPathZugpferd , FileMode . Create , FileAccess . Write )
desc . Save ( stream , ZUGFeRDVersion . Version20 , Profile . Comfort )
stream . Flush ( )
stream . Close ( )
Return tmpPathZugpferd
If Gesamt_RG_BetragSteuerfrei > 0 Then
desc . AddApplicableTradeTax ( Convert . ToDecimal ( Gesamt_RG_BetragSteuerfrei ) , 0 , TaxTypes . VAT , TaxCategoryCodes . Z )
End If
If Gesamt_RG_BetragSteuerpflichtig > 0 Then
desc . AddApplicableTradeTax ( Convert . ToDecimal ( taxBasisAmount - Gesamt_RG_BetragSteuerfrei ) , Convert . ToDecimal ( steuerProzenFaktor ) , Convert . ToDecimal ( taxTotalAmount ) , TaxTypes . VAT , IIf ( isReverseCharge , TaxCategoryCodes . AE , TaxCategoryCodes . S ) )
End If
Dim tmpPathZugpferd = VERAG_PROG_ALLGEMEIN . DATENVERVER_OPTIONS . getTMPPath ( " ZUGFeRD_Invoice_ " & RechnungsNr , " .xml " , True , False )
Dim stream As FileStream = New FileStream ( tmpPathZugpferd , FileMode . Create , FileAccess . Write )
desc . Save ( stream , ZUGFeRDVersion . Version20 , Profile . Comfort )
stream . Flush ( )
stream . Close ( )
Return tmpPathZugpferd
End If
@@ -2900,7 +2903,7 @@ Public Class cFakturierung
End If
kdTmp = RG . RechnungsKundenNr
kdTmp = RG . RechnungsKundenNr
FilialeTmp = RG . FilialenNr
FIRMATmp = RG . Firma_ID
Case Else
@@ -2978,7 +2981,7 @@ Public Class cFakturierung
End Function
Public Shared Function doSAMMELRechnungsDruck_Abschnitt ( ByRef RechnungsNr As Integer , Firma_ID As Integer , Buchungsjahr As Integer , DruckdatumUhrzeit As DateTime , PrinterName As String , Optional AnlageEinzelRg As Boolean = True , Optional Sammelrechnungsbericht As Boolean = True , Optional RechnungsdruckArt As Integer = - 1 , Optional ByRef pathPDF As String = " " , Optional SRDruckWiederholen As Boolean = False , Optional SB As String = " " , Optional AnlageExcelEvolog As Boolean = False , Optional ByRef SonstAnlagen As List ( Of String ) = Nothing , Optional VorschauID As String = " " , Optional AnlageExcelTransferry360 As Boolean = False , Optional FakturierungsGruppe As String = " " , Optional Abfertigungsart As String = " " , Optional mergePDF As Boolean = False , Optional RechnungsmautanhangAsPDF As Boolean = False ) As Boolean
Public Shared Function doSAMMELRechnungsDruck_Abschnitt ( ByRef RechnungsNr As Integer , Firma_ID As Integer , Buchungsjahr As Integer , DruckdatumUhrzeit As DateTime , PrinterName As String , Optional AnlageEinzelRg As Boolean = True , Optional Sammelrechnungsbericht As Boolean = True , Optional RechnungsdruckArt As Integer = - 1 , Optional ByRef pathPDF As String = " " , Optional SRDruckWiederholen As Boolean = False , Optional SB As String = " " , Optional AnlageExcelEvolog As Boolean = False , Optional ByRef SonstAnlagen As List ( Of String ) = Nothing , Optional VorschauID As String = " " , Optional AnlageExcelTransferry360 As Boolean = False , Optional FakturierungsGruppe As String = " " , Optional Abfertigungsart As String = " " , Optional mergePDF As Boolean = False , Optional RechnungsanhangPDF As Boolean = False , Optional RechnugnskopieMDMSammelrechnung As Boolean = False , Optional AnhList As List ( Of String ) = Nothing , Optional RechnungsanhangCSV As Boolean = False ) As Boolean
'SB Nicht mehr benötigt, da RG-Nr und DruckdatumUhrzeit
Dim dt As DataTable
@@ -3005,32 +3008,12 @@ Public Class cFakturierung
'-------------- ENDE --------------
doSAMMELRechnungsDruck_Abschnitt = doSAMMELRechnungDruck_Rechnungsdruck ( dt , RechnungsNr , DruckdatumUhrzeit , 3 , RechnungsdruckArt , pathPDF_SammelRg , PrinterName , SRDruckWiederholen , VorschauID ) 'Sammelrechnung drucken
If Sammelrechnungsbericht Then If Not doSAMMELRechnungDruck_Rechnungsdruck_Sammelrechnungsbericht ( RechnungsNr , DruckdatumUhrzeit , RechnungsdruckArt , pathPDF_SammelBericht , PrinterName , VorschauID , dt ) Then doSAMMELRechnungsDruck_Abschnitt = False 'Sammelrechnungsbericht drucken
If Sammelrechnungsbericht Then If Not doSAMMELRechnungDruck_Rechnungsdruck_Sammelrechnungsbericht ( RechnungsNr , DruckdatumUhrzeit , RechnungsdruckArt , pathPDF_SammelBericht , PrinterName , VorschauID , dt , RechnugnskopieMDMSammelrechnung ) Then doSAMMELRechnungsDruck_Abschnitt = False 'Sammelrechnungsbericht drucken
If AnlageEinzelRg Then If Not doSAMMELRechnungDruck_Rechnungsdruck_Anlagen ( RechnungsNr , DruckdatumUhrzeit , PrinterName , pathPDF_Anlage , RechnungsdruckArt , VorschauID ) Then doSAMMELRechnungsDruck_Abschnitt = False 'Anlagen drucken
If Rechnungsmaut anhangAs PDF Then
If RechnungsanhangPDF Then getRechnungsanshang ( dt , pathPDF_Anlage , " pdf " )
If RechnungsanhangCSV Then getRechnungsanshang ( dt , AnhList , " csv " )
Dim displayView = New DataView ( dt , " " , " RK_ID " , DataViewRowState . CurrentRows )
Dim distinctDT_RK As DataTable = displayView . ToTable ( True , " RK_ID " )
For Each r In distinctDT_RK . Rows
Dim RG As New VERAG_PROG_ALLGEMEIN . cRechnungsausgang ( r ( " RK_ID " ) )
If RG IsNot Nothing Then
RG . LOAD_ANHAENGE ( )
For Each RG_AH In RG . ANHAENGE
If RG_AH . Bezeichnung . ToUpper . Contains ( " MAUT " ) Or RG_AH . Bezeichnung . ToUpper . Contains ( " DIESEL " ) Or RG_AH . Bezeichnung . ToUpper . Contains ( " INVOICE " ) Then
Dim Path = VERAG_PROG_ALLGEMEIN . cDATENSERVER . GET_PDFPath_BY_DocID ( RG_AH . dsId )
If Not pathPDF_Anlage . Contains ( Path ) Then
If Not ( pathPDF_Anlage . Any ( Function ( f ) f . Contains ( " COPY_INVOICE " ) ) And Path . ToUpper . Contains ( " COPY_INVOICE " ) ) Then 'damit diesel IDS-Rechnung nicht doppelt hinzugefügt wird.
pathPDF_Anlage . Add ( Path )
End If
End If
End If
Next
End If
Next
End If
'SONSTIGE ANLAGEN:
@@ -3362,7 +3345,7 @@ Public Class cFakturierung
End Function
Shared Function doSAMMELRechnungDruck_Rechnungsdruck_Sammelrechnungsbericht ( RechnungsNr As Integer , DruckdatumUhrzeit As Date , Optional Rechnugnsdruck As Integer = - 1 , Optional ByRef Path As String = " " , Optional PrinterName As String = " " , Optional VorschauID As String = " " , Optional SammelrechnungsDT As DataTable = Nothing ) As Boolean 'RECHNUNG As VERAG_PROG_ALLGEMEIN.cRechnungsausgang, Optional vorschau As Boolean = False, Optional Rechnugnsdruck As Integer = -1, Optional ByRef Path As String = "") As Boolean
Shared Function doSAMMELRechnungDruck_Rechnungsdruck_Sammelrechnungsbericht ( RechnungsNr As Integer , DruckdatumUhrzeit As Date , Optional Rechnugnsdruck As Integer = - 1 , Optional ByRef Path As String = " " , Optional PrinterName As String = " " , Optional VorschauID As String = " " , Optional SammelrechnungsDT As DataTable = Nothing , Optional Sammelrechnungskopie As Boolean = False ) As Boolean 'RECHNUNG As VERAG_PROG_ALLGEMEIN.cRechnungsausgang, Optional vorschau As Boolean = False, Optional Rechnugnsdruck As Integer = -1, Optional ByRef Path As String = "") As Boolean
Try
@@ -3436,7 +3419,7 @@ Public Class cFakturierung
Case Else
Select Case BelegartenKz
Case " AR "
rpt . lblUeberschriftRG_GS . Text = IIf ( Not isMDMRechnungsdruck , " Anlage zur Sammelrechnung " , " Sammelr echnung" )
rpt . lblUeberschriftRG_GS . Text = IIf ( Not isMDMRechnungsdruck , " Anlage zur Sammelrechnung " , " R echnung" )
Case " AG "
rpt . lblUeberschriftRG_GS . Text = " GUTSCHRIFT "
rpt . lblSummeUeberschrift . Text = " Gutschriftsbetrag: "
@@ -3544,8 +3527,13 @@ Public Class cFakturierung
If KD_RG IsNot Nothing AndAlso If ( KD_RG . Steuernummer , " " ) <> String . Empty Then
rpt . lblRechnung_Steuernummer . Text = If ( KD_RG . LandKz , " " ) & " " & If ( KD_RG . Steuernummer , " " ) . ToString . Trim
' rpt.lblRechnung_UID.Text = If(KD_RG.UstIdKz, "") & " " & If(KD_RG.UstIdNr, ""). ToString. Trim
If isMDMRechnungsdruck Then
rpt . lblRechnung_Steuernummer . Text = If ( KD_RG . Steuernummer , " " ) . ToString. Trim
Else
rpt . lblRechnung_Steuernummer . Text = If ( KD_RG . LandKz , " " ) & " " & If ( KD_RG . Steuernummer , " " ) . ToString . Trim
' rpt.lblRechnung_UID.Text = If(KD_RG.UstIdKz, "") & " " & If(KD_RG.UstIdNr, "").ToString.Trim
End If
Else
rpt . lblRechnung_Steuernummer . Text = " "
' rpt.lblRechnung_UID.Text = ""
@@ -3561,13 +3549,20 @@ Public Class cFakturierung
rpt . lblSteuerpflichtigUeberschrift . Visible = Not isMDMRechnungsdruck
rpt . lblDurchlaufposten . Visible = isMDMRechnungsdruck
rpt . lblSteuerplichtUeberschriftMDM . Visible = isMDMRechnungsdruck
rpt . lblEORI . Visible = Not isMDMRechnungsdruck
rpt . lblEORIUeberschrift . Visible = Not isMDMRechnungsdruck
rpt . txtAbfertigungsart . Visible = Not isMDMRechnungsdruck
Dim sumSteuerpflichtig As Double = 0
Dim sumSteuerfrei As Double = 0
If Sammelrechnungskopie Then
Select Case ROW ( " RechnungSprache " )
Case " EN " : rpt . lblUeberschriftRG_GS . Text &= " - COPY "
Case Else : rpt . lblUeberschriftRG_GS . Text &= " - KOPIE "
End Select
End If
@@ -4200,11 +4195,14 @@ Public Class cFakturierung
Select Case If ( Rechnugnsdruck > 0 , Rechnugnsdruck , If ( AD . Rechnungsdruck , 0 ) ) 'If(AD.Rechnungsdruck, 0)
Case 0 , 1 'DRUCKEN
Path = tmpPath 'wird für Therefore benötigt
Return cProgramFunctions . printRpt ( rpt , PrinterName , False )
Case 0 , 1 'DRUCKEN
If isMDMRechnungsdruck Then Return True 'MDM-Sammelrechnungen nicht mitgeben!
Path = tmpPath 'wird für Therefore benötigt
Return cProgramFunctions . printRpt ( rpt , PrinterName , False )
'Case 1 'FAX
Case 2 'MAIL
Case 2 'MAIL
'Dim tmpPath = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(RG_Bezeichnung, ".pdf", , False)
'Dim p As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
@@ -4218,53 +4216,53 @@ Public Class cFakturierung
Path = tmpPath
Try
Dim outl As New Outlook . Application
Dim Mail As Microsoft . Office . Interop . Outlook . MailItem
Mail = outl . CreateItem ( 0 )
' Mail.Subject = "Rechnung Nr. " & ROW("RechnungsNr")
' Mail.HTMLBody = "Sehr geehrte Damen und Herren,<br><br>anbei erhalten Sie die Rechnung Nr. " & ROW("RechnungsNr") & "."
Try
Dim outl As New Outlook . Application
Dim Mail As Microsoft . Office . Interop . Outlook . MailItem
Mail = outl . CreateItem ( 0 )
' Mail.Subject = "Rechnung Nr. " & ROW("RechnungsNr")
' Mail.HTMLBody = "Sehr geehrte Damen und Herren,<br><br>anbei erhalten Sie die Rechnung Nr. " & ROW("RechnungsNr") & "."
' Mail.Subject = " Rechnung Nr. " & ROW("RechnungsNr")
' Mail.Subject = VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & " Rechnung Nr. " & ROW("RechnungsNr")
Select Case ROW ( " RechnungsLandKz " )
Case " TR "
Mail . Subject = " Invoice NO. " & ROW ( " RechnungsNr " )
Mail . HTMLBody = " Sayin Bayanlar ve Baylar,<br><br>ekte baslikta yazan faturayi bulabilirsinz. "
Mail . HTMLBody &= " <br><br><br>Saygilarimizla<br><br> " & getSignature ( ROW ( " RechnungsLandKz " ) , ROW ( " Firma_ID " ) )
Case " A " , " AT " , " D " , " DE " , " CH "
Mail . Subject = " Rechnung Nr. " & ROW ( " RechnungsNr " )
Mail . HTMLBody = " Sehr geehrte Damen und Herren,<br><br>im Anhang senden wir Ihnen die o.g. Rechnung. "
Mail . HTMLBody &= " <br><br><br>Mit freundlichen Grüßen<br><br> " & getSignature ( ROW ( " RechnungsLandKz " ) , ROW ( " Firma_ID " ) )
Case Else
Mail . Subject = " Invoice No. " & ROW ( " RechnungsNr " )
Mail . HTMLBody = " Dear Sir or Madam,<br><br>attached we send you the invoice mentioned above. "
Mail . HTMLBody &= " <br><br><br>Best regards<br><br> " & getSignature ( ROW ( " RechnungsLandKz " ) , ROW ( " Firma_ID " ) )
End Select
Mail . Attachments . Add ( tmpPath , Microsoft . Office . Interop . Outlook . OlAttachmentType . olByValue , , " Formular.pdf " )
Mail . Display ( )
' Mail.Subject = " Rechnung Nr. " & ROW("RechnungsNr")
' Mail.Subject = VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA & " Rechnung Nr. " & ROW("RechnungsNr")
Select Case ROW ( " RechnungsLandKz " )
Case " TR "
Mail . Subject = " Invoice NO. " & ROW ( " RechnungsNr " )
Mail . HTMLBody = " Sayin Bayanlar ve Baylar,<br><br>ekte baslikta yazan faturayi bulabilirsinz. "
Mail . HTMLBody &= " <br><br><br>Saygilarimizla<br><br> " & getSignature ( ROW ( " RechnungsLandKz " ) , ROW ( " Firma_ID " ) )
Case " A " , " AT " , " D " , " DE " , " CH "
Mail . Subject = " Rechnung Nr. " & ROW ( " RechnungsNr " )
Mail . HTMLBody = " Sehr geehrte Damen und Herren,<br><br>im Anhang senden wir Ihnen die o.g. Rechnung. "
Mail . HTMLBody &= " <br><br><br>Mit freundlichen Grüßen<br><br> " & getSignature ( ROW ( " RechnungsLandKz " ) , ROW ( " Firma_ID " ) )
Case Else
Mail . Subject = " Invoice No. " & ROW ( " RechnungsNr " )
Mail . HTMLBody = " Dear Sir or Madam,<br><br>attached we send you the invoice mentioned above. "
Mail . HTMLBody &= " <br><br><br>Best regards<br><br> " & getSignature ( ROW ( " RechnungsLandKz " ) , ROW ( " Firma_ID " ) )
End Select
Mail . Attachments . Add ( tmpPath , Microsoft . Office . Interop . Outlook . OlAttachmentType . olByValue , , " Formular.pdf " )
Mail . Display ( )
Catch ex As Exception
MsgBox ( " Fehler bim Öffnen des Mail-Programmes. PDF wird geladen! " )
Process . Start ( tmpPath )
End Try
rpt . Dispose ( )
Return True
Case 3 'PDF + öffnen
'Dim tmpPath = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(RG_Bezeichnung, ".pdf", , False)
'Dim p As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
'rpt.Run(True)
'p.NeverEmbedFonts = ""
'p.Export(rpt.Document, tmpPath)
'rpt.Dispose()
Path = tmpPath
Catch ex As Exception
MsgBox ( " Fehler bim Öffnen des Mail-Programmes. PDF wird geladen! " )
Process . Start ( tmpPath )
rpt . Dispose ( )
Return True
Case 4 'PDF
End Try
rpt . Dispose ( )
Return True
Case 3 'PDF + öffnen
'Dim tmpPath = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(RG_Bezeichnung, ".pdf", , False)
'Dim p As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
'rpt.Run(True)
'p.NeverEmbedFonts = ""
'p.Export(rpt.Document, tmpPath)
'rpt.Dispose()
Path = tmpPath
Process . Start ( tmpPath )
rpt . Dispose ( )
Return True
Case 4 'PDF
'Dim tmpPath = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(RG_Bezeichnung, ".pdf", , False)
'Dim p As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
'rpt.Run(True)
@@ -4274,13 +4272,13 @@ Public Class cFakturierung
If isMDMRechnungsdruck Then Return True 'MDM-Sammelrechnungen nicht mitgeben!
Path = tmpPath
rpt . Dispose ( )
Return True
Path = tmpPath
rpt . Dispose ( )
Return True
End Select
End If
End Select
End If
@@ -4344,11 +4342,60 @@ Public Class cFakturierung
'If (Rechnungsdruck = 7 OrElse Rechnungsdruck = 4 AndAlso (Status = 2 Or Status = 4)) Then Return True
If ( Rechnungsdruck = 7 OrElse Rechnungsdruck = 4 AndAlso ( Status = 2 Or Status = 4 ) OrElse Rechnungsdruck = 3 AndAlso ( Status = 2 Or Status = 4 ) OrElse Rechnungsdruck = 2 AndAlso ( Status = 2 Or Status = 4 ) ) Then Return True
If ( Rechnungsdruck = 7 OrElse Rechnungsdruck = 8 OrElse Rechnungsdruck = 4 AndAlso ( Status = 2 Or Status = 4 ) OrElse Rechnungsdruck = 3 AndAlso ( Status = 2 Or Status = 4 ) OrElse Rechnungsdruck = 2 AndAlso ( Status = 2 Or Status = 4 ) ) Then Return True
Return False
End Function
Public Shared Function getRechnungsanshang ( dt As DataTable , listAnh As List ( Of String ) , extTyp As String )
Dim displayView = New DataView ( dt , " " , " RK_ID " , DataViewRowState . CurrentRows )
Dim distinctDT_RK As DataTable = displayView . ToTable ( True , " RK_ID " )
For Each r In distinctDT_RK . Rows
Dim RG As New VERAG_PROG_ALLGEMEIN . cRechnungsausgang ( r ( " RK_ID " ) )
If RG IsNot Nothing Then
RG . LOAD_ANHAENGE ( )
For Each RG_AH In RG . ANHAENGE . Where ( Function ( x ) x . Bezeichnung . ToLower . EndsWith ( extTyp ) )
Select Case extTyp
Case " pdf "
If RG_AH . Bezeichnung . ToUpper . Contains ( " MAUT " ) Or RG_AH . Bezeichnung . ToUpper . Contains ( " DIESEL " ) Or RG_AH . Bezeichnung . ToUpper . Contains ( " INVOICE " ) Then
Dim Path = VERAG_PROG_ALLGEMEIN . cDATENSERVER . GET_PDFPath_BY_DocID ( RG_AH . dsId )
If Not listAnh . Contains ( Path ) Then
If Not ( listAnh . Any ( Function ( f ) f . Contains ( " COPY_INVOICE " ) ) And Path . ToUpper . Contains ( " COPY_INVOICE " ) ) Then 'damit diesel IDS-Rechnung nicht doppelt hinzugefügt wird.
listAnh . Add ( Path )
End If
End If
End If
Case " csv "
If RG_AH . Bezeichnung . ToUpper . Contains ( " MAUT " ) Then
Dim Path = VERAG_PROG_ALLGEMEIN . cDATENSERVER . GET_PDFPath_BY_DocID ( RG_AH . dsId )
If Not listAnh . Contains ( Path ) Then
listAnh . Add ( Path )
End If
End If
End Select
Next
End If
Next
End Function
End Class