668: Begin
669: errcd := 0;
670: select j.due_date
671: into duedt
672: from jl_br_ap_tax_calendar_lines j, ap_invoices a
673: where a.invoice_id = invoiceid
674: and j.tax_calendar_name = taxcal_name
675: and a.terms_date between j.start_date and j.end_date
676: and sysdate < nvl(j.inactive_date,sysdate+1) and rownum = row_number;
687: Begin
688: errcd := 0;
689: select j.due_date
690: into duedt
691: from jl_br_ap_tax_calendar_lines j, ap_invoices a
692: where a.invoice_id = invoiceid
693: and j.tax_calendar_name = taxcal_name
694: and a.invoice_date between j.start_date and j.end_date
695: and sysdate < nvl(j.inactive_date,sysdate+1) and rownum = row_number;
706: Begin
707: errcd := 0;
708: select j.due_date
709: into duedt
710: from jl_br_ap_tax_calendar_lines j, ap_invoice_distributions a
711: where a.invoice_id = invoiceid
712: and j.tax_calendar_name = taxcal_name
713: and a.accounting_date between j.start_date and j.end_date
714: and sysdate < nvl(j.inactive_date,sysdate+1) and rownum = row_number;