345: select tax_rate_id
346: from ap_awt_tax_rates_all
347: where tax_name in (
348: select name from ap_tax_codes_all
349: where awt_vendor_id = fnd_profile.value('IGI_CIS2007_TAX_AUTHORITY')));
350: --when the WHT is applied at the invoice validation level
351: Cursor C_inv_cis_tax is
352: Select nvl(sum(amount),0) awt_amount
353: From ap_invoice_distributions
358: select tax_rate_id
359: from ap_awt_tax_rates_all
360: where tax_name in (
361: select name from ap_tax_codes_all
362: where awt_vendor_id = fnd_profile.value('IGI_CIS2007_TAX_AUTHORITY')));
363: l_inv_amount number;
364: l_inv_labour_amount number; --igi_cis_mth_ret_pay_t.labour_cost%Type;
365: l_inv_material_amount number; --igi_cis_mth_ret_pay_t.material_cost%Type;
366: l_awt_amount number; --igi_cis_mth_ret_pay_t.total_deductions%Type;
659: total_deductions, discount_amount from igi_cis_mth_ret_pay_gt;*/
660: -- get the reporting entity information
661: Cursor C_rep_entity is
662: Select UNIQUE_TAX_REFERENCE_NUM,ACCOUNTS_OFFICE_REFERENCE,
663: TAX_OFFICE_NUMBER,PAYE_REFERENCE,fnd_profile.value('ORG_ID') ORG_ID,
664: CIS_SENDER_ID
665: From AP_REPORTING_ENTITIES
666: Where UNIQUE_TAX_REFERENCE_NUM is not null;
667: Cursor C_prev_return is
761: From AP_OTHER_PERIODS aop,
762: (SELECT decode(SIGN(to_number(to_char(sysdate, 'DD')) -6), -1, add_months(to_date(('05-' || to_char(sysdate, 'MM-YYYY')), 'DD-MM-YYYY'), 3),
763: add_months(to_date(('05-' || to_char(sysdate, 'MM-YYYY')),'DD-MM-YYYY'), 4)) end_date_criteria from dual) temp
764: where aop.period_type =
765: fnd_profile.value('IGI_CIS2007_CALENDAR')
766: and aop.period_year <= 2099
767: and aop.end_date between to_date('05-05-2007', 'DD-MM-YYYY')
768: AND
769: temp.end_date_criteria
876: -- get the start_date and end_date from ap_other_periods
877: select start_date,end_date
878: into l_period_start_date,l_period_end_date
879: from ap_other_periods
880: where period_type = fnd_profile.value('IGI_CIS2007_CALENDAR')
881: and period_name = p_period_name;
882:
883: log(C_STATE_LEVEL, l_procedure_name, 'l_period_start_date='||l_period_start_date);
884: log(C_STATE_LEVEL, l_procedure_name, 'l_period_end_date='||l_period_end_date);