Three Digit Invoice Balance in Mailing Template

Support for our integrated Contact Manager, Calendar, and Project Tracker.
Posts: 36
Joined: Sun May 11, 2008 9:56 am
Location: Bahrain
PostPosted: Sat Jun 21, 2008 1:39 am
Hi John,

How do I change the number format for the invoice balance to revert to three digits and a different currency sign than Dollar in a new template in mailing.
Salman Maidan
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Sat Jun 21, 2008 8:26 am
For the currency symbol, edit the field "z_MMemberMessageMergedCalc" in the Mailing Members table. The auto enter calc here is where all the actual merging happens.

You'll see that whenever we use a currency field like "<<Contact Balance>>" or "<<Invoice Amount>>" we employ a custom function to format the number. The currency symbol is sent to this custom function as a parameter, so just replace "$" with whatever you need. Be sure to do this for each instance of the SeedCode_AddDollarFormat function used in that calc.

When it comes to "reverting to 3 digits" I'm not completely sure what you mean. If you want the numbers in the mailing to have 3 digits to the right of the decimal, instead of 2, edit the custom function "SeedCode_AddDollarFormat", replacing the meat of the function with this version:

Code: Select all
Let ( [
Amount = Round ( NumberField ; 3 ) ;
A = Int ( Amount ) + 0 ;
L = Length ( A ) ;
R = If ( Amount ≠ A ; Left ( amount - A & "000" ; 4 ) ; ".000" )
] ;
CurrencySymbol & Case (
L=9 ; Left(A;3) &","& Middle(A;4;3) &","& Right(A;3) ;
L=8 ; Left(A;2) &","& Middle(A;3;3) &","& Right(A;3) ;
L=7 ; Left(A;1) &","& Middle(A;2;3) &","& Right(A;3) ;
L=6 ; Left(A;3) &","& Right(A;3) ;
L=5 ; Left(A;2) &","& Right(A;3) ;
L=4 ; Left(A;1) &","& Right(A;3) ;
A
) //end Case
& R
) //end Let


Let me know if I've misunderstood you.
John Sindelar
SeedCode
Posts: 36
Joined: Sun May 11, 2008 9:56 am
Location: Bahrain
PostPosted: Sat Jun 21, 2008 9:11 am
Thanks, That worked on the digits to right of the decimal. There are 3 digits now.

I need to change the Currency to read "BD" instead of $, and the date to DD/MMM/YYYY. Thanks.
Salman Maidan
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Sat Jun 21, 2008 11:24 am
maidanss wrote:Thanks, That worked on the digits to right of the decimal. There are 3 digits now.

I need to change the Currency to read "BD" instead of $, and the date to DD/MMM/YYYY. Thanks.


Glad it worked.

Instructions for changing the "$" symbol can be found in the post above.

For dates you'll have to edit the auto enter calc field "z_MMemberMessageMergedCalc" in the Mailing Members table, taking apart the date fields to get the format you want. You can use something like this, taking the invoice date as an example:

Code: Select all
[ "<<Invoice Date>>" ; Let ( n =  MailingMemberInvoice::InvDate ; Day ( n ) & "/" & Month ( n ) & "/" & Year ( n ) ) ] ;
John Sindelar
SeedCode
Posts: 36
Joined: Sun May 11, 2008 9:56 am
Location: Bahrain
PostPosted: Sat Jun 21, 2008 12:07 pm
Thanks,

It all worked like a charm. :P
Salman Maidan

Return to SeedCode Calendar

Who is online

Users browsing this forum: No registered users and 3 guests

(855) SEEDCODE
[email protected]
Follow us: