Generates a pdf file report.
'A business rule responsable for sent invoice by e-mail
If itemVO.isSigned and not IsVoid(itemVO.ClVO.email) then
Dim baseReportStamp As String = "z202102180826521220071603" 'PHC GO Documentos Faturação
Dim result As PHCResult = SDK.Report.GenerateReport("Ft", baseReportStamp, itemVO.ftstamp, itemVO.ndoc)
If Not result.HasErrors() Then
Dim filename As String = result.result.Cast(Of StringVO).FirstOrDefault.phcString
Dim emailAttachments As New List(Of FileAttachment)
emailAttachments.Add(sdk.FileUtil.getFile(filename))
Dim emailSubject = itemVO.nmdoc + " nº " + itemVO.uniqueid
Dim emailbody = "Dear customer, please see attached invoice number " + itemVO.uniqueid + ". Don’t hesitate to reach out if you have any questions."
If sdk.email.send("from@phcsoftware.com", itemVO.ClVO.email, emailSubject, emailbody, True, emailAttachments)
listMsg.Add(New MsgInfo("The invoice has been sent by e-mail to customer"))
End If
End If
End If