Hello Pierre,
On 27/01/2018 16:20, Pierre Smits wrote:
Hey Nicolas,

Is this a follow-up of the 'template-able' solution you proposed back in
2014/2015? If I remember correctly, your solution envisioned having
FTL-templates for invoice, order, shipment and other documents which could
be retrieved through the content component based on passed parameters.
Yes my solution is more generic that this previous idea, (because I grow ;) )

I  orientated my thinking about to two axes :
* Unique area to configure document template for an existing list easily
* support tenant and plugin system as well

So I oriented my solution on new entity related to PartyAcctgPreference and an other entity CustomScreen to list all configured screen on the system. As I work only with the screen, you can custom your template as you want without limitation that the content system can introduce. But you can create a content library for your template and like to your organization the screen rendering a content (we need to define standard rules for the content resolution)

I put on the issue https://issues.apache.org/jira/browse/OFBIZ-10186 a patch for analyze my POC, all don't work but the main structure is present.

I imagine tomorrow to introduce new template as plugin like :
* template-invoice-detail-shipping
* template-invoice-europeen-flower
* template-order-consolidate-lines
and this without framework modification :)

Nicolas


Best regards,

Pierre Smits

V.P. Apache Trafodion

On Tue, Jan 23, 2018 at 9:10 PM, Nicolas Malin <nicolas.ma...@nereide.fr>
wrote:

Hi all,

Currently, I work on a pdf invoice creation for a personal project and I
wish go for this time to improve the printable document configuration (like
order pdf, invoice pdf, shipment pdf, and soon) related to the
organizational party that at its origin.

To realize it I started a POC where a add a new entity
PartyAcctgPrefTplDoc (maybe you have a better name) that associate an
organizational party (PartyAcctgPreference), a documentType (invoiceType,
orderType...) and a content.
The content return the screen to use (as blog concept) and the standard
document screen return the given screen or call the default screen is empty.

With this improvement, you can create your own pdf template document in
your custom plugin with associate data and use it without any framework
modification.

More, if you have a specific case to rendering different document
following functional case, you can implement it on your screen.

Also, we can have a standard choice to rendering your document from a
content, manageable from PartyContent association.

The life isn't pretty ? (french expression, if you not understant, just
ignore it :)

Feel free if you have some remarks, I will create an issue for each
document type manageable by this concept to detail more this idea.

For example :
    Content data
  ---------------------

     <DataResource dataResourceId="MY_TPL_SALES_INV"
dataResourceTypeId="URL_RESOURCE" dataResourceName="My templage sales
invoice" mimeTypeId="application/pdf" objectInfo="component://myplug
in/widget/AccountingPrintScreens.xml#MyBeautyfullInvoicePDF"/>

     <Content contentId="MY_TPL_SALES_INV" contentTypeId="DOCUMENT"
dataResourceId="MY_TPL_SALES_INV" contentName="My Beautyfull template
sales invoice with flowers"/>

     <ContentPurposeType contentPusposeTypeId="INVOICE_TEMPLATE"
description="Content dedicate to rendering invoices"/>

     <PartyAcctgPrefTplDoc partyId="Company" invoiceTypeId="SALES_INVOICE"
contentId="MY_TPL_SALES_INV" fromDate="2000-01-01 00:00:00" />

  ----------------------

   Standard screen (application/accounting/widget
/AccountinPrintScreens.xml)
  -------------------------
    <screen name="InvoicePDF">...
      <actions><script location="component://accounti
ng/groovyScripts/invoice/GetInvoiceTemplateScreen.groovy"/></actions>
      <widgets>
           <include-screen name="${screenName}"
location="${screenLocation}"/>
      </widgets>
     </screen>

     <screen name="DefaultInvoicePDF">
         <section>.....
  ------------------------

GetInvoiceTemplateScreen.groovy return DefaultInvoicePDF screen if didn't
found any configuration for the invoice.partyIdFrom (for sales) or
invoice.partyId (for purchase)

Cheers,

Nicolas

--
logoNrd <https://nereide.fr/>
         Nicolas Malin
The apache way <http://theapacheway.com/> : *Charity* Apache’s mission is
providing software for the public good.
informat...@nereide.fr
8 rue des Déportés 37000 TOURS, 02 47 50 30 54

Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way <
http://theapacheway.com/>|réseau LE <http://www.libre-entreprise.org/>


Reply via email to