MDM, fakt
This commit is contained in:
@@ -543,46 +543,46 @@ Public Class frmFaktEmail
|
||||
|
||||
|
||||
|
||||
Try
|
||||
Dim outl As New Outlook.Application
|
||||
Dim Mail As Microsoft.Office.Interop.Outlook.MailItem
|
||||
Mail = outl.CreateItem(0)
|
||||
Try
|
||||
Dim outl As New Outlook.Application
|
||||
Dim Mail As Microsoft.Office.Interop.Outlook.MailItem
|
||||
Mail = outl.CreateItem(0)
|
||||
|
||||
If Firma_ID = 24 Then
|
||||
Try
|
||||
Dim oAccount As Outlook.Account
|
||||
Dim accountToSent = SDL.cFakturierung.getDefaultMail("AMBAR",, True)
|
||||
If Firma_ID = 24 Then
|
||||
Try
|
||||
Dim oAccount As Outlook.Account
|
||||
Dim accountToSent = SDL.cFakturierung.getDefaultMail("AMBAR",, True)
|
||||
|
||||
|
||||
If outl.Session.Accounts.Count > 0 Then
|
||||
For Each oAccount In outl.Session.Accounts
|
||||
If oAccount.SmtpAddress = accountToSent Then
|
||||
Mail.SendUsingAccount = oAccount
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("Fehler beim Ermitteln des Mail-Accounts." & ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
If outl.Session.Accounts.Count > 0 Then
|
||||
For Each oAccount In outl.Session.Accounts
|
||||
If oAccount.SmtpAddress = accountToSent Then
|
||||
Mail.SendUsingAccount = oAccount
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("Fehler beim Ermitteln des Mail-Accounts." & ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
'Mail-Adressen eintragen
|
||||
'-----------------------------------------------------------------
|
||||
For Each r In dgvEmail.Rows
|
||||
If r.cells(0).value <> "" Then Mail.To &= r.cells(0).value & ";"
|
||||
Next
|
||||
For Each r In dgvEmailCC.Rows
|
||||
If r.cells(0).value <> "" Then Mail.CC &= r.cells(0).value & ";"
|
||||
Next
|
||||
For Each r In dgvEmailBCC.Rows
|
||||
If r.cells(0).value <> "" Then Mail.BCC &= r.cells(0).value & ";"
|
||||
Next
|
||||
'Mail-Adressen eintragen
|
||||
'-----------------------------------------------------------------
|
||||
For Each r In dgvEmail.Rows
|
||||
If r.cells(0).value <> "" Then Mail.To &= r.cells(0).value & ";"
|
||||
Next
|
||||
For Each r In dgvEmailCC.Rows
|
||||
If r.cells(0).value <> "" Then Mail.CC &= r.cells(0).value & ";"
|
||||
Next
|
||||
For Each r In dgvEmailBCC.Rows
|
||||
If r.cells(0).value <> "" Then Mail.BCC &= r.cells(0).value & ";"
|
||||
Next
|
||||
|
||||
'Rechnung erstellen:
|
||||
'-----------------------------------------------------------------
|
||||
Dim pathRG = ""
|
||||
'Rechnung erstellen:
|
||||
'-----------------------------------------------------------------
|
||||
Dim pathRG = ""
|
||||
|
||||
If Not cFakturierung.doRechnungsDruck(RECHNUNG, Rechnungsdatum,, 4, pathRG,, cbxOriginalPrint.Checked) Then
|
||||
Exit Sub
|
||||
@@ -595,65 +595,65 @@ Public Class frmFaktEmail
|
||||
|
||||
RechnungsNr = RECHNUNG.RechnungsNr
|
||||
|
||||
If cbxRgKopieDrucken.Checked Then
|
||||
'KOPIE DRUCK
|
||||
cFakturierung.doRechnungsDruck(RECHNUNG,,, 1, "", cboPrinter.Text, False)
|
||||
End If
|
||||
If cbxRgKopieDrucken.Checked Then
|
||||
'KOPIE DRUCK
|
||||
cFakturierung.doRechnungsDruck(RECHNUNG,,, 1, "", cboPrinter.Text, False)
|
||||
End If
|
||||
|
||||
If pathRG <> "" Then ATTACHMENTS.Add(New cFakt_MailATTach(pathRG, If(RECHNUNG.BelegartenKz = "AR", "Rechnung.pdf", "Gutschrift.pdf")))
|
||||
If pathRG <> "" Then ATTACHMENTS.Add(New cFakt_MailATTach(pathRG, If(RECHNUNG.BelegartenKz = "AR", "Rechnung.pdf", "Gutschrift.pdf")))
|
||||
|
||||
|
||||
RichTextBox.Text = RichTextBox.Text.Replace("%RgNr%", RechnungsNr)
|
||||
txtSubject.Text = txtSubject.Text.Replace("%RgNr%", RechnungsNr) & abfNr
|
||||
RichTextBox.Text = RichTextBox.Text.Replace("%RgNr%", RechnungsNr)
|
||||
txtSubject.Text = txtSubject.Text.Replace("%RgNr%", RechnungsNr) & abfNr
|
||||
|
||||
|
||||
Dim TextHTML = "<div style=""font-family:Calibri, Arial"">" & RichTextBox.Text.Replace(ControlChars.Lf, "<br>") & cFakturierung.getSignature(RECHNUNG.RechnungsLandKz, RECHNUNG.Firma_ID,,,, additionalLine,, IIf(Firma_ID = "24", True, False)) & "</div>"
|
||||
Dim TextHTML = "<div style=""font-family:Calibri, Arial"">" & RichTextBox.Text.Replace(ControlChars.Lf, "<br>") & cFakturierung.getSignature(RECHNUNG.RechnungsLandKz, RECHNUNG.Firma_ID,,,, additionalLine,, IIf(Firma_ID = "24", True, False)) & "</div>"
|
||||
|
||||
Mail.HTMLBody = TextHTML
|
||||
Mail.Subject = txtSubject.Text
|
||||
Mail.HTMLBody = TextHTML
|
||||
Mail.Subject = txtSubject.Text
|
||||
|
||||
' Mail.HTMLBody = Mail.HTMLBody.Replace("%RgNr%", RECHNUNG.RechnungsNr)
|
||||
' Mail.Subject = Mail.Subject.Replace("%RgNr%", RECHNUNG.RechnungsNr & abfNr)
|
||||
' Mail.HTMLBody = Mail.HTMLBody.Replace("%RgNr%", RECHNUNG.RechnungsNr)
|
||||
' Mail.Subject = Mail.Subject.Replace("%RgNr%", RECHNUNG.RechnungsNr & abfNr)
|
||||
|
||||
'-----------------------------------------------------------------
|
||||
'-----------------------------------------------------------------
|
||||
|
||||
'Steuerbescheid/VDB anfügen
|
||||
'-----------------------------------------------------------------
|
||||
getAnhaengeSingle()
|
||||
'-----------------------------------------------------------------
|
||||
'Steuerbescheid/VDB anfügen
|
||||
'-----------------------------------------------------------------
|
||||
getAnhaengeSingle()
|
||||
'-----------------------------------------------------------------
|
||||
|
||||
'Rechnungsanhänge anfügen
|
||||
'-----------------------------------------------------------------
|
||||
RECHNUNG.LOAD_ANHAENGE()
|
||||
For Each ANH In RECHNUNG.ANHAENGE
|
||||
ATTACHMENTS.Add(New cFakt_MailATTach(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(ANH.dsId), ANH.Bezeichnung))
|
||||
Next
|
||||
'-----------------------------------------------------------------
|
||||
'Rechnungsanhänge anfügen
|
||||
'-----------------------------------------------------------------
|
||||
RECHNUNG.LOAD_ANHAENGE()
|
||||
For Each ANH In RECHNUNG.ANHAENGE
|
||||
ATTACHMENTS.Add(New cFakt_MailATTach(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(ANH.dsId), ANH.Bezeichnung))
|
||||
Next
|
||||
'-----------------------------------------------------------------
|
||||
|
||||
'Anhang an Mail anfügen
|
||||
'-----------------------------------------------------------------
|
||||
addAttachments(Mail, RECHNUNG.RechnungsNr, cbxMergePDF.Checked)
|
||||
'-----------------------------------------------------------------
|
||||
'Anhang an Mail anfügen
|
||||
'-----------------------------------------------------------------
|
||||
addAttachments(Mail, RECHNUNG.RechnungsNr, cbxMergePDF.Checked)
|
||||
'-----------------------------------------------------------------
|
||||
|
||||
|
||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA = "AMBAR" Then
|
||||
Try
|
||||
Mail.SentOnBehalfOfName = "buchhaltung@ambarlog.de"
|
||||
Catch ex2 As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex2.Message, ex2.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
End If
|
||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA = "AMBAR" Then
|
||||
Try
|
||||
Mail.SentOnBehalfOfName = "buchhaltung@ambarlog.de"
|
||||
Catch ex2 As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex2.Message, ex2.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
End If
|
||||
|
||||
|
||||
Mail.Display()
|
||||
Mail.Display()
|
||||
|
||||
'------------------------------------------------------------------------------------------
|
||||
' STB /FA
|
||||
send_StbFAMail(RECHNUNG.RechnungsKundenNr, " Rg-Nr.: " & RechnungsNr & abfNr, RECHNUNG.RechnungsNr)
|
||||
'------------------------------------------------------------------------------------------
|
||||
'------------------------------------------------------------------------------------------
|
||||
' STB /FA
|
||||
send_StbFAMail(RECHNUNG.RechnungsKundenNr, " Rg-Nr.: " & RechnungsNr & abfNr, RECHNUNG.RechnungsNr)
|
||||
'------------------------------------------------------------------------------------------
|
||||
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("Fehler beim Öffnen des Mail-Programmes." & ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR("Fehler beim Öffnen des Mail-Programmes." & ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
'Process.Start(a)
|
||||
End Try
|
||||
|
||||
|
||||
Reference in New Issue
Block a user