[Home] [Help]
PACKAGE: APPS.PA_BILLING_AMOUNT
Source
1 PACKAGE pa_billing_amount AUTHID CURRENT_USER AS
2 /* $Header: PAXIAMTS.pls 120.1 2005/08/19 17:13:45 mwasowic noship $ */
3
4 ------------
5 -- OVERVIEW
6 -- Contains procedures that do calculations and return numeric values.
7 --
8
9 ----------------------------
10 -- PROCEDURES AND FUNCTIONS
11 --
12 --
13 -- 1. Procedure Name: CostAmount returns the actual burden cost for the
14 -- project/task_id specified. This includes accumulated
15 -- and unaccumulated burden cost with pa_dates before
16 -- the specified accrue thru date.
17 -- Usage: CostAmount(project_id, task_id, accru_thr_date, cost)
18 -- where cost is an OUT variable.
19 --
20 -- 2. Procedure Name: RevenueAmount returns all revenue that came from the
21 -- cost-cost algorithm events or Expenditure Items.
22 -- Usage: RevenueAmount(project_id, task_id, revenue)
23 -- where revenue is an OUT parameter.
24 --
25 -- 3. Procedure Name: PotEventAmount returns revenue and invoice amount total
26 -- for all events other than those coming from cost-cost,
27 -- for the Project/Task specified with completion dates
28 -- before the accrue_thru_date.
29 -- Usage: PotEventAmount(project_id, task_id, accrue_thru_date,
30 -- revenue, invoice)
31 -- where revenue and invoice are OUT parameters.
32 --
33 -- 4. Procedure Name: InvoiceAmount returns the Invoice Amount that is coming
34 -- from expenditure items or cost-cost events for the
35 -- project/task specified.
36 -- Usage: InvoiceAmount(project_id, task_id, invoice)
37 -- where invoice is an OUT parameter.
38 --
39 -- 5. Function Name: LowestAmountLeft calculates how much can go under the
40 -- lowest hard limit of the customers attached to the
41 -- project taking the bill split and accrued_amounts
42 -- into account. From this it subtracts automatic events
43 -- have not been accrued/billed yet.
44 -- If called by Revenue it returns the Revenue
45 -- amount otherwise the Invoice Amount. If the amount
46 -- being returned in negative it returns zero.
47 -- Usage: amount REAL;
48 -- amount := LowestAmountLeft(project, task,
49 -- calling_process);
50 --
51 -- 6. Function Name: rdl_amount
52 --
53 -- Usage: amount := rdl_amount(eiid, which_amount)
54 --
55 -- Parameters: X_which: Can have values R or I (Default R)
56 -- R: return revenue_amount
57 -- I: return invoice_amount
58 -- X_eiid: Return amount for this eiid.
59 -- X_adj: If 'Y' Return only adjusting amounts.
60 -- If 'N' return only +ve amounts
61 -- IF NULL return both.
62 -- X_ei_adj: 'Y' if the Exp Item is an adjusting
63 -- one, 'N' otherwise.
64 --
65 -- 7. Procedure Name : get_baseline_budget
66 --
67 -- Usage: get_baseline_budget ( X_project_id,
68 -- X_rev_budget,
69 -- X_cost_budget,
70 -- X_err_msg )
71 --
72 -- Parameter: X_project_id : Project id
73 -- X_rev_budget : Baseline Revenue Budget
74 -- X_cost_budget: Baseline Cost Budget
75 -- X_err_msg : Error Message
76 --
77 ------------------------
78 -- FUNCTION DECLARATIONS
79 --
80
81
82
83 Procedure CostAmount( X2_project_id NUMBER,
84 X2_task_id NUMBER DEFAULT NULL,
85 X2_accrue_through_date DATE DEFAULT NULL,
86 X2_cost_amount OUT NOCOPY REAL); --File.Sql.39 bug 4440895
87
88 Procedure RevenueAmount( X2_project_id NUMBER,
89 X2_task_Id NUMBER DEFAULT NULL,
90 X2_revenue_amount OUT NOCOPY REAL); --File.Sql.39 bug 4440895
91
92 Procedure PotEventAmount( X2_project_id NUMBER,
93 X2_task_id NUMBER DEFAULT NULL,
94 X2_accrue_through_date DATE DEFAULT NULL,
95 X2_revenue_amount OUT NOCOPY REAL, --File.Sql.39 bug 4440895
96 X2_invoice_amount OUT NOCOPY REAL); --File.Sql.39 bug 4440895
97
98 Procedure InvoiceAmount( X2_project_id NUMBER,
99 X2_task_id NUMBER default NULL,
100 X2_invoice_amount OUT NOCOPY REAL); --File.Sql.39 bug 4440895
101
102 FUNCTION LowestAmountLeft ( X2_project_id NUMBER,
103 X2_task_id NUMBER,
104 X2_calling_process VARCHAR2)
105 RETURN REAL;
106
107 FUNCTION rdl_amount(X_which VARCHAR2, X_eiid NUMBER, X_adj VARCHAR2, X_ei_adj VARCHAR2)
108 return REAL;
109
110 PROCEDURE get_baseline_budget ( X_project_id IN NUMBER,
111 X_rev_budget OUT NOCOPY REAL, --File.Sql.39 bug 4440895
112 X_cost_budget OUT NOCOPY REAL, --File.Sql.39 bug 4440895
113 X_err_msg OUT NOCOPY VARCHAR2); --File.Sql.39 bug 4440895
114
115
116 END pa_billing_amount;