Calculation
1 post • Page 1 of 1
Calculation
Hi, Im having a difficulty to sum up the total amount with different currency. I would appreciate for any advise. Here with my example:
eg. if currency = EUR then
a = EUR100 * 2.02
else if currency = RM then
b = RM100 * 0.42
else if currency = SGD
c = SGD 100 * 1
and i want to sum up all the converted amount a+b+c.
I wrote the codes as below, but it only returned 1 converted amount if the first currency type was found.
CurrencyVar Total;
CurrencyVar AUD;
CurrencyVar EUR;
CurrencyVar GBP;
CurrencyVar RM;
CurrencyVar SGD;
CurrencyVar THB;
CurrencyVar USD;
if {GLDebit.OriginCurr} = "AUD" then
(AUD := {tbl_ValueInfo.AUG}* Sum ({@SalesValueAUD}, {tbl_Posting.ID});
Total := Total + AUD)
else if {GLDebit.OriginCurr} = "EUR" then
(EUR := {tbl_ValueInfo.EUR}* Sum ({@SalesValueEUR}, {tbl_Posting.ID});
Total := Total + EUR)
else if {GLDebit.OriginCurr} = "GBP" then
(GBP := {tbl_ValueInfo.GBP}* Sum ({@SalesValueGBP}, {tbl_Posting.ID});
Total := Total + GBP)
else if {GLDebit.OriginCurr} = "SGD" then
(RM := {tbl_ValueInfo.SGD}* Sum ({@SalesValueSGD}, {tbl_Posting.ID});
Total := Total + SGD)
else if {GLDebit.OriginCurr} = "USD" then
(SGD := {tbl_ValueInfo.USD}* Sum ({@SalesValueUSD}, {tbl_Posting.ID});
Total := Total + USD)
else if {GLDebit.OriginCurr} = "RM" then
(RM := {tbl_ValueInfo.RM}* Sum ({@SalesValueRM}, {tbl_Posting.ID});
Total := Total + RM)
else if {GLDebit.OriginCurr} = "THB" then
(THB := {tbl_ValueInfo.THB}*Sum ({@SalesValueTHB}, {tbl_Posting.ID});
Total := Total + THB)
Anatasia
eg. if currency = EUR then
a = EUR100 * 2.02
else if currency = RM then
b = RM100 * 0.42
else if currency = SGD
c = SGD 100 * 1
and i want to sum up all the converted amount a+b+c.
I wrote the codes as below, but it only returned 1 converted amount if the first currency type was found.
CurrencyVar Total;
CurrencyVar AUD;
CurrencyVar EUR;
CurrencyVar GBP;
CurrencyVar RM;
CurrencyVar SGD;
CurrencyVar THB;
CurrencyVar USD;
if {GLDebit.OriginCurr} = "AUD" then
(AUD := {tbl_ValueInfo.AUG}* Sum ({@SalesValueAUD}, {tbl_Posting.ID});
Total := Total + AUD)
else if {GLDebit.OriginCurr} = "EUR" then
(EUR := {tbl_ValueInfo.EUR}* Sum ({@SalesValueEUR}, {tbl_Posting.ID});
Total := Total + EUR)
else if {GLDebit.OriginCurr} = "GBP" then
(GBP := {tbl_ValueInfo.GBP}* Sum ({@SalesValueGBP}, {tbl_Posting.ID});
Total := Total + GBP)
else if {GLDebit.OriginCurr} = "SGD" then
(RM := {tbl_ValueInfo.SGD}* Sum ({@SalesValueSGD}, {tbl_Posting.ID});
Total := Total + SGD)
else if {GLDebit.OriginCurr} = "USD" then
(SGD := {tbl_ValueInfo.USD}* Sum ({@SalesValueUSD}, {tbl_Posting.ID});
Total := Total + USD)
else if {GLDebit.OriginCurr} = "RM" then
(RM := {tbl_ValueInfo.RM}* Sum ({@SalesValueRM}, {tbl_Posting.ID});
Total := Total + RM)
else if {GLDebit.OriginCurr} = "THB" then
(THB := {tbl_ValueInfo.THB}*Sum ({@SalesValueTHB}, {tbl_Posting.ID});
Total := Total + THB)
Anatasia
- anatasia(Legacy Member)
1 post • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests