w3scout / w3s_li_crm

LiCRM
11 stars 6 forks source link

Problem with postal code #24

Closed lionel-m closed 12 years ago

lionel-m commented 12 years ago

I use a postal code with 4 numbers (Switzerland) but in my invoice, I have 5 numbers (Germany ?). So, there is a zero before. Is it possible to remove this zero ?

christian-kolb commented 12 years ago

This is the result of a workaround for a bug in contao. A postal will be filled with zeroes to a length of 5 characters. But there aren't any postals with 5 characters in switzerland, are there? Because then I will check whether it is a postal for germany and fill them to a length of 5 and the ones for switzerland to a length of 4.

lionel-m commented 12 years ago

Only 4 for Switzerland

http://de.wikipedia.org/wiki/Liste_der_Postleitsysteme

Thx

christian-kolb commented 12 years ago

Ok then I will enhance the workaround on the basis of the postal list

christian-kolb commented 12 years ago

After thinking a little more about the problem it occurred to me that there shouldn't be a workaround, but a solution for the contao bug.

I'll delete the workaround in the invoice generation. The once which have a postal with a leading zero aren't able to insert them in the contao backend any more because contao will transform the number (until the contao bug is fixed).

Instead you can insert the postal into the localconfig file directly.

$GLOBALS['TL_CONFIG']['li_crm_company_postal'] = 'Your postal';

I issued a ticket to the contao core: https://github.com/contao/core/issues/4035