[Home] [Help]
138: /* Check if the current record is a duplicate */
139: BEGIN
140: SELECT 'X'
141: INTO p_duplicate
142: FROM wsh_transactions_history
143: WHERE document_type = p_doc_type
144: AND document_number = p_doc_number
145: AND action_type = p_action_type
146: AND trading_partner_id = x_trading_partner_id
184:
185: BEGIN
186: SELECT 'X'
187: INTO p_940_exists
188: FROM wsh_transactions_history
189: WHERE document_number = p_orig_document_number
190: AND document_type = 'SR'
191: AND document_direction = 'I'
192: AND action_type = 'A';
223: /* Check if the Corresponding 940 Out exists when a 945 Comes in */
224: BEGIN
225: SELECT 'X'
226: INTO p_940_exists
227: FROM wsh_transactions_history
228: WHERE document_number = p_orig_document_number
229: AND document_type = 'SR'
230: AND document_direction = 'O'
231: AND action_type = 'A';