The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT xle_auth.city tax_office_location
,xle_auth.address3 tax_office_code
FROM XLE_FIRSTPARTY_INFORMATION_V xfpiv
, xle_registrations xle_reg
, xle_legalauth_v xle_auth
WHERE xle_reg.source_id = xfpiv.legal_entity_id
AND xle_reg.source_table = 'XLE_ENTITY_PROFILES'
AND xle_auth.legalauth_id (+) = xle_reg.issuing_authority_id
AND xle_reg.identifying_flag = 'Y'
AND xfpiv.legislative_cat_code = 'INCOME_TAX'
AND xfpiv.legal_entity_id = p_le_id;
SELECT activity_code
INTO l_activity_code
FROM xle_entity_profiles
WHERE legal_entity_id = l_legal_entity_id;
SELECT precision
INTO l_precision
FROM fnd_currencies
WHERE currency_code = l_func_curr;
INSERT INTO jg_zz_vat_trx_gt
(
jg_info_n1
,jg_info_v1
,jg_info_v2
,jg_info_v3
,jg_info_v4
,jg_info_v5
,jg_info_v6
,jg_info_v7
,jg_info_v8
,jg_info_v9
,jg_info_v10
,jg_info_v11
,jg_info_v12
,jg_info_v13
,jg_info_v14
,jg_info_v15
,jg_info_v16
,jg_info_v17
,jg_info_d1
,jg_info_d2
,jg_info_v20
,jg_info_v21
,jg_info_n25
,jg_info_v30
,jg_info_v22
,jg_info_v23
,jg_info_v24
)
VALUES
(
l_legal_entity_id
,l_company_name ---l_legal_entity_name
,l_tax_registration_num
,l_registration_num --l_tax_payer_id
,l_contact_name
,l_address_line_1
,l_address_line_2
,l_address_line_3
,l_address_line_4
,l_city
,l_country
,l_phone_number
,l_postal_code
,l_func_curr
,l_reporting_status
,l_tax_regime
,l_activity_code
,l_tax_registration_num
,l_period_end_date
,l_period_start_date
,l_tax_office_location
,l_tax_office_code
,l_precision -- currency precision
,'H'
,l_province
,l_comm_num
,l_vat_reg_num
);
SELECT
JZVRS.tax_calendar_year PERIOD_YEAR
, JZVRS.tax_calendar_period PERIOD_NAME
, NVL(AL.tax_box, '99') TAX_BOX
, NVL(AL.taxable_box, '99') TAXABLE_BOX
, TBLLOOKUP.description TAXABLEBOX_DESCRIPTION
, TLOOKUP.description TAXBOX_DESCRIPTION
, JG.extract_source_ledger SOURCE
, JG.doc_seq_name DOCUMENT_SEQ_NAME
, JG.doc_seq_value DOCUMENT_SEQ_VALUE
/**************************************************
Commented the below code for Bug 7344931 and added GL_DATE
, fnd_date.date_to_displaydate(JG.trx_date) GL_DATE
**************************************************/
, JG.gl_date GL_DATE
, JG.billing_tp_number TRADING_PARTNER_NUMBER
, JG.billing_tp_name TRADING_PARTNER_NAME
, JG.trx_number INVOICE
, JG.trx_line_number LINE_NUMBER
, JG.tax_rate_Code VAT_CODE
, JG.tax_rate_vat_trx_type_code VAT_TRANSACTION_TYPE
, JG.taxable_amt * to_number (alr.taxable_non_rec_sign_flag || '1') TAXABLE_AMOUNT
, JG.tax_amt * to_number(decode(JG.extract_source_ledger, 'AP',
decode(jg.tax_recoverable_flag, 'Y',
alr.tax_rec_sign_flag, alr.tax_non_rec_sign_flag) || '1',
alr.tax_rec_sign_flag || '1')) TAX_AMOUNT
FROM
jg_zz_vat_box_allocs AL
, jg_zz_vat_alloc_rules alr
, jg_zz_vat_trx_details JG
, fnd_lookup_values TLOOKUP
, fnd_lookup_values TBLLOOKUP
, jg_zz_vat_rep_status JZVRS
WHERE
NVL(AL.taxable_box, '99') = TBLLOOKUP.lookup_code
AND NVL(AL.tax_box, '99') = TLOOKUP.lookup_code -- brathod, Using AND condition instead of OR
AND TLOOKUP.lookup_type = 'JGZZ_VAT_REPORT_BOXES'
AND TBLLOOKUP.lookup_type = 'JGZZ_VAT_REPORT_BOXES'
AND TLOOKUP.language = USERENV('LANG') -- Modified for bug 6189243 used col "language" instead of "source_lang"
AND TBLLOOKUP.language = USERENV('LANG') -- Modified for bug 6189243 used col "language" instead of "source_lang"
AND AL.PERIOD_TYPE = 'PERIODIC'
AND jg.tax_rate_vat_trx_type_code BETWEEN NVL( P_VAT_TRX_TYPE_LOW,jg.tax_rate_vat_trx_type_code )
AND NVL( P_VAT_TRX_TYPE_HIGH,jg.tax_rate_vat_trx_type_code )
AND JZVRS.reporting_status_id = JG.reporting_status_id
AND AL.vat_transaction_id = JG.vat_transaction_id
AND alr.allocation_rule_id = al.allocation_rule_id
AND (P_vat_box IS NULL OR AL.tax_box = P_vat_box OR AL.taxable_box = P_vat_box)
AND JG.extract_source_ledger = NVL(P_source,JG.extract_source_ledger)
AND (JG.doc_seq_name = P_doc_name OR P_doc_name IS NULL)
AND (JG.doc_seq_value = P_doc_seq_value OR P_doc_seq_value IS NULL)
AND JZVRS.vat_reporting_entity_id = P_vat_rep_entity_id
AND JZVRS.tax_calendar_period = P_PERIOD
ORDER BY
JG.trx_date
, AL.tax_box
, source
, JG.doc_seq_name
, JG.doc_seq_value
, DECODE (jg.extract_source_ledger
,'AR', JG.trx_line_number
,'AP', JG.trx_line_number
,'GL', JG.trx_line_number);
INSERT INTO jg_zz_vat_trx_gt
(
jg_info_n1
, jg_info_v1
, jg_info_v2
, jg_info_v3
, jg_info_v4
, jg_info_v5
, jg_info_n2
, jg_info_d1
, jg_info_v6
, jg_info_v7
, jg_info_v8
, jg_info_n3
, jg_info_v9
, jg_info_v10
, jg_info_n4
, jg_info_n5
)
VALUES(
l_box_amount_grouped(i).period_year
, l_box_amount_grouped(i).period_name
, l_box_amount_grouped(i).vat_report_box
, l_box_amount_grouped(i).vat_box_description
, l_box_amount_grouped(i).source
, l_box_amount_grouped(i).document_seq_name
, l_box_amount_grouped(i).document_seq_value
, l_box_amount_grouped(i).gl_date
, l_box_amount_grouped(i).trading_partner_number
, l_box_amount_grouped(i).trading_partner_name
, l_box_amount_grouped(i).invoice
, l_box_amount_grouped(i).line_number
, l_box_amount_grouped(i).vat_code
, l_box_amount_grouped(i).vat_transaction_type
, l_box_amount_grouped(i).taxable_amount
, l_box_amount_grouped(i).tax_amount
);
SELECT count(*) into l_count from jg_zz_vat_trx_gt ;
fnd_file.put_line(fnd_file.log,'Number of records inserted into jg_zz_vat_trx_gt table: ' || l_count );
SELECT
NVL(
DECODE(ALLOCBOX.tax_recoverable_flag,
'Y',TO_NUMBER(ALLOCBOX.taxable_box)),1000) TXBL_REC_BOX
, NVL(
DECODE(NVL(ALLOCBOX.tax_recoverable_flag,'N'),
'N',TO_NUMBER(ALLOCBOX.taxable_box)),1000) TXBL_NRC_BOX
, DECODE(JG.extract_source_ledger
,'AP', DECODE(JG.tax_recoverable_flag,'Y', NVL(JG.taxable_amt_funcl_curr ,0))
,NVL(JG.taxable_amt_funcl_curr ,0)) TXBL_AMOUNT
, DECODE(JG.extract_source_ledger
,'AP', DECODE(JG.tax_recoverable_flag,'N', NVL(JG.taxable_amt_funcl_curr ,0))
,NVL(JG.taxable_amt_funcl_curr ,0)) TXBL_NRC_AMOUNT
/* , DECODE(ALLOCBOX.tax_recoverable_flag,
'Y',taxable_amt, 0) TXBL_AMOUNT
, DECODE(ALLOCBOX.tax_recoverable_flag,'Y',0,taxable_amt ) TXBL_NRC_AMOUNT */
, NVL(TO_NUMBER(ALLOCRUL.TOTAL_BOX),1000) TOTAL_BOX
, NVL(TO_NUMBER(ALLOCBOX.tax_box),1000) TAX_BOX --Here we have to identify, whether this tax box is recoverable or non-rec box.
, NVL(DECODE(JG.extract_source_ledger,'GL',
DECODE(JG.prl_no,
'I',(NVL(JG.taxable_amt_funcl_curr ,0)*(NVL(JG.tax_rate,0)/100))*(NVL(JG.tax_recovery_rate,0)/ 100),
'O',((NVL(JG.taxable_amt_funcl_curr,0)*(NVL(JG.tax_rate,0)/100))*(NVL(JG.tax_recovery_rate,0)/ 100)*-1 ))
,DECODE(JG.extract_source_ledger,'AP',NVL(JG.tax_amt_funcl_curr , 0)
,DECODE(JG.extract_source_ledger,'AR',NVL(JG.tax_amt_funcl_curr , 0)*-1)))
,0) TAX_AMOUNT
, DECODE(JG.application_id,
200,'I',
222,'0',
101,JG.prl_no) TAX_CLASS
, JG.tax_rate_code TAX_CODE_RATE
, JG.tax_rate TAX_RATE
, JG.trx_id TRANSACTION_ID
, JG.trx_number TRX_NUMBER
, JG.extract_source_ledger SOURCE_LEDGER
, JG.tax_recovery_rate TAX_RECV_RATE
, ALLOCBOX.tax_recoverable_flag TAX_RECOVERABLE_FLAG
, JG.extract_source_ledger EXTRACT_SOURCE_LEDGER
, AllOCBOX.allocation_rule_id ALLOCATION_RULE_ID
FROM jg_zz_vat_trx_details JG
, jg_zz_vat_rep_status JZVRS
, jg_zz_vat_box_allocs AllOCBOX
, jg_zz_vat_alloc_rules ALLOCRUL
WHERE JZVRS.reporting_status_id = JG.reporting_status_id
AND JZVRS.vat_reporting_entity_id = p_vat_rep_entity_id
AND JZVRS.tax_calendar_year = p_period
AND JG.pt_location = p_location
AND AllOCBOX.vat_transaction_id = JG.vat_transaction_id
AND AllOCBOX.allocation_rule_id = ALLOCRUL.allocation_rule_id
AND AllOCBOX.period_type = 'ANNUAL'
ORDER BY JG.trx_id,
AllOCBOX.allocation_rule_id;
INSERT INTO jg_zz_vat_trx_gt ( jg_info_n1
,jg_info_n2
,jg_info_n3
,jg_info_n4
,jg_info_v1
)
VALUES(
i,
v_box_amounts(i).taxable_amount,
v_box_amounts(i).tax_amount,
v_box_amounts(i).tot_box_num,
v_box_amounts(i).box_type
);
INSERT INTO jg_zz_vat_trx_gt ( jg_info_n1
,jg_info_n2
,jg_info_n3
,jg_info_n5
,jg_info_v1
)
VALUES(
floor(i/10000) + decode(sign(v_box_amounts(i).tax_rate), -1, 1, 0)
,v_box_amounts(i).taxable_amount
,v_box_amounts(i).tax_amount
,v_box_amounts(i).tax_rate
,v_box_amounts(i).box_type
);
select count(*) into l_count from jg_zz_vat_trx_gt ;
fnd_file.put_line(fnd_file.log,'Number of records inserted into jg_zz_vat_trx_gt table :' || l_count );
SELECT NVL(TO_NUMBER(al.taxable_box), 1000) TAXABLE_BOX
, NVL(taxable_amt_funcl_curr , 0) TAXABLE_AMOUNT
, NVL(TO_NUMBER(al.tax_box), 1000) TAX_BOX
, NVL(DECODE(DECODE(JG.extract_source_ledger
,'GL',DECODE(JG.PRL_NO,'I','AP','O','AR')
,JG.extract_source_ledger)
, 'AP', DECODE(SIGN(tax_amt_funcl_curr )
, 1 , DECODE(trx_line_class,'AP_CREDIT_MEMO',0,
'AP_DEBIT_MEMO',0,tax_amt_funcl_curr )
, DECODE(reporting_code
, 'OFFSET' , 0
, DECODE(trx_line_class
, 'AP_CREDIT_MEMO' , 0
, 'AP_DEBIT_MEMO' , 0
,tax_amt_funcl_curr )))
, 'AR', DECODE(reporting_code
, 'OFFSET',DECODE(SIGN(tax_amt_funcl_curr ), 1,tax_amt_funcl_curr )
, DECODE(SIGN(tax_amt_funcl_curr ), -1, tax_amt_funcl_curr * -1 , 0))), 0) DEDUCT_TAX
, NVL(DECODE(DECODE(JG.extract_source_ledger
,'GL',DECODE(JG.PRL_NO,'I','AP','O','AR')
,JG.extract_source_ledger)
, 'AP', DECODE(SIGN(tax_amt_funcl_curr )
, -1, DECODE(reporting_code
, 'OFFSET', tax_amt_funcl_curr * -1
, DECODE(trx_line_class
, 'AP_CREDIT_MEMO',tax_amt_funcl_curr *-1
, 'AP_DEBIT_MEMO',tax_amt_funcl_curr * -1,0))
, DECODE(trx_line_class
, 'AP_CREDIT_MEMO' ,tax_amt_funcl_curr
, 'AP_DEBIT_MEMO',tax_amt_funcl_curr,0))
, 'AR', DECODE(reporting_code
, 'OFFSET',DECODE(SIGN(tax_amt_funcl_curr ), -1,tax_amt* -1 )
, DECODE(SIGN(tax_amt_funcl_curr ), 1, tax_amt_funcl_curr , 0))), 0) CLEAR_TAX
, JG.trx_line_class TRX_LINE_CLASS
, JG.tax_rate_code TAX_RATE_CODE
, JG.trx_id TRX_ID
, JG.tax_recoverable_flag TAX_RECOVERABLE_FLAG
, JG.trx_number TRX_NUMBER
, DECODE(JG.application_id, 200,'I', 222,'O',
101,JG.prl_no) TAX_CLASS
,JG.extract_source_ledger EXTRACT_SOURCE_LEDGER
,JG.reporting_code REPORTING_CODE
FROM jg_zz_vat_trx_details JG
, jg_zz_vat_rep_status JZVRS
, jg_zz_vat_box_allocs AL
WHERE decode(JG.extract_source_ledger,'AP',NVL(JG.tax_recoverable_flag,'N'),'Y') ='Y' -- Bug 5561879
AND JZVRS.reporting_status_id = JG.reporting_status_id
AND AL.vat_transaction_id = JG.vat_transaction_id
AND AL.period_type = 'PERIODIC'
AND JZVRS.tax_calendar_period = p_period
AND JZVRS.vat_reporting_entity_id = p_vat_rep_entity_id
AND JG.pt_location = p_location ;
INSERT INTO jg_zz_vat_trx_gt(
jg_info_n1,
jg_info_n2,
jg_info_n3,
jg_info_n4,
jg_info_v1
)
VALUES(
i,
v_box_amounts(i).taxable_amount,
v_box_amounts(i).deduct_tax,
v_box_amounts(i).clear_tax,
v_box_amounts(i).box_type
);
SELECT count(*) into l_count from jg_zz_vat_trx_gt ;
fnd_file.put_line(fnd_file.log,'Number of records inserted into jg_zz_vat_trx_gt table: ' || l_count );
SELECT
tax_rate_code TAX_RATE_CODE
, tax_rate_code_description VAT_CODE_DESC
, trx_id TRX_ID
, DECODE(extract_source_ledger,'AP',taxable_amt*(tax_recovery_rate/100),taxable_amt) TAXABLE_AMT
, tax_amt TAX_AMT
/****************************************************
Re ordered the query to keep it in sync with the Insert query used
below
Bug 7355610 START
****************************************************
, DECODE(extract_source_ledger,'AP',taxable_amt_funcl_curr*(tax_recovery_rate/100),taxable_amt_funcl_curr) TAXABLE_AMT_FUNCL_CURR
, tax_amt_funcl_curr TAX_AMT_FUNCL_CURR
***************************************************/
, tax_amt_funcl_curr TAX_AMT_FUNCL_CURR
, DECODE(extract_source_ledger,'AP',taxable_amt_funcl_curr*(tax_recovery_rate/100),taxable_amt_funcl_curr) TAXABLE_AMT_FUNCL_CURR
/**************************************************
Bug 7355610 END
**************************************************/
, doc_seq_id DOC_SEQ_ID
, extract_source_ledger EXTRACT_SOURCE_LEDGER
, trx_line_type TRX_LINE_TYPE
, accounting_date ACCOUNTING_DATE
-- Bug 6238170 Start
--, tax_type_code TAX_TYPE_CODE
, reporting_code REPORTING_CODE
-- Bug 6238170 End
, gl_transfer_flag GL_TRANSFER_FLAG
, tax_rate_register_type_code TAX_RATE_REGISTER_TYPE_CODE
, trx_currency_code TRX_CURRENCY_CODE
, tax_recovery_rate TAX_RECOVERY_RATE
, tax_recoverable_flag TAX_RECOVERABLE_FLAG
, tax_rate_id TAX_RATE_ID
, trx_number TRX_NUMBER
, DECODE(credit_balance_amt,NULL,0,credit_balance_amt) CREDIT_BALANCE_AMT
, assessable_value ASSESSABLE_VALUE
FROM
jg_zz_vat_trx_details JG
, jg_zz_vat_rep_status JZVRS
WHERE JZVRS.reporting_status_id = JG.reporting_status_id
AND JZVRS.vat_reporting_entity_id = p_vat_rep_entity_id
AND JZVRS.tax_calendar_period = p_period ;
INSERT INTO jg_zz_vat_trx_gt
(
jg_info_v1
,jg_info_v2
,jg_info_n1
,jg_info_n2
,jg_info_n3
,jg_info_n4
,jg_info_n5
,jg_info_n6
,jg_info_v3 --extract_source_ledger
,jg_info_v4 --trx_line_type
,jg_info_v5
,jg_info_v6 --reporting_code
-- ,jg_info_d1 --bug5573113
,jg_info_v7 --tax_rate_register_type_code
,jg_info_v8
,jg_info_n7
,jg_info_v9 --tax_recoverable_flag
,jg_info_n9
,jg_info_v10
,jg_info_n10
,jg_info_n11
)
VALUES
(l_it_vat.tax_rate_code
,l_it_vat.vat_code_desc
,l_it_vat.trx_id
,l_it_vat.taxable_amt
/******************************************
Reordered the way of inserting into the temp table as it was not
in sync with the Query used to fetch the values in data definition
jgzzsummaryall.xml
Bug 7355610 START
,l_it_vat.taxable_amt_funcl_curr
,l_it_vat.tax_amt
,l_it_vat.tax_amt_funcl_curr
*****************************************/
,l_it_vat.tax_amt
,l_it_vat.tax_amt_funcl_curr
,l_it_vat.taxable_amt_funcl_curr
/***************************************
Bug 7355610 END
****************************************/
,l_it_vat.doc_seq_id
,l_it_vat.extract_source_ledger
,l_it_vat.trx_line_type
,l_it_vat.accounting_date
-- Bug 6238170 Start
--,l_it_vat.tax_type_code
,l_it_vat.reporting_code
-- Bug 6238170 End
--,l_it_vat.gl_transfer_flag --bug5573113
,l_it_vat.tax_rate_register_type_code
,l_it_vat.trx_currency_code
,l_it_vat.tax_recovery_rate
,l_it_vat.tax_recoverable_flag
,l_it_vat.tax_rate_id
,l_it_vat.trx_number
,l_it_vat.credit_balance_amt
,l_it_vat.assessable_value
);
SELECT count(*) into l_count from jg_zz_vat_trx_gt ;
fnd_file.put_line(fnd_file.log,'Number of records inserted into jg_zz_vat_trx_gt table: ' || l_count );
SELECT SUM(tax_amt_funcl_curr)
INTO invoice_values
FROM jg_zz_vat_trx_details
WHERE trx_id = p_cust_trx_id
AND application_id = 200
AND event_class_code = 'PURCHASE_TRANSACTION'
AND entity_code = 'AP_INVOICES';
SELECT SUM(tax_amt)
INTO invoice_values
FROM jg_zz_vat_trx_details
WHERE trx_id = p_cust_trx_id
AND application_id = 200
AND event_class_code = 'PURCHASE_TRANSACTION'
AND entity_code = 'AP_INVOICES';
SELECT meaning
INTO l_detail_summary
FROM fnd_lookups
WHERE lookup_type = 'JEBE_REPORT_FORMAT'
AND lookup_code = P_REPORT_FORMAT
AND p_report_name = 'JEBEVA06';
SELECT FFV.description
INTO l_location_name
FROM fnd_flex_values_vl FFV
, fnd_flex_value_sets FFVS
WHERE FFV.flex_value_set_id = FFVS.flex_value_set_id
AND FFVS.flex_value_set_name = 'JEPT_TAX_LOCATION'
AND FFV.flex_value = P_LOCATION;
SELECT NVL(jiy.adjusted_limit_amount, 0)
INTO l_starting_limit
FROM je_it_year_ex_limit JIY,
fnd_lookups fl
WHERE fl.lookup_type = 'JEIT_MONTH'
AND JIY.month = fl.lookup_code
AND JIY.year = to_char(P_PERIOD,'RRRR')
AND JIY.month = to_char(P_PERIOD,'MM')
AND JIY.legal_entity_id = P_LEGAL_ENTITY_ID ;
SELECT NVL(JIY.adjusted_limit_amount, 0)
INTO l_adjustment_limit
FROM je_it_year_ex_limit JIY
WHERE JIY.year = to_char(P_PERIOD,'RRRR')
AND JIY.month = to_char(P_PERIOD,'MM')
AND JIY.legal_entity_id = P_LEGAL_ENTITY_ID ;
SELECT
JZVRS.CREDIT_BALANCE_AMT,
JZVRS.FINAL_REPORTING_STATUS_FLAG,
jg_zz_vat_rep_utility.get_last_processed_date(p_vat_rep_entity_id,'ALL','FINAL REPORTING') LAST_PROCESS_DATE
FROM jg_zz_vat_rep_status JZVRS
WHERE JZVRS.vat_reporting_entity_id = p_vat_rep_entity_id
AND JZVRS.tax_calendar_period = p_period
AND ROWNUM = 1;
SELECT jg_info_d2 FROM jg_zz_vat_trx_gt WHERE jg_info_v30 = 'H';
SELECT
max(JZVRS.period_end_date)
FROM
jg_zz_vat_rep_status JZVRS
WHERE
JZVRS.vat_reporting_entity_id = p_vat_rep_entity_id
AND JZVRS.period_end_date <
(SELECT max(JZVRS1.period_end_date)
FROM jg_zz_vat_rep_status JZVRS1
WHERE JZVRS1.tax_calendar_period = p_period
AND JZVRS1.vat_reporting_entity_id = p_vat_rep_entity_id
AND JZVRS1.final_reporting_status_flag = 'S'
)
AND (JZVRS.final_reporting_status_flag = 'S')
;
SELECT
JZVRS.CREDIT_BALANCE_AMT
FROM jg_zz_vat_rep_status JZVRS
WHERE JZVRS.vat_reporting_entity_id = p_vat_rep_entity_id
AND JZVRS.tax_calendar_period =( SELECT JZVRS1.tax_calendar_period
FROM jg_zz_vat_rep_status JZVRS1
WHERE
JZVRS1.vat_reporting_entity_id = p_vat_rep_entity_id
AND TRUNC(JZVRS1.period_end_date) = pn_last_process_date
AND ROWNUM =1)
AND ROWNUM = 1;
SELECT
JZVRS.FINAL_REPORTING_STATUS_FLAG
FROM jg_zz_vat_rep_status JZVRS
WHERE JZVRS.vat_reporting_entity_id = p_vat_rep_entity_id
AND JZVRS.tax_calendar_period = p_period
AND ROWNUM = 1;
JEITPSSR_AMOUNT_TO_PAY_UPDATE function
IF FINAL_FLAG = 'S' THEN
IF AMOUNT_TO_PAY >= 0 THEN
CARRY_OVER := 0;
UPDATE jg_zz_vat_rep_status SET CREDIT_BALANCE_AMT=CARRY_OVER
WHERE vat_reporting_entity_id = p_vat_rep_entity_id
AND tax_calendar_period = p_period;
/****Added below function JEITPSSR_AMOUNT_TO_PAY_UPDATE for bug 7633948***/
FUNCTION JEITPSSR_AMOUNT_TO_PAY_UPDATE(AMOUNT_TO_PAY IN NUMBER)
RETURN BOOLEAN IS
FINAL_FLAG VARCHAR2(1);
SELECT
JZVRS.FINAL_REPORTING_STATUS_FLAG
FROM jg_zz_vat_rep_status JZVRS
WHERE JZVRS.vat_reporting_entity_id = p_vat_rep_entity_id
AND JZVRS.tax_calendar_period = p_period
AND ROWNUM = 1;
UPDATE jg_zz_vat_rep_status SET CREDIT_BALANCE_AMT=CARRY_OVER
WHERE vat_reporting_entity_id = p_vat_rep_entity_id
AND tax_calendar_period = p_period;
fnd_file.put_line(fnd_file.log,'Error in Procedure jg_zz_summary_all_pkg.JEITPSSR_AMOUNT_TO_PAY_UPDATE ' || SUBSTR(SQLERRM,1,200));
END JEITPSSR_AMOUNT_TO_PAY_UPDATE;