204: WHERE du.du_stp_id = p_old_vendor_id
205: AND du.du_stp_site_id = p_old_vendor_site_id
206: AND du.du_type_header_id IN
207: (SELECT du_type_header_id
208: FROM igi_exp_du_type_headers
209: WHERE application_id = 200) ;
210: ELSE
211: -- User has chosen to update only unpaid invoices
212: -- Update all dialog units which are not completed.
220: AND du.du_stp_site_id = p_old_vendor_site_id
221: AND du.du_status <> 'COM'
222: AND du.du_type_header_id IN
223: (SELECT du_type_header_id
224: FROM igi_exp_du_type_headers
225: WHERE application_id = 200) ;
226:
227: --
228: -- Then update all the dialog units which are completed but
237: AND du.du_stp_site_id = p_old_vendor_site_id
238: AND du.du_status = 'COM'
239: AND du.du_type_header_id IN
240: (SELECT du_type_header_id
241: FROM igi_exp_du_type_headers
242: WHERE application_id = 200)
243: AND NOT EXISTS
244: (SELECT 'X'
245: FROM ap_invoices api,