DBA Data[Home] [Help]

PACKAGE: APPS.CSD_ANALYSIS_UTIL

Source


1 PACKAGE CSD_ANALYSIS_UTIL AUTHID CURRENT_USER AS
2 /* $Header: csdvanus.pls 115.3 2002/11/08 23:36:49 swai noship $ */
3 
4 
5 /*----------------------------------------------------------------*/
6 /* record name:  MLE_TOTALS_REC_TYPE                            */
7 /* description:  Record used to hold totals                     */
8 /*                                                                */
9 /*----------------------------------------------------------------*/
10 TYPE MLE_TOTALS_REC_TYPE IS RECORD
11 (  MATERIALS         NUMBER,
12    LABOR             NUMBER,
13    EXPENSES          NUMBER,
14    MLE_TOTAL         NUMBER,
15    CURRENCY_CODE     VARCHAR2(15));
16 
17 
18 /*----------------------------------------------------------------*/
19 /* function name: Get_CurrencyCode                                */
20 /* description  : Gets the currency from GL_SETS_OF_BOOKS for an  */
21 /*                organization                                    */
22 /*                                                                */
23 /* p_organization_id            Organization ID to get currency   */
24 /*                                                                */
25 /*----------------------------------------------------------------*/
26 FUNCTION Get_CurrencyCode (
27    p_organization_id   IN   NUMBER
28 )
29 RETURN VARCHAR2;
30 
31 /*----------------------------------------------------------------*/
32 /* procedure name: Convert_CurrencyAmount                         */
33 /* description   : Converts an amount from one currency to        */
34 /*                 another currency                               */
35 /*                                                                */
36 /* p_api_version                Standard IN param                 */
37 /* p_commit                     Standard IN param                 */
38 /* p_init_msg_list              Standard IN param                 */
39 /* p_validation_level           Standard IN param                 */
40 /* p_from_currency              Currency code to convert from     */
41 /* p_to_currency                Currency code to convert to       */
42 /* p_eff_date                   Conversion Date                   */
43 /* p_amount                     Amount to convert                 */
44 /* p_conv_type                  Conversion type                   */
45 /* x_conv_amount                Converted amount                  */
46 /* x_return_status              Standard OUT param                */
47 /* x_msg_count                  Standard OUT param                */
48 /* x_msg_data                   Standard OUT param                */
49 /*                                                                */
50 /*----------------------------------------------------------------*/
51 PROCEDURE Convert_CurrencyAmount (
52    p_api_version           IN     NUMBER,
53    p_commit                IN     VARCHAR2,
54    p_init_msg_list         IN     VARCHAR2,
55    p_validation_level      IN     NUMBER,
56    p_from_currency         IN     VARCHAR2,
57    p_to_currency           IN     VARCHAR2,
58    p_eff_date              IN     DATE,
59    p_amount                IN     NUMBER,
60    p_conv_type             IN     VARCHAR2,
61    x_conv_amount           OUT NOCOPY    NUMBER,
62    x_return_status         OUT NOCOPY    VARCHAR2,
63    x_msg_count             OUT NOCOPY    NUMBER,
64    x_msg_data              OUT NOCOPY    VARCHAR2
65 );
66 
67 /*----------------------------------------------------------------*/
68 /* procedure name: Get_TotalActCosts                              */
69 /* description   : Given a repair line id, gets the total MLE     */
70 /*                 actual costs.                                  */
71 /*                                                                */
72 /* p_api_version                Standard IN param                 */
73 /* p_commit                     Standard IN param                 */
74 /* p_init_msg_list              Standard IN param                 */
75 /* p_validation_level           Standard IN param                 */
76 /* p_repair_line_id             Repair Line ID to get actual costs*/
77 /* p_currency_code              Currency to convert costs to      */
78 /* x_costs                      Total MLE costs for repair line   */
79 /* x_return_status              Standard OUT param                */
80 /* x_msg_count                  Standard OUT param                */
81 /* x_msg_data                   Standard OUT param                */
82 /*                                                                */
83 /*----------------------------------------------------------------*/
84 PROCEDURE Get_TotalActCosts
85 (
86    p_api_version           IN     NUMBER,
87    p_commit                IN     VARCHAR2,
88    p_init_msg_list         IN     VARCHAR2,
89    p_validation_level      IN     NUMBER,
90    p_repair_line_id        IN     NUMBER,
91    p_currency_code         IN     VARCHAR2,  --currency to convert costs to
92    x_costs                 OUT NOCOPY    MLE_TOTALS_REC_TYPE,
93    x_return_status         OUT NOCOPY    VARCHAR2,
94    x_msg_count             OUT NOCOPY    NUMBER,
95    x_msg_data              OUT NOCOPY    VARCHAR2
96 );
97 
98 
99 /*----------------------------------------------------------------*/
100 /* procedure name: Get_TotalEstCosts                              */
101 /* description   : Given an estimate header, gets the total MLE   */
102 /*                 estimated costs.                               */
103 /*                                                                */
104 /* p_api_version                Standard IN param                 */
105 /* p_commit                     Standard IN param                 */
106 /* p_init_msg_list              Standard IN param                 */
107 /* p_validation_level           Standard IN param                 */
108 /* p_estimate_header_id         Est header ID to get est costs for*/
109 /* p_currency_code              Currency to convert costs to      */
110 /* x_costs                      Total MLE costs for repair line   */
111 /* x_return_status              Standard OUT param                */
112 /* x_msg_count                  Standard OUT param                */
113 /* x_msg_data                   Standard OUT param                */
114 /*                                                                */
115 /*----------------------------------------------------------------*/
116 PROCEDURE Get_TotalEstCosts (
117    p_api_version           IN     NUMBER,
118    p_commit                IN     VARCHAR2,
119    p_init_msg_list         IN     VARCHAR2,
120    p_validation_level      IN     NUMBER,
121    p_estimate_header_id    IN     NUMBER,
122    x_costs                 OUT NOCOPY    MLE_TOTALS_REC_TYPE,
123    x_return_status         OUT NOCOPY    VARCHAR2,
124    x_msg_count             OUT NOCOPY    NUMBER,
125    x_msg_data              OUT NOCOPY    VARCHAR2
126 );
127 
128 /*----------------------------------------------------------------*/
129 /* procedure name: Compare_MLETotals                              */
130 /* description   : Compares any two records of                    */
131 /*                 MLE_total_record_type by amount and percent.   */
132 /*                 Difference is calculated by basis - compare.   */
136 /*                                                                */
133 /*                 Percent is determined by dividing difference   */
134 /*                 by the basis. If currencies are different,     */
135 /*                 Difference will be in currency of compare amts */
137 /* p_api_version                Standard IN param                 */
138 /* p_commit                     Standard IN param                 */
139 /* p_init_msg_list              Standard IN param                 */
140 /* p_validation_level           Standard IN param                 */
141 /* p_mle_totals_basis           Totals to use as basis            */
142 /* p_mle_totals_compare         Totals to compare to basis        */
143 /* x_diff                       Basis - Compare                   */
144 /* x_pct_diff                   (Basis - Compare)*100/Basis       */
145 /* x_return_status              Standard OUT param                */
146 /* x_msg_count                  Standard OUT param                */
147 /* x_msg_data                   Standard OUT param                */
148 /*                                                                */
149 /*----------------------------------------------------------------*/
150 PROCEDURE Compare_MLETotals (
151    p_api_version           IN     NUMBER,
152    p_commit                IN     VARCHAR2,
153    p_init_msg_list         IN     VARCHAR2,
154    p_validation_level      IN     NUMBER,
155    p_mle_totals_basis      IN     MLE_TOTALS_REC_TYPE,
156    p_mle_totals_compare    IN     MLE_TOTALS_REC_TYPE,
157    x_diff                  OUT NOCOPY    MLE_TOTALS_REC_TYPE,
158    x_pct_diff              OUT NOCOPY    MLE_TOTALS_REC_TYPE,
159    x_return_status         OUT NOCOPY    VARCHAR2,
160    x_msg_count             OUT NOCOPY    NUMBER,
161    x_msg_data              OUT NOCOPY    VARCHAR2
162 );
163 
164 END CSD_ANALYSIS_UTIL ;