function AfterPForm return boolean is V_DUE_DATE VARCHAR(400); begin /* set where and order clauses using selection criteria */ :P_WHERE_CLAUSE := 'WHERE (TAX_TRANS.ENTER_DATE between :START_DATE AND :END_DATE) AND TAX_TYP.TAX_TYPE_NO = TAX_TRANS.TAX_TYPE_NO AND SIGFIS.TAX_TYPE_NO = TAX_TYP.TAX_TYPE_NO AND STRANS.TAX_TRANS_NO = TAX_TRANS.TAX_TRANS_NO AND TAX_TRANS.TAX_TYPE_NO NOT IN(1,2,4,8,13) AND STRANS.CHARGE_TYPE_NO IN (2,4) AND SIGFIS.ACCT_DESCRIPTION NOT IN(''Income Tax (Arrears)'', ''Estate Dues'')'; :P_WHERE_CLAUSE2 := 'WHERE (TAX_TRANS.ENTER_DATE between :START_DATE AND :END_DATE) AND SIGFIS.TAX_TYPE_NO = TAX_TRANS.TAX_TYPE_NO AND STRANS.TAX_TRANS_NO = TAX_TRANS.TAX_TRANS_NO AND STRANS.TAX_PERIOD_NO = TPER.TAX_PERIOD_NO AND tax_trans.tax_type_no in(1,2,4,8,13) AND STRANS.CHARGE_TYPE_NO IN (2,4) AND TP.TAX_PAYER_NO = TAX_TRANS.TAX_PAYER_NO AND strans.arrears_flag = ''N'' AND SIGFIS.ACCT_DESCRIPTION NOT IN(''Income Tax (Arrears)'') AND (TAX_TRANS.trans_date <= TPER.TPER_DUE_DATE OR (TPER.TPER_DUE_DATE is NULL AND TAX_TRANS.TRANS_DATE <= valid_date(TO_DATE(LPAD(TO_CHAR(tp.fisc_yr_end),4,''0'')||TO_CHAR(tper.tper_year), ''DDMMYYYY''), TPER.TPER_due_date_interval, NULL)))'; :P_WHERE_CLAUSE_ARR := 'WHERE (TAX_TRANS.enter_date BETWEEN :start_date AND :end_date) AND SUB_TRANS.TAX_TRANS_NO = TAX_TRANS.TAX_TRANS_NO AND SUB_TRANS.TAX_PERIOD_NO = TPER.TAX_PERIOD_NO(+) AND TAX_TRANS.tax_type_no IN(1,2,4,8,13) AND SUB_TRANS.CHARGE_TYPE_NO IN (2,4) AND TP.TAX_PAYER_NO = TAX_TRANS.TAX_PAYER_NO AND (SUB_TRANS.arrears_flag = ''Y'' OR (TPER.TPER_DUE_DATE < TAX_TRANS.trans_date OR (TPER.TPER_DUE_DATE is NULL AND TAX_TRANS.trans_DATE > valid_date(TO_DATE(LPAD(TO_CHAR(tp.fisc_yr_end),4,''0'')||TO_CHAR(tper.tper_year), ''DDMMYYYY''), TPER.TPER_due_date_interval, NULL))))'; :P_WHERE_CLAUSE_TOTAL := 'WHERE (TAX_TRANS.ENTER_DATE between :START_DATE AND :END_DATE) AND STRANS.CHARGE_TYPE_NO IN (2,4) AND STRANS.TAX_TRANS_NO = TAX_TRANS.TAX_TRANS_NO '; IF :PAY_LOC IS NOT NULL THEN :P_WHERE_CLAUSE := :P_WHERE_CLAUSE || ' AND TAX_TRANS.PAYMENT_LOC_NO = :PAY_LOC'; :P_WHERE_CLAUSE2 := :P_WHERE_CLAUSE2 || ' AND TAX_TRANS.PAYMENT_LOC_NO = :PAY_LOC '; :P_WHERE_CLAUSE_ARR := :P_WHERE_CLAUSE_ARR || ' AND TAX_TRANS.PAYMENT_LOC_NO = :PAY_LOC '; :P_WHERE_CLAUSE_TOTAL := :P_WHERE_CLAUSE_TOTAL || ' AND TAX_TRANS.PAYMENT_LOC_NO = :PAY_LOC '; END IF; return (TRUE); RETURN NULL; EXCEPTION WHEN NO_DATA_FOUND THEN NULL; RETURN NULL; end;