19: END deleteViolationEntry;
20:
21: -------------------------------------------------------------------------------
22: FUNCTION updateViolationsHeaderId(
23: p_ReportHeaderID IN AP_EXPENSE_REPORT_LINES.report_header_id%TYPE,
24: p_newReportHeaderID IN AP_EXPENSE_REPORT_LINES.report_header_id%TYPE)
25: RETURN BOOLEAN IS
26: --------------------------------------------------------------------------------
27: BEGIN
20:
21: -------------------------------------------------------------------------------
22: FUNCTION updateViolationsHeaderId(
23: p_ReportHeaderID IN AP_EXPENSE_REPORT_LINES.report_header_id%TYPE,
24: p_newReportHeaderID IN AP_EXPENSE_REPORT_LINES.report_header_id%TYPE)
25: RETURN BOOLEAN IS
26: --------------------------------------------------------------------------------
27: BEGIN
28: -- set the report_header_id for the line
31: SET report_header_id = p_newReportHeaderID
32: WHERE report_header_id = p_ReportHeaderID
33: AND distribution_line_number IN(
34: SELECT distribution_line_number
35: FROM ap_expense_report_lines
36: WHERE report_header_id = p_newReportHeaderID);
37:
38: return TRUE;
39: EXCEPTION
57: UPDATE ap_pol_violations
58: SET report_header_id = p_new_report_header_id
59: WHERE distribution_line_number IN
60: (select distribution_line_number
61: from ap_expense_report_lines
62: where report_header_id = p_new_report_header_id
63: and ( nvl(policy_shortpay_flag,'N') = 'Y'
64: or
65: (itemization_parent_id in
63: and ( nvl(policy_shortpay_flag,'N') = 'Y'
64: or
65: (itemization_parent_id in
66: (select report_line_id
67: from ap_expense_report_lines
68: where report_header_id = p_new_report_header_id
69: and nvl(policy_shortpay_flag,'N') = 'Y'
70: and itemization_parent_id = -1
71: )
92: UPDATE ap_pol_violations
93: SET report_header_id = p_new_report_header_id
94: WHERE distribution_line_number IN
95: (select distribution_line_number
96: from ap_expense_report_lines
97: where report_header_id = p_new_report_header_id
98: and ((receipt_required_flag = 'Y'
99: and nvl(receipt_verified_flag,'N') = 'N'
100: and nvl(policy_shortpay_flag, 'N') = 'N'
101: )
102: or
103: (itemization_parent_id in
104: (select report_line_id
105: from ap_expense_report_lines
106: where report_header_id = p_new_report_header_id
107: and receipt_required_flag = 'Y'
108: and nvl(receipt_verified_flag,'N') = 'N'
109: and nvl(policy_shortpay_flag, 'N') = 'N'
133: UPDATE ap_pol_violations
134: SET report_header_id = p_new_report_header_id
135: WHERE distribution_line_number IN
136: (SELECT distribution_line_number
137: FROM ap_expense_report_lines
138: WHERE report_header_id = p_orig_expense_report_id
139: AND credit_card_trx_id IS NOT NULL)
140: AND report_header_id = p_orig_expense_report_id;
141: