mig28mx
20th August 2008, 02:32
Hello all,
I´m facing with the following problem:
I have a maintenance session, that insert data to a table.
The table have the fields:
conc (enumerated)
year
prod
iaaj (tfgld.amnt domain) Import (display only)
imaj (tfgld.amnt domain) Adjustment
idaj (tfgld.amnt domain) Import after adjustment (display only)
I need that, when I insert a record, the field iaaj, shows the balance of a ledger account (already done).
Then, put an ammount on Adjustment field, and the field idaj shows the operation idaj = iaaj + imaj
The problem is, when I delete one record, the iaaj and idaj stills on scren even if I insert a new record!
I need that all the fields must be initialized before I add a new set.
Here is my code.
Any sugestions?
Thank you in advance.
field.all:
before.input:
refresh()
field.tfcmg883.peri:
when.field.changes:
if tfcmg883.conc = tfgld.conc.iva.retenido then
cta.debe = 0
cta.haber = 0
cre = 0
deb = 0
tot = 0
saa = 0
select tfcmg877.*
from tfcmg877
| where tfcmg877._index1 = {" "}
as set with 1 rows
selectdo
select tfgld206.year, tfgld206.leac, tfgld206.fobh, tfcmg877.leac
from tfgld206, tfcmg877
where tfgld206.year = :tfcmg883.year
and tfgld206.leac = tfcmg877.leac
selectdo
saa = saa + tfgld206.fobh
selectempty
saa = saa + 0
endselect
select tfgld201.year, tfgld201.prno, tfgld201.ptyp, tfgld201.leac, tfgld201.fdah, tfgld201.fcah
from tfgld201
where tfgld201.year = :tfcmg883.year
and tfgld201.prno inrange 1 and :tfcmg883.peri
| and tfgld201.prno = :tfcmg883.peri
and tfgld201.leac = :tfcmg877.leac
and tfgld201.ptyp = tfgld.ptyp.financial
selectdo
cre = cre + tfgld201.fcah
deb = deb + tfgld201.fdah
endselect
endselect
tot = cre - deb - saa
tfcmg883.iaaj = tot
display.all()
refresh()
tot = 0
endif
I´m facing with the following problem:
I have a maintenance session, that insert data to a table.
The table have the fields:
conc (enumerated)
year
prod
iaaj (tfgld.amnt domain) Import (display only)
imaj (tfgld.amnt domain) Adjustment
idaj (tfgld.amnt domain) Import after adjustment (display only)
I need that, when I insert a record, the field iaaj, shows the balance of a ledger account (already done).
Then, put an ammount on Adjustment field, and the field idaj shows the operation idaj = iaaj + imaj
The problem is, when I delete one record, the iaaj and idaj stills on scren even if I insert a new record!
I need that all the fields must be initialized before I add a new set.
Here is my code.
Any sugestions?
Thank you in advance.
field.all:
before.input:
refresh()
field.tfcmg883.peri:
when.field.changes:
if tfcmg883.conc = tfgld.conc.iva.retenido then
cta.debe = 0
cta.haber = 0
cre = 0
deb = 0
tot = 0
saa = 0
select tfcmg877.*
from tfcmg877
| where tfcmg877._index1 = {" "}
as set with 1 rows
selectdo
select tfgld206.year, tfgld206.leac, tfgld206.fobh, tfcmg877.leac
from tfgld206, tfcmg877
where tfgld206.year = :tfcmg883.year
and tfgld206.leac = tfcmg877.leac
selectdo
saa = saa + tfgld206.fobh
selectempty
saa = saa + 0
endselect
select tfgld201.year, tfgld201.prno, tfgld201.ptyp, tfgld201.leac, tfgld201.fdah, tfgld201.fcah
from tfgld201
where tfgld201.year = :tfcmg883.year
and tfgld201.prno inrange 1 and :tfcmg883.peri
| and tfgld201.prno = :tfcmg883.peri
and tfgld201.leac = :tfcmg877.leac
and tfgld201.ptyp = tfgld.ptyp.financial
selectdo
cre = cre + tfgld201.fcah
deb = deb + tfgld201.fdah
endselect
endselect
tot = cre - deb - saa
tfcmg883.iaaj = tot
display.all()
refresh()
tot = 0
endif