[Home] [Help]
256: /**************************************************************************
257: * *
258: * Name : Insert_Credit_Letter_Amount *
259: * Purpose : Stores current information about credit letters into the *
260: * JL_AR_AP_SUP_AWT_CR_LTS table *
261: * *
262: **************************************************************************/
263: PROCEDURE Insert_Credit_Letter_Amount
264: (P_Vendor_Id IN Number,
3925: -- and the withholding tax type
3926: ------------------------------------------------------
3927: SELECT max(seq_num)
3928: INTO l_seq_num
3929: FROM jl_ar_ap_sup_awt_cr_lts
3930: WHERE po_vendor_id = P_Vendor_Id
3931: AND awt_type_code = P_AWT_Type_Code;
3932:
3933: IF (l_seq_num IS NULL) THEN
3935: END IF;
3936:
3937: SELECT balance
3938: INTO l_credit_letter_amount
3939: FROM jl_ar_ap_sup_awt_cr_lts
3940: WHERE po_vendor_id = P_Vendor_Id
3941: AND awt_type_code = P_AWT_Type_Code
3942: AND seq_num = l_seq_num;
3943:
4182: /**************************************************************************
4183: * *
4184: * Name : Insert_Credit_Letter_Amount *
4185: * Purpose : Stores current information about credit letters into the *
4186: * JL_AR_AP_SUP_AWT_CR_LTS table *
4187: * *
4188: **************************************************************************/
4189: PROCEDURE Insert_Credit_Letter_Amount
4190: (P_Vendor_Id IN Number,
4217: 'Insert_Credit_Letter_Amount<--' ||
4218: P_Calling_Sequence;
4219:
4220: -----------------------------------------------
4221: -- Inserts record into JL_AR_AP_SUP_AWT_CR_LTS
4222: -----------------------------------------------
4223: INSERT INTO jl_ar_ap_sup_awt_cr_lts
4224: (seq_num,
4225: po_vendor_id,
4219:
4220: -----------------------------------------------
4221: -- Inserts record into JL_AR_AP_SUP_AWT_CR_LTS
4222: -----------------------------------------------
4223: INSERT INTO jl_ar_ap_sup_awt_cr_lts
4224: (seq_num,
4225: po_vendor_id,
4226: awt_type_code,
4227: tax_id,
4241: program_id,
4242: request_id,
4243: status)
4244: VALUES
4245: (jl_ar_ap_sup_awt_cr_lts_s.nextval,
4246: P_Vendor_Id,
4247: P_AWT_Type_Code,
4248: P_Tax_Id,
4249: P_AWT_Date,
4332: SELECT jlcl.po_vendor_id vendor_id,
4333: jlcl.awt_type_code awt_type_code,
4334: jlcl.calc_wh_amnt calc_wh_amnt,
4335: jlcl.act_wheld_amnt act_wheld_amnt
4336: FROM jl_ar_ap_sup_awt_cr_lts jlcl
4337: WHERE jlcl.status = 'AA'
4338: AND ((P_Check_Id IS NOT NULL AND
4339: jlcl.check_id = P_Check_Id) OR
4340: (P_Selected_Check_Id IS NOT NULL AND
4399:
4400: ----------------------------------------------
4401: -- Changes the status of the reversed records
4402: ----------------------------------------------
4403: UPDATE jl_ar_ap_sup_awt_cr_lts
4404: SET status = 'AR'
4405: WHERE CURRENT OF c_credit_letters;
4406:
4407: END LOOP;
5407: -- Updates the credit letter information by
5408: -- replacing the selected check ID by the check ID
5409: ---------------------------------------------------
5410: IF (l_check_id IS NOT NULL) THEN
5411: UPDATE jl_ar_ap_sup_awt_cr_lts
5412: SET check_id = l_check_id,
5413: selected_check_id = null
5414: WHERE selected_check_id = l_check_id;
5415: END IF;