152:
153: if (ap_invoices_pkg.get_encumbered_flag(X_invoice_id) = 'Y') then
154: -- Cannot change the invoice_amount as it is encumbered
155: fnd_message.set_name('SQLAP','AP_INV_ALL_DISTS_ENCUMB');
156: app_exception.raise_exception;
157: elsif (ap_invoices_pkg.get_posting_status(X_invoice_id) = 'Y') then
158: -- Cannot change the invoice_amount as it is posted
159: fnd_message.set_name('SQLAP','AP_INV_ALL_DIST_POSTED');
160: app_exception.raise_exception;
156: app_exception.raise_exception;
157: elsif (ap_invoices_pkg.get_posting_status(X_invoice_id) = 'Y') then
158: -- Cannot change the invoice_amount as it is posted
159: fnd_message.set_name('SQLAP','AP_INV_ALL_DIST_POSTED');
160: app_exception.raise_exception;
161: elsif (ap_invoices_pkg.selected_for_payment_flag(
162: X_invoice_id) = 'Y') then
163: -- Cannot change the amount as it is selected for payment
164: fnd_message.set_name('SQLAP','AP_INV_SELECTED_INVOICE');
161: elsif (ap_invoices_pkg.selected_for_payment_flag(
162: X_invoice_id) = 'Y') then
163: -- Cannot change the amount as it is selected for payment
164: fnd_message.set_name('SQLAP','AP_INV_SELECTED_INVOICE');
165: app_exception.raise_exception;
166: elsif (l_allow_paid_invoice_adjust <> 'Y'
167: and nvl(x_calling_mode, 'X') <> 'APXIIMPT'
168: --bug 8891266 added the below condition
169: and l_amount_paid <> (-1 * l_recouped_amount )) then
167: and nvl(x_calling_mode, 'X') <> 'APXIIMPT'
168: --bug 8891266 added the below condition
169: and l_amount_paid <> (-1 * l_recouped_amount )) then
170: fnd_message.set_name('SQLAP','AP_DIST_NO_UPDATE_PAID');
171: app_exception.raise_exception;
172: end if;
173:
174: -- Look at the sign of the adjustment and determine whether
175: -- an existing payment should be adjusted or a payment schedule
330: if (l_current_payment_num is null) then
331: -- Cannot find a payment schedule to adjust
332: FND_MESSAGE.Set_Name('SQLAP', 'AP_INV_NO_PAYMENT_SCHEDULE');
333: FND_MESSAGE.Set_Name('SQLAP', 'AP_PAY_NO_PAYMENT_SCHEDULE');
334: APP_EXCEPTION.Raise_Exception;
335: end if;
336:
337: -- Adjust for any rounding errors that might have been introduced
338: -- for inv_curr_gross_amount
471: ||', X_liability_adjusted_flag = '||X_liability_adjusted_flag
472: );
473: FND_MESSAGE.SET_TOKEN('DEBUG_INFO',debug_info);
474: END IF;
475: APP_EXCEPTION.RAISE_EXCEPTION;
476:
477: END adjust_pay_schedule;
478:
479: -----------------------------------------------------------------------
915: ) then
916: return;
917: else
918: FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
919: APP_EXCEPTION.RAISE_EXCEPTION;
920: end if;
921:
922: EXCEPTION
923: WHEN OTHERS THEN
935: );
936: FND_MESSAGE.SET_TOKEN('DEBUG_INFO',debug_info);
937: END IF;
938: END IF;
939: APP_EXCEPTION.RAISE_EXCEPTION;
940:
941: END Lock_Row;
942:
943: END AP_PAYMENT_SCHEDULES_PKG;