1 package jai_rgm_thhold_proc_pkg AS
2 /*$Header: jai_rgm_thld_prc.pls 120.1.12000000.1 2007/07/24 06:56:12 rallamse noship $*/
3 /**
4
5
6 /* ----------------------------------------------------------------------------
7
8 CHANGE HISTORY:
9 -------------------------------------------------------------------------------
10 S.No Date Author and Details
11 -------------------------------------------------------------------------------
12 1. 01/02/2007 Created by Bgowrava for forward porting bug#5631784. Version#120.0.
13 This was Directly created from 11i version 115.2
14
15
16 ----------------------------------------------------------------------------
17 get_threshold_slab_id - returns identifier for current threshold slab as out parameter
18 IN
19 p_regime_id - A valid regime_id from jai_rgm_thresholds.
20 p_org_tan_no - Organiztion TAN as defined in the regime setup
21 p_organization_id - Inventory organization defined in the regime setup
22 p_party_type - Party type. Can be either CUSTOMER or VENDOR. Currently only CUSTOMER is valid.
23 p_party_id - Party identifier.
24 p_fin_year - Financial year
25 p_org_id - Optional parameter. If fin_year is not given, operating unit is used to derive the fin_year
26 p_source_trx_date - Optional parameter. If fin_year is not given, transaction date is used to derive the fin_year
27 p_called_from - This will always be null if the call is external. For all the external call the API will simply
28 look return value of column JAI_RGM_THRESHOLD.THRESHOLD_SLAB_ID for the given parameters.
29 Only when the call is internal it will look into the setup to derrive the threshold_slab_id
30 OUT
31 p_threshold_slab_id - Current threshold slab identifier
32 p_process_flag - Flag indicates the process status, can be either
33 Successful (SS)
34 Expected Error (EE)
35 Unexpected Error (UE)
36 p_process_message - Message to be passed to caller of the api. It can be null in case of p_process_flag = 'SS'
37 */
38
39 procedure get_threshold_slab_id
40 (
41 p_regime_id in jai_rgm_thresholds.regime_id%type
42 , p_org_tan_no in JAI_RGM_REGISTRATIONS.attribute_value%type default null
43 , p_organization_id in hr_organization_units.organization_id%type default null
44 , p_party_type in jai_rgm_thresholds.party_type%type
45 , p_party_id in jai_rgm_thresholds.party_id%type
46 , p_fin_year in jai_rgm_thresholds.fin_year%type default null
47 , p_org_id in jai_ap_tds_thhold_taxes.operating_unit_id%type default null
48 , p_source_trx_date in date default null
49 , p_called_from in varchar2 default null
50 , p_threshold_slab_id out nocopy jai_rgm_thresholds.threshold_slab_id%type
51 , p_process_flag out nocopy varchar2
52 , p_process_message out nocopy varchar2
53 );
54 /*
55 get_threshold_tax_cat_id - returns tax category defined in the threshold setup as out parameter
56 IN
57 p_threshold_slab_id - Threshold slab identifier
58 p_org_id - Operating unit
59 OUT
60 p_threshold_tax_cat_id - Tax category identifier
61 p_process_flag - Flag indicates the process status, can be either
62 Successful (SS)
63 Expected Error (EE)
64 Unexpected Error (UE)
65 p_process_message - Message to be passed to caller of the api. It can be null in case of p_process_flag = 'SS'
66 */
67
68 procedure get_threshold_tax_cat_id
69 (
70 p_threshold_slab_id in jai_rgm_thresholds.threshold_slab_id%type
71 , p_org_id in jai_ap_tds_thhold_taxes.operating_unit_id%type
72 , p_threshold_tax_cat_id out nocopy jai_ap_tds_thhold_taxes.tax_category_id%type
73 , p_process_flag out nocopy varchar2
74 , p_process_message out nocopy varchar2
75 );
76 /*
77 default_thhold_taxes - defaults threshold taxes defined by the tax category
78 IN
79 p_source_trx_id - transaction identifier
80 p_source_trx_line_id - transaction line identifier
81 p_source_event - Event for which taxes to be defaulted. Currently only 'DELIVERY'
82 p_action - Action on which taxes are defaulted. Currently only 'DEFAULT_TAXES'
83 p_threshold_tax_cat_id - Tax category identifier for taxes to be defaulted
84 p_tax_base_line_number - Line number to be used as base line when calculating taxes. Default is 0
85 p_last_line_number - Line number after which threshold taxes to be defaulted
86
87 OUT
88 p_process_flag - Flag indicates the process status, can be either
89 Successful (SS)
90 Expected Error (EE)
91 Unexpected Error (UE)
92 p_process_message - Message to be passed to caller of the api. It can be null in case of p_process_flag = 'SS'
93 */
94
95 procedure default_thhold_taxes
96 (
97 p_source_trx_id in number
98 , p_source_trx_line_id in number
99 , p_source_event in varchar2
100 , p_action in varchar2
101 , p_threshold_tax_cat_id in jai_ap_tds_thhold_taxes.tax_category_id%type
102 , p_tax_base_line_number in number default 0
103 , p_last_line_number in number default 0
104 , p_currency_code in varchar2 default null
105 , p_currency_conv_rate in number default null
106 , p_quantity in number default null
107 , p_base_tax_amt in number default null
108 , p_assessable_value in number default null
109 , p_inventory_item_id in number default null
110 , p_uom_code in varchar2 default null
111 , p_vat_assessable_value in number default null
112 , p_process_flag out nocopy varchar2
113 , p_process_message out nocopy varchar2
114 );
115
116 procedure maintain_threshold
117 ( p_transaction_id in jai_rgm_refs_all.transaction_id%type
118 , p_last_line_flag in varchar2 default jai_constants.yes
119 , p_process_flag out nocopy varchar2
120 , p_process_message out nocopy varchar2
121 );
122
123 procedure insert_threshold_dtl
124 ( p_record in jai_rgm_threshold_dtls%rowtype
125 , p_threshold_dtl_id out nocopy jai_rgm_threshold_dtls.threshold_dtl_id%type
126 , p_row_id out nocopy rowid
127 ) ;
128
129 procedure insert_threshold_hdr
130 ( p_record in jai_rgm_thresholds%rowtype
131 , p_threshold_id out nocopy jai_rgm_thresholds.threshold_id%type
132 , p_row_id out nocopy rowid
133 );
134
135 procedure sync_threshold_header
136 ( p_threshold_id in jai_rgm_thresholds.threshold_id%type
137 , p_source_trx_date in date
138 , p_thhold_slab_change_flag out nocopy varchar2
139 , p_new_thhold_slab_id out nocopy jai_rgm_thresholds.threshold_slab_id%type
140 , p_process_flag out nocopy varchar2
141 , p_process_message out nocopy varchar2
142 ) ;
143
144
145
146
147
148 end jai_rgm_thhold_proc_pkg;