Amount in Words
upasanisandip
Member Posts: 405
Hi ,
How can I print Amount in Words in Purchase Order report?
Thanks & Regards,
Sandip.
How can I print Amount in Words in Purchase Order report?
Thanks & Regards,
Sandip.
0
Answers
-
I had to do that too once. I did not find anything in Dutch so I ended up doing it myself.
But for English, here is a link to a VBA Macro for Excel:
http://www.ozgrid.com/VBA/ValueToWords.htm
Maybe you can adapt this to C/AL.0 -
Hello this is from US Check 1401. The following two function will create the amount into word
FormatNoText(VAR NoText : ARRAY [2] OF Text[80];No : Decimal;CurrencyCode : Code[10]) CLEAR(NoText); NoTextIndex := 1; NoText[1] := '****'; IF No < 1 THEN AddToNoText(NoText,NoTextIndex,PrintExponent,Text026) ELSE BEGIN FOR Exponent := 4 DOWNTO 1 DO BEGIN PrintExponent := FALSE; Ones := No DIV POWER(1000,Exponent - 1); Hundreds := Ones DIV 100; Tens := (Ones MOD 100) DIV 10; Ones := Ones MOD 10; IF Hundreds > 0 THEN BEGIN AddToNoText(NoText,NoTextIndex,PrintExponent,OnesText[Hundreds]); AddToNoText(NoText,NoTextIndex,PrintExponent,Text027); END; IF Tens >= 2 THEN BEGIN AddToNoText(NoText,NoTextIndex,PrintExponent,TensText[Tens]); IF Ones > 0 THEN AddToNoText(NoText,NoTextIndex,PrintExponent,OnesText[Ones]); END ELSE IF (Tens * 10 + Ones) > 0 THEN AddToNoText(NoText,NoTextIndex,PrintExponent,OnesText[Tens * 10 + Ones]); IF PrintExponent AND (Exponent > 1) THEN AddToNoText(NoText,NoTextIndex,PrintExponent,ExponentText[Exponent]); No := No - (Hundreds * 100 + Tens * 10 + Ones) * POWER(1000,Exponent - 1); END; END; AddToNoText(NoText,NoTextIndex,PrintExponent,Text028); AddToNoText(NoText,NoTextIndex,PrintExponent,FORMAT(No * 100) + '/100'); IF CurrencyCode <> '' THEN AddToNoText(NoText,NoTextIndex,PrintExponent,CurrencyCode) ELSE AddToNoText(NoText,NoTextIndex,PrintExponent,Text1020000); AddToNoText(VAR NoText : ARRAY [2] OF Text[80];VAR NoTextIndex : Integer;VAR PrintExponent : Boolean;AddText : Text[30]) PrintExponent := TRUE; WHILE STRLEN(NoText[NoTextIndex] + ' ' + AddText) > MAXSTRLEN(NoText[1]) DO BEGIN NoTextIndex := NoTextIndex + 1; IF NoTextIndex > ARRAYLEN(NoText) THEN ERROR(Text029,AddText); END; NoText[NoTextIndex] := DELCHR(NoText[NoTextIndex] + ' ' + AddText,'<');
Here is text constantsName ConstValue Text026 ZERO Text027 HUNDRED Text028 AND Name ConstValue Text032 ONE Text033 TWO Text034 THREE Text035 FOUR Text036 FIVE Text037 SIX Text038 SEVEN Text039 EIGHT Text040 NINE Text041 TEN Text042 ELEVEN Text043 TWELVE Text044 THIRTEEN Text045 FOURTEEN Text046 FIFTEEN Text047 SIXTEEN Text048 SEVENTEEN Text049 EIGHTEEN Text050 NINETEEN Text051 TWENTY Text052 THIRTY Text053 FORTY Text054 FIFTY Text055 SIXTY Text056 SEVENTY Text057 EIGHTY Text058 NINETY Text059 THOUSAND Text060 MILLION Text061 BILLION Name ConstValue Text1020000 DOLLARS
And here is how you use it.FormatNoText(DescriptionLine,CheckLedgEntry.Amount,BankAcc2."Currency Code");
0 -
This function is from W1 version. It's exclusive from US Version :-D0
-
right it's W1 version. if it's in all the version, then I guess I didn't have to put the code. :oops:0
-
In what respect is CheckLedgEntry.Amount ?
Is it a record or a text in c/al globals ?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 323 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
