******************
Create RECEIPT
******************
DECLARE
l_return_status VARCHAR2 (1);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (240);
l_cr_id NUMBER;
BEGIN
ar_receipt_api_pub.create_cash (p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_false,
p_validation_level => fnd_api.g_valid_level_full,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_currency_code => 'USD',
p_amount => 200,
p_receipt_number => 'XX_TEST1',
p_receipt_date => SYSDATE,
p_gl_date => SYSDATE,
p_customer_id => p_customer_id,
p_customer_bank_account_id => p_customer_bank_account_id,
p_customer_site_use_id => p_customer_site_use_id,
p_receipt_method_id => p_receipt_method_id,
p_cr_id => l_cr_id
);
DBMS_OUTPUT.put_line ( 'Message count '
|| '-'
|| l_msg_count);
DBMS_OUTPUT.put_line ( 'Status '
|| '-'
|| l_return_status);
IF l_msg_count = 1
THEN
DBMS_OUTPUT.put_line ( 'l_msg_data '
|| '-'
|| l_msg_data);
ELSIF l_msg_count > 1
THEN
LOOP
l_msg_data := fnd_msg_pub.get (fnd_msg_pub.g_next, fnd_api.g_false);
IF l_msg_data IS NULL
THEN
EXIT;
END IF;
DBMS_OUTPUT.put_line ( 'Message'
|| '-'
|| '---'
|| '-'
|| ' ---'
|| '-'
|| l_msg_data);
END LOOP;
END IF;
arp_standard.disable_debug;
END;
/
*************************
Apply to invoice :-
*************************
DECLARE
l_return_status VARCHAR2 (1);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (240);
BEGIN
ar_receipt_api_pub.APPLY (p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_false,
p_validation_level => fnd_api.g_valid_level_full,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_cash_receipt_id => p_cash_receipt_id,
p_customer_trx_id => p_customer_trx_id,
p_applied_payment_schedule_id => p_applied_payment_schedule_id,
p_amount_applied => p_amount_applied,
p_show_closed_invoices => 'Y',
p_apply_date => SYSDATE,
p_apply_gl_date => SYSDATE,
p_line_number => 1
);
DBMS_OUTPUT.put_line ( 'Message count '
|| l_msg_count);
DBMS_OUTPUT.put_line ( 'Status '
|| l_return_status);
IF l_msg_count = 1
THEN
DBMS_OUTPUT.put_line ( 'l_msg_data '
|| l_msg_data);
ELSIF l_msg_count > 1
THEN
LOOP
l_msg_data := fnd_msg_pub.get (fnd_msg_pub.g_next, fnd_api.g_false);
IF l_msg_data IS NULL
THEN
EXIT;
END IF;
DBMS_OUTPUT.put_line ( 'Message'
|| '---'
|| ' ---'
|| l_msg_data);
END LOOP;
END IF;
arp_standard.disable_debug;
END;
**********************************
UNApplying a receipt to an Invoice
**********************************
DECLARE
l_return_status VARCHAR2 (1);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (240);
l_count NUMBER;
l_cash_receipt_id NUMBER;
l_msg_data_out VARCHAR2 (240);
l_mesg VARCHAR2 (240);
p_count NUMBER;
BEGIN
arp_standard.enable_debug;
arp_standard.enable_file_debug ('/usr/tmp', 'Api_Create.log');
ar_receipt_api_pub.unapply (p_api_version => 1.0,
p_init_msg_list => fnd_api.g_true,
p_commit => fnd_api.g_true,
p_validation_level => fnd_api.g_valid_level_full,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_cash_receipt_id => &cash_receipt_id,
p_applied_payment_schedule_id => &applied_payment_schedule_id,
p_reversal_gl_date => '&reversal_gl_date'
);
DBMS_OUTPUT.put_line ( 'Message count '
|| l_msg_count);
DBMS_OUTPUT.put_line ( 'Cash Receipt ID '
|| l_cash_receipt_id);
IF l_msg_count = 1
THEN
DBMS_OUTPUT.put_line ( 'l_msg_data '
|| l_msg_data);
ELSIF l_msg_count > 1
THEN
LOOP
p_count := p_count
+ 1;
l_msg_data := fnd_msg_pub.get (fnd_msg_pub.g_next, fnd_api.g_false);
IF l_msg_data IS NULL
THEN
EXIT;
END IF;
DBMS_OUTPUT.put_line ( 'Message'
|| p_count
|| ' ---'
|| l_msg_data);
END LOOP;
END IF;
arp_standard.disable_debug;
END;
/
Create RECEIPT
******************
DECLARE
l_return_status VARCHAR2 (1);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (240);
l_cr_id NUMBER;
BEGIN
ar_receipt_api_pub.create_cash (p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_false,
p_validation_level => fnd_api.g_valid_level_full,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_currency_code => 'USD',
p_amount => 200,
p_receipt_number => 'XX_TEST1',
p_receipt_date => SYSDATE,
p_gl_date => SYSDATE,
p_customer_id => p_customer_id,
p_customer_bank_account_id => p_customer_bank_account_id,
p_customer_site_use_id => p_customer_site_use_id,
p_receipt_method_id => p_receipt_method_id,
p_cr_id => l_cr_id
);
DBMS_OUTPUT.put_line ( 'Message count '
|| '-'
|| l_msg_count);
DBMS_OUTPUT.put_line ( 'Status '
|| '-'
|| l_return_status);
IF l_msg_count = 1
THEN
DBMS_OUTPUT.put_line ( 'l_msg_data '
|| '-'
|| l_msg_data);
ELSIF l_msg_count > 1
THEN
LOOP
l_msg_data := fnd_msg_pub.get (fnd_msg_pub.g_next, fnd_api.g_false);
IF l_msg_data IS NULL
THEN
EXIT;
END IF;
DBMS_OUTPUT.put_line ( 'Message'
|| '-'
|| '---'
|| '-'
|| ' ---'
|| '-'
|| l_msg_data);
END LOOP;
END IF;
arp_standard.disable_debug;
END;
/
*************************
Apply to invoice :-
*************************
DECLARE
l_return_status VARCHAR2 (1);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (240);
BEGIN
ar_receipt_api_pub.APPLY (p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_false,
p_validation_level => fnd_api.g_valid_level_full,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_cash_receipt_id => p_cash_receipt_id,
p_customer_trx_id => p_customer_trx_id,
p_applied_payment_schedule_id => p_applied_payment_schedule_id,
p_amount_applied => p_amount_applied,
p_show_closed_invoices => 'Y',
p_apply_date => SYSDATE,
p_apply_gl_date => SYSDATE,
p_line_number => 1
);
DBMS_OUTPUT.put_line ( 'Message count '
|| l_msg_count);
DBMS_OUTPUT.put_line ( 'Status '
|| l_return_status);
IF l_msg_count = 1
THEN
DBMS_OUTPUT.put_line ( 'l_msg_data '
|| l_msg_data);
ELSIF l_msg_count > 1
THEN
LOOP
l_msg_data := fnd_msg_pub.get (fnd_msg_pub.g_next, fnd_api.g_false);
IF l_msg_data IS NULL
THEN
EXIT;
END IF;
DBMS_OUTPUT.put_line ( 'Message'
|| '---'
|| ' ---'
|| l_msg_data);
END LOOP;
END IF;
arp_standard.disable_debug;
END;
**********************************
UNApplying a receipt to an Invoice
**********************************
DECLARE
l_return_status VARCHAR2 (1);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (240);
l_count NUMBER;
l_cash_receipt_id NUMBER;
l_msg_data_out VARCHAR2 (240);
l_mesg VARCHAR2 (240);
p_count NUMBER;
BEGIN
arp_standard.enable_debug;
arp_standard.enable_file_debug ('/usr/tmp', 'Api_Create.log');
ar_receipt_api_pub.unapply (p_api_version => 1.0,
p_init_msg_list => fnd_api.g_true,
p_commit => fnd_api.g_true,
p_validation_level => fnd_api.g_valid_level_full,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_cash_receipt_id => &cash_receipt_id,
p_applied_payment_schedule_id => &applied_payment_schedule_id,
p_reversal_gl_date => '&reversal_gl_date'
);
DBMS_OUTPUT.put_line ( 'Message count '
|| l_msg_count);
DBMS_OUTPUT.put_line ( 'Cash Receipt ID '
|| l_cash_receipt_id);
IF l_msg_count = 1
THEN
DBMS_OUTPUT.put_line ( 'l_msg_data '
|| l_msg_data);
ELSIF l_msg_count > 1
THEN
LOOP
p_count := p_count
+ 1;
l_msg_data := fnd_msg_pub.get (fnd_msg_pub.g_next, fnd_api.g_false);
IF l_msg_data IS NULL
THEN
EXIT;
END IF;
DBMS_OUTPUT.put_line ( 'Message'
|| p_count
|| ' ---'
|| l_msg_data);
END LOOP;
END IF;
arp_standard.disable_debug;
END;
/
No comments:
Post a Comment