[
https://issues.apache.org/jira/browse/OFBIZ-5441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13853735#comment-13853735
]
Jacques Le Roux commented on OFBIZ-5441:
----------------------------------------
The problem is more than we actually have to handle InvoiceItem.descriptions
like
description="Spend more than $100 on your favorite widgets and gizmos and get a
free <a
href="/ecommerce/control/product?category_id=20111&amp;product_id=WG-1111">Micro
Chrome Widget</a>!"
See for instane this one
<InvoiceItem amount="-59.990" createdStamp="2013-12-19 22:31:11.578"
createdTxStamp="2013-12-19 22:31:07.921" description="Spend more than $100 on
your favorite widgets and gizmos and get a free <a
href="/ecommerce/control/product?category_id=20111&amp;product_id=WG-1111">Micro
Chrome Widget</a>!" invoiceId="CI3" invoiceItemSeqId="00006"
invoiceItemTypeId="ITM_PROMOTION_ADJ" lastUpdatedStamp="2013-12-19
22:31:11.578" lastUpdatedTxStamp="2013-12-19 22:31:07.921"
parentInvoiceId="CI3" parentInvoiceItemSeqId="00005" productId="WG-1111"
quantity="1.000000"/>
So, to generate the url inside the generated PDF file, we need to parse the
InvoiceItem.description inside invoiceReportItems.fo.ftl.
Also in ProductionRun.fo.ftl (the only place where we currently have a
<fo:basic-link external-destination=...>) the external-destinationattribute is
wrongly completed. It misses the url('...') part in
external-destination=url('...'). And, as you mentionned, the generated url is
incomplete. I believe we will need a new transform for URLs in *fo.ftl files.
> URLs in some(all?) PDF files are not handled correctly
> ------------------------------------------------------
>
> Key: OFBIZ-5441
> URL: https://issues.apache.org/jira/browse/OFBIZ-5441
> Project: OFBiz
> Issue Type: Bug
> Components: accounting
> Affects Versions: SVN trunk
> Reporter: Jacques Le Roux
> Priority: Minor
>
> When a PDF file contains a reference to a promotion like when you buy a
> WG-5569 (Tiny Chrome Widget) and get a free WG-1111 (Micro Chrome Widget).
> You end with a corresponding invoice containing <<Spend more than $100 on
> your favorite widgets and gizmos and get a free <a
> href="/ecommerce/control/product?category_id=20111&product_id=WG-1111">Micro
> Chrome Widget</a>!>> instead of a real link.
> It's possible to generare a link in a PDF with FOP, we need to
> # dynamically define a fop.base using a ftl transform refs:
> http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elements
> http://xmlgraphics.apache.org/fop/faq.html#MalformedURL
> # here is an example from ProductionRun.fo.ftl
> {code}
> <fo:table-cell padding="2pt">
> <fo:block><fo:basic-link background-color="lightblue"
> external-destination="<@ofbizContentUrl>/content/control/ViewBinaryDataResource?dataResourceId=${productionRunContent.drDataResourceId}</@ofbizContentUrl>">${uiLabelMap.CommonView}</fo:basic-link></fo:block>
> </fo:table-cell>
> {code}
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)