and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
...
@@ -121,7 +122,7 @@ SELECT h.period_year,
...
@@ -121,7 +122,7 @@ SELECT h.period_year,
GROUP BY l.reference1,
GROUP BY l.reference1,
reference3,
reference3,
reference4,
reference4,
h.journal_num,
h.sbo_num,
l.cashflow_id,
l.cashflow_id,
l.journal_header_id,
l.journal_header_id,
h.je_transaction_code,
h.je_transaction_code,
...
@@ -136,12 +137,12 @@ SELECT h.period_year,
...
@@ -136,12 +137,12 @@ SELECT h.period_year,
h.period_num,
h.period_num,
h.internal_period_num,
h.internal_period_num,
h.journal_date,
h.journal_date,
h.journal_num,
h.sbo_num journal_num,
reference3 contract_number,
reference3 contract_number,
reference4 bp_code,
reference1 bp_code,
(SELECT BP_NAME
(SELECT BP_NAME
FROM hls_bp_master
FROM hls_bp_master
WHERE bp_code = reference4
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
AND ROWNUM = 1) bp_name,
l.journal_header_id,
l.journal_header_id,
(SELECT hi.invoice_date
(SELECT hi.invoice_date
...
@@ -168,7 +169,7 @@ SELECT h.period_year,
...
@@ -168,7 +169,7 @@ SELECT h.period_year,
AND ROWNUM = 1)
AND ROWNUM = 1)
due_amount,
due_amount,
(SELECT principal
(SELECT due_amount
FROM con_contract_cashflow
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND cf_item = 2
...
@@ -204,6 +205,7 @@ SELECT h.period_year,
...
@@ -204,6 +205,7 @@ SELECT h.period_year,
h.je_transaction_code
h.je_transaction_code
FROM hls_journal_header h, hls_journal_detail l
FROM hls_journal_header h, hls_journal_detail l
WHERE h.journal_header_id = l.journal_header_id
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
AND h.je_transaction_code = 'LEASE_INCEPT'
AND h.je_transaction_code = 'LEASE_INCEPT'
AND l.je_template_ln_id = 8797
AND l.je_template_ln_id = 8797
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
...
@@ -121,7 +122,7 @@ SELECT h.period_year,
...
@@ -121,7 +122,7 @@ SELECT h.period_year,
GROUP BY l.reference1,
GROUP BY l.reference1,
reference3,
reference3,
reference4,
reference4,
h.journal_num,
h.sbo_num,
l.cashflow_id,
l.cashflow_id,
l.journal_header_id,
l.journal_header_id,
h.je_transaction_code,
h.je_transaction_code,
...
@@ -136,12 +137,12 @@ SELECT h.period_year,
...
@@ -136,12 +137,12 @@ SELECT h.period_year,
h.period_num,
h.period_num,
h.internal_period_num,
h.internal_period_num,
h.journal_date,
h.journal_date,
h.journal_num,
h.sbo_num journal_num,
reference3 contract_number,
reference3 contract_number,
reference4 bp_code,
reference1 bp_code,
(SELECT BP_NAME
(SELECT BP_NAME
FROM hls_bp_master
FROM hls_bp_master
WHERE bp_code = reference4
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
AND ROWNUM = 1) bp_name,
l.journal_header_id,
l.journal_header_id,
(SELECT hi.invoice_date
(SELECT hi.invoice_date
...
@@ -168,7 +169,7 @@ SELECT h.period_year,
...
@@ -168,7 +169,7 @@ SELECT h.period_year,
AND ROWNUM = 1)
AND ROWNUM = 1)
due_amount,
due_amount,
(SELECT principal
(SELECT due_amount
FROM con_contract_cashflow
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND cf_item = 2
...
@@ -204,6 +205,7 @@ SELECT h.period_year,
...
@@ -204,6 +205,7 @@ SELECT h.period_year,
h.je_transaction_code
h.je_transaction_code
FROM hls_journal_header h, hls_journal_detail l
FROM hls_journal_header h, hls_journal_detail l
WHERE h.journal_header_id = l.journal_header_id
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
AND h.je_transaction_code = 'LEASE_INCEPT'
AND h.je_transaction_code = 'LEASE_INCEPT'
AND l.je_template_ln_id = 8797
AND l.je_template_ln_id = 8797
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))