DBA Data[Home] [Help]

APPS.CN_NOTIFY_ORDERS dependencies on CN_NOT_TRX

Line 18: -- cn_not_trx. It returns true if yes, otherwise return false.

14: -- Function Name
15: -- check_header_exists
16: -- Purpose
17: -- This function will check whether a particular header exsits in
18: -- cn_not_trx. It returns true if yes, otherwise return false.
19: -- History
20:
21: FUNCTION check_header_exists(hid NUMBER,
22: p_org_id NUMBER)

Line 35: FROM cn_not_trx

31: INTO exist
32: FROM sys.dual
33: WHERE EXISTS
34: (SELECT 1
35: FROM cn_not_trx
36: WHERE source_trx_id = hid
37: AND org_id = p_org_id);
38:
39: RETURN exist;

Line 87: -- cn_not_trx. It returns the status of its collected_flag.

83: -- Function Name
84: -- check_last_entry
85: -- Purpose
86: -- This function will check the last entry of a particular line in
87: -- cn_not_trx. It returns the status of its collected_flag.
88: -- History
89:
90: FUNCTION check_last_entry(hid NUMBER,
91: lid NUMBER,

Line 98: -- We need to use CN_NOT_TRX_ALL instead of CN_NOT_TRX because this

94: IS
95: col_flag VARCHAR2(1) := 'Y';
96: BEGIN
97:
98: -- We need to use CN_NOT_TRX_ALL instead of CN_NOT_TRX because this
99: -- procedure is being called by Adjust_Order, which processes orders
100: -- from all orgs. This should be OK because we are selecting based on
101: -- header_id, which for Orders are unique identifiers across all orgs.
102:

Line 105: FROM cn_not_trx_all a

101: -- header_id, which for Orders are unique identifiers across all orgs.
102:
103: SELECT collected_flag
104: INTO col_flag
105: FROM cn_not_trx_all a
106: WHERE a.source_trx_id = hid
107: AND a.source_trx_line_id = lid
108: AND a.org_id = x_org_id
109: AND a.not_trx_id = ( SELECT max(b.not_trx_id)

Line 110: FROM cn_not_trx_all b

106: WHERE a.source_trx_id = hid
107: AND a.source_trx_line_id = lid
108: AND a.org_id = x_org_id
109: AND a.not_trx_id = ( SELECT max(b.not_trx_id)
110: FROM cn_not_trx_all b
111: WHERE b.source_trx_id = hid
112: AND b.source_trx_line_id = lid
113: AND b.org_id = a.org_id );
114:

Line 129: -- This procedure collects order line identifiers into cn_not_trx

125: ---------------------------------------------------------------------------+
126: -- Procedure Name
127: -- notify_line
128: -- Purpose
129: -- This procedure collects order line identifiers into cn_not_trx
130: -- as part of order update notification.
131: --
132: -- Note. Whereas Regular_Col_Notify is run for each Org, Notify_Line
133: -- is part of the Update Notification process, of which there is only

Line 136: -- This means that new rows inserted into CN_NOT_TRX_ALL must get the

132: -- Note. Whereas Regular_Col_Notify is run for each Org, Notify_Line
133: -- is part of the Update Notification process, of which there is only
134: -- one instance for the installation - because we only have one
135: -- Notification Queue which passes us updates to orders from any Org.
136: -- This means that new rows inserted into CN_NOT_TRX_ALL must get the
137: -- Org_Id of the updated order rather than just defaulting to the
138: -- client Org-Id. (The defaulting is OK in regular_col_notify because
139: -- that procedure only selects orders for the Client Org anyway). For
140: -- this reason, we use CN_NOT_TRX_ALL here, rather than just CN_NOT_TRX

Line 140: -- this reason, we use CN_NOT_TRX_ALL here, rather than just CN_NOT_TRX

136: -- This means that new rows inserted into CN_NOT_TRX_ALL must get the
137: -- Org_Id of the updated order rather than just defaulting to the
138: -- client Org-Id. (The defaulting is OK in regular_col_notify because
139: -- that procedure only selects orders for the Client Org anyway). For
140: -- this reason, we use CN_NOT_TRX_ALL here, rather than just CN_NOT_TRX
141: -- and we explicitly set the Org_Id during our insert.
142:
143: -- History
144: --

Line 173: -- already a 'to-be-collected' record for the line in CN_NOT_TRX_ALL.

169: FETCH batch_size INTO l_sys_batch_size;
170: CLOSE batch_size;
171:
172: -- Call to Check_Last_Entry makes sure that there is not
173: -- already a 'to-be-collected' record for the line in CN_NOT_TRX_ALL.
174: IF Check_Last_Entry
175: (p_header_id,
176: p_line_id,
177: x_org_id) = 'Y' THEN

Line 178: INSERT INTO cn_not_trx_all (

174: IF Check_Last_Entry
175: (p_header_id,
176: p_line_id,
177: x_org_id) = 'Y' THEN
178: INSERT INTO cn_not_trx_all (
179: org_id,
180: not_trx_id,
181: batch_id,
182: notified_date,

Line 194: cn_not_trx_s.NEXTVAL,

190: adjusted_flag,
191: event_id)
192: SELECT
193: asoh.org_id,
194: cn_not_trx_s.NEXTVAL,
195: FLOOR(cn_not_trx_s.CURRVAL/NVL(l_sys_batch_size,200)),
196: SYSDATE,
197: asoh.booked_date,
198: l_proc_audit_id,

Line 195: FLOOR(cn_not_trx_s.CURRVAL/NVL(l_sys_batch_size,200)),

191: event_id)
192: SELECT
193: asoh.org_id,
194: cn_not_trx_s.NEXTVAL,
195: FLOOR(cn_not_trx_s.CURRVAL/NVL(l_sys_batch_size,200)),
196: SYSDATE,
197: asoh.booked_date,
198: l_proc_audit_id,
199: 'N',

Line 248: -- into cn_not_trx as part of order update notification.

244: -- Procedure Name
245: -- notify_deleted_line
246: -- Purpose
247: -- This procedure collects order line identifiers for deleted lines
248: -- into cn_not_trx as part of order update notification.
249: --
250: -- When a collected order is changed, all of the old lines are reversed
251: -- out and all current lines for the order are added in again. This
252: -- procedure is used to register the Id of a deleted line so that it

Line 288: -- already a 'to-be-collected' record for the line in CN_NOT_TRX_ALL.

284: FETCH batch_size INTO l_sys_batch_size;
285: CLOSE batch_size;
286:
287: -- Call to Check_Last_Entry makes sure that there is not
288: -- already a 'to-be-collected' record for the line in CN_NOT_TRX_ALL.
289: IF Check_Last_Entry
290: (p_header_id,
291: p_line_id,
292: l_org_id) = 'Y' THEN

Line 293: INSERT INTO cn_not_trx_all (

289: IF Check_Last_Entry
290: (p_header_id,
291: p_line_id,
292: l_org_id) = 'Y' THEN
293: INSERT INTO cn_not_trx_all (
294: org_id,
295: not_trx_id,
296: batch_id,
297: notified_date,

Line 309: cn_not_trx_s.NEXTVAL,

305: adjusted_flag,
306: event_id)
307: SELECT
308: asoh.org_id,
309: cn_not_trx_s.NEXTVAL,
310: FLOOR(cn_not_trx_s.CURRVAL/NVL(l_sys_batch_size,200)),
311: SYSDATE,
312: asoh.booked_date,
313: l_proc_audit_id,

Line 310: FLOOR(cn_not_trx_s.CURRVAL/NVL(l_sys_batch_size,200)),

306: event_id)
307: SELECT
308: asoh.org_id,
309: cn_not_trx_s.NEXTVAL,
310: FLOOR(cn_not_trx_s.CURRVAL/NVL(l_sys_batch_size,200)),
311: SYSDATE,
312: asoh.booked_date,
313: l_proc_audit_id,
314: 'N',

Line 339: -- This procedure collects order line identifiers into cn_not_trx_all

335: ---------------------------------------------------------------------------+
336: -- Procedure Name
337: -- notify_affected_lines
338: -- Purpose
339: -- This procedure collects order line identifiers into cn_not_trx_all
340: -- of lines affected by a change to an order sales credit.
341: -- Design Note: A Top Model Line will have its own line_id in its
342: -- top_model_line_id column.
343: --

Line 590: -- Notify_Line then adds a new row in CN_NOT_TRX_ALL for the

586: -- and then act appropriately.
587: -- The general strategy is simply to call Notify_Line for each
588: -- existing order line which is affected by a change to an Order
589: -- Header, Line or Sales Credit.
590: -- Notify_Line then adds a new row in CN_NOT_TRX_ALL for the
591: -- order line. That strategy takes care of changes to existing
592: -- lines and addition of new lines. However for a line deletetion,
593: -- Notify_Line would not add a record for it in CN_NOT_TRX_ALL, because it
594: -- requeries the line to get more details,

Line 593: -- Notify_Line would not add a record for it in CN_NOT_TRX_ALL, because it

589: -- Header, Line or Sales Credit.
590: -- Notify_Line then adds a new row in CN_NOT_TRX_ALL for the
591: -- order line. That strategy takes care of changes to existing
592: -- lines and addition of new lines. However for a line deletetion,
593: -- Notify_Line would not add a record for it in CN_NOT_TRX_ALL, because it
594: -- requeries the line to get more details,
595: -- which would fail. We must have this record because
596: -- the collection process will use its presence to Reverse
597: -- the existing line in CN_COMM_LINES_API. That is why we call the special

Line 1251: -- This procedure collects order line identifiers into cn_not_trx

1247: ------------------------------------------------------------------------+
1248: -- Procedure Name
1249: -- regular_col_notify
1250: -- Purpose
1251: -- This procedure collects order line identifiers into cn_not_trx
1252: -- as part of the collection process for new orders.
1253: --
1254: -- It is called from CN_COLLECT_ORDERS and is passed a
1255: -- start-period-id and end-period-id.

Line 1345: ( 'notify: Inserting records into CN_NOT_TRX from period '

1341: cn_periods_api.set_dates(x_start_period, x_end_period, x_org_id,
1342: l_start_date, l_end_date);
1343:
1344: cn_message_pkg.debug
1345: ( 'notify: Inserting records into CN_NOT_TRX from period '
1346: || l_start_date ||' to period '|| l_end_date ||'.');
1347:
1348: fnd_file.put_line(fnd_file.Log, 'notify: Inserting records into CN_NOT_TRX from period '
1349: || l_start_date ||' to period '|| l_end_date ||'.');

Line 1348: fnd_file.put_line(fnd_file.Log, 'notify: Inserting records into CN_NOT_TRX from period '

1344: cn_message_pkg.debug
1345: ( 'notify: Inserting records into CN_NOT_TRX from period '
1346: || l_start_date ||' to period '|| l_end_date ||'.');
1347:
1348: fnd_file.put_line(fnd_file.Log, 'notify: Inserting records into CN_NOT_TRX from period '
1349: || l_start_date ||' to period '|| l_end_date ||'.');
1350:
1351: OPEN batch_size;
1352: FETCH batch_size INTO l_sys_batch_size;

Line 1355: INSERT INTO cn_not_trx (

1351: OPEN batch_size;
1352: FETCH batch_size INTO l_sys_batch_size;
1353: CLOSE batch_size;
1354:
1355: INSERT INTO cn_not_trx (
1356: not_trx_id,
1357: batch_id,
1358: notified_date,
1359: processed_date,

Line 1370: cn_not_trx_s.NEXTVAL,

1366: adjusted_flag,
1367: event_id,
1368: org_id)
1369: SELECT
1370: cn_not_trx_s.NEXTVAL,
1371: FLOOR(cn_not_trx_s.CURRVAL/l_sys_batch_size),
1372: SYSDATE,
1373: asoh.booked_date,
1374: l_proc_audit_id,

Line 1371: FLOOR(cn_not_trx_s.CURRVAL/l_sys_batch_size),

1367: event_id,
1368: org_id)
1369: SELECT
1370: cn_not_trx_s.NEXTVAL,
1371: FLOOR(cn_not_trx_s.CURRVAL/l_sys_batch_size),
1372: SYSDATE,
1373: asoh.booked_date,
1374: l_proc_audit_id,
1375: 'N',

Line 1408: FROM cn_not_trx

1404: AND mtl.inventory_item_id = asol.inventory_item_id
1405: AND mtl.invoiceable_item_flag = 'Y') -- only want invoiceable items
1406: AND NOT EXISTS
1407: (SELECT 1
1408: FROM cn_not_trx
1409: WHERE source_trx_id = asoh.header_id
1410: AND source_trx_line_id = asol.line_id
1411: AND event_id= cn_global.ord_event_id
1412: AND org_id = l_client_org_id) ;

Line 1427: cn_message_pkg.debug('notify: No rows inserted into CN_NOT_TRX. Possible reason: Order transactions may have already been collected.');

1423: --DBMS_OUTPUT.put_line('parent_proc_audit_id '||parent_proc_audit_id);
1424:
1425: IF ( l_trx_count = 0 ) THEN
1426:
1427: cn_message_pkg.debug('notify: No rows inserted into CN_NOT_TRX. Possible reason: Order transactions may have already been collected.');
1428: fnd_file.put_line(fnd_file.Log, 'notify: No rows inserted into CN_NOT_TRX. Possible reason: Order transactions may have already been collected.');
1429:
1430: END IF;
1431:

Line 1428: fnd_file.put_line(fnd_file.Log, 'notify: No rows inserted into CN_NOT_TRX. Possible reason: Order transactions may have already been collected.');

1424:
1425: IF ( l_trx_count = 0 ) THEN
1426:
1427: cn_message_pkg.debug('notify: No rows inserted into CN_NOT_TRX. Possible reason: Order transactions may have already been collected.');
1428: fnd_file.put_line(fnd_file.Log, 'notify: No rows inserted into CN_NOT_TRX. Possible reason: Order transactions may have already been collected.');
1429:
1430: END IF;
1431:
1432: -- COMMIT; -- Commit now done by Order Capture notification process or by CN_COLLECT_ORDERS