//TTC_KH_12012021_US and IN version
report 50004 "Check Customize"
{
Caption = 'Check Customize';
ProcessingOnly = true;
dataset
{
dataitem(Integer; Integer)
{
column(Number; Number)
{
}
}
}
var
Text024: Label 'XXXX.XX';
Text025: Label 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
Text026: Label 'ZERO';
Text027: Label 'HUNDRED';
Text028: Label 'AND';
Text029: Label '%1 results in a written number that is too long.';
Text030: Label ' is already applied to %1 %2 for customer %3.';
Text031: Label ' is already applied to %1 %2 for vendor %3.';
Text032: Label 'ONE';
Text033: Label 'TWO';
Text034: Label 'THREE';
Text035: Label 'FOUR';
Text036: Label 'FIVE';
Text037: Label 'SIX';
Text038: Label 'SEVEN';
Text039: Label 'EIGHT';
Text040: Label 'NINE';
Text041: Label 'TEN';
Text042: Label 'ELEVEN';
Text043: Label 'TWELVE';
Text044: Label 'THIRTEEN';
Text045: Label 'FOURTEEN';
Text046: Label 'FIFTEEN';
Text047: Label 'SIXTEEN';
Text048: Label 'SEVENTEEN';
Text049: Label 'EIGHTEEN';
Text050: Label 'NINETEEN';
Text051: Label 'TWENTY';
Text052: Label 'THIRTY';
Text053: Label 'FORTY';
Text054: Label 'FIFTY';
Text055: Label 'SIXTY';
Text056: Label 'SEVENTY';
Text057: Label 'EIGHTY';
Text058: Label 'NINETY';
Text059: Label 'THOUSAND';
Text060: Label 'MILLION';
Text061: Label 'BILLION';
Text1280000: Label 'LAKH';
Text1280001: Label 'CRORE';
OnesText: array[20] of Text[50];
TensText: array[10] of Text[50];
ExponentText: array[5] of Text[50];
//TTC_KH_AmountInWords_USversion_START
procedure InitTextVariable_USversion()
begin
OnesText[1] := Text032;
OnesText[2] := Text033;
OnesText[3] := Text034;
OnesText[4] := Text035;
OnesText[5] := Text036;
OnesText[6] := Text037;
OnesText[7] := Text038;
OnesText[8] := Text039;
OnesText[9] := Text040;
OnesText[10] := Text041;
OnesText[11] := Text042;
OnesText[12] := Text043;
OnesText[13] := Text044;
OnesText[14] := Text045;
OnesText[15] := Text046;
OnesText[16] := Text047;
OnesText[17] := Text048;
OnesText[18] := Text049;
OnesText[19] := Text050;
TensText[1] := '';
TensText[2] := Text051;
TensText[3] := Text052;
TensText[4] := Text053;
TensText[5] := Text054;
TensText[6] := Text055;
TensText[7] := Text056;
TensText[8] := Text057;
TensText[9] := Text058;
ExponentText[1] := '';
ExponentText[2] := Text059;
ExponentText[3] := Text060;
ExponentText[4] := Text061;
end;
procedure FormatNoText_USversion(var NoText: array[2] of text; No: Decimal;
CurrencyCode: Code[10])
var
PrintExponent: Boolean;
Ones: Integer;
Tens: Integer;
Hundreds: Integer;
Exponent: Integer;
NoTextIndex: Integer;
DecimalPosition: Decimal;
begin
CLEAR(NoText);
NoTextIndex := 1;
//TTC_KH
//NoText[1] := '****';
NoText[1] := '';
// GLSetup.GET;
IF No < 1 THEN
AddToNoText_USversion(NoText, NoTextIndex, PrintExponent, Text026)
ELSE
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_USversion(NoText, NoTextIndex, PrintExponent,
OnesText[Hundreds]);
AddToNoText_USversion(NoText, NoTextIndex, PrintExponent, Text027);
END;
IF Tens >= 2 THEN BEGIN
AddToNoText_USversion(NoText, NoTextIndex, PrintExponent,
TensText[Tens]);
IF Ones > 0 THEN
AddToNoText_USversion(NoText, NoTextIndex, PrintExponent,
OnesText[Ones]);
END ELSE
IF (Tens * 10 + Ones) > 0 THEN
AddToNoText_USversion(NoText, NoTextIndex, PrintExponent,
OnesText[Tens * 10 + Ones]);
IF PrintExponent AND (Exponent > 1) THEN
AddToNoText_USversion(NoText, NoTextIndex, PrintExponent,
ExponentText[Exponent]);
No := No - (Hundreds * 100 + Tens * 10 + Ones) *
POWER(1000, Exponent - 1);
END;
AddToNoText_USversion(NoText, NoTextIndex, PrintExponent, Text028);
DecimalPosition := GetAmtDecimalPosition_USversion;
//TTC_KH
//AddToNoText(NoText,NoTextIndex,PrintExponent,(FORMAT(No * DecimalPosition)
+ '/' + FORMAT(DecimalPosition)));
//AddToNoText_USversion(NoText, NoTextIndex, PrintExponent, 'CENTS '); //TTC_KH
IF No * DecimalPosition = 0 THEN
AddToNoText_USversion(NoText, NoTextIndex, PrintExponent, 'ZERO')
ELSE BEGIN
Ones := No * DecimalPosition;
Tens := (Ones MOD 100) DIV 10;
Ones := Ones MOD 10;
IF Tens >= 2 THEN BEGIN
AddToNoText_USversion(NoText, NoTextIndex, PrintExponent,
TensText[Tens]);
IF Ones > 0 THEN
AddToNoText_USversion(NoText, NoTextIndex,
PrintExponent, OnesText[Ones]);
END ELSE
IF (Tens * 10 + Ones) > 0 THEN
AddToNoText_USversion(NoText, NoTextIndex, PrintExponent,
OnesText[Tens * 10 + Ones]);
END;
// TTC_KH End
//TTC_KH_START
IF (CurrencyCode = 'MVR') THEN
AddToNoText_USversion(NoText, NoTextIndex, PrintExponent, 'LAARI ONLY')
ELSE
AddToNoText_USversion(NoText, NoTextIndex, PrintExponent, 'CENTS ONLY');
//TTC_KH_EMd
// IF CurrencyCode <> '' THEN
// AddToNoText_USversion(NoText, NoTextIndex, PrintExponent, CurrencyCode);
end;
local procedure AddToNoText_USversion(var NoText: array[2] of Text;
var NoTextIndex: Integer; var PrintExponent: Boolean; AddText: Text[30])
begin
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, '<');
end;
local procedure GetAmtDecimalPosition_USversion(): Decimal
var
Currency: Record Currency;
GenJnlLine: Record "Gen. Journal Line";
begin
IF GenJnlLine."Currency Code" = '' THEN
Currency.InitRoundingPrecision
ELSE BEGIN
Currency.GET(GenJnlLine."Currency Code");
Currency.TESTFIELD("Amount Rounding Precision");
END;
EXIT(1 / Currency."Amount Rounding Precision");
end;
//TTC_KH_AmountInWords_USversion_END
//TTC_KH_AmountInWords_INversion_START
procedure InitTextVariable_INversion()
begin
OnesText[1] := Text032;
OnesText[2] := Text033;
OnesText[3] := Text034;
OnesText[4] := Text035;
OnesText[5] := Text036;
OnesText[6] := Text037;
OnesText[7] := Text038;
OnesText[8] := Text039;
OnesText[9] := Text040;
OnesText[10] := Text041;
OnesText[11] := Text042;
OnesText[12] := Text043;
OnesText[13] := Text044;
OnesText[14] := Text045;
OnesText[15] := Text046;
OnesText[16] := Text047;
OnesText[17] := Text048;
OnesText[18] := Text049;
OnesText[19] := Text050;
TensText[1] := '';
TensText[2] := Text051;
TensText[3] := Text052;
TensText[4] := Text053;
TensText[5] := Text054;
TensText[6] := Text055;
TensText[7] := Text056;
TensText[8] := Text057;
TensText[9] := Text058;
ExponentText[1] := '';
ExponentText[2] := Text059;
ExponentText[3] := Text1280000;
ExponentText[4] := Text1280001;
end;
procedure FormatNoText_INversion(var NoText: array[2] of Text; No: Decimal;
CurrencyCode: Code[10])
var
PrintExponent: Boolean;
Ones: Integer;
Tens: Integer;
Hundreds: Integer;
Exponent: Integer;
NoTextIndex: Integer;
Currency: Record Currency;
TensDec: Integer;
OnesDec: Integer;
begin
CLEAR(NoText);
NoTextIndex := 1;
NoText[1] := '****';
IF No < 1 THEN
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent, Text026)
ELSE
FOR Exponent := 4 DOWNTO 1 DO BEGIN
PrintExponent := FALSE;
IF No > 99999 THEN BEGIN
Ones := No DIV (POWER(100, Exponent - 1) * 10);
Hundreds := 0;
END ELSE BEGIN
Ones := No DIV POWER(1000, Exponent - 1);
Hundreds := Ones DIV 100;
END;
Tens := (Ones MOD 100) DIV 10;
Ones := Ones MOD 10;
IF Hundreds > 0 THEN BEGIN
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent,
OnesText[Hundreds]);
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent, Text027);
END;
IF Tens >= 2 THEN BEGIN
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent,
TensText[Tens]);
IF Ones > 0 THEN
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent,
OnesText[Ones]);
END ELSE
IF (Tens * 10 + Ones) > 0 THEN
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent,
OnesText[Tens * 10 + Ones]);
IF PrintExponent AND (Exponent > 1) THEN
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent,
ExponentText[Exponent]);
IF No > 99999 THEN
No := No - (Hundreds * 100 + Tens * 10 + Ones) *
POWER(100, Exponent - 1) * 10
ELSE
No := No - (Hundreds * 100 + Tens * 10 + Ones) *
POWER(1000, Exponent - 1);
END;
IF CurrencyCode <> '' THEN BEGIN
Currency.GET(CurrencyCode);
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent, Currency.Code);
END ELSE
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent, '');
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent, Text028);
// AddToNoText(NoText,NoTextIndex,PrintExponent,FORMAT(No * 100) + '/100');
TensDec := ((No * 100) MOD 100) DIV 10;
OnesDec := (No * 100) MOD 10;
IF TensDec >= 2 THEN BEGIN
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent, TensText[TensDec]);
IF OnesDec > 0 THEN
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent, OnesText[OnesDec]);
END ELSE
IF (TensDec * 10 + OnesDec) > 0 THEN
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent,
OnesText[TensDec * 10 + OnesDec])
ELSE
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent, Text026);
IF (CurrencyCode = 'MVR') THEN
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent, 'LAARI ONLY')
ELSE
AddToNoText_INversion(NoText, NoTextIndex, PrintExponent, 'CENTS ONLY')
end;
local procedure AddToNoText_INversion(var NoText: array[2] of Text[80];
var NoTextIndex: Integer; var PrintExponent: Boolean; AddText: Text[30])
begin
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, '<');
end;
//TTC_KH_AmountInWords_INversion_END
}
Comments
Post a Comment