Fakt, ustva, frmMitarbeiter
This commit is contained in:
@@ -6,6 +6,7 @@ Imports VERAG_PROG_ALLGEMEIN
|
||||
Imports s2industries.ZUGFeRD
|
||||
Imports System.IO
|
||||
Imports GrapeCity.ActiveReports.Core.Rendering.Tools
|
||||
Imports System.Windows.Converters
|
||||
|
||||
Public Class cFakturierung
|
||||
|
||||
@@ -1798,7 +1799,7 @@ Public Class cFakturierung
|
||||
|
||||
End If
|
||||
'-----------------------------
|
||||
|
||||
desc.ActualDeliveryDate = (RECHNUNG.Abfertigungsdatum)
|
||||
|
||||
Dim steuerProzent As Double = SQL.DLookup(" isnull([Steuersatz %],0)", "[Steuertabelle] ", "[Steuerschlüssel]='" & checkNull(RECHNUNG.Steuerschlüssel) & "'", "FMZOLL", 0)
|
||||
Dim steuerProzenFaktor As Double = 0
|
||||
@@ -1859,73 +1860,78 @@ Public Class cFakturierung
|
||||
'End If
|
||||
|
||||
Dim isReverseCharge = isReverseChargeSumme(FIRMA, RECHNUNG)
|
||||
If isReverseCharge Then
|
||||
Select Case RECHNUNG.RechnungSprache
|
||||
Case "EN" : desc.AddNote("The VAT liability is transferred to the recipient of the service (reverse charge system).", SubjectCodes.AAI)
|
||||
Case Else : desc.AddNote("Die Umsatzsteuerschuld geht auf den Leistungsempfänger über (Reverse Charge Verfahren).", SubjectCodes.AAI)
|
||||
End Select
|
||||
End If
|
||||
|
||||
|
||||
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")
|
||||
Else
|
||||
If hasVK(RECHNUNG) Then
|
||||
desc.AddCreditorFinancialAccount("AT35 4480 0365 7822 0002", "VBOEATWWOOE",,, "Volksbank Oberösterreich AG")
|
||||
Case 20 '"IMEX"
|
||||
If RECHNUNG.RechnungsLandKz = "TR" Then
|
||||
desc.AddCreditorFinancialAccount("TR84 0006 2001 6040 0009 0987 13", "",,, "Garanti Bank")
|
||||
Else
|
||||
If hasEUSTZOLL(RECHNUNG.RechnungsNr) Then
|
||||
desc.AddCreditorFinancialAccount("AT62 4480 0365 7822 0001", "VBOEATWWOOE", )
|
||||
If hasVK(RECHNUNG) Then
|
||||
desc.AddCreditorFinancialAccount("AT35 4480 0365 7822 0002", "VBOEATWWOOE",,, "Volksbank Oberösterreich AG")
|
||||
Else
|
||||
desc.AddCreditorFinancialAccount("TR84 0006 2001 6040 0009 0987 13", "VBOEATWWOOE", ,, "Volksbank Oberösterreich AG")
|
||||
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
|
||||
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"))
|
||||
@@ -1994,14 +2000,18 @@ Public Class cFakturierung
|
||||
'End If
|
||||
If rpt IsNot Nothing Then
|
||||
If rpt.txtVermerk.Text IsNot Nothing AndAlso rpt.txtVermerk.Text <> "" Then desc.AddNote(rpt.txtVermerk.Text.ToString, SubjectCodes.AAI)
|
||||
If rpt.txtInfo.Text IsNot Nothing AndAlso rpt.txtInfo.Text <> "" Then desc.AddNote(rpt.txtInfo.Text.ToString, SubjectCodes.AAI)
|
||||
ElseIf rptAnl IsNot Nothing Then
|
||||
If rptAnl.txtInfo.Text IsNot Nothing AndAlso rptAnl.txtInfo.Text <> "" Then desc.AddNote(rptAnl.txtInfo.Text.ToString, SubjectCodes.AAI)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
desc.AddNote("Es bestehen Rabatt- und Bonusvereinbarungen.", SubjectCodes.AAK)
|
||||
|
||||
If ROW("Abfertigungsdatum") IsNot DBNull.Value AndAlso ROW("Abfertigungsdatum") <> "" Then
|
||||
desc.ActualDeliveryDate = (CDate(ROW("Abfertigungsdatum")))
|
||||
End If
|
||||
|
||||
|
||||
desc.SetBuyer(ROW("RechnungsName 1") & " " & Rechnugnsname2, RechnungsOrt, RechnungsOrt, RechnungsStraße, GetCountryCodeFromLandKZ(RechnungsLandKz, vatBuyer), IIf(Not IsDBNull(ROW("RechnungsKundenNr")), ROW("RechnungsKundenNr"), ""))
|
||||
desc.SetSeller(FIRMA.Firma_Bez, FIRMA.Firma_Ort, FIRMA.Firma_Ort, FIRMA.Firma_Straße, GetCountryCodeFromLandKZ(FIRMA.Firma_LandKz, vatSeller))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user