Problem in calculation in form 6i [message #439999] |
Wed, 20 January 2010 09:09 |
allianz2010
Messages: 101 Registered: October 2009 Location: Pakistan
|
Senior Member |
|
|
i m create form on customer.
in this form customer information and his balance.
i want that when i enter paid amount of any customer in Account Manager Tab.
then it check how much i enter new amount in paid section and it minus above current balance.
and current balance just minus new amount... not calculate previous amount..
i have 2 blocks 1st customer and 2nd customer_paid_amount
i also attached the form screen.
i write this code for this purpose:
DECLARE
ALRT NUMBER;
PBAL NUMBER;
BEGIN
:PARAMETER.OLDPAID:= NVL(:CS_PAID_AMNT.TOTAL_PAID,0) ;
:PARAMETER.OLDADJ := NVL(:CS_PAID_AMNT.TOTAL_ADJUSTED,0);
-- :PARAMETER.MODE_PMTR when in this parameter value is 2 then its mean now i update the records through form..
IF :PARAMETER.MODE_PMTR = 2 THEN
SET_ALERT_PROPERTY('COMMON_ALRT', ALERT_MESSAGE_TEXT,
'OLD PAID AMOUNT='||:PARAMETER.OLDPAID ||'OLD TOTAL ADJUSTED='||:PARAMETER.OLDADJ );
ALRT := SHOW_ALERT('COMMON_ALRT');
IF :CS_PAID_AMNT.TOTAL_PAID <> :PARAMETER.OLDPAID OR :CS_PAID_AMNT.TOTAL_ADJUSTED <> :PARAMETER.OLDADJ THEN
PBAL := (NVL(:CS_PAID_AMNT.TOTAL_PAID,0) + NVL(:CS_PAID_AMNT.TOTAL_ADJUSTED,0))
- (:PARAMETER.OLDPAID + :PARAMETER.OLDADJ );
SET_ALERT_PROPERTY('COMMON_ALRT', ALERT_MESSAGE_TEXT, 'NEW PAID BALANCE='||PBAL );
ALRT := SHOW_ALERT('COMMON_ALRT');
:CUS_SUPP.CS_BALANCE:= NVL(:CUS_SUPP.CS_BALANCE,0) - PBAL;
SET_ALERT_PROPERTY('COMMON_ALRT', ALERT_MESSAGE_TEXT, 'CURRENT BALANCE ='||:CUS_SUPP.CS_BALANCE);
ALRT := SHOW_ALERT('COMMON_ALRT');
END IF;
END IF;
END;
[EDITED by LF: applied [code] tags] [EDITED by DJM: split overly long line]
-
Attachment: CUSTOMER.JPG
(Size: 42.58KB, Downloaded 739 times)
[Updated on: Thu, 25 February 2010 18:37] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Problem in calculation in form 6i [message #440164 is a reply to message #440159] |
Thu, 21 January 2010 07:39 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
allianz2010 wrote on Thu, 21 January 2010 14:00
i call BALANCE_CHK this trigger when i saved the records... mean i call on it this SAVE_REC_TRGG trigger... True, we agree on that.
Quote:and i call SAVE_REC_TRGG this trigger on menu.
Menu? What menu?
[Updated on: Thu, 21 January 2010 07:40] Report message to a moderator
|
|
|
|
|
|
Re: Problem in calculation in form 6i [message #440264 is a reply to message #440220] |
Thu, 21 January 2010 22:27 |
allianz2010
Messages: 101 Registered: October 2009 Location: Pakistan
|
Senior Member |
|
|
Thanks for your reply...
sir i think you kidding with me....
i m sure you are senior member....
and you ask me this question that...
Quote:OK, if we suppose that menu "Save" calls SAVE_REC_TRGG trigger, what calls EDIT_REC_TRGG which is supposed to do the update
obviously sir if i call ""SAVE_REC_TRGG"" this trigger on Menu Bar... then i call ""EDIT_REC_TRGG"" this trigger on Menu Bar......
i send your my total menu screen
-
Attachment: MENUBAR.JPG
(Size: 62.49KB, Downloaded 720 times)
[Updated on: Thu, 21 January 2010 22:28] Report message to a moderator
|
|
|
|