-
Hi,
I need to create this Bill report on a monthly or weekly basis.
the report should look like this.
-----------FPN----amt_A---amt_B---total
-------------------------------------------
accum---X001----10-------20
Prev---------------5-------10
curr---------------5-------10--------15
this is the process needed to generate this report.
- the report is grouped by FPN
- line1 will have accumlatives up to the minute I am printing
this report.
- move line3 to line 2
- subtract line1 from line2 to get how much need to bill.
- repeat all the steps everytime the report is generated.
Any idea on how to design the tables, and the realtionships to do the job.
* I am using developer6 on oracle8.0.5 thanks in advance
-
Let's say what you want to do in other words:
you want to issue a bill, then next time you issue a bil, you print the current amount and the oldest amount printed, and subtract them.
OK:
you will have the following tables:
1- FPN
2- transactions table with fields : FPN, amt_a, Amt_b, flag: Billed
3- Balance table. with fields : FPN, AMT_A_balance, Amt_B_Balance, AMT_A_LAST_BALANCE, AMT_B_LAST_BALANCE.
(this table is not mandatory, but it will speed up the reporting process)
whenever any transaction happen, a new record is inserted in the TRANSACTION tablem and BILLED flag ='N', at the same time you increase the amounts : AMT_A_BALANCE, AMT_B_BALANCE at table BALANCE
then when you print the bill, you print AMT_A_LAST_BALANCE, AMT_B_LAST_BALANCE, and AMT_A_BALANCE, AMT_B_BALANCE , then set the flag BILLED='Y' for transactions where the flag where ='N'
and set AMT_A_LAST_BALANCE=AMT_A_BALANCE, and AMT_B_LAST_BALANCE=AMT_B_BALANCE.
Amir Magdy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|