closing balance of a customer

Dear all,

I have written a program to calculate closing balance, but I dont know how to keep track of exchange gain amt.
for eg: suppose My base currency is INR .for customer "100" I send the invoice for $100 ( exchage rate 40 Rs = 1 $ ) . It means I have to received Rs 4000/- from the customer.
When I received a check from customer of $100 that time exchange rate was 50 Rs = 1 $ . It means that I received Rs 5000/-.
My program is designed like it will do 4000-5000. and it will show Rs 1000
as a closing balance , but in realilty the transaction is balanced.
This amt Rs 1000/- goes to exchange gain account.But how should I add that amt . Can anyone suggest me a query on gltr_hist to get the record.
 
hi kishor,

I have implemented the same in the program. Our user interface is somewhat like----
----------------------------------------------------------------------
customer:ABC__________ to:_______________
type:______________ to:_______________
eff date:01/01/2008____ to:_______________

output :_____

Program gives the output like

opening balance : 100 ( opening balance for 01/01/2008 )
period activity: 200 ( balance between 01/01/2008 to today )
closing balance: 300 ( opening + period activity )
-----------------------------------------------------------------------


To compare the output I have chosen standard mfg/pro as of effective date report. I entered date 31/12/2007, becasue closing balance of that day will be the openning balance for 01/01/2008. Then I run the program for today as a eff date and then compare the output. Is this way is fine?
or there are some other way to check it out?

I have one doubt . The above case can fail in one case:
for eg: suppose My base currency is INR , for customer "ABC" I have given invoice of $ 100 ( exchange rate : 1$ = 40 INR ) with effective date
31/12/2008 . He gave me $ 40 on same day . so no exchage gain. But I have to receive $60. Hence opening balance for customer on 01/01/2008 is $60 (exchange rate 1$ = 40 INR). hence
opening balance will be: 60 * 40 = 2400 INR.
He had not returned me any money till today (exchange rate 1$ = 50 INR)
Ideally closing balance for today = 60 * 50 = 3000 INR.
------------------------------------------------------------
my program will show
opening balance (01/01/2008) : 2400 INR
Period activity ( from 01.01/2008 to today) = 0 INR ( as not returned money)
closing balanc: 2400 INR.
------------------------------------------------------------

Which one is correct 2400 or 3000 ? I think 3000...Please sir,reply....
 
Your test method is correct, you should get 3000 to attain this if period activity is zero then find the rate as of today & apply it to the open balance. there is a incxlude file which does it look ine age report source.
 
Top