[Home] [Help]
PACKAGE BODY: APPS.PO_PB_LINES_1
Source
1 PACKAGE BODY PO_PB_LINES_1 as
2 /* $Header: POPBLINB.pls 120.0 2005/06/02 02:17:30 appldev noship $*/
3
4 procedure insert_line(X_Rowid IN OUT NOCOPY VARCHAR2,
5 X_Po_Line_Id IN OUT NOCOPY NUMBER,
6 X_Last_Update_Date DATE,
7 X_Last_Updated_By NUMBER,
8 X_Po_Header_Id NUMBER,
9 X_Line_Type_Id NUMBER,
10 X_Line_Num NUMBER,
11 X_Last_Update_Login NUMBER,
12 X_Item_Id NUMBER,
13 X_Item_Revision VARCHAR2,
14 X_Category_Id NUMBER,
15 X_Item_Description VARCHAR2,
16 X_Unit_Meas_Lookup_Code VARCHAR2,
17 X_Unit_Price NUMBER,
18 X_Vendor_Product_Num VARCHAR2,
19 X_Org_Id NUMBER,
20 X_Note_To_Vendor VARCHAR2
21 ) IS
22
23 X_autocreated_ship BOOLEAN;
24 X_accrue_on_receipt_flag VARCHAR2(25);
25 X_line_location_id NUMBER;
26 X_List_Price_Per_Unit NUMBER;
27 X_Market_Price NUMBER;
28 X_UM_Number NUMBER;
29 X_Hazard_Class NUMBER;
30
31 -- <SERVICES FPJ START>
32 l_order_type_lookup_code PO_LINE_TYPES_B.order_type_lookup_code%TYPE;
33 l_purchase_basis PO_LINE_TYPES_B.purchase_basis%TYPE;
34 l_matching_basis PO_LINE_TYPES_B.matching_basis%TYPE;
35 l_category_id PO_LINE_TYPES_B.category_id%TYPE;
36 l_unit_meas_lookup_code PO_LINE_TYPES_B.unit_of_measure%TYPE;
37 l_unit_price PO_LINE_TYPES_B.unit_price%TYPE;
38 l_outside_operation_flag PO_LINE_TYPES_B.outside_operation_flag%TYPE;
39 l_receiving_flag PO_LINE_TYPES_B.receiving_flag%TYPE;
40 l_receive_close_tolerance PO_LINE_TYPES_B.receive_close_tolerance%TYPE;
41 -- <SERVICES FPJ END>
42
43 begin
44 X_autocreated_ship:=false;
45
46 if(X_Org_Id is null) then
47 X_List_Price_Per_Unit:=1;
48 X_Market_Price:=1;
49 X_UM_Number:=null;
50 X_Hazard_Class:=null;
51 else
52 select list_price_per_unit,
53 market_price,
54 un_number_id,
55 hazard_class_id
56 into X_List_Price_Per_Unit,
57 X_Market_Price,
58 X_UM_Number,
59 X_Hazard_Class
60 from mtl_system_items
61 where inventory_item_id=X_Item_Id
62 and organization_id=X_Org_Id;
63 end if;
64
65 -- <SERVICES FPJ START>
66 -- Retrieve the values for order_type_lookup_code, purchase_basis
67 -- and matching_basis
68 PO_LINE_TYPES_SV.get_line_type_def(
69 X_Line_Type_Id,
70 l_order_type_lookup_code,
71 l_purchase_basis,
72 l_matching_basis,
73 l_category_id,
74 l_unit_meas_lookup_code,
75 l_unit_price,
76 l_outside_operation_flag,
77 l_receiving_flag,
78 l_receive_close_tolerance);
79 -- <SERVICES FPJ END>
80
81 PO_LINES_SV3.insert_line(X_Rowid ,
82 X_Po_Line_Id ,
83 X_Last_Update_Date ,
84 X_Last_Updated_By ,
85 X_Po_Header_Id ,
86 X_Line_Type_Id ,
87 X_Line_Num ,
88 X_Last_Update_Login ,
89 X_Last_Update_Date ,--create_date
90 X_Last_Updated_By ,--create_by
91 X_Item_Id ,
92 X_Item_Revision ,
93 X_Category_Id ,
94 X_Item_Description ,
95 X_Unit_Meas_Lookup_Code ,
96 null ,--Quantity_Committed
97 null , --X_Committed_Amount,
98 'N' ,--X_Allow_Price_Override_Flag,
99 null , --X_Not_To_Exceed_Price
100 X_List_Price_Per_Unit ,
101 X_Unit_Price ,
102 null ,--X_Quantity
103 X_UM_Number ,--
104 X_Hazard_Class ,--
105 X_Note_To_Vendor ,--X_Note_To_Vendor
106 null ,--X_From_Header_Id
107 null ,--X_From_Line_Id
108 NULL, --X_From_Line_Location_Id -- <SERVICES FPJ>
109 null ,--X_Min_Order_Quantity
110 null ,--X_Max_Order_Quantity
111 null ,--X_Qty_Rcv_Tolerance
112 null ,--X_Over_Tolerance_Error_Flag
113 X_Market_Price ,--
114 'N' ,--X_Unordered_Flag
115 'N' ,--X_Closed_Flag
116 null ,--X_User_Hold_Flag
117 'N' ,--X_Cancel_Flag
118 null ,--X_Cancelled_By
119 null ,--X_Cancel_Date
120 null ,--X_Cancel_Reason
121 null ,--X_Firm_Status_Lookup_Code
122 null ,--X_Firm_Date
123 X_Vendor_Product_Num ,--
124 null ,-- X_Contract_Num
125 null ,-- X_Taxable_Flag previously 'N'
126 null ,--X_Tax_Code_Id
127 null ,--X_Type_1099
128 null ,-- X_Capital_Expense_Flag previously 'N'
129 null ,--X_Negotiated_By_Preparer_Flag previously 'N
130 null ,-- X_Attribute_Category
131 null ,--X_Attribute1
132 null ,-- X_Attribute2
133 null ,--
134 null ,--
135 null ,--
136 null ,--
137 null ,--
138 null ,--
139 null ,--
140 null ,--
141 null ,--X_Reference_Num
142 null ,--Attribute11
143 null ,--X_Attribute12
144 null ,--X_Attribute13
145 null ,--
146 null ,--
147 null ,--X_Min_Release_Amount
148 'VARIABLE' ,--X_Price_Type_Lookup_Code
149 null ,--X_Closed_Code
150 'CUMULATIVE' ,--X_Price_Break_Lookup_Code
151 null ,--X_Ussgl_Transaction_Code
152 null ,--X_Government_Context
153 null ,--X_Closed_Date
154 null ,--X_Closed_Reason
155 null ,--X_Closed_By
156 null ,--X_Transaction_Reason_Code
157 false ,--X_revise_header
158 null ,--X_revision_num
159 null ,--X_revised_date
160 null ,--X_approved_flag
161 null ,--X_header_row_id
162 null ,--X_type_lookup_code
163 null ,--X_ship_to_location_id
164 null ,--X_ship_org_id
165 null ,--X_need_by_date
166 null ,--X_promised_date
167 null ,--X_receipt_required_flag
168 null ,--X_invoice_close_tolerance
169 null ,--X_receive_close_tolerance
170 null ,--X_planned_item_flag
171 null ,--X_outside_operation_flag
172 null ,--X_destination_type_code
173 null ,--X_expense_accrual_code
174 null ,--X_dist_blk_status
175 X_accrue_on_receipt_flag,--
176 null ,--X_ok_to_autocreate_ship
177 X_autocreated_ship ,--
178 X_line_location_id ,--
179 null, null, null, null, null,null, null,
180 null, null, null, null, null,null, null,
181 null, null, null, null, null,null, null,
182 null, null, null, null, null,null, null,
183 null, -- x_oke_contract_header_id
184 null,
185 null,
186 null,
187 null,
188 null,
189 null,
190 null,
191 null,
192 null,
193 null, -- x_amount_db
194 l_order_type_lookup_code,
195 l_purchase_basis,
196 l_matching_basis,
197 null,
198 null,
199 null,
200 X_Org_Id -- <R12 MOAC>
201 );
202
203 exception
204
205 when others then
206 po_message_s.sql_error('insert_line', '010', sqlcode);
207 raise;
208
209 end insert_line;
210
211 END PO_PB_LINES_1;