[Home] [Help]
8947: AND vinv.var_rent_inv_id=p_inv_id;
8948:
8949: /*Cursor to get all abtmt terms for a particular invoice*/
8950: CURSOR get_abtmt_terms_inv(p_inv_id IN NUMBER) IS
8951: select * from pn_var_abatements_all
8952: where var_rent_inv_id=p_inv_id;
8953:
8954: /*Cursor to get abtmt terms for 1st invoice from setup*/
8955: CURSOR get_var_abtmt_id(p_vrent_id IN NUMBER) IS
8953:
8954: /*Cursor to get abtmt terms for 1st invoice from setup*/
8955: CURSOR get_var_abtmt_id(p_vrent_id IN NUMBER) IS
8956: SELECT var_abatement_id,payment_term_id
8957: FROM pn_var_abatements_all
8958: WHERE var_rent_inv_id = -1
8959: AND var_rent_id=p_vrent_id;
8960:
8961:
9003: l_min_pmt_term_id := abtmt_exists_rec.payment_term_id;
9004:
9005: --pnp_debug_pkg.log('prior to update');
9006: PN_VAR_ABATEMENTS_PKG.LOCK_ROW(p_var_rent_id,-1,l_min_pmt_term_id);
9007: update pn_var_abatements_all
9008: set var_rent_inv_id = l_fst_inv_id
9009: where var_abatement_id = l_min_var_abt_id;
9010:
9011: END LOOP;
9130: AND adjust_num=0;
9131:
9132: /*Cursor to get all abtmt terms for a particular invoice*/
9133: CURSOR get_abtmt_terms_inv(p_inv_id IN NUMBER) IS
9134: SELECT * FROM pn_var_abatements_all
9135: WHERE var_rent_inv_id=p_inv_id;
9136:
9137: -- Check whether a given combination of (payment_term_id,var_rent_inv_id)
9138: -- exists in pn_var_abatements_all
9134: SELECT * FROM pn_var_abatements_all
9135: WHERE var_rent_inv_id=p_inv_id;
9136:
9137: -- Check whether a given combination of (payment_term_id,var_rent_inv_id)
9138: -- exists in pn_var_abatements_all
9139: CURSOR check_abtmt_exists(p_inv_id IN NUMBER,p_pmt_id IN NUMBER)
9140: IS
9141: SELECT 'Y' abt_exists
9142: FROM dual
9140: IS
9141: SELECT 'Y' abt_exists
9142: FROM dual
9143: WHERE EXISTS ( SELECT NULL
9144: FROM pn_var_abatements_all
9145: WHERE var_rent_inv_id=p_inv_id
9146: AND payment_term_id = p_pmt_id );
9147: -- Get the invoice_date for an invoice with a given grp_end_dt
9148: CURSOR get_inv_date(p_var_rent_id IN NUMBER,p_prd_id IN NUMBER,p_end_dt IN DATE)
9311: AND vinv.var_rent_inv_id=p_inv_id;
9312:
9313: /*Cursor to get all abtmt terms for a particular invoice*/
9314: CURSOR get_abtmt_terms_inv(p_inv_id IN NUMBER) IS
9315: select * from pn_var_abatements_all
9316: where var_rent_inv_id=p_inv_id;
9317:
9318: /*Cursor to get abtmt terms for 1st invoice from setup*/
9319: CURSOR get_var_abtmt_id(p_var_rent_id IN NUMBER) IS
9317:
9318: /*Cursor to get abtmt terms for 1st invoice from setup*/
9319: CURSOR get_var_abtmt_id(p_var_rent_id IN NUMBER) IS
9320: SELECT var_abatement_id , payment_term_id
9321: FROM pn_var_abatements_all
9322: WHERE var_rent_inv_id = -1
9323: AND var_rent_id=p_var_rent_id;
9324:
9325: -- Get the invoice id for combination of a given invoice_date and period_id
9374: l_min_pmt_term_id:= abtmt_exists_rec.payment_term_id;
9375: --pnp_debug_pkg.log('prior to update');
9376:
9377: PN_VAR_ABATEMENTS_PKG.LOCK_ROW(p_var_rent_id,-1,l_min_pmt_term_id);
9378: UPDATE pn_var_abatements_all
9379: SET var_rent_inv_id=l_inv_id
9380: WHERE var_abatement_id = l_min_var_abt_id;
9381:
9382: END LOOP;
9447: PROCEDURE include_increases_firstyr(p_var_rent_id IN NUMBER) IS
9448:
9449: /*Cursor to get all abtmt terms with include_incr='Y' for a particular invoice*/
9450: CURSOR get_abtmt_terms_inv(p_inv_id IN NUMBER,p_var_rent_id IN NUMBER) IS
9451: SELECT * from pn_var_abatements_all
9452: WHERE var_rent_inv_id = p_inv_id
9453: AND var_rent_id = p_var_rent_id
9454: AND include_increases = 'Y';
9455:
9481: -- Check if abatement exists for this pmt term and invoice id combination
9482: CURSOR check_abtmt_exists(pmt_term_id IN NUMBER,invoice_id IN NUMBER) IS
9483: SELECT 'N'
9484: FROM dual
9485: WHERE NOT EXISTS ( SELECT NULL FROM pn_var_abatements_all
9486: WHERE payment_term_id=pmt_term_id
9487: AND var_rent_inv_id=invoice_id);
9488:
9489: CURSOR org_cur(p_var_rent_id IN NUMBER) IS
9573: PROCEDURE include_increases(p_var_rent_id IN NUMBER) IS
9574:
9575: /*Cursor to get all abtmt terms with include_incr='Y' for a particular invoice*/
9576: CURSOR get_abtmt_terms_inv(p_inv_id IN NUMBER,p_var_rent_id IN NUMBER) IS
9577: SELECT * from pn_var_abatements_all
9578: WHERE var_rent_inv_id = p_inv_id AND
9579: var_rent_id = p_var_rent_id AND
9580: include_increases = 'Y';
9581:
9610: -- Get the details of
9611: CURSOR check_abtmt_exists(pmt_term_id IN NUMBER,invoice_id IN NUMBER) IS
9612: SELECT 'N'
9613: FROM dual
9614: WHERE NOT EXISTS ( SELECT NULL FROM pn_var_abatements_all
9615: WHERE payment_term_id=pmt_term_id
9616: AND var_rent_inv_id=invoice_id);
9617:
9618: CURSOR check_inv_exists(p_var_rent_id IN NUMBER,p_inv_dt IN DATE,p_prd_id IN NUMBER) IS