684: min_dunning_days NUMBER;
685: previously_dunned BOOLEAN := TRUE;
686:
687: -- cursor to get latest print for a given open payment schedule
688: -- Note: the new one is not in the ar_correspondence_pay_sched yet,
689: -- so this is the latest one for the existing records.
690:
691: CURSOR last_print IS
692: SELECT c.correspondence_date
689: -- so this is the latest one for the existing records.
690:
691: CURSOR last_print IS
692: SELECT c.correspondence_date
693: FROM ar_correspondence_pay_sched cp
694: ,ar_correspondences c
695: ,ar_dunning_letter_set_lines dlsl
696: WHERE cp.payment_schedule_id = ps_id
697: AND c.preliminary_flag = 'N'