Home » Developer & Programmer » Forms » Req Block Solution
Req Block Solution [message #232011] Thu, 19 April 2007 01:35 Go to next message
sweetkhaliq
Messages: 189
Registered: April 2006
Senior Member

Dear All
I have vouchar form. There are two type of entries debit and credit. The Table 
data is like this

account#     acc_name         narration        debit    credit
010010036    Telphone Exp     Paid Expenses     5000

Now I want that when i Goes to next record  then debit amount automatically 
comes in credit field just like this.

account#     acc_name         narration        debit    credit
010010036    Telphone Exp     Paid Expenses     5000
010010011    Cash in hand     Paid Expenses              5000

Now if there are more then one debit entries and i goes to next record then 
sum of debit amount shold goes in the credit field automatically. just like 
this

account#     acc_name         narration       debit    credit
010010036    Telphone Exp     Paid Expenses     5000
010010045    Electricity Exp  Paid Expenses     6000
010010011    Cash in hand     Paid Expenses             11000

Please provide me the answer i will be very thankful to you

[Updated on: Fri, 20 April 2007 01:40] by Moderator

Report message to a moderator

Re: Req Block Solution [message #232260 is a reply to message #232011] Thu, 19 April 2007 23:34 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
In the When-Create-Record trigger determine if the rowid is greater than 1 and if it is populate the fields of interest. You will have to keep a running total of the 'debit' fields to place in the 'credit' field through the use of a field in another block (what we usually call the 'ctrl' block and it is non-database).

David
Re: Req Block Solution [message #232299 is a reply to message #232011] Fri, 20 April 2007 01:31 Go to previous messageGo to next message
sweetkhaliq
Messages: 189
Registered: April 2006
Senior Member

Thanks For Reply
I have done this Now debit amout goes automatically to credit field but still there is a problem. When 1st time when i put the debit value 5000 and goes to next record it automatically put 5000 in credit field. But when i goes to next record and put another debit entry with 6000 in debit field and goes to next record it automaticaly put 11000 in the credit field sum of two debit 5000 and 6000. But in previous record credit field it still have 5000 amount. It should be removed. Credit amount should be shown in once ,the last record the sum of all the previous records debit fields.
See the example blow.

account#     acc_name         narration       debit    credit
010010036    Telphone Exp     Paid Expenses     5000
010010045    Electricity Exp  Paid Expenses     6000    5000
010010043    Journal Exp      Paid Expenses     4000    11000
010010011    Cash in hand     Paid Expenses             15000

The Result should be like this.

account#     acc_name         narration       debit    credit
010010036    Telphone Exp     Paid Expenses     5000
010010045    Electricity Exp  Paid Expenses     6000    
010010043    Journal Exp      Paid Expenses     4000    
010010011    Cash in hand     Paid Expenses             15000

Provide the solution in Detail. Thanks
Please Reply me as soon as possible I have urgent need of this.

[Updated on: Fri, 20 April 2007 01:40] by Moderator

Report message to a moderator

Re: Req Block Solution [message #232306 is a reply to message #232299] Fri, 20 April 2007 01:41 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Put a When-Validate-Item trigger on the 'debit' field. When you populate it, set the 'credit' field to 'null'.

David
Re: Req Block Solution [message #232314 is a reply to message #232011] Fri, 20 April 2007 02:10 Go to previous messageGo to next message
sweetkhaliq
Messages: 189
Registered: April 2006
Senior Member

Thanks a lot
It works Quite well. Now i have found the Desire result.
Thanks once again.

[Updated on: Fri, 20 April 2007 02:11]

Report message to a moderator

Re: Req Block Solution [message #234538 is a reply to message #232011] Wed, 02 May 2007 01:27 Go to previous messageGo to next message
sweetkhaliq
Messages: 189
Registered: April 2006
Senior Member

Dear
Above scanario works well if there is only one credit entry.
If i enter another credit entry it again show the sum of debit in this field but it should show in next credit entry sum of debit minus credit.
The scanrio is like this
account#     acc_name         narration       debit    credit
010010036    Telphone Exp     Paid Expenses     5000
010010045    Electricity Exp  Paid Expenses     6000    
010010043    Journal Exp      Paid Expenses     4000    
010010011    Cash in hand     Paid Expenses             15000


Now i change the credit amount and add another credit entry.

account#     acc_name         narration       debit    credit
010010036    Telphone Exp     Paid Expenses     5000
010010045    Electricity Exp  Paid Expenses     6000    
010010043    Journal Exp      Paid Expenses     4000    
010010011    Cash in hand     Paid Expenses             5000
010010012    Cash at bank     Paid Expenses             15000


The Result should be like this

account#     acc_name         narration       debit    credit
010010036    Telphone Exp     Paid Expenses     5000
010010045    Electricity Exp  Paid Expenses     6000    
010010043    Journal Exp      Paid Expenses     4000    
010010011    Cash in hand     Paid Expenses             5000
010010012    Cash at bank     Paid Expenses             10000

Requirment:
When i add another credity entry it should automatically show in credit field (sum of all previous debit minus sum of all previous credit)
Thanks in Advance.




[Updated on: Wed, 02 May 2007 02:08]

Report message to a moderator

Re: Req Block Solution [message #234700 is a reply to message #232011] Wed, 02 May 2007 23:14 Go to previous messageGo to next message
sweetkhaliq
Messages: 189
Registered: April 2006
Senior Member

I am still waiting for reply.
Re: Req Block Solution [message #234784 is a reply to message #232011] Thu, 03 May 2007 02:56 Go to previous messageGo to next message
sameer_am2002
Messages: 129
Registered: September 2002
Senior Member
Test Case :
Create Block JV_BLK based on Table Journal_voucher_detail_tab with items
Srno , AcctCode , Narration , Debit , Credit
Create two more non-database items in the same block named runningdebit , runningcredit . base these two items on Debit and Credit respectively as Summary Items.

Then on When Create Record of the block JV_BLK write code
declare
ln_diffvalue number ;
begin
ln_diffvalue := nvl(:runningdebit,0) - nvl(:runningcredit,0) ;

if ln_diffvalue > 0 then
:credit := ln_diffvalue ;
else
:debit := abs(ln_diffvalue) ;
end if ;
end ;









Re: Req Block Solution [message #234826 is a reply to message #234784] Thu, 03 May 2007 04:28 Go to previous messageGo to next message
sweetkhaliq
Messages: 189
Registered: April 2006
Senior Member

Thanks
It works quite well it provide both debit and credit balance.
Please provide me your active email address i have need of further assistance for my project.
Re: Req Block Solution [message #234827 is a reply to message #232011] Thu, 03 May 2007 04:34 Go to previous message
sameer_am2002
Messages: 129
Registered: September 2002
Senior Member
sameer_am2002@yahoo.com , akil@taza.com.sa
Previous Topic: Text item
Next Topic: how to change values in lov dynamically?
Goto Forum:
  


Current Time: Wed Dec 07 08:28:12 CST 2016

Total time taken to generate the page: 0.10738 seconds