The following lines contain the word 'select', 'insert', 'update' or 'delete':
arp_ct_pkg.update_p( l_trx_rec,
p_customer_trx_id );
SELECT customer_trx_line_id
INTO p_commitment_line_id
FROM ra_customer_trx_lines ctl,
ra_customer_trx ct
WHERE ct.customer_trx_id = p_customer_trx_id
AND ctl.customer_trx_id = ct.initial_customer_trx_id;
| line has been deleted and the transaction only contains a header |
| freight record. |
| |
| SCOPE - PRIVATE |
| |
| EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
| arp_util.debug |
| |
| ARGUMENTS : IN: |
| p_customer_trx_id |
| p_trx_amount |
| p_exchange_rate |
| p_gl_date |
| OUT: |
| None |
| |
| RETURNS : NONE |
| |
| NOTES |
| |
| MODIFICATION HISTORY |
| 25-JUL-95 Charlie Tomberg Created |
| |
+===========================================================================*/
PROCEDURE header_freight_only_rules_case(
p_customer_trx_id IN
ra_customer_trx.customer_trx_id%type,
p_trx_amount IN number,
p_exchange_rate IN
ra_customer_trx.exchange_rate%type,
p_gl_date IN
ra_cust_trx_line_gl_dist.gl_date%type
)
IS
l_trx_rec ra_customer_trx%rowtype;
arp_ct_pkg.update_p( l_trx_rec,
p_customer_trx_id );
| update the account sets to be real dists. |
| inv rule is cleared by the form at complete time |
| or when all 'line' lines are deleted |
| if rules and freight only invoice. |
| Reason is that the Revenue Recognition Program |
| cannot handle freight only transactions with rules. |
| |
| There are two dists in this case: |
| o The REC dist |
| o The FREIGHT dist |
+---------------------------------------------------------*/
arp_ctlgd_pkg.set_to_dummy(l_dist_rec);
arp_ctlgd_pkg.update_f_ct_id(l_dist_rec,
p_customer_trx_id,
null,
null);
| val_insert_line |
| |
| DESCRIPTION |
| Does validation that is required when a new line is inserted. |
| |
| SCOPE - PRIVATE |
| |
| EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
| arp_util.debug |
| |
| ARGUMENTS : IN: |
| p_line_rec |
| OUT: |
| None |
| |
| RETURNS : NONE |
| |
| NOTES |
| |
| MODIFICATION HISTORY |
| 24-JUL-95 Charlie Tomberg Created |
| 31-JAN-96 Martin Johnson Added call to |
| arp_dates.val_gl_periods_for_rules. |
| Changed l_line_rec.set_of_books_id to |
| arp_global.set_of_books_id. |
| 06-FEB-96 Martin Johnson Don't call val_gl_periods_for_rules |
| for CM's because CM module will |
| derive the correct values later |
| |
+===========================================================================*/
PROCEDURE val_insert_line ( p_line_rec IN ra_customer_trx_lines%rowtype ) IS
BEGIN
arp_util.debug('arp_process_line.val_insert_line()+');
arp_util.debug('arp_process_line.val_insert_line()-');
arp_util.debug('EXCEPTION: arp_process_line.val_insert_line()');
arp_util.debug('------ parameters for val_insert_line() -------');
| val_update_line |
| |
| DESCRIPTION |
| Does validation that is required when a line is updated. |
| |
| SCOPE - PRIVATE |
| |
| EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
| arp_util.debug |
| |
| ARGUMENTS : IN: |
| p_line_rec - The line rec with the changed colums |
| p_db_line_rec - The old line record |
| p_new_line_rec - Contains old rec + updated columns |
| OUT: |
| None |
| |
| RETURNS : NONE |
| |
| NOTES |
| |
| MODIFICATION HISTORY |
| 24-JUL-95 Charlie Tomberg Created |
| 31-JAN-96 Martin Johnson Changed l_line_rec.set_of_books_id to |
| arp_global.set_of_books_id. |
| 06-FEB-96 Martin Johnson Don't call val_gl_periods_for_rules |
| for CM's because CM module will |
| derive the correct values later |
| |
+===========================================================================*/
PROCEDURE val_update_line ( p_line_rec IN ra_customer_trx_lines%rowtype,
p_db_line_rec IN ra_customer_trx_lines%rowtype,
p_new_line_rec OUT NOCOPY ra_customer_trx_lines%rowtype )
IS
l_errorbuf varchar2(200);
arp_util.debug('arp_process_line.val_update_line()+');
arp_util.debug('EXCEPTION: arp_process_line.val_update_line()');
arp_util.debug('arp_process_line.val_update_line()-');
arp_util.debug('EXCEPTION: arp_process_line.val_update_line()');
arp_util.debug('------ parameters for val_update_line() -------');
| val_delete_line |
| |
| DESCRIPTION |
| Does validation that is required when a line is deleted. |
| |
| SCOPE - PRIVATE |
| |
| EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
| arp_util.debug |
| |
| ARGUMENTS : IN: |
| p_line_rec |
| p_complete_flag |
| OUT: |
| None |
| |
| RETURNS : NONE |
| |
| NOTES |
| |
| MODIFICATION HISTORY |
| 24-JUL-95 Charlie Tomberg Created |
| |
+===========================================================================*/
PROCEDURE val_delete_line ( p_line_rec IN ra_customer_trx_lines%rowtype,
p_complete_flag IN
ra_customer_trx.complete_flag%type ) IS
BEGIN
arp_util.debug('arp_process_line.val_delete_line()+');
arp_util.debug('arp_process_line.val_delete_line()-');
arp_util.debug('EXCEPTION: arp_process_line.val_delete_line()');
arp_util.debug('------ parameters for val_delete_line() -------');
| insert_line |
| |
| DESCRIPTION |
| Inserts a record into ra_customer_trx_lines. |
| |
| SCOPE - PUBLIC |
| |
| EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
| arp_util.debug |
| |
| ARGUMENTS : IN: |
| p_form_name |
| p_form_version |
| p_line_rec |
| p_memo_line_type |
| p_currency_code |
| OUT: |
| p_customer_trx_line_id |
| p_rule_start_date |
| p_accounting_rule_duration |
| p_status |
| IN/ OUT: |
| p_gl_date |
| p_trx_date |
| |
| RETURNS : NONE |
| |
| NOTES |
| |
| MODIFICATION HISTORY |
| 24-JUL-95 Charlie Tomberg Created |
| 15-JAN-96 Martin Johnson Added call to credit memo module. |
| Added OUT NOCOPY parameters |
| p_rule_start_date |
| and p_accounting_rule_duration |
| 06-FEB-96 Martin Johnson Don't call tax engine if trx is a |
| debit memo reversal |
| 08-FEB-96 Martin Johnson Call arp_dates.derive_gl_trx_dates_ |
| from_rules() and added IN OUT NOCOPY |
| parameters p_gl_date and p_trx_date. |
| 15-MAY-96 Martin Johnson BugNo:356814. Added OUT NOCOPY param |
| p_status. Call calculate_tax_f_ctl_ |
| id in 'DEFERRED' mode so that |
| 'soft' exception will be raised. |
| 01-JUL-96 Simon Leung Do not call the tax engine if the |
| memo line type is TAX, FREIGHT or |
| CHARGES. |
| |
| Rel 11 Changes: |
| |
| 04-AUG-97 OSTEINME Added new parameters p_header_currency_code |
| p_header_exchange_rate |
| changed p_line_rec to IN OUT NOCOPY |
| |
+===========================================================================*/
PROCEDURE insert_line(
p_form_name IN varchar2,
p_form_version IN number,
p_line_rec IN OUT NOCOPY ra_customer_trx_lines%rowtype,
p_memo_line_type IN ar_memo_lines.line_type%type,
p_customer_trx_line_id OUT NOCOPY
ra_customer_trx_lines.customer_trx_line_id%type,
p_trx_class IN ra_cust_trx_types.type%type
DEFAULT NULL,
p_ccid1 IN
gl_code_combinations.code_combination_id%type
DEFAULT NULL,
p_ccid2 IN
gl_code_combinations.code_combination_id%type
DEFAULT NULL,
p_amount1 IN ra_cust_trx_line_gl_dist.amount%type
DEFAULT NULL,
p_amount2 IN ra_cust_trx_line_gl_dist.amount%type
DEFAULT NULL,
p_rule_start_date OUT NOCOPY
ra_customer_trx_lines.rule_start_date%type,
p_accounting_rule_duration OUT NOCOPY
ra_customer_trx_lines.accounting_rule_duration%type,
p_gl_date IN OUT NOCOPY
ra_cust_trx_line_gl_dist.gl_date%type,
p_trx_date IN OUT NOCOPY
ra_customer_trx.trx_date%type,
p_header_currency_code IN
ra_customer_trx.invoice_currency_code%type
DEFAULT NULL,
p_header_exchange_rate IN ra_customer_trx.exchange_rate%type
DEFAULT NULL,
p_status OUT NOCOPY varchar2,
p_run_autoacc_flag IN varchar2 DEFAULT 'Y',
p_run_tax_flag IN varchar2 DEFAULT 'Y',
p_create_salescredits_flag IN VARCHAR2 DEFAULT 'Y' )
IS
l_ccid number;
arp_util.debug('arp_process_line.insert_line()+');
arp_process_line.val_insert_line(p_line_rec);
| Call the table handler to insert the line |
+----------------------------------------------*/
arp_util.debug('ARTECTLB: l_line_rec.amount_includes_tax_flag = ' || l_line_rec.amount_includes_tax_flag);
arp_ctl_pkg.insert_p( l_line_rec,
l_customer_trx_line_id);
'arp_process_line.insert_line before create_tax_f_ctl_id');
l_mode := 'INSERT_NO_TAX';
arp_util.debug('Overridding mode to INSERT_NO_TAX');
l_mode := 'INSERT';
'arp_process_line.insert_line after create_tax_f_ctl_id');
arp_process_debit_memo.line_post_insert(
l_customer_trx_line_id,
p_ccid1,
p_ccid2,
p_amount1,
p_amount2
);
'arp_process_line.insert_line before credit_transactions');
'arp_process_line.insert_line after credit_transactions');
/* Check if any gl_dist rows are inserted for the current trx_line.*/
BEGIN
SELECT customer_trx_line_id
INTO l_dist_line
FROM ra_cust_trx_line_gl_dist
WHERE customer_trx_line_id = p_customer_trx_line_id
AND account_set_flag = 'N'
AND ROWNUM < 2;
ARP_CTLGD_PKG.update_f_ctl_id(l_dist_rec,p_customer_trx_line_id,'N','');
cursor c1 is select customer_trx_line_id
from ra_customer_trx_lines
where link_to_cust_trx_line_id = p_customer_trx_line_id;
ARP_CTLGD_PKG.update_f_ctl_id(l_dist_rec,l_id,'N','');
arp_util.debug('arp_process_line.insert_line()-');
arp_util.debug('EXCEPTION: arp_process_line.insert_line()');
arp_util.debug('---------- parameters for insert_line() ---------');
| update_line |
| |
| DESCRIPTION |
| Updates a ra_customer_trx_lines record |
| |
| SCOPE - PUBLIC |
| |
| EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
| arp_util.debug |
| |
| ARGUMENTS : IN: |
| p_form_name |
| p_form_version |
| p_customer_trx_line_id |
| p_line_rec |
| p_foreign_currency_code |
| p_exchange_rate |
| p_recalculate_tax_flag |
| p_rerun_autoacc_flag |
| OUT: |
| p_rule_start_date |
| p_accounting_rule_duration |
| p_status |
| IN OUT: |
| p_gl_date |
| p_trx_date |
| |
| RETURNS : NONE |
| |
| NOTES |
| |
| MODIFICATION HISTORY |
| 24-JUL-95 Charlie Tomberg Created |
| 17-JAN-96 Martin Johnson Added call to credit memo module. |
| Added OUT NOCOPY parameters |
| p_rule_start_date |
| and p_accounting_rule_duration |
| 13-FEB-96 Martin Johnson Added OUT NOCOPY parameters p_gl_date |
| and p_trx_date |
| 20-MAR-96 Martin Johnson Rewrote algorithm to figure out NOCOPY |
| whether to call CM module, autoacc, or |
| dist table handler to update |
| distributions |
| 20-MAY-96 Martin Johnson BugNo:356814. Added OUT NOCOPY |
| parameter p_status. Call tax engine |
| in 'DEFERRED' mode so that 'soft' |
| excpetion will be raise. |
| |
+===========================================================================*/
PROCEDURE update_line(
p_form_name IN varchar2,
p_form_version IN number,
p_customer_trx_line_id IN
ra_customer_trx_lines.customer_trx_line_id%type,
p_line_rec IN OUT NOCOPY ra_customer_trx_lines%rowtype,
p_foreign_currency_code IN fnd_currencies.currency_code%type,
p_exchange_rate IN ra_customer_trx.exchange_rate%type,
p_recalculate_tax_flag IN boolean,
p_rerun_autoacc_flag IN boolean,
p_rule_start_date OUT NOCOPY
ra_customer_trx_lines.rule_start_date%type,
p_accounting_rule_duration OUT NOCOPY
ra_customer_trx_lines.accounting_rule_duration%type,
p_gl_date IN OUT NOCOPY
ra_cust_trx_line_gl_dist.gl_date%type,
p_trx_date IN OUT NOCOPY
ra_customer_trx.trx_date%type,
p_status OUT NOCOPY varchar2 )
IS
l_recalculate_tax_flag boolean;
SELECT 'Y'
FROM ra_customer_trx_lines l,
ra_cust_trx_line_gl_dist d
WHERE l.customer_trx_line_id = p_customer_trx_line_id
AND l.customer_trx_id = d.customer_trx_id
AND d.account_set_flag = 'N'
AND d.posting_Control_id <> -3;
arp_util.debug('arp_process_line.update_line()+');
arp_process_line.val_update_line(p_line_rec,
l_db_line_rec,
l_new_line_rec);
arp_etax_services_pkg.before_update_line(
l_db_line_rec.customer_trx_line_id,
p_line_rec,
l_recalculate_tax_flag);
'arp_etax_services_pkg.before_update_line raised exception');
-- set net amounts and gross amounts to AR_NUMBER_DUMMY to avoid update
p_line_rec.extended_amount := AR_NUMBER_DUMMY;
| Call the table handler to update the line |
+---------------------------------------------*/
arp_ctl_pkg.update_p( p_line_rec,
p_customer_trx_line_id,
p_foreign_currency_code );
| Call Tax Engine, recalculating tax for this updated invoice line.|
+------------------------------------------------------------------*/
BEGIN
-- Rel. 11 call to new tax engine:
-- copy entered amounts into parameters
l_extended_amount := p_line_rec.extended_amount;
p_mode => 'UPDATE');
p_action => 'UPDATE',
p_line_level_action => 'UPDATE');
| Update the salescredit lines associated with this transaction line |
+---------------------------------------------------------------------*/
IF ( l_amount_changed_flag = TRUE )
THEN arp_ctls_pkg.update_amounts_f_ctl_id(p_customer_trx_line_id,
l_new_line_rec.extended_amount,
p_foreign_currency_code );
| THEN call CM module to update the distributions |
| ELSIF rerun_autoacc is TRUE |
| THEN call autoaccounting to update the distributions |
| ELSIF amount changed |
| THEN update the distribution amounts |
+-----------------------------------------------------------*/
IF ( ( p_line_rec.previous_customer_trx_id IS NOT NULL )
AND
( ( p_rerun_autoacc_flag )
OR
( ( p_line_rec.accounting_rule_id IS NOT NULL )
AND
( l_amount_changed_flag OR l_last_period_changed_flag )
)
)
)
THEN
BEGIN
arp_credit_memo_module.credit_transactions(
p_line_rec.customer_trx_id,
p_customer_trx_line_id,
p_line_rec.previous_customer_trx_id,
p_line_rec.previous_customer_trx_line_id,
null,
l_failure_count,
l_rule_start_date,
l_accounting_rule_duration,
'U' );
arp_ctlgd_pkg.update_amount_f_ctl_id(
p_customer_trx_line_id,
l_new_line_rec.extended_amount,
p_foreign_currency_code,
pg_base_curr_code,
p_exchange_rate,
pg_base_precision,
pg_base_min_acct_unit );
/* Check if any gl_dist rows are inserted for the current trx_line.*/
BEGIN
SELECT customer_trx_line_id
INTO l_dist_line
FROM ra_cust_trx_line_gl_dist
WHERE customer_trx_line_id = p_customer_trx_line_id
AND account_set_flag = 'N'
AND ROWNUM < 2;
ARP_CTLGD_PKG.update_f_ctl_id(l_dist_rec,p_customer_trx_line_id,'N','');
linked to the line updated above apart from the REC row*/
DECLARE
cursor c1 is select customer_trx_line_id
from ra_customer_trx_lines
where link_to_cust_trx_line_id = p_customer_trx_line_id;
ARP_CTLGD_PKG.update_f_ctl_id(l_dist_rec,l_id,'N','');
arp_util.debug('arp_process_line.update_line()-');
arp_util.debug('EXCEPTION: arp_process_line.update_line()');
arp_util.debug('---------- parameters for update_line() ---------');
| delete_line |
| |
| DESCRIPTION |
| Deletes records from ra_customer_trx_lines |
| |
| SCOPE - PUBLIC |
| |
| EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
| arp_util.debug |
| |
| ARGUMENTS : IN: |
| p_form_name |
| p_form_version |
| p_customer_trx_line_id |
| p_complete_flag |
| p_recalculate_tax_flag |
| p_trx_amount |
| p_exchange_rate |
| p_line_rec |
| IN / OUT: |
| p_gl_date |
| p_trx_date |
| OUT: |
| p_status |
| |
| RETURNS : NONE |
| |
| NOTES |
| |
| MODIFICATION HISTORY |
| 24-JUL-95 Charlie Tomberg Created |
| 15-MAR-96 Martin Johnson Delete from ar_credit_memo_amounts if |
| the transaction is a credit memo with |
| rules. |
| Do not derive gl and trx dates for CM's|
| 20-MAY-96 Martin Johnson BugNo:356814. Added OUT NOCOPY parameter |
| p_status. Call tax engine in |
| 'DEFERRED' mode so that 'soft' |
| excpetion will be raise. |
| 21-OCT-1997 OSTEINME Bug 565566:
| added call to procedure
| arp_ctlgd_pkg.delete_f_ct_ltctl_id_type
| |
+===========================================================================*/
PROCEDURE delete_line(p_form_name IN varchar2,
p_form_version IN number,
p_customer_trx_line_id IN
ra_customer_trx_lines.customer_trx_line_id%type,
p_complete_flag IN ra_customer_trx.complete_flag%type,
p_recalculate_tax_flag IN boolean,
p_trx_amount IN number,
p_exchange_rate IN ra_customer_trx.exchange_rate%type,
p_header_currency_code IN fnd_currencies.currency_code%type,
p_gl_date IN OUT NOCOPY ra_cust_trx_line_gl_dist.gl_date%type,
p_trx_date IN OUT NOCOPY ra_customer_trx.trx_date%type,
p_line_rec IN ra_customer_trx_lines%rowtype,
p_status OUT NOCOPY varchar2 ) IS
l_recalculate_tax_flag boolean;
select alc.customer_trx_line_id
from ra_customer_trx_lines ctl,
ar_line_conts alc
where
ctl.customer_trx_line_id = p_customer_trx_line_id
and ctl.customer_trx_line_id = alc.customer_trx_line_id
and ctl.line_type = 'LINE'
FOR UPDATE OF alc.customer_trx_line_id NOWAIT;
select customer_trx_line_id
from ar_deferred_lines
where customer_trx_line_id = p_customer_trx_line_id
FOR UPDATE OF customer_trx_line_id NOWAIT;
arp_util.debug('arp_process_line.delete_line()+');
arp_process_line.val_delete_line(p_line_rec,
p_complete_flag);
arp_etax_services_pkg.before_delete_line(
p_customer_trx_line_id => p_customer_trx_line_id,
p_customer_trx_id => p_line_rec.customer_trx_id);
| Delete the account assignments associated with |
| the freight line. |
+---------------------------------------------------*/
arp_ctlgd_pkg.delete_f_ct_ltctl_id_type(
p_line_rec.customer_trx_id,
p_customer_trx_line_id,
'FREIGHT',
NULL,
NULL);
| Delete the tax and freight lines that are associated with this |
| line of type LINE. |
+------------------------------------------------------------------*/
arp_ctl_pkg.delete_f_ltctl_id( p_customer_trx_line_id );
| Delete the salescredits associated with this line. |
+------------------------------------------------------*/
arp_ctls_pkg.delete_f_ctl_id( p_customer_trx_line_id );
| Delete the account assignments and account sets |
| associated with this line. |
+---------------------------------------------------*/
arp_ctlgd_pkg.delete_f_ctl_id( p_customer_trx_line_id,
null,
null );
| Delete from ar_credit_memo_amounts if the transaction is |
| a credit memo with rules. |
+------------------------------------------------------------*/
IF ( (p_line_rec.previous_customer_trx_line_id IS NOT NULL) AND
(p_line_rec.accounting_rule_id IS NOT NULL ) )
THEN
arp_cma_pkg.delete_f_ctl_id( p_customer_trx_line_id );
delete from ar_line_conts
where customer_trx_line_id = l_cont_rec.customer_trx_line_id;
delete from ar_deferred_lines
WHERE customer_trx_line_id = l_deferred_rec.customer_trx_line_id;
| call the table-handler to delete the line record |
+-----------------------------------------------------*/
arp_ctl_pkg.delete_p( p_customer_trx_line_id );
| of the rule schedule of the line that has just been deleted. |
| arp_dates.derive_gl_trx_dates_from_rules() rederives and resets |
| the trx_date and gl_date. |
| |
| If the line that was deleted was the last line on a transaction |
| that has header freight and rules, the transaction is no longer |
| valid because header freight only transactions cannot have rules. |
| header_freight_only_rules_case() converts the transaction to one |
| without rules in this case. |
+--------------------------------------------------------------------*/
IF (p_line_rec.accounting_rule_id IS NOT NULL )
THEN
IF ( p_line_rec.previous_customer_trx_line_id IS NULL )
THEN
arp_dates.derive_gl_trx_dates_from_rules(
p_line_rec.customer_trx_id,
p_gl_date,
p_trx_date,
l_recalculate_tax_flag);
THEN -- salestax delete
-- call header tax in update mode if the trx_date has changed
-- (the tax may not be valid for the new trx_date)
null;
arp_util.debug('arp_process_line.delete_line()-');
arp_util.debug('EXCEPTION: arp_process_line.delete_line()');
arp_util.debug('---------- parameters for delete_line() ---------');