void BillingEngine_EinvNodeAdding(object sender, MercatorUi.Engine.Gescom.BillingEngine.EinvNodeAddingEventArgs e)
{
    MercatorUi.Engine.Gescom.BillingEngine billingEngine = (MercatorUi.Engine.Gescom.BillingEngine)sender;
    if (e.Node.Name == "cac:AccountingSupplierParty")
    {
        string dirSqlFiles = "<" + Api.SqlFilePathRoots.Files.ToString() + "\\" + billingEngine.Journal + "\\" + billingEngine.Id;
        foreach (string file in Api.GetFiles(dirSqlFiles, "*.pdf"))
        {
            XmlNode n1 = billingEngine.EinvAddNode(e.eInvoiceEnum, e.ParentNode, "cac:AdditionalDocumentReference");
            billingEngine.EinvAddNode(e.eInvoiceEnum, n1, "cbc:ID", Api.JustFName(file));
            billingEngine.EinvAddNode(e.eInvoiceEnum, n1, "cbc:DocumentType", "Appendix");
            XmlNode n2 = billingEngine.EinvAddNode(e.eInvoiceEnum, n1, "cac:Attachment");
            billingEngine.EinvAddNode(e.eInvoiceEnum, n2, "cbc:EmbeddedDocumentBinaryObject", Convert.ToBase64String(Api.SqlFileToBytes(file)), new MercatorUi.Engine.Gescom.Tools.EinvNodeAttribute("mimeCode", "application/pdf"));
        }
    }
}