[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Address formatting functionality





On Mon, May 7, 2012 at 5:53 AM, Chris Travers <..hidden..> wrote:
On Sun, May 6, 2012 at 8:30 PM, John Locke <..hidden..> wrote:
> Drupal 7 has been addressing :-P these issues with an "addressfield" module
> ( http://drupal.org/project/addressfield ), which aims to incorporate the
> flexibility of xNAL - http://xml.coverpages.org/xnal.html .

Interesting idea.  I am all for incorporating work of others into
LedgerSMB.  However, I am not sure how this would be done since I
doubt our invoices, check printing, etc. will ever move off TT/LaTeX.
it seems to me we'd have to find out what they are doing regarding
address formats and convert these into TT snippets to be used.

Chris and I evaluated xNAL this afternoon and while it seems to be a very good tool to help design a schema for storing names and addresses, it doesn't seem to concern itself with actual representation of address data.

Some of the links enumerated by Havard elsethread do do that. Going over the examples provided by BitBoost.com, we've come up with the following solution:

We think about creating a default address template and adding the option to add a template per country.

When producing an address, the template (either the default or the country specific one) would be processed by template toolkit to fill out name, street, etc. Then the result will be post-processed to remove any white-space-only lines from the output.

The end result being an opaque array of lines to be printed on an envelope, invoice or other document -- without the need to build the same intelligence into every template.

Would this be a suitable solution to most situations you can imagine using LedgerSMB?


Bye,

Erik.