DBA Data[Home] [Help]

PACKAGE BODY: APPS.GMF_AP_GET_PAYMENT_TERMS

Source


1 PACKAGE BODY GMF_AP_GET_PAYMENT_TERMS AS
2 /* $Header: gmfpayrb.pls 115.0 99/07/16 04:21:51 porting shi $ */
3   CURSOR payment_terms(startdate date, enddate date, name1 varchar2) IS
4       SELECT   apt.name,
5             apt.description,
6             apt.start_date_active,
7             apt.end_date_active,
8             apt1.creation_date,
9             apt1.last_update_date,
10             apt1.created_by,
11             apt1.last_updated_by,
12             apt1.due_percent,
13             nvl(apt1.due_amount,0),
14             nvl(apt1.due_days,0),
15             apt1.due_day_of_month,
16             apt1.due_months_forward,
17             nvl(apt1.discount_percent,0),
18             nvl(apt1.discount_days,0),
19             apt1.discount_day_of_month,
20             apt1.discount_months_forward,
21             apt1.discount_percent_2,
22             apt1.discount_days_2,
23             apt1.discount_day_of_month_2,
24             apt1.discount_months_forward_2,
25             apt1.discount_percent_3,
26             apt1.discount_days_3,
27             apt1.discount_day_of_month_3,
28             apt1.discount_months_forward_3
29     FROM      ap_terms apt,ap_terms_lines apt1
30     WHERE      apt.name like name1       AND
31             apt.term_id = apt1.term_id  AND
32             apt1.sequence_num = 1     AND
33             apt.last_update_date  BETWEEN
34               nvl(startdate,apt.last_update_date)  AND
35               nvl(enddate,apt.last_update_date);
36 
37      PROCEDURE ap_get_payment_terms (  startdate  in date,
38                           enddate  in date,
39                           name1 in out varchar2,
40                           descr out varchar2,
41                           startdateactive  out date,
42                           enddateactive  out date,
43                           duepercent out number,
44                           dueamount out number,
45                           duedays out number,
46                           duedayofmonth out  number,
47                           duemonthsforward out number,
48                           discountpercent out number,
49                           discountdays out number,
50                           discountdayofmonth out number,
51                           discountmonthforward out number,
52                           discountpercent2 out number,
53                           discountdays2 out number,
54                           discountdayofmonth2 out number,
55                           discountmonthsforward2 out number,
56                           discountpercent3 out number,
57                           discountdays3 out number,
58                           discountdayofmonth3 out number,
59                           discountmonthsforward3 out number,
60                           creation_date out date,
61                           created_by out number,
62                           last_update_date out date,
63                           last_updated_by out number,
64                           row_to_fetch in out number,
65                           statuscode out  number) IS
66     BEGIN
67         IF NOT payment_terms%ISOPEN THEN
68           OPEN payment_terms(startdate,enddate,name1);
69         END IF;
70         FETCH   payment_terms
71         INTO    name1 ,
72               descr ,
73               startdateactive  ,
74               enddateactive  ,
75               creation_date,
76               last_update_date,
77               created_by,
78               last_updated_by  ,
79               duepercent ,
80               dueamount ,
81               duedays ,
82               duedayofmonth ,
83               duemonthsforward ,
84               discountpercent ,
85               discountdays ,
86               discountdayofmonth ,
87               discountmonthforward ,
88               discountpercent2 ,
89               discountdays2 ,
90               discountdayofmonth2 ,
91               discountmonthsforward2 ,
92               discountpercent3 ,
93               discountdays3 ,
94               discountdayofmonth3 ,
95               discountmonthsforward3;
96  /*          added_by := pkg_gl_get_currencies.get_name(ad_by); */
97  /*          modified_by := pkg_gl_get_currencies.get_name(mod_by); */
98           if payment_terms%NOTFOUND then
99              statuscode := 100;
100                end if;
101         IF payment_terms%NOTFOUND or row_to_fetch = 1 THEN
102            CLOSE payment_terms;
103         END IF;
104         EXCEPTION
105           WHEN OTHERS THEN
106             statuscode := SQLCODE;
107       END;
108 END GMF_AP_GET_PAYMENT_TERMS;