233:
234: CURSOR c_get_event_key (v_delivery_id number) is
235: select wth.event_key, wth.item_type
236: from wsh_new_deliveries wnd,
237: wsh_transactions_history wth
238: where delivery_id =v_delivery_id
239: and wnd.name = wth.entity_number
240: and wth.document_direction = 'O'
241: and wth.document_type = 'SR'
244: order by transaction_id desc;
245:
246: cursor c_inbound_txn_csr (v_event_key VARCHAR2, v_item_type VARCHAR2) is
247: select 'X'
248: from wsh_transactions_history
249: where event_key = v_event_key
250: and item_type = v_item_type
251: and document_direction = 'I'
252: and action_type = 'A'
253: and document_type = 'SA'
254: order by transaction_id desc;
255:
256: l_sa_exist VARCHAR2(1);
257: l_event_key wsh_transactions_history.event_key%TYPE;
258: l_item_type wsh_transactions_history.item_type%TYPE;
259:
260: wsh_del_not_found EXCEPTION;
261: wsh_invalid_action_code EXCEPTION;
254: order by transaction_id desc;
255:
256: l_sa_exist VARCHAR2(1);
257: l_event_key wsh_transactions_history.event_key%TYPE;
258: l_item_type wsh_transactions_history.item_type%TYPE;
259:
260: wsh_del_not_found EXCEPTION;
261: wsh_invalid_action_code EXCEPTION;
262: --
669: cursor valid_shpmnt_advice_cur(p_delivery_id IN NUMBER,
670: p_tp_id IN NUMBER
671: ) is
672: select 'X'
673: from wsh_transactions_history
674: where transaction_id = (
675: select max(transaction_id)
676: from wsh_transactions_history wth,
677: wsh_new_deliveries wnd
672: select 'X'
673: from wsh_transactions_history
674: where transaction_id = (
675: select max(transaction_id)
676: from wsh_transactions_history wth,
677: wsh_new_deliveries wnd
678: where wth.entity_number = wnd.name
679: and wth.trading_partner_id = p_tp_id
680: and wnd.delivery_id = p_delivery_id