DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_LINES_PKG_SL

Source


1 PACKAGE BODY PO_LINES_PKG_SL as
2 /* $Header: POXPIL2B.pls 120.2.12020000.2 2013/02/11 00:05:14 vegajula ship $ */
3 -- Read the profile option that enables/disables the debug log
4 g_fnd_debug CONSTANT VARCHAR2(1) := NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N');
5 
6 c_log_head    CONSTANT VARCHAR2(35) := 'po.plsql.PO_LINES_PKG_SL.';
7 
8   PROCEDURE Lock_Row(X_Rowid                            VARCHAR2,
9                      X_Po_Line_Id                       NUMBER,
10                      X_Po_Header_Id                     NUMBER,
11                      X_Line_Type_Id                     NUMBER,
12                      X_Line_Num                         NUMBER,
13                      X_Item_Id                          NUMBER,
14                      X_Item_Revision                    VARCHAR2,
15                      X_Category_Id                      NUMBER,
16                      X_Item_Description                 VARCHAR2,
17                      X_Unit_Meas_Lookup_Code            VARCHAR2,
18                      X_Quantity_Committed               NUMBER,
19                      X_Committed_Amount                 NUMBER,
20                      X_Allow_Price_Override_Flag        VARCHAR2,
21                      X_Not_To_Exceed_Price              NUMBER,
22                      X_List_Price_Per_Unit              NUMBER,
23                      X_Unit_Price                       NUMBER,
24                      X_Quantity                         NUMBER,
25                      X_Un_Number_Id                     NUMBER,
26                      X_Hazard_Class_Id                  NUMBER,
27                      X_Note_To_Vendor                   VARCHAR2,
28                      X_From_Header_Id                   NUMBER,
29                      X_From_Line_Id                     NUMBER,
30                      X_From_Line_Location_Id            NUMBER,  -- <SERVICES FPJ>
31                      X_Min_Order_Quantity               NUMBER,
32                      X_Max_Order_Quantity               NUMBER,
33                      X_Qty_Rcv_Tolerance                NUMBER,
34                      X_Over_Tolerance_Error_Flag        VARCHAR2,
35                      X_Market_Price                     NUMBER,
36                      X_Unordered_Flag                   VARCHAR2,
37                      X_Closed_Flag                      VARCHAR2,
38                      X_User_Hold_Flag                   VARCHAR2,
39                      X_Cancel_Flag                      VARCHAR2,
40                      X_Cancelled_By                     NUMBER,
41                      X_Cancel_Date                      DATE,
42                      X_Cancel_Reason                    VARCHAR2,
43                      X_Firm_Status_Lookup_Code          VARCHAR2,
44                      X_Firm_Date                        DATE,
45                      X_Vendor_Product_Num               VARCHAR2,
46                      X_Contract_Num                     VARCHAR2,
47                      X_Tax_Code_Id                      NUMBER,
48                      X_Type_1099                        VARCHAR2,
49                      X_Capital_Expense_Flag             VARCHAR2,
50                      X_Negotiated_By_Preparer_Flag      VARCHAR2,
51                      X_Attribute_Category               VARCHAR2,
52                      X_Attribute1                       VARCHAR2,
53                      X_Attribute2                       VARCHAR2,
54                      X_Attribute3                       VARCHAR2,
55                      X_Attribute4                       VARCHAR2,
56                      X_Attribute5                       VARCHAR2,
57                      X_Attribute6                       VARCHAR2,
58                      X_Attribute7                       VARCHAR2,
59                      X_Attribute8                       VARCHAR2,
60                      X_Attribute9                       VARCHAR2,
61                      X_Attribute10                      VARCHAR2,
62                      X_Reference_Num                    VARCHAR2,
63                      X_Attribute11                      VARCHAR2,
64                      X_Attribute12                      VARCHAR2,
65                      X_Attribute13                      VARCHAR2,
66                      X_Attribute14                      VARCHAR2,
67                      X_Attribute15                      VARCHAR2,
68                      X_Min_Release_Amount               NUMBER,
69                      X_Price_Type_Lookup_Code           VARCHAR2,
70                      X_Closed_Code                      VARCHAR2,
71                      X_Price_Break_Lookup_Code          VARCHAR2,
72                      X_Ussgl_Transaction_Code           VARCHAR2,
73                      X_Government_Context               VARCHAR2,
74                      X_Closed_Date                      DATE,
75                      X_Closed_Reason                    VARCHAR2,
76                      X_Closed_By                        NUMBER,
77                      X_Transaction_Reason_Code          VARCHAR2,
78                      X_Expiration_Date                  DATE,
79                      X_Global_Attribute_Category          VARCHAR2,
80                      X_Global_Attribute1                  VARCHAR2,
81                      X_Global_Attribute2                  VARCHAR2,
82                      X_Global_Attribute3                  VARCHAR2,
83                      X_Global_Attribute4                  VARCHAR2,
84                      X_Global_Attribute5                  VARCHAR2,
85                      X_Global_Attribute6                  VARCHAR2,
86                      X_Global_Attribute7                  VARCHAR2,
87                      X_Global_Attribute8                  VARCHAR2,
88                      X_Global_Attribute9                  VARCHAR2,
89                      X_Global_Attribute10                 VARCHAR2,
90                      X_Global_Attribute11                 VARCHAR2,
91                      X_Global_Attribute12                 VARCHAR2,
92                      X_Global_Attribute13                 VARCHAR2,
93                      X_Global_Attribute14                 VARCHAR2,
94                      X_Global_Attribute15                 VARCHAR2,
95                      X_Global_Attribute16                 VARCHAR2,
96                      X_Global_Attribute17                 VARCHAR2,
97                      X_Global_Attribute18                 VARCHAR2,
98                      X_Global_Attribute19                 VARCHAR2,
99                      X_Global_Attribute20                 VARCHAR2,
100 -- Bug# 1056597
101 -- Mahesh Chandak(GML-OPM).Use 3 new fields secondary_unit_of_measure,secondary_quantity,preferred_grade.Ignore the old fields added by bug# 1056597..
102 --Preetam Bamb (GML)     21-feb-2000  Added 5 columns to the insert_row procedure
103 --Bug# 1056597
104 -- start of 1548597
105                      X_Base_Uom                           VARCHAR2,
106                      X_Base_Qty                           NUMBER,
107                      X_Secondary_Uom                    VARCHAR2,
108                      X_Secondary_Qty                    NUMBER,
109                      X_Qc_Grade                         VARCHAR2,
110                      X_Secondary_Unit_of_measure          VARCHAR2 default null ,
111                      X_Secondary_Quantity                 NUMBER default null,
112                      X_preferred_Grade                    VARCHAR2 default null,
113 -- end of 1548597
114                      p_contract_id                    IN  NUMBER DEFAULT NULL,  -- <GC FPJ>
115                      X_job_id                           NUMBER,                 -- <SERVICES FPJ>
116                      X_contractor_first_name            VARCHAR2,               -- <SERVICES FPJ>
117                      X_contractor_last_name             VARCHAR2,               -- <SERVICES FPJ>
118                      X_assignment_start_date            DATE,                   -- <SERVICES FPJ>
119                      X_amount_db                        NUMBER,                  -- <SERVICES FPJ>
120                      -- <FPJ Advanced Price START>
121                      X_Base_Unit_Price                  NUMBER DEFAULT NULL
122                      -- <FPJ Advanced Price END>
123   ) IS
124     CURSOR C IS
125         SELECT *
126         FROM   PO_LINES
127         WHERE  rowid = X_Rowid
128         FOR UPDATE of Po_Line_Id  NOWAIT;
129     Recinfo C%ROWTYPE;
130      -- For debug purposes
131     l_api_name CONSTANT VARCHAR2(30) := 'Lock_Row';
132   BEGIN
133     IF (g_fnd_debug = 'Y') THEN
134       FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name || '.begin','lock rows');
135     END IF;
136     OPEN C;
137     FETCH C INTO Recinfo;
138     if (C%NOTFOUND) then
139       CLOSE C;
140       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
141       APP_EXCEPTION.Raise_Exception;
142     end if;
143     CLOSE C;
144     if (
145           (Recinfo.po_line_id = X_Po_Line_Id)
146            AND (Recinfo.po_header_id = X_Po_Header_Id)
147            AND (Recinfo.line_type_id = X_Line_Type_Id)
148            AND (Recinfo.line_num = X_Line_Num)
149            AND (   (Recinfo.item_id = X_Item_Id)
150                 OR (    (Recinfo.item_id IS NULL)
151                     AND (X_Item_Id IS NULL)))
152            AND (   (TRIM(Recinfo.item_revision) = TRIM(X_Item_Revision))
153                 OR (    (TRIM(Recinfo.item_revision) IS NULL)
154                     AND (TRIM(X_Item_Revision) IS NULL)))
155            AND (   (Recinfo.category_id = X_Category_Id)
156                 OR (    (Recinfo.category_id IS NULL)
157                     AND (X_Category_Id IS NULL)))
158            AND (   (TRIM(Recinfo.item_description) = TRIM(X_Item_Description))
159                 OR (    (TRIM(Recinfo.item_description) IS NULL)
160                     AND (TRIM(X_Item_Description) IS NULL)))
161            AND (   (TRIM(Recinfo.unit_meas_lookup_code) = TRIM(X_Unit_Meas_Lookup_Code))
162                 OR (    (TRIM(Recinfo.unit_meas_lookup_code) IS NULL)
163                     AND (TRIM(X_Unit_Meas_Lookup_Code) IS NULL)))
164            AND (   (Recinfo.quantity_committed = X_Quantity_Committed)
165                 OR (    (Recinfo.quantity_committed IS NULL)
166                     AND (X_Quantity_Committed IS NULL)))
167            AND (   (Recinfo.committed_amount = X_Committed_Amount)
168                 OR (    (Recinfo.committed_amount IS NULL)
169                     AND (X_Committed_Amount IS NULL)))
170            AND (   (TRIM(Recinfo.allow_price_override_flag) = TRIM(X_Allow_Price_Override_Flag))
171                 OR (    (TRIM(Recinfo.allow_price_override_flag) IS NULL)
172                     AND (TRIM(X_Allow_Price_Override_Flag) IS NULL)))
173            AND (   (Recinfo.not_to_exceed_price = X_Not_To_Exceed_Price)
174                 OR (    (Recinfo.not_to_exceed_price IS NULL)
175                     AND (X_Not_To_Exceed_Price IS NULL)))
176            AND (   (Recinfo.list_price_per_unit = X_List_Price_Per_Unit)
177                 OR (    (Recinfo.list_price_per_unit IS NULL)
178                     AND (X_List_Price_Per_Unit IS NULL)))
179            -- <FPJ Advanced Price START>
180            AND (   (Recinfo.base_unit_price = X_Base_Unit_Price)
181                 OR (X_Base_Unit_Price IS NULL))
182            -- <FPJ Advanced Price START>
183            AND (   (Recinfo.unit_price = X_Unit_Price)
184                 OR (    (Recinfo.unit_price IS NULL)
185                     AND (X_Unit_Price IS NULL)))
186            AND (   (Recinfo.quantity = X_Quantity)
187                 OR (    (Recinfo.quantity IS NULL)
188                     AND (X_Quantity IS NULL)))
189            AND (   (Recinfo.un_number_id = X_Un_Number_Id)
190                 OR (    (Recinfo.un_number_id IS NULL)
191                     AND (X_Un_Number_Id IS NULL)))
192            AND (   (Recinfo.hazard_class_id = X_Hazard_Class_Id)
193                 OR (    (Recinfo.hazard_class_id IS NULL)
194                     AND (X_Hazard_Class_Id IS NULL)))
195            AND (   (TRIM(Recinfo.note_to_vendor) = TRIM(X_Note_To_Vendor)) -- bug 10192815
196                 OR (    (TRIM(Recinfo.note_to_vendor) IS NULL)
197                     AND (TRIM(X_Note_To_Vendor) IS NULL)))
198            AND (   (Recinfo.from_header_id = X_From_Header_Id)
199                 OR (    (Recinfo.from_header_id IS NULL)
200                     AND (X_From_Header_Id IS NULL)))
201            AND (   (Recinfo.from_line_id = X_From_Line_Id)
202                 OR (    (Recinfo.from_line_id IS NULL)
203                     AND (X_From_Line_Id IS NULL)))
204            -- <SERVICES FPJ START>
205            AND (   (Recinfo.from_line_location_id = X_From_Line_Location_Id)
206                 OR (    (Recinfo.from_line_location_id IS NULL)
207                     AND (X_From_Line_Location_Id IS NULL)))
208            -- <SERVICES FPJ END>
209            AND (   (Recinfo.min_order_quantity = X_Min_Order_Quantity)
210                 OR (    (Recinfo.min_order_quantity IS NULL)
211                     AND (X_Min_Order_Quantity IS NULL)))
212            AND (   (Recinfo.max_order_quantity = X_Max_Order_Quantity)
213                 OR (    (Recinfo.max_order_quantity IS NULL)
214                     AND (X_Max_Order_Quantity IS NULL)))
215            AND (   (Recinfo.qty_rcv_tolerance = X_Qty_Rcv_Tolerance)
216                 OR (    (Recinfo.qty_rcv_tolerance IS NULL)
217                     AND (X_Qty_Rcv_Tolerance IS NULL)))
218            AND (   (TRIM(Recinfo.over_tolerance_error_flag) = TRIM(X_Over_Tolerance_Error_Flag))
219                 OR (    (TRIM(Recinfo.over_tolerance_error_flag) IS NULL)
220                     AND (TRIM(X_Over_Tolerance_Error_Flag) IS NULL)))
221            AND (   (Recinfo.market_price = X_Market_Price)
222                 OR (    (Recinfo.market_price IS NULL)
223                     AND (X_Market_Price IS NULL)))
224            AND (   (TRIM(Recinfo.unordered_flag) = TRIM(X_Unordered_Flag))
225                 OR (    (TRIM(Recinfo.unordered_flag) IS NULL)
226                     AND (TRIM(X_Unordered_Flag) IS NULL)))
227            AND (   (TRIM(Recinfo.closed_flag) = TRIM(X_Closed_Flag))
228                 OR (    (TRIM(Recinfo.closed_flag) IS NULL)
229                     AND (TRIM(X_Closed_Flag) IS NULL)))
230            AND (   (TRIM(Recinfo.user_hold_flag) = TRIM(X_User_Hold_Flag))
231                 OR (    (TRIM(Recinfo.user_hold_flag) IS NULL)
232                     AND (TRIM(X_User_Hold_Flag) IS NULL)))
233            AND (   (TRIM(Recinfo.cancel_flag) = TRIM(X_Cancel_Flag))
234                 OR (    (TRIM(Recinfo.cancel_flag) IS NULL)
235                     AND (TRIM(X_Cancel_Flag) IS NULL)))
236            AND (   (Recinfo.cancelled_by = X_Cancelled_By)
237                 OR (    (Recinfo.cancelled_by IS NULL)
238                     AND (X_Cancelled_By IS NULL)))
242            AND (   (TRIM(Recinfo.cancel_reason) = TRIM(X_Cancel_Reason))
239            AND (   (Recinfo.cancel_date = X_Cancel_Date)
240                 OR (    (Recinfo.cancel_date IS NULL)
241                     AND (X_Cancel_Date IS NULL)))
243                 OR (    (TRIM(Recinfo.cancel_reason) IS NULL)
244                     AND (TRIM(X_Cancel_Reason) IS NULL)))
245            AND (   (TRIM(Recinfo.firm_status_lookup_code) = TRIM(X_Firm_Status_Lookup_Code))
246                 OR (    (TRIM(Recinfo.firm_status_lookup_code) IS NULL)
247                     AND (TRIM(X_Firm_Status_Lookup_Code) IS NULL)))
248            AND (   (Recinfo.firm_date = X_Firm_Date)
249                 OR (    (Recinfo.firm_date IS NULL)
250                     AND (X_Firm_Date IS NULL)))
251            AND (   (TRIM(Recinfo.vendor_product_num) = TRIM(X_Vendor_Product_Num))
252                 OR (    (TRIM(Recinfo.vendor_product_num) IS NULL)
253                     AND (TRIM(X_Vendor_Product_Num) IS NULL)))
254         )  then
255 
256 	   if  (-- <GC FPJ START>
257                -- Check Contract_id instead of Contract_num
258           (  (Recinfo.contract_id  = p_contract_id)
259                 OR (    (Recinfo.contract_id IS NULL)
260                     AND (p_contract_id IS NULL)))
261                -- <GC FPJ END>
262            AND (   (TRIM(Recinfo.type_1099) = TRIM(X_Type_1099))
263                 OR (    (TRIM(Recinfo.type_1099) IS NULL)
264                     AND (TRIM(X_Type_1099) IS NULL)))
265            AND (   (TRIM(Recinfo.capital_expense_flag) = TRIM(X_Capital_Expense_Flag))
266                 OR (    (TRIM(Recinfo.capital_expense_flag) IS NULL)
267                     AND (TRIM(X_Capital_Expense_Flag) IS NULL)))
268            AND (   (TRIM(Recinfo.negotiated_by_preparer_flag) = TRIM(X_Negotiated_By_Preparer_Flag))
269                 OR (    (TRIM(Recinfo.negotiated_by_preparer_flag) IS NULL)
270                     AND (TRIM(X_Negotiated_By_Preparer_Flag) IS NULL)))
271            AND (   (TRIM(Recinfo.attribute_category) = TRIM(X_Attribute_Category))
272                 OR (    (TRIM(Recinfo.attribute_category) IS NULL)
273                     AND (TRIM(X_Attribute_Category) IS NULL)))
274            AND (   (TRIM(Recinfo.attribute1) = TRIM(X_Attribute1))
275                 OR (    (TRIM(Recinfo.attribute1) IS NULL)
276                     AND (TRIM(X_Attribute1) IS NULL)))
277            AND (   (TRIM(Recinfo.attribute2) = TRIM(X_Attribute2))
278                 OR (    (TRIM(Recinfo.attribute2) IS NULL)
279                     AND (TRIM(X_Attribute2) IS NULL)))
280            AND (   (TRIM(Recinfo.attribute3) = TRIM(X_Attribute3))
281                 OR (    (TRIM(Recinfo.attribute3) IS NULL)
282                     AND (TRIM(X_Attribute3) IS NULL)))
283            AND (   (TRIM(Recinfo.attribute4) = TRIM(X_Attribute4))
284                 OR (    (TRIM(Recinfo.attribute4) IS NULL)
285                     AND (TRIM(X_Attribute4) IS NULL)))
286            AND (   (TRIM(Recinfo.attribute5) = TRIM(X_Attribute5))
287                 OR (    (TRIM(Recinfo.attribute5) IS NULL)
288                     AND (TRIM(X_Attribute5) IS NULL)))
289            AND (   (TRIM(Recinfo.attribute6) = TRIM(X_Attribute6))
290                 OR (    (TRIM(Recinfo.attribute6) IS NULL)
291                     AND (TRIM(X_Attribute6) IS NULL)))
292            AND (   (TRIM(Recinfo.attribute7) = TRIM(X_Attribute7))
293                 OR (    (TRIM(Recinfo.attribute7) IS NULL)
294                     AND (TRIM(X_Attribute7) IS NULL)))
295            AND (   (TRIM(Recinfo.attribute8) = TRIM(X_Attribute8))
296                 OR (    (TRIM(Recinfo.attribute8) IS NULL)
297                     AND (TRIM(X_Attribute8) IS NULL)))
298            AND (   (TRIM(Recinfo.attribute9) = TRIM(X_Attribute9))
299                 OR (    (TRIM(Recinfo.attribute9) IS NULL)
300                     AND (TRIM(X_Attribute9) IS NULL)))
301            AND (   (TRIM(Recinfo.attribute10) = TRIM(X_Attribute10))
302                 OR (    (TRIM(Recinfo.attribute10) IS NULL)
303                     AND (TRIM(X_Attribute10) IS NULL)))
304            AND (   (TRIM(Recinfo.reference_num) = TRIM(X_Reference_Num))
305                 OR (    (TRIM(Recinfo.reference_num) IS NULL)
306                     AND (TRIM(X_Reference_Num) IS NULL)))
307            AND (   (TRIM(Recinfo.attribute11) = TRIM(X_Attribute11))
308                 OR (    (TRIM(Recinfo.attribute11) IS NULL)
309                     AND (TRIM(X_Attribute11) IS NULL)))
310            AND (   (TRIM(Recinfo.attribute12) = TRIM(X_Attribute12))
311                 OR (    (TRIM(Recinfo.attribute12) IS NULL)
312                     AND (TRIM(X_Attribute12) IS NULL)))
313            AND (   (TRIM(Recinfo.attribute13) = TRIM(X_Attribute13))
314                 OR (    (TRIM(Recinfo.attribute13) IS NULL)
315                     AND (TRIM(X_Attribute13) IS NULL)))
316            AND (   (TRIM(Recinfo.attribute14) = TRIM(X_Attribute14))
317                 OR (    (TRIM(Recinfo.attribute14) IS NULL)
318                     AND (TRIM(X_Attribute14) IS NULL)))
319            AND (   (TRIM(Recinfo.attribute15) = TRIM(X_Attribute15))
320                 OR (    (TRIM(Recinfo.attribute15) IS NULL)
321                     AND (TRIM(X_Attribute15) IS NULL)))
322            AND (   (Recinfo.min_release_amount = X_Min_Release_Amount)
323                 OR (    (Recinfo.min_release_amount IS NULL)
324                     AND (X_Min_Release_Amount IS NULL)))
325            AND (   (TRIM(Recinfo.price_type_lookup_code) = TRIM(X_Price_Type_Lookup_Code))
326                 OR (    (TRIM(Recinfo.price_type_lookup_code) IS NULL)
327                     AND (TRIM(X_Price_Type_Lookup_Code) IS NULL)))
328            AND (   (TRIM(Recinfo.closed_code) = TRIM(X_Closed_Code))
329                 OR (    (TRIM(Recinfo.closed_code) IS NULL)
330                     AND (TRIM(X_Closed_Code) IS NULL)))
331            AND (   (TRIM(Recinfo.price_break_lookup_code) = TRIM(X_Price_Break_Lookup_Code))
332                 OR (    (TRIM(Recinfo.price_break_lookup_code) IS NULL)
336                     AND (TRIM(X_Government_Context) IS NULL)))
333                     AND (TRIM(X_Price_Break_Lookup_Code) IS NULL)))
334            AND (   (TRIM(Recinfo.government_context) = TRIM(X_Government_Context))
335                 OR (    (TRIM(Recinfo.government_context) IS NULL)
337            AND (   (Recinfo.closed_date = X_Closed_Date)
338                 OR (    (Recinfo.closed_date IS NULL)
339                     AND (X_Closed_Date IS NULL)))
340            AND (   (TRIM(Recinfo.closed_reason) = TRIM(X_Closed_Reason))
341                 OR (    (TRIM(Recinfo.closed_reason) IS NULL)
342                     AND (TRIM(X_Closed_Reason) IS NULL)))
343            AND (   (Recinfo.closed_by = X_Closed_By)
344                 OR (    (Recinfo.closed_by IS NULL)
345                     AND (X_Closed_By IS NULL)))
346            AND (   (TRIM(Recinfo.transaction_reason_code) = TRIM(X_Transaction_Reason_Code))
347                 OR (    (TRIM(Recinfo.transaction_reason_code) IS NULL)
348                     AND (TRIM(X_Transaction_Reason_Code) IS NULL)))
349            AND (   (Recinfo.Expiration_Date = X_Expiration_Date)
350                 OR (    (Recinfo.Expiration_Date IS NULL)
351                     AND (X_Expiration_Date IS NULL)))
352 --Bug# 1056597 Preetam Bamb (GML)     21-feb-2000  Added 5 columns to the insert_row procedure
353 -- start of 1548597 comment code added by bug 1056597 and add code to include secondary_unit_of_measure,secondary_quantity and preferred_grade fields
354 /**
355            AND (   (TRIM(Recinfo.Base_uom) = TRIM(X_Base_uom))
356                 OR (    (TRIM(Recinfo.Base_uom) IS NULL)
357                     AND (TRIM(X_Base_uom) IS NULL)))
358            AND (   (TRIM(Recinfo.Base_qty) = TRIM(X_Base_qty))
359                 OR (    (TRIM(Recinfo.Base_qty) IS NULL)
360                     AND (TRIM(X_Base_qty) IS NULL)))
361            AND (   (TRIM(Recinfo.Secondary_uom) = TRIM(X_Secondary_uom))
362                 OR (    (TRIM(Recinfo.Secondary_uom) IS NULL)
363                     AND (TRIM(X_Secondary_uom) IS NULL)))
364            AND (   (Recinfo.Secondary_qty = X_Secondary_qty)
365                 OR (    (Recinfo.Secondary_qty IS NULL)
366                     AND (X_Secondary_qty IS NULL)))
367            AND (   (TRIM(Recinfo.qc_grade) = TRIM(X_qc_grade))
368                 OR (    (TRIM(Recinfo.qc_grade) IS NULL)
369                     AND (TRIM(X_qc_grade) IS NULL)))
370 **/
371 --End Bug# 1056597
372            AND (   (TRIM(Recinfo.Secondary_unit_of_measure) = TRIM(X_Secondary_Unit_Of_Measure))
373                 OR (    (TRIM(Recinfo.Secondary_unit_of_measure) IS NULL)
374                     AND (TRIM(X_Secondary_Unit_Of_Measure) IS NULL)))
375            AND (   (Recinfo.Secondary_quantity = X_Secondary_Quantity)
376                 OR (    (Recinfo.Secondary_quantity IS NULL)
377                     AND (X_Secondary_Quantity IS NULL)))
378            AND (   (TRIM(Recinfo.preferred_grade) = TRIM(X_preferred_grade))
379                 OR (    (TRIM(Recinfo.preferred_grade) IS NULL)
380                     AND (TRIM(X_preferred_grade) IS NULL)))
381 --End Bug# 1548597
382            AND (   (TRIM(Recinfo.global_attribute_category) = TRIM(X_Global_Attribute_Category))
383                 OR (    (TRIM(Recinfo.global_attribute_category) IS NULL)
384                     AND (TRIM(X_Global_Attribute_Category) IS NULL)))
385            AND (   (TRIM(Recinfo.global_attribute1) = TRIM(X_Global_Attribute1))
386                 OR (    (TRIM(Recinfo.global_attribute1) IS NULL)
387                     AND (TRIM(X_Global_Attribute1) IS NULL)))
388            AND (   (TRIM(Recinfo.global_attribute2) = TRIM(X_Global_Attribute2))
389                 OR (    (TRIM(Recinfo.global_attribute2) IS NULL)
390                     AND (TRIM(X_Global_Attribute2) IS NULL)))
391            AND (   (TRIM(Recinfo.global_attribute3) = TRIM(X_Global_Attribute3))
392                 OR (    (TRIM(Recinfo.global_attribute3) IS NULL)
393                     AND (TRIM(X_Global_Attribute3) IS NULL)))
394            AND (   (TRIM(Recinfo.global_attribute4) = TRIM(X_Global_Attribute4))
395                 OR (    (TRIM(Recinfo.global_attribute4) IS NULL)
396                     AND (TRIM(X_Global_Attribute4) IS NULL)))
397            AND (   (TRIM(Recinfo.global_attribute5) = TRIM(X_Global_Attribute5))
398                 OR (    (TRIM(Recinfo.global_attribute5) IS NULL)
399                     AND (TRIM(X_Global_Attribute5) IS NULL)))
400            AND (   (TRIM(Recinfo.global_attribute6) = TRIM(X_Global_Attribute6))
401                 OR (    (TRIM(Recinfo.global_attribute6) IS NULL)
402                     AND (TRIM(X_Global_Attribute6) IS NULL)))
403            AND (   (TRIM(Recinfo.global_attribute7) = TRIM(X_Global_Attribute7))
404                 OR (    (TRIM(Recinfo.global_attribute7) IS NULL)
405                     AND (TRIM(X_Global_Attribute7) IS NULL)))
406            AND (   (TRIM(Recinfo.global_attribute8) = TRIM(X_Global_Attribute8))
407                 OR (    (TRIM(Recinfo.global_attribute8) IS NULL)
408                     AND (TRIM(X_Global_Attribute8) IS NULL)))
409            AND (   (TRIM(Recinfo.global_attribute9) = TRIM(X_Global_Attribute9))
410                 OR (    (TRIM(Recinfo.global_attribute9) IS NULL)
411                     AND (TRIM(X_Global_Attribute9) IS NULL)))
412            AND (   (TRIM(Recinfo.global_attribute10) = TRIM(X_Global_Attribute10))
413                 OR (    (TRIM(Recinfo.global_attribute10) IS NULL)
414                     AND (TRIM(X_Global_Attribute10) IS NULL)))
415            AND (   (TRIM(Recinfo.global_attribute11) = TRIM(X_Global_Attribute11))
416                 OR (    (TRIM(Recinfo.global_attribute11) IS NULL)
417                     AND (TRIM(X_Global_Attribute11) IS NULL)))
418            AND (   (TRIM(Recinfo.global_attribute12) = TRIM(X_Global_Attribute12))
419                 OR (    (TRIM(Recinfo.global_attribute12) IS NULL)
420                     AND (TRIM(X_Global_Attribute12) IS NULL)))
421            AND (   (TRIM(Recinfo.global_attribute13) = TRIM(X_Global_Attribute13))
422                 OR (    (TRIM(Recinfo.global_attribute13) IS NULL)
426                     AND (TRIM(X_Global_Attribute14) IS NULL)))
423                     AND (TRIM(X_Global_Attribute13) IS NULL)))
424            AND (   (TRIM(Recinfo.global_attribute14) = TRIM(X_Global_Attribute14))
425                 OR (    (TRIM(Recinfo.global_attribute14) IS NULL)
427            AND (   (TRIM(Recinfo.global_attribute15) = TRIM(X_Global_Attribute15))
428                 OR (    (TRIM(Recinfo.global_attribute15) IS NULL)
429                     AND (TRIM(X_Global_Attribute15) IS NULL)))
430            AND (   (TRIM(Recinfo.global_attribute16) = TRIM(X_Global_Attribute16))
431                 OR (    (TRIM(Recinfo.global_attribute16) IS NULL)
432                     AND (TRIM(X_Global_Attribute16) IS NULL)))
433            AND (   (TRIM(Recinfo.global_attribute17) = TRIM(X_Global_Attribute17))
434                 OR (    (TRIM(Recinfo.global_attribute17) IS NULL)
435                     AND (TRIM(X_Global_Attribute17) IS NULL)))
436            AND (   (TRIM(Recinfo.global_attribute18) = TRIM(X_Global_Attribute18))
437                 OR (    (TRIM(Recinfo.global_attribute18) IS NULL)
438                     AND (TRIM(X_Global_Attribute18) IS NULL)))
439            AND (   (TRIM(Recinfo.global_attribute19) = TRIM(X_Global_Attribute19))
440                 OR (    (TRIM(Recinfo.global_attribute19) IS NULL)
441                     AND (TRIM(X_Global_Attribute19) IS NULL)))
442            AND (   (TRIM(Recinfo.global_attribute20) = TRIM(X_Global_Attribute20))
443                 OR (    (TRIM(Recinfo.global_attribute20) IS NULL)
444                     AND (TRIM(X_Global_Attribute20) IS NULL)))
445            -- <SERVICES FPJ START>
446            AND (   (Recinfo.job_id = X_job_id)
447                 OR (    (Recinfo.job_id IS NULL)
448                     AND (X_job_id IS NULL)))
449            AND (   (TRIM(Recinfo.contractor_first_name) = TRIM(X_contractor_first_name))
450                 OR (    (TRIM(Recinfo.contractor_first_name) IS NULL)
451                     AND (TRIM(X_contractor_first_name) IS NULL)))
452            AND (   (TRIM(Recinfo.contractor_last_name) = TRIM(X_contractor_last_name))
453                 OR (    (TRIM(Recinfo.contractor_last_name) IS NULL)
454                     AND (TRIM(X_contractor_last_name) IS NULL)))
455            AND (   (Recinfo.start_date = X_assignment_start_date)
456                 OR (    (Recinfo.start_date IS NULL)
457                     AND (X_assignment_start_date IS NULL)))
458            AND (   (Recinfo.amount = X_amount_db)
459                 OR (    (Recinfo.amount IS NULL)
460                     AND (X_amount_db IS NULL)))
461            -- <SERVICES FPJ END>
462             ) then
463 
464       IF (g_fnd_debug = 'Y') THEN
465         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name || '.end','no lock error');
466       END IF;
467 
468       return;
469     else
470     --only display discrepancy when fnd debug is enabled
471     IF (g_fnd_debug = 'Y') THEN
472 
473       --Included for Debugging Purposes
474         IF (NVL(p_contract_id,-999) <> NVL(Recinfo.contract_id,-999)) THEN
475           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form contract_id '||p_contract_id ||' Database  contract_id '||Recinfo.contract_id);
476         END IF;
477         IF (NVL(TRIM(X_type_1099),'-999') <> NVL(TRIM(Recinfo.type_1099),'-999') ) THEN
478           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form type_1099 '||X_type_1099 ||' Database  type_1099 '||Recinfo.type_1099);
479         END IF;
480         IF (NVL(TRIM(X_capital_expense_flag),'-999') <> NVL(TRIM(Recinfo.capital_expense_flag),'-999')) THEN
481           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form capital_expense_flag '||X_capital_expense_flag ||' Database  capital_expense_flag '||Recinfo.capital_expense_flag);
482         END IF;
483         IF (NVL(TRIM(X_negotiated_by_preparer_flag),'-999') <> NVL(TRIM(Recinfo.negotiated_by_preparer_flag),'-999') ) THEN
484           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form negotiated_by_preparer_flag '||X_negotiated_by_preparer_flag ||' Database  negotiated_by_preparer_flag '||Recinfo.negotiated_by_preparer_flag);
485         END IF;
486         IF (NVL(TRIM(X_Attribute_Category),'-999') <> NVL( TRIM(Recinfo.Attribute_Category),'-999')) THEN
487           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute_Category '||X_Attribute_Category ||' Database  Attribute_Category '||Recinfo.Attribute_Category);
488         END IF;
489         IF (NVL(TRIM(X_Attribute1),'-999') <> NVL( TRIM(Recinfo.Attribute1),'-999')) THEN
490           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute1 '||X_Attribute1 ||' Database  Attribute1 '||Recinfo.Attribute1);
491         END IF;
492         IF (NVL(TRIM(X_Attribute2),'-999') <> NVL( TRIM(Recinfo.Attribute2),'-999')) THEN
493           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute2 '||X_Attribute2 ||' Database  Attribute2 '||Recinfo.Attribute2);
494         END IF;
495         IF (NVL(TRIM(X_Attribute3),'-999') <> NVL( TRIM(Recinfo.Attribute3),'-999')) THEN
496           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute3 '||X_Attribute3 ||' Database  Attribute3 '||Recinfo.Attribute3);
497         END IF;
498         IF (NVL(TRIM(X_Attribute4),'-999') <> NVL( TRIM(Recinfo.Attribute4),'-999')) THEN
499           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute4 '||X_Attribute4 ||' Database  Attribute4 '||Recinfo.Attribute4);
500         END IF;
501         IF (NVL(TRIM(X_Attribute5),'-999') <> NVL( TRIM(Recinfo.Attribute5),'-999')) THEN
502           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute5 '||X_Attribute5 ||' Database  Attribute5 '||Recinfo.Attribute5);
503         END IF;
504         IF (NVL(TRIM(X_Attribute6),'-999') <> NVL( TRIM(Recinfo.Attribute6),'-999')) THEN
505           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute6 '||X_Attribute6 ||' Database  Attribute6 '||Recinfo.Attribute6);
506         END IF;
510         IF (NVL(TRIM(X_Attribute8),'-999') <> NVL( TRIM(Recinfo.Attribute8),'-999')) THEN
507         IF (NVL(TRIM(X_Attribute7),'-999') <> NVL( TRIM(Recinfo.Attribute7),'-999')) THEN
508           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute7 '||X_Attribute7 ||' Database  Attribute7 '||Recinfo.Attribute7);
509         END IF;
511           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute8 '||X_Attribute8 ||' Database  Attribute8 '||Recinfo.Attribute8);
512         END IF;
513         IF (NVL(TRIM(X_Attribute9),'-999') <> NVL( TRIM(Recinfo.Attribute9),'-999')) THEN
514           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute9 '||X_Attribute9 ||' Database  Attribute9 '||Recinfo.Attribute9);
515         END IF;
516         IF (NVL(TRIM(X_Attribute10),'-999') <> NVL( TRIM(Recinfo.Attribute10),'-999')) THEN
517           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute10 '||X_Attribute10 ||' Database  Attribute10 '||Recinfo.Attribute10);
518         END IF;
519         IF (NVL(TRIM(X_Attribute11),'-999') <> NVL( TRIM(Recinfo.Attribute11),'-999')) THEN
520           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute11 '||X_Attribute11 ||' Database  Attribute11 '||Recinfo.Attribute11);
521         END IF;
522         IF (NVL(TRIM(X_Attribute12),'-999') <> NVL( TRIM(Recinfo.Attribute12),'-999')) THEN
523           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute12 '||X_Attribute12 ||' Database  Attribute12 '||Recinfo.Attribute12);
524         END IF;
525         IF (NVL(TRIM(X_Attribute13),'-999') <> NVL( TRIM(Recinfo.Attribute13),'-999')) THEN
526           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute13 '||X_Attribute13 ||' Database  Attribute13 '||Recinfo.Attribute13);
527         END IF;
528         IF (NVL(TRIM(X_Attribute14),'-999') <> NVL( TRIM(Recinfo.Attribute14),'-999')) THEN
529           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute14 '||X_Attribute14 ||' Database  Attribute14 '||Recinfo.Attribute14);
530         END IF;
531         IF (NVL(TRIM(X_Attribute15),'-999') <> NVL( TRIM(Recinfo.Attribute15),'-999')) THEN
532           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Attribute15 '||X_Attribute15 ||' Database  Attribute15 '||Recinfo.Attribute15);
533         END IF;
534         IF (NVL(X_min_release_amount,-999) <> NVL(Recinfo.min_release_amount,-999)) THEN
535           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form min_release_amount '||X_min_release_amount ||' Database  min_release_amount '||Recinfo.min_release_amount);
536         END IF;
537         IF (NVL(TRIM(X_price_type_lookup_code),'-999') <> NVL(TRIM(Recinfo.price_type_lookup_code),'-999')) THEN
538           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form price_type_lookup_code '||X_price_type_lookup_code ||' Database  price_type_lookup_code '||Recinfo.price_type_lookup_code);
539         END IF;
540         IF (NVL(TRIM(X_closed_code),'-999') <> NVL(TRIM(Recinfo.closed_code),'-999')) THEN
541           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form closed_code '||X_closed_code ||' Database  closed_code '||Recinfo.closed_code);
542         END IF;
543         IF (NVL(TRIM(X_price_break_lookup_code),'-999') <> NVL(TRIM(Recinfo.price_break_lookup_code),'-999')) THEN
544           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form price_break_lookup_code '||X_price_break_lookup_code ||' Database  price_break_lookup_code '||Recinfo.price_break_lookup_code);
545         END IF;
546         IF (NVL(TRIM(X_government_context),'-999') <> NVL(TRIM(Recinfo.government_context),'-999')) THEN
547           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form government_context '||X_government_context ||' Database  government_context '||Recinfo.government_context);
548         END IF;
549         IF (X_closed_date <> Recinfo.closed_date) THEN
550           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form closed_date '||X_closed_date ||' Database  closed_date '||Recinfo.closed_date);
551         END IF;
552         IF (NVL(X_closed_by,'-999') <> NVL(Recinfo.closed_by ,'-999')) THEN
553           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form closed_by '||X_closed_by ||' Database  closed_by '||Recinfo.closed_by);
554         END IF;
555         IF (NVL(TRIM(X_closed_reason),'-999') <> NVL(TRIM(Recinfo.closed_reason),'-999')) THEN
556           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form closed_reason '||X_closed_reason ||' Database  closed_reason '||Recinfo.closed_reason);
557         END IF;
558         IF (NVL(TRIM(X_transaction_reason_code),'-999') <> NVL(TRIM(Recinfo.transaction_reason_code),'-999')) THEN
559           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form transaction_reason_code '||X_transaction_reason_code ||' Database  transaction_reason_code '||Recinfo.transaction_reason_code);
560         END IF;
561         IF (X_Expiration_Date <> Recinfo.Expiration_Date ) THEN
562           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Expiration_Date '||X_Expiration_Date ||' Database  Expiration_Date '||Recinfo.Expiration_Date);
563         END IF;
564         IF (NVL(TRIM(X_Secondary_unit_of_measure),'-999') <> NVL(TRIM(Recinfo.Secondary_unit_of_measure),'-999') ) THEN
565           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Secondary_unit_of_measure '||X_Secondary_unit_of_measure ||' Database  Secondary_unit_of_measure '||Recinfo.Secondary_unit_of_measure);
566         END IF;
567         IF (NVL(X_Secondary_quantity,-999) <> NVL(Recinfo.Secondary_quantity,-999)) THEN
568           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Secondary_quantity '||X_Secondary_quantity||' Database  Secondary_quantity '||Recinfo.Secondary_quantity);
569         END IF;
570         IF (NVL(TRIM(X_preferred_grade),'-999') <> NVL( TRIM(Recinfo.preferred_grade),'-999')) THEN
571           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form preferred_grade '||X_preferred_grade ||' Database  preferred_grade '||Recinfo.preferred_grade);
572         END IF;
576         IF (NVL(TRIM(X_global_attribute1),'-999') <> NVL( TRIM(Recinfo.global_attribute1),'-999')) THEN
573         IF (NVL(TRIM(X_global_Attribute_Category),'-999') <> NVL( TRIM(Recinfo.global_attribute_Category),'-999')) THEN
574           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute_Category '||X_global_attribute_Category ||' Database  global_attribute_Category '||Recinfo.global_attribute_Category);
575         END IF;
577           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute1 '||X_global_attribute1 ||' Database  global_attribute1 '||Recinfo.global_attribute1);
578         END IF;
579         IF (NVL(TRIM(X_global_attribute2),'-999') <> NVL( TRIM(Recinfo.global_attribute2),'-999')) THEN
580           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute2 '||X_global_attribute2 ||' Database  global_attribute2 '||Recinfo.global_attribute2);
581         END IF;
582         IF (NVL(TRIM(X_global_attribute3),'-999') <> NVL( TRIM(Recinfo.global_attribute3),'-999')) THEN
583           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute3 '||X_global_attribute3 ||' Database  global_attribute3 '||Recinfo.global_attribute3);
584         END IF;
585         IF (NVL(TRIM(X_global_attribute4),'-999') <> NVL( TRIM(Recinfo.global_attribute4),'-999')) THEN
586           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute4 '||X_global_attribute4 ||' Database  global_attribute4 '||Recinfo.global_attribute4);
587         END IF;
588         IF (NVL(TRIM(X_global_attribute5),'-999') <> NVL( TRIM(Recinfo.global_attribute5),'-999')) THEN
589           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute5 '||X_global_attribute5 ||' Database  global_attribute5 '||Recinfo.global_attribute5);
590         END IF;
591         IF (NVL(TRIM(X_global_attribute6),'-999') <> NVL( TRIM(Recinfo.global_attribute6),'-999')) THEN
592           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute6 '||X_global_attribute6 ||' Database  global_attribute6 '||Recinfo.global_attribute6);
593         END IF;
594         IF (NVL(TRIM(X_global_attribute7),'-999') <> NVL( TRIM(Recinfo.global_attribute7),'-999')) THEN
595           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute7 '||X_global_attribute7 ||' Database  global_attribute7 '||Recinfo.global_attribute7);
596         END IF;
597         IF (NVL(TRIM(X_global_attribute8),'-999') <> NVL( TRIM(Recinfo.global_attribute8),'-999')) THEN
598           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute8 '||X_global_attribute8 ||' Database  global_attribute8 '||Recinfo.global_attribute8);
599         END IF;
600         IF (NVL(TRIM(X_global_attribute9),'-999') <> NVL( TRIM(Recinfo.global_attribute9),'-999')) THEN
601           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute9 '||X_global_attribute9 ||' Database  global_attribute9 '||Recinfo.global_attribute9);
602         END IF;
603         IF (NVL(TRIM(X_global_attribute10),'-999') <> NVL( TRIM(Recinfo.global_attribute10),'-999')) THEN
604           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute10 '||X_global_attribute10 ||' Database  global_attribute10 '||Recinfo.global_attribute10);
605         END IF;
606         IF (NVL(TRIM(X_global_attribute11),'-999') <> NVL( TRIM(Recinfo.global_attribute11),'-999')) THEN
607           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute11 '||X_global_attribute11 ||' Database  global_attribute11 '||Recinfo.global_attribute11);
608         END IF;
609         IF (NVL(TRIM(X_global_attribute12),'-999') <> NVL( TRIM(Recinfo.global_attribute12),'-999')) THEN
610           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute12 '||X_global_attribute12 ||' Database  global_attribute12 '||Recinfo.global_attribute12);
611         END IF;
612         IF (NVL(TRIM(X_global_attribute13),'-999') <> NVL( TRIM(Recinfo.global_attribute13),'-999')) THEN
613           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute13 '||X_global_attribute13 ||' Database  global_attribute13 '||Recinfo.global_attribute13);
614         END IF;
615         IF (NVL(TRIM(X_global_attribute14),'-999') <> NVL( TRIM(Recinfo.global_attribute14),'-999')) THEN
616           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute14 '||X_global_attribute14 ||' Database  global_attribute14 '||Recinfo.global_attribute14);
617         END IF;
618         IF (NVL(TRIM(X_global_attribute15),'-999') <> NVL( TRIM(Recinfo.global_attribute15),'-999')) THEN
619           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute15 '||X_global_attribute15 ||' Database  global_attribute15 '||Recinfo.global_attribute15);
620         END IF;
621         IF (NVL(TRIM(X_global_attribute16),'-999') <> NVL( TRIM(Recinfo.global_attribute16),'-999')) THEN
622           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute16 '||X_global_attribute16 ||' Database  global_attribute16 '||Recinfo.global_attribute16);
623         END IF;
624         IF (NVL(TRIM(X_global_attribute17),'-999') <> NVL( TRIM(Recinfo.global_attribute17),'-999')) THEN
625           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute17 '||X_global_attribute17 ||' Database  global_attribute17 '||Recinfo.global_attribute17);
626         END IF;
627         IF (NVL(TRIM(X_global_attribute18),'-999') <> NVL( TRIM(Recinfo.global_attribute18),'-999')) THEN
628           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute18 '||X_global_attribute18 ||' Database  global_attribute18 '||Recinfo.global_attribute18);
629         END IF;
630         IF (NVL(TRIM(X_global_attribute19),'-999') <> NVL( TRIM(Recinfo.global_attribute19),'-999')) THEN
631           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute19 '||X_global_attribute19 ||' Database  global_attribute19 '||Recinfo.global_attribute19);
632         END IF;
633         IF (NVL(TRIM(X_global_attribute20),'-999') <> NVL( TRIM(Recinfo.global_attribute20),'-999')) THEN
637           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form job_id '||X_job_id ||' Database  job_id '||Recinfo.job_id);
634           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form global_attribute20 '||X_global_attribute20 ||' Database  global_attribute20 '||Recinfo.global_attribute20);
635         END IF;
636         IF (NVL(X_job_id,'-999') <> NVL( Recinfo.job_id,'-999')) THEN
638         END IF;
639         IF (NVL(TRIM(X_contractor_first_name),'-999') <> NVL( TRIM(Recinfo.contractor_first_name),'-999')) THEN
640           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form contractor_first_name '||X_contractor_first_name ||' Database  contractor_first_name '||Recinfo.contractor_first_name);
641         END IF;
642         IF (NVL(TRIM(X_contractor_last_name),'-999') <> NVL( TRIM(Recinfo.contractor_last_name),'-999')) THEN
643           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form contractor_last_name '||X_contractor_last_name ||' Database  contractor_last_name '||Recinfo.contractor_last_name);
644         END IF;
645         IF ( X_assignment_start_date <> Recinfo.start_date) THEN
646           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form start_date '||X_assignment_start_date ||' Database  start_date '||Recinfo.start_date);
647         END IF;
648         IF (NVL(X_amount_db,-999) <> NVL( Recinfo.amount,-999)) THEN
649           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form amount '||X_amount_db ||' Database  X_amount_db '||Recinfo.amount);
650         END IF;
651         IF (NVL(TRIM(X_Reference_Num),'-999') <> NVL( TRIM(Recinfo.reference_num),'-999')) THEN
652           FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form reference_num '||X_Reference_Num ||' Database  reference_num '||Recinfo.reference_num);
653         END IF;
654         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name || '.end','Failed second if statement when comparing fields');
655       END IF; --end g_fnd_debug = 'Y'
656       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
657       APP_EXCEPTION.RAISE_EXCEPTION;
658     END IF;
659   ELSE
660     --only display discrepancy when fnd debug is enabled
661     IF (g_fnd_debug = 'Y') THEN
662       --Included for Debugging Purposes
663       IF (NVL(X_Po_Header_Id ,-999) <> NVL(Recinfo.Po_Header_Id,-999) ) THEN
664         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Po_Header_Id '||X_Po_Header_Id ||' Database  Po_Header_Id '||Recinfo.Po_Header_Id);
665       END IF;
666       IF (NVL(X_Po_Line_Id,-999) <> NVL(Recinfo.Po_Line_Id,-999)) THEN
667         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Po_Line_Id '||X_Po_Line_Id||' Database  Po_Line_Id '||Recinfo.Po_Line_Id);
668       END IF;
669       IF (NVL(X_line_type_id,-999) <> NVL(Recinfo.line_type_id,-999)) THEN
670         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form line_type_id '||X_line_type_id||' Database  line_type_id '||Recinfo.line_type_id);
671       END IF;
672       IF (NVL(X_Line_Num ,-999) <> NVL( Recinfo.Line_Num,-999)) THEN
673         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Line_Num '||X_Line_Num ||' Database  Line_Num '||Recinfo.Line_Num);
674       END IF;
675       IF (NVL(X_item_id ,-999) <> NVL( Recinfo.item_id,-999)) THEN
676         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form item_id '||X_item_id ||' Database  item_id '||Recinfo.item_id);
677       END IF;
678       IF (NVL(TRIM(X_item_revision),'-999') <> NVL( TRIM(Recinfo.item_revision),'-999')) THEN
679         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form item_revision '||X_item_revision ||' Database  item_revision '||Recinfo.item_revision);
680       END IF;
681       IF (NVL(X_category_id,-999) <> NVL( Recinfo.category_id,-999)) THEN
682         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form category_id '||X_category_id ||' Database  category_id '||Recinfo.category_id);
683       END IF;
684       IF (NVL(TRIM(X_item_description) ,'-999') <> NVL( TRIM(Recinfo.item_description) ,'-999')) THEN
685         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form item_description '||X_item_description ||' Database  item_description '||Recinfo.item_description);
686       END IF;
687       IF (NVL(TRIM(X_unit_meas_lookup_code),'-999') <> NVL(TRIM(Recinfo.unit_meas_lookup_code),'-999')) THEN
688         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form unit_meas_lookup_code '||X_unit_meas_lookup_code ||' Database  unit_meas_lookup_code '||Recinfo.unit_meas_lookup_code);
689       END IF;
690       IF (NVL(X_quantity_committed,-999) <> NVL( Recinfo.quantity_committed,-999)) THEN
691         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form quantity_committed '||X_quantity_committed ||' Database  quantity_committed '||Recinfo.quantity_committed);
692       END IF;
693       IF (NVL(X_committed_amount,-999) <> NVL( Recinfo.committed_amount,-999)) THEN
694         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form committed_amount '||X_committed_amount ||' Database  committed_amount '||Recinfo.committed_amount);
695       END IF;
696       IF (NVL(TRIM(X_allow_price_override_flag),'-999') <> NVL( TRIM(Recinfo.allow_price_override_flag),'-999')) THEN
697         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form allow_price_override_flag '||X_allow_price_override_flag ||' Database  allow_price_override_flag '||Recinfo.allow_price_override_flag);
698       END IF;
699       IF (NVL(X_not_to_exceed_price,-999) <> NVL( Recinfo.not_to_exceed_price ,-999)) THEN
700         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form not_to_exceed_price '||X_not_to_exceed_price ||' Database  not_to_exceed_price '||Recinfo.not_to_exceed_price);
701       END IF;
702       IF (NVL(X_list_price_per_unit,-999) <> NVL( Recinfo.list_price_per_unit,-999)) THEN
703         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form list_price_per_unit '||X_list_price_per_unit ||' Database  list_price_per_unit '||Recinfo.list_price_per_unit);
704       END IF;
705       IF (NVL(X_base_unit_price,-999) <> NVL(Recinfo.base_unit_price,-999) ) THEN
709         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form Rate '||X_unit_price ||' Database  unit_price '||Recinfo.unit_price);
706         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form base_unit_price '||X_base_unit_price ||' Database  base_unit_price '||Recinfo.base_unit_price);
707       END IF;
708       IF (NVL(X_unit_price,-999) <> NVL(Recinfo.unit_price,-999)) THEN
710       END IF;
711       IF (NVL(X_quantity,-999) <> NVL(Recinfo.quantity,-999)) THEN
712         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form quantity '||X_quantity ||' Database  quantity '||Recinfo.quantity);
713       END IF;
714       IF (NVL(X_un_number_id,-999) <> NVL(Recinfo.un_number_id,-999)) THEN
715         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form un_number_id '||X_un_number_id ||' Database  un_number_id '||Recinfo.un_number_id);
716       END IF;
717       IF (NVL(X_hazard_class_id,-999) <> NVL(Recinfo.hazard_class_id ,-999)) THEN
718         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form hazard_class_id '||X_hazard_class_id ||' Database  hazard_class_id '||Recinfo.hazard_class_id);
719       END IF;
720       IF (NVL(TRIM(X_note_to_vendor),'-999') <> NVL(TRIM(Recinfo.note_to_vendor),'-999')) THEN
721         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form note_to_vendor '||X_note_to_vendor ||' Database  note_to_vendor '||Recinfo.note_to_vendor);
722       END IF;
723       IF (NVL(X_from_header_id,-999) <> NVL(Recinfo.from_header_id,-999)) THEN
724         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form from_header_id '||X_from_header_id ||' Database  from_header_id '||Recinfo.from_header_id);
725       END IF;
726       IF (NVL(X_from_line_id,-999) <> NVL(Recinfo.from_line_id,-999)) THEN
727         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form from_line_id '||X_from_line_id ||' Database  from_line_id '||Recinfo.from_line_id);
728       END IF;
729       IF (NVL(X_from_line_location_id,-999) <> NVL(Recinfo.from_line_location_id,-999)) THEN
730         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form from_line_location_id '||X_from_line_location_id ||' Database  from_line_location_id '||Recinfo.from_line_location_id);
731       END IF;
732       IF ( NVL(X_min_order_quantity,-999) <> NVL(Recinfo.min_order_quantity,-999) ) THEN
733         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form min_order_quantity '||X_min_order_quantity ||' Database  min_order_quantity '||Recinfo.min_order_quantity);
734       END IF;
735       IF (NVL(X_max_order_quantity,-999) <> NVL(Recinfo.max_order_quantity,-999)) THEN
736         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form max_order_quantity '||X_max_order_quantity ||' Database  max_order_quantity '||Recinfo.max_order_quantity);
737       END IF;
738       IF ( NVL(X_qty_rcv_tolerance,-999) <> NVL(Recinfo.qty_rcv_tolerance,-999) ) THEN
739         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form qty_rcv_tolerance '||X_qty_rcv_tolerance ||' Database  qty_rcv_tolerance '||Recinfo.qty_rcv_tolerance);
740       END IF;
741       IF (NVL(TRIM(X_over_tolerance_error_flag),'-999') <> NVL(TRIM(Recinfo.over_tolerance_error_flag),'-999')) THEN
742         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form over_tolerance_error_flag '||X_over_tolerance_error_flag ||' Database  over_tolerance_error_flag '||Recinfo.over_tolerance_error_flag);
743       END IF;
744       IF (NVL(X_market_price,-999) <> NVL(Recinfo.market_price,-999)) THEN
745         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form market_price '||X_market_price ||' Database  market_price '||Recinfo.market_price);
746       END IF;
747       IF (NVL(TRIM(X_unordered_flag),'-999') <> NVL(TRIM(Recinfo.unordered_flag),'-999')) THEN
748         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form unordered_flag '||X_unordered_flag ||' Database  unordered_flag '||Recinfo.unordered_flag);
749       END IF;
750       IF (NVL(TRIM(X_closed_flag),'-999') <> NVL(TRIM(Recinfo.closed_flag),'-999')) THEN
751         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form closed_flag '||X_closed_flag ||' Database  closed_flag '||Recinfo.closed_flag);
752       END IF;
753       IF ( NVL(TRIM(X_user_hold_flag),'-999') <> NVL(TRIM(Recinfo.user_hold_flag),'-999') ) THEN
754         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form user_hold_flag '||X_user_hold_flag ||' Database  user_hold_flag '||Recinfo.user_hold_flag);
755       END IF;
756       IF (NVL(TRIM(X_cancel_flag),'-999') <> NVL(TRIM(Recinfo.cancel_flag),'-999')) THEN
757         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form cancel_flag '||X_cancel_flag ||' Database  cancel_flag '||Recinfo.cancel_flag);
758       END IF;
759       IF ( NVL(X_cancelled_by,'-999') <> NVL(Recinfo.cancelled_by,'-999') ) THEN
760         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form cancelled_by '||X_cancelled_by ||' Database  cancelled_by '||Recinfo.cancelled_by);
761       END IF;
762       IF (X_cancel_date <> Recinfo.cancel_date) THEN
763         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form cancel_date '||X_cancel_date ||' Database  cancel_date '||Recinfo.cancel_date);
764       END IF;
765       IF (NVL(TRIM(X_cancel_reason),'-999') <> NVL(TRIM(Recinfo.cancel_reason),'-999')) THEN
766         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form cancel_reason '||X_cancel_reason ||' Database  cancel_reason '||Recinfo.cancel_reason);
767       END IF;
768       IF (NVL(TRIM(X_firm_status_lookup_code),'-999') <> NVL(TRIM(Recinfo.firm_status_lookup_code),'-999')) THEN
769         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form firm_status_lookup_code '||X_firm_status_lookup_code ||' Database  firm_status_lookup_code '||Recinfo.firm_status_lookup_code);
770       END IF;
771       IF (X_firm_date <> Recinfo.firm_date) THEN
772         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form firm_date '||X_firm_date ||' Database  firm_date '||Recinfo.firm_date);
773       END IF;
774       IF (NVL(TRIM(X_vendor_product_num),-999) <> NVL(TRIM(Recinfo.vendor_product_num),-999)) THEN
775         FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name,' Form vendor_product_num '||X_vendor_product_num ||' Database  vendor_product_num '||Recinfo.vendor_product_num);
776       END IF;
777       FND_LOG.string(FND_LOG.LEVEL_STATEMENT,c_log_head || l_api_name || '.end','Failed first if statement when comparing fields');
778     END IF; --end g_fnd_debug = 'Y'
779     FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
780     APP_EXCEPTION.RAISE_EXCEPTION;
781   END IF;
782 END Lock_Row;
783 END PO_LINES_PKG_SL;