CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Mailing Labels - OCR requirements
Pages: [1]

Author Topic: Mailing Labels - OCR requirements  (Read 1736 times)

Shefftini

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 3.2
  • CMS version: Drupal 6.x
  • MySQL version: 5.1.5
  • PHP version: 5.2.14
Mailing Labels - OCR requirements
February 16, 2011, 11:40:26 am
We serve an international membership and part of that is the publication of a magazine.  We've run into an issue with the mailing label formatting that CiviCRM provides.

For OCR compatibility a major requirement these days is that the "Country" be all uppercase, and in most cases the line that the postal code is on also be all uppercase.  Some nations now request that all lines be that way (United States Postal Service for one!).  We rely upon the Universal Postal Union for our guidance.. www. upu. int.

Alas out of the box CiviCRM currently uses upper and lowercase.  May we suggest for starters that the Country and State/province tables be made all uppercase. 

We've "fixed" it on our install by running via phpMyAdmin

UPDATE `civicrm_country` SET name = UPPER ( name )
and
UPDATE `civicrm_state_province` SET name = UPPER ( name )
respectively.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Mailing Labels - OCR requirements
February 16, 2011, 03:26:26 pm

1. am surprised this has not come up in the past

2. can u give a more specific link at upu.int and usps.gov which states this requirement?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Mailing Labels - OCR requirements
February 17, 2011, 01:34:11 am
Hi,

Would suggest not to fix the data in the DB (most of the time you'd want the lower case, eg on screen as it's more readable and take less space.

What I'd suggest doing it to fix the PHP code that generates the mailing labels to uppercase the name of whatever you need.

Something that would be even more versatile is to improve the token syntax so you can add an extra param, eg: {contact.country|uppercase}

FIY here in Europe, most of the letters & magazines I receive are with the country not all uppercase.

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Mailing Labels - OCR requirements
July 22, 2012, 04:26:25 pm
smarty params are

|upper
|lower
|capitalize

The code in question doesn't use the standard functions for swapping out tokens & it looks like a fairly big change to work through that - but I could fairly easily make

{contact.city|upper} work on address labels (ditto the other 2).

I think the mailing label code might be older than the other token code. At least this change would follow the smarty convention which would seem to provide some comfort that it is a good way to go (even if it's written directly into CRM_Utils_Address::format rather than going through the main token handling class)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Mailing Labels - OCR requirements
July 22, 2012, 05:21:12 pm
Have created a ticket re the above with a patch

http://issues.civicrm.org/jira/browse/CRM-10571
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Mailing Labels - OCR requirements

This forum was archived on 2017-11-26.