I need to create invoice as XML file in UBL 2.1 format. Mandatory field is attached PDF invoice. Can you help me how to embed PDF invoice in XML (VFP 6)?
Thanks in advance.
,,,
lcImePdfSaExt="TrtMrtFakktura.PDF"
lcBase64bin = DajBase64bin(lcImePdfSaExt)
...
I created one Ubl Template file and that is my basis for the upgrade.
See the attached picture
<cac:AdditionalDocumentReference>
<cbc:ID><<lcImePdfbezExt>></cbc:ID>
<cac:Attachment>
<cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf" filename="<<lcImePdfSaExt>>"><<lcBase64bin>> </cbc:EmbeddedDocumentBinaryObject>
</cac:Attachment>
</cac:AdditionalDocumentReference>
...
FUNCTION DajBase64bin
LPARAMETERS tcImePdfSaExt
LOCAL sb2binbase64, lcstr
lcstr=FILETOSTR(tcImePdfSaExt)
sb2binbase64=STRCONV(lcstr,13) && konvertuje u base64 binary
_cliptext=sb2binbase64 && base64 bin. stavio u _cliptext
RETURN _cliptext